- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
When I try to implement the code below it gives me the following error:
"Invalid option value (currency). Expected USD but received "GBP""
<script
src="https://www.paypal.com/sdk/js?client-id=xxxx¤cy=GBP&components=messages"
data-namespace="PayPalSDK">
</script>
<div data-pp-message data-pp-style-layout="text" data-pp-style-logo-type="inline" data-pp-style-text-color="black" data-pp-amount="100"> </div>
If have searched everywhere and cannot see what the problem is. When I remove the "currency=GBP" it works but displays it in dollars. Can anyone help?
Thanks in advance
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @sitebox,
Thank you for posting to the PayPal Community.
I tested with the code from the developer site:
https://developer.paypal.com/docs/checkout/pay-later/gb/integrate/
I found that as long as the client id being used belonged to a UK Business account the banner and the button would render using GBP. If the client id belonged to a US account, the banner and the button would not render.
<script src="https://www.paypal.com/sdk/js?client-id=UK_CLIENTID¤cy=GBP&components=messages,buttons">
</script>
<div
data-pp-message
data-pp-amount="100.00">
</div>
</ br>
<div id="paypal-button-container"></div>
<script>
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '100.00'
}
}]
});
}
}).render('#paypal-button-container');
</script>
I moved the banner above the button to show you that it will display, below is what renders for me:
Make certain that the client id that you are adding to your code belongs to a UK Sandbox Account or a UK Live Business Account.
Thank you,
Jennifer
MTS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @sitebox,
Thank you for posting to the PayPal Community.
I tested with the code from the developer site:
https://developer.paypal.com/docs/checkout/pay-later/gb/integrate/
I found that as long as the client id being used belonged to a UK Business account the banner and the button would render using GBP. If the client id belonged to a US account, the banner and the button would not render.
<script src="https://www.paypal.com/sdk/js?client-id=UK_CLIENTID¤cy=GBP&components=messages,buttons">
</script>
<div
data-pp-message
data-pp-amount="100.00">
</div>
</ br>
<div id="paypal-button-container"></div>
<script>
paypal.Buttons({
createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
value: '100.00'
}
}]
});
}
}).render('#paypal-button-container');
</script>
I moved the banner above the button to show you that it will display, below is what renders for me:
Make certain that the client id that you are adding to your code belongs to a UK Sandbox Account or a UK Live Business Account.
Thank you,
Jennifer
MTS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,
For some reason my sandbox account must be set to US.
I appreciate your help.
Thanks
Dave
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Currently using Paypal IPN service. Continue using IPN or look at new options? in PayPal Payments Standard
- Getting an error when calling API endpoint for Create Billing Agreement Token V1 in Sandbox Environment
- Things don't appear to be working at the moment. Please try again later in Sandbox Environment
- PayPal integration with Next, Lambda and API Gateway - 400 Invalid Request in Sandbox Environment
- Need help with copy/paste PayPal Button script not working in SDKs