• Resolved Henry

    (@henrybaum)


    I’m getting the message: “Something went wrong. Please try again or choose another payment source.” The process:

    1. Select a country at checkout, which sets the currency (via Aelia Currency Converter). Click Paypal – it loads OK.

    2. Cancel out of the Paypal popup and set another country and currency, click Paypal – it has the error message.

    In previous threads about this it mentions a currency converter conflict. I’ve contacted Aelia and they say it’s on your side. He says that maybe…”For some reason, PayPal sees this as the same order as before (step #1), but the data (country, total, currency) is now different. Due to that, PayPal doesn’t allow the transaction to proceed.”

    I’ve disabled checkout plugins and run a default theme and it hasn’t helped.

    Here’s the log of the two orders:

    2024-06-27T16:34:32+00:00 DEBUG POST https://api-m.paypal.com/v2/checkout/orders
    Request Body: {“intent”:”CAPTURE”,”purchase_units”:[{“reference_id”:”default”,”amount”:{“currency_code”:”USD”,”value”:”300.00″,”breakdown”:{“item_total”:{“currency_code”:”USD”,”value”:”300.00″},”shipping”:{“currency_code”:”USD”,”value”:”0.00″},”tax_total”:{“currency_code”:”USD”,”value”:”0.00″}}},”description”:””,”items”:[{“name”:”IRB Book Review – In Brief”,”unit_amount”:{“currency_code”:”USD”,”value”:”100.00″},”quantity”:3,”description”:””,”sku”:””,”category”:”PHYSICAL_GOODS”,”url”:”https:\/\/www.independentreviewofbooks.com\/submit-your-book-for-review\/?attribute_type-of-review=In+Brief”,”image_url”:”https:\/\/www.independentreviewofbooks.com\/wp-content\/uploads\/2019\/04\/IRBlogoweb.png”,”cart_item_key”:”8e6cb6116ab6e2e4d2886acdedf21214″}],”custom_id”:”pcp_customer_t_fd1f5ee4fb8e2d3968022414e0c303″,”soft_descriptor”:”Independent Review”}],”application_context”:{“user_action”:”PAY_NOW”,”shipping_preference”:”GET_FROM_FILE”,”landing_page”:”BILLING”,”locale”:”en-US”,”brand_name”:”The Independent Review of Books”,”return_url”:”https:\/\/www.independentreviewofbooks.com\/?wc-ajax=ppc-return-url”,”cancel_url”:”https:\/\/www.independentreviewofbooks.com\/checkout\/”,”payment_method”:{“payee_preferred”:”UNRESTRICTED”}},”payer”:{“email_address”:”***@gmail.com”,”name”:{“given_name”:”asda”,”surname”:””},”address”:{“country_code”:”US”}}}
    Response Debug ID: fd321b526e594
    Response: Array
    (
    [code] => 201
    [message] => Created
    )

    2024-06-27T16:34:46+00:00 DEBUG POST https://api-m.paypal.com/v2/checkout/orders
    Request Body: {"intent":"CAPTURE","purchase_units":[{"reference_id":"default","amount":{"currency_code":"GBP","value":"237.39","breakdown":{"item_total":{"currency_code":"GBP","value":"237.39"},"shipping":{"currency_code":"GBP","value":"0.00"},"tax_total":{"currency_code":"GBP","value":"0.00"}}},"description":"","items":[{"name":"IRB Book Review - In Brief","unit_amount":{"currency_code":"GBP","value":"79.13"},"quantity":3,"description":"","sku":"","category":"PHYSICAL_GOODS","url":"https:\/\/www.independentreviewofbooks.com\/submit-your-book-for-review\/?attribute_type-of-review=In+Brief","image_url":"https:\/\/www.independentreviewofbooks.com\/wp-content\/uploads\/2019\/04\/IRBlogoweb.png","cart_item_key":"8e6cb6116ab6e2e4d2886acdedf21214"}],"custom_id":"pcp_customer_t_fd1f5ee4fb8e2d3968022414e0c303","soft_descriptor":"Independent Review"}],"application_context":{"user_action":"PAY_NOW","shipping_preference":"GET_FROM_FILE","landing_page":"BILLING","locale":"en-US","brand_name":"The Independent Review of Books","return_url":"https:\/\/www.independentreviewofbooks.com\/?wc-ajax=ppc-return-url","cancel_url":"https:\/\/www.independentreviewofbooks.com\/checkout\/","payment_method":{"payee_preferred":"UNRESTRICTED"}},"payer":{"email_address":"***@gmail.com","name":{"given_name":"asda","surname":""},"address":{"country_code":"GB"}}}
    Response Debug ID: 03a76cb6d55ff
    Response: Array
    (
    [code] => 201
    [message] => Created
    )

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Henry

    (@henrybaum)

    When switching countries, I get this error in in Chrome Developer Tools (normally, I would get this error at checkout as well): Expected currency from order api call to be USD, got GBP. Please ensure you are passing currency=GBP to the sdk url.

    Plugin Support Krystian from Syde

    (@inpsydekrystian)

    Hello @henrybaum

    Currently, the “Force currency by country” feature in the Aelia Currency Converter isn’t supported because of a technical issue: While the currency updates via AJAX on the server, the PayPal button script doesn’t refresh to reflect the new currency, leading to a currency mismatch error.

    Using a standard currency switcher widget or menu is recommended when integrating with PayPal Payments. This usually triggers a page reload when a new currency is selected, ensuring that the PayPal button script is correctly loaded with the updated currency at page load.

    In the meantime, there are a couple of potential workarounds:

    1. Disable PayPal Smart Buttons and use the default “Place Order” button instead. This can be done using a filter provided in the documentation. However, this approach removes all Alternative Payment Methods (APMs) and extra features, leaving only the basic PayPal redirect.
    2. Force the page to reload each time a user selects a different country. This method might affect user experience, as it’s generally unexpected for the page to reload after choosing a billing country.

    We’re exploring a solution that would properly reload the PayPal buttons following AJAX events, though we don’t have a specific release date yet. I’ve assigned this thread to the feature, and I’ll update it once it’s available.

    Let us know if you have further questions.

    Kind regards,
    Krystian

    Plugin Support Krystian from Syde

    (@inpsydekrystian)

    Hello @henrybaum

    Since we haven’t heard back from you, we’ll assume everything is working as needed.

    If you have any more questions, feel free to start a new thread or directly reach out for help. You can get support by opening a ticket with our service desk here: Request Support. Please include this thread’s URL in your ticket for reference.

    Kind regards,
    Krystian

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.