craftcms / commerce-paypal-checkout

PayPal Checkout gateway for Craft Commerce.
https://plugins.craftcms.com/commerce-paypal-checkout
MIT License
5 stars 10 forks source link

Currency Error #45

Closed iamtompickering closed 2 years ago

iamtompickering commented 2 years ago

Description I am trying to pass USD as the currency to the getPaymentFormHtml tag but the following error keeps showing up when I click the PayPal button.

Error: Expected currency from order api call to be USD, got EUR. Please ensure you are passing currency=EUR to the sdk url. https://developer.paypal.com/docs/checkout/reference/customize-sdk/

Using the currency EUR works fine, but I need to show the prices as USD in PayPals popup window.

Is this because the Base currency in Commerce is set to EUR? I would have thought that you can just pass any of the PayPal supported currencies to this option and it would work fine?!

nfourtythree commented 2 years ago

Hi @iamtompickering

Thank you for your message.

As well as passing USD to customise the PayPal SDK are you also setting the payment currency on the order? (see points 2 or 3)

Thanks.

iamtompickering commented 2 years ago

@nfourtythree ahhh yes looks like that was still being returned as EUR.

I've reworked my forms now to update the paymentCurrency and all appears to be working, thanks! 👌

nfourtythree commented 2 years ago

Hi @iamtompickering

Glad everything is working now!

Thanks.