saucal / woocommerce-gateway-amazon-pay

Amazon Pay Gateway
0 stars 1 forks source link

Error message when using WPML plugins + 100%discount coupon #121

Open ChristianAF opened 2 years ago

ChristianAF commented 2 years ago

Screenshot_2021-09-23_12-52-42.png

Log: 
09-23-2021 @ 12:47:33 - kAYbNh - WC_Gateway_Amazon_Payments_Advanced::process_payment - Info: Beginning processing of payment for order 653 for the amount of 0.00 EUR. Checkout Session ID: bb382139-e83c-448d-bed8-d01c51856fe5.
09-23-2021 @ 12:47:33 - kAYbNh - WC_Gateway_Amazon_Payments_Advanced::process_payment - Updating checkout session data for #653.
09-23-2021 @ 12:47:33 - kAYbNh - WC_Amazon_Payments_Advanced_API::update_checkout_session_data - Checkout Session ID bb382139-e83c-448d-bed8-d01c51856fe5
{
    "data": {
        "paymentDetails": {
            "paymentIntent": "AuthorizeWithCapture",
            "canHandlePendingAuthorization": false,
            "chargeAmount": {
                "amount": "0.00",
                "currencyCode": "EUR"
            }
        },
        "merchantMetadata": {
            "merchantReferenceId": 653,
            "merchantStoreName": "Test shop",
            "customInformation": "Created by WC_Gateway_Amazon_Pay\/2.0.3 (Platform=WooCommerce\/5.5.2)"
        }
    },
    "headers": []
}
09-23-2021 @ 12:47:34 - kAYbNh - WC_Amazon_Payments_Advanced_API::update_checkout_session_data - ERROR. Checkout Session ID bb382139-e83c-448d-bed8-d01c51856fe5.
{
    "status": 400,
    "method": "PATCH",
    "url": "https:\/\/pay-api.amazon.eu\/sandbox\/v2\/checkoutSessions\/bb382139-e83c-448d-bed8-d01c51856fe5",
    "headers": [
        "accept:application\/json",
        "authorization:AMZN-PAY-RSASSA-PSS PublicKeyId=AHFNFOPHWU6LGIXEKSGM6X7Z, SignedHeaders=accept;content-type;x-amz-pay-date;x-amz-pay-host;x-amz-pay-region, Signature=XHlLoNgQouaBFz4asGbvcc\/tnGq9EsjBARfRS8eZrUGditDavbG8X13Eqglpxph+j\/Zi+tMtq7cyDPQbVHsKJx\/raxwv4xh2sKQix8NUcHWQoKMkob5A4L8KMWNlT5Ontdk3LDcZMAcdG+Q+2hWMZr0ivDHKOtSiozHAuudr842N5YT9Au2C1P15M3obhVjx1Lr2gPA0ZG14KWgZEueaRIamawtYkfAHQCbdJBuyagaJt0vE4KbrOnByJ\/FMw1G4\/oRY\/oS+\/LN9QthqZs0O62EC\/nakJNQXcCzZLcs0SesWxViDhdzu8o2U3aUVTpVcUxYOsBiG4EXO8sr3\/ixN3Q==",
        "content-type:application\/json",
        "user-agent:amazon-pay-api-sdk-php\/2.2.2 (PHP\/7.4.23; Linux\/x86_64\/5.4.0-1043-gcp)",
        "x-amz-pay-date:20210923T124733Z",
        "x-amz-pay-host:pay-api.amazon.eu",
        "x-amz-pay-region:eu"
    ],
    "request": "{\"paymentDetails\":{\"paymentIntent\":\"AuthorizeWithCapture\",\"canHandlePendingAuthorization\":false,\"chargeAmount\":{\"amount\":\"0.00\",\"currencyCode\":\"EUR\"}},\"merchantMetadata\":{\"merchantReferenceId\":653,\"merchantStoreName\":\"Test shop\",\"customInformation\":\"Created by WC_Gateway_Amazon_Pay\\\/2.0.3 (Platform=WooCommerce\\\/5.5.2)\"}}",
    "response": "{\"reasonCode\":\"InvalidParameterValue\",\"message\":\"The value '0.00' provided for 'chargeAmount.Amount' is invalid.\"}",
    "request_id": "0463610b-e4d0-43e9-9f2f-e8a5ff91ddb8",
    "retries": 0,
    "duration": 433
}
09-23-2021 @ 12:47:34 - kAYbNh - WC_Gateway_Amazon_Payments_Advanced::process_payment - Error processing payment for order 653. Checkout Session ID: bb382139-e83c-448d-bed8-d01c51856fe5
{
    "errors": {
        "InvalidParameterValue": [
            "The value '0.00' provided for 'chargeAmount.Amount' is invalid."
        ]
    },
    "error_data": []
}

Steps:

  1. Create a coupon with 100% of discount
  2. WPML pugins should be activated
  3. Go to site, add product to cart, log in to Amazon account
  4. check total amount is 0
  5. Place order

Reported by: Christian Fricker (christian@saucal.com)

Source URL: https://amazondemo.wpengine.com/checkout/

BrowserFirefox 92.0
Screen Size1366 x 768
OSUbuntu
Viewport Size1366 x 656
Zoom Level100%
Pixel Ratio@​1x
lauramelos commented 2 years ago

reference card https://app.clickup.com/t/1h5rv6e