How can I dynamically change the currency using the PayPal JavaScript SDK?

MarkWaller
Contributor
Contributor

I want to allow my users to choose the currency they checkout with, but I can't find any way to dynamically change the currency. It seems like it is determined by the currency that you specify when the SDK is loaded i.e.

 

<script src="https://www.paypal.com/sdk/js?client-id=SB_CLIENT_ID&currency=GBP">

How do I change it to USD or EUR when the customer selects a different currency?

I have tried specifing it the purchase units definition i.e.

amount: {
currency_code: 'USD',
}

 But it seems this used to work with checkout.js but no longer works with the SDK.

 

I am really stuck, has anyone solved this issue?

Thanks, Mark.

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.