This repository has been archived by the owner on Dec 12, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The transactionTimeout format has to be number.
I tried passing .withTransactionTimeout('0') as a string, and the ChargeAPI returns the error below. so, I guess that transactionTimeout has to be passed as a number to resolve the error. (At least, that was my solution to solve the error.) ``` "request": { "type": "Connections.Response", "requestId": "amzn1.echo-api.request.d313d5f4-3e73-4e17-9d3b-3bb7bb4c63a4", "timestamp": "2021-11-23T06:04:58Z", "locale": "ja-JP", "status": { "code": "400", "message": "Connections validation failed. Violating fields in payload: [payload.authorizeAttributes.transactionTimeout]." }, "name": "Charge", "token": "token" } ``` ORIGINAL CODE: ``` const payloadBuilder = AmazonPay.chargePayload(/* version */ "2") .withBillingAgreementId(session.billingAgreementDetails?.billingAgreementId) .withCurrency("JPY") .withSellerId(process.env["AMAZONPAY_SELLER_ID"]) .withTransactionTimeout(0) .withPaymentAction(PaymentAction.AUTHORIZE) .withAmount(`${totalAmount}`) .withAuthorizationReferenceId("" + Date.now()) .withSellerOrderId(generateSellerOrderId()) .withCustomInformation(getCustomerInformationToCsv(session)); ``` PayLoadResult: ``` { "name": "Charge", "payload": { "@type": "ChargeAmazonPayRequest", "@Version": "2", "billingAgreementId": "C03-2822209-5606699", "paymentAction": "AUTHORIZE", "sellerId": "XXXXXXXXXXXXXXXXXXXXXXXXXX", "authorizeAttributes": { "@type": "AuthorizeAttributes", "@Version": "2", "authorizationAmount": { "@type": "Price", "@Version": "2", "amount": "350", "currencyCode": "JPY" }, "authorizationReferenceId": "1637647498489", "transactionTimeout": "0" // <- has to be a number and not a string. }, "sellerOrderAttributes": { "@type": "SellerOrderAttributes", "@Version": "2", "customInformation": "XXXX,XXXXX,XXXXX,XXXX,XXXXXX", "sellerOrderId": "alexa-1637647498489" } }, "token": "token", "type": "Connections.SendRequest" } ```
- Loading branch information