djack109
djack109

Reputation: 1377

Is there a way to change the default country of the PayPal credit card form?

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?

enter image description here

Upvotes: 9

Views: 3576

Answers (3)

Chandimal Fernando
Chandimal Fernando

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&currency=GBP&locale=en_GB"></script>

You can find all PayPal locale codes in this link

Upvotes: 0

David Pierson
David Pierson

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&currency=AUD&client-id=*SB_CLIENT_ID*"></script>

This is in sandbox mode.

Upvotes: 10

Preston PHX
Preston PHX

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

Related Questions