Reputation: 1377
I'm integrating PayPal into my website, using these settings.
paypal.Buttons({
locale: "en_GB",
style: {
color: 'blue',
shape: 'pill',
label: 'pay',
height: 40
},
If you use PayPal all is well and it shows up in GBP, but if you decide to pay using a credit card it always seems to default to US. I can't find anything on the PayPal developer website, nor here. Is there any way to change this?
Upvotes: 9
Views: 3576
Reputation: 41
If you want to set Britain as the default selected country in your billing address, just add bellow query parameter at the end of PayPal script URL.
&locale=en_GB
<script src="https://www.paypal.com/sdk/js?client-id=CLIENT_ID¤cy=GBP&locale=en_GB"></script>
You can find all PayPal locale codes in this link
Upvotes: 0
Reputation: 298
Setting the "buyer-country" in the script tag line, did not work for me. Neither did setting it as an item in the paypal.Buttons ({ script code. Clicking the Credit Card button always defaulted to US.
What did work is setting the "locale".
For example
<script src="https://www.paypal.com/sdk/js?locale=en_AU¤cy=AUD&client-id=*SB_CLIENT_ID*"></script>
This is in sandbox mode.
Upvotes: 10
Reputation: 30377
If you know the buyer's billing address, you can pass it. Documentation here.
When testing in sandbox, you can set "buyer-country" in the script tag line that loads the PayPal JS. But this only applies to sandbox testing -- for live, the buyer country will be auto detected.
Upvotes: 2