Unable to set currency using paypal js sdk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to set the currency for the paypal api and I am unable to do so.
When you click on the paypal button, It shows the total amount in USD (next to the cart icon). Under pay with, it shows the amount converted to CAD which is more than the amount set in createOrder.
I have:
<script src="https://www.paypal.com/sdk/js?currency=CAD&client-id="></script>
<script>
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
intent: "CAPTURE",
purchase_units: [{
amount: {
value: "150"
}
}]
});
},
onError: function (err) {
alert(err);
}
}).render('#paypal-button-container');
</script>
I have tried to put currency_code: "CAD" in amount but I get:
Error: Unexpected currency: CAD passed to order.create. Please ensure you are passing /sdk/js?currency=CAD in the paypal script tag.
Any ideas in what I am doing wrong or perhaps I am missing something?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well you can try using 'currency' instead of 'currency_code' I saw that in an example but it isn't what the docs say. It doesn't crash but it doesn't do anything much either. I'm trying to specify GBP but whatever I do it assumes it has to convert the amount from dollars. I must say the PayPal experience has been pretty awful from the start.

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- "System error. Please try again later" when connecting to paypal sandbox account with my android app in Sandbox Environment
- Unable to test successful payments using sandbox personal accounts in NVP/SOAP APIs
- Help me find the solution for the error 'rwindow.paypal.Buttons is undefined.' in Next.js project in PayPal Payments Standard
- Pricing for Indian NGO in PayPal Payments Standard
- Payment Authorization Error in PayPal Payments Standard