Home » Php » php – Paypal send shipping country (use different values lc and country fields)

php – Paypal send shipping country (use different values lc and country fields)

Posted by: admin July 12, 2020 Leave a comment


I try to integrate a paypal button payment on my website.
The website accepts users from many countries.
The website’s language are english.
My users defines shipping address in my website and I provide it to Paypal with the form.
But, when I sent another country without change lc paramter, Paypal don’t pre-fill country with the new.

My Problem is the opposit of this one : Paypal Hosted language bug. Based on ‘country’ instead of ‘lc’ for Paypal Express button

Example (my form) :

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">

    <input type="hidden" name="amount" value="5">
    <input name="currency_code" type="hidden" value="GBP">
    <input name="shipping" type="hidden" value="0.00">
    <input name="tax" type="hidden" value="0.00">
    <input name="return" type="hidden" value="https://my-shop.com">
    <input name="cancel_return" type="hidden" value="https://my-shop.com">
    <input name="notify_url" type="hidden" value="https://my-shop.com">
    <input name="cmd" type="hidden" value="_xclick">
    <input name="business" type="hidden" value="[email protected]">
    <input name="no_shipping" type="hidden" value="1">
    <input name="item_name" type="hidden" value="1234">
    <input name="no_note" type="hidden" value="1">
    <input name="bn" type="hidden" value="xxxx">
    <input name="custom" type="hidden" value="[email protected]">
    <input name="invoice" type="hidden" value="1223">

    <input name="address_override" type="hidden" value="1">
    <input name="address1" type="hidden" value="Frani Sramka 20">
    <input name="address2" type="hidden" value="">
    <input name="city" type="hidden" value="Prague 5">
    <input name="zip" type="hidden" value="15000">
    <input name="country" type="hidden" value="CZ">

    <!-- Countries part -->
    <input name="lc" type="hidden" value="GB">

    <input name="address_country" type="hidden" value="CZECH REPUBLIC">
    <input name="address_country_code" type="hidden" value="CZ">
    <input name="residence_country" type="hidden" value="CZ">

    <button type="submit" class="btn btn-primary">Pay by PayPal</button>

In this case, Paypal set the page language in GB (provided by lc field)
But the Paypal’s Country field was pre-fill with United Kingdom, see screenshot :

enter image description here

But I want Paypal take my countries fields (with value CZ) into account.

Set lc field to CZ behavior

If I set lc field to CZ :

<input name="lc" type="hidden" value="CZ">

I get both language in CZ and user country pre-fill in CZ :

enter image description here

Brief question :

Do you know a way to :

  • Pre-fill user country (CZ)
  • Keep the choosen language (GB)

Additional information

  • Except this language issue, the form works
  • I use a custom PHP back-end technology (not a CMS with plugin)

Paypal Documentation

pre-populate my customer’s PayPal sign-up form, contains country and lc description

Countries code

How to&Answers:

I saw China is ‘c2’ not ‘cz’ ? am I wrong?

enter image description here


You might want to force a location.

<input type="hidden" name="locale.x" value="cz_XC">
<input type="hidden" name="lc" value="GB">