PayPal Pay Later message it says invalid currency

sitebox
Contributor
Contributor

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&currency=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

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MTS_Jennifer
Moderator
Moderator

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&currency=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:

MTS_Jennifer_0-1679177031610.png

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

 

 

View solution in original post

Login to Me Too
2 REPLIES 2
Solved

MTS_Jennifer
Moderator
Moderator

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&currency=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:

MTS_Jennifer_0-1679177031610.png

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

 

 

Login to Me Too

sitebox
Contributor
Contributor

Thanks,

 

For some reason my sandbox account must be set to US. 

 

I appreciate your help.

 

Thanks

 

Dave

Login to Me Too

Haven't Found your Answer?

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