简体   繁体   English

Paypal 发送发货国家(使用不同的值 lc 和 country 字段)

[英]Paypal send shipping country (use different values lc and country fields)

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.我的用户在我的网站中定义了送货地址,然后我将其与表单一起提供给 Paypal。 But, when I sent another country without change lc paramter, Paypal don't pre-fill country with the new.但是,当我在不更改lc参数的情况下发送另一个国家/地区时,Paypal 不会使用新的国家/地区预填充国家/地区。

My Problem is the opposit of this one : Paypal Hosted language bug.我的问题与此相反: Paypal 托管语言错误。 Based on 'country' instead of 'lc' for Paypal Express button Paypal Express 按钮基于“国家/地区”而不是“lc”

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="sales@my-shop.com">
    <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="the_buyer@gmail.com">
    <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>
</form>

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 :在这种情况下,Paypal 将页面语言设置为 GB(由lc字段提供)但 Paypal 的 Country 字段预先填写了英国,请参见截图:

在此处输入图片说明

But I want Paypal take my countries fields (with value CZ) into account.但我希望 Paypal 将我的国家/地区字段(值 CZ)考虑在内。


Set lc field to CZ behavior将 lc 字段设置为 CZ 行为

If I set lc field to CZ :如果我将lc字段设置为 CZ :

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

I get both language in CZ and user country pre-fill in CZ :我在 CZ 中获得了两种语言,在 CZ 中预填了用户国家/地区:

在此处输入图片说明


Brief question :简短的问题:

Do you know a way to :你知道一种方法吗:

  • Pre-fill user country (CZ)预填用户国家 (CZ)
  • Keep the choosen language (GB)保留所选语言 (GB)

Additional information附加信息

  • Except this language issue, the form works除了这个语言问题,表格有效
  • I use a custom PHP back-end technology (not a CMS with plugin)我使用自定义 PHP 后端技术(不是带有插件的 CMS)

Paypal Documentation贝宝文件

pre-populate my customer's PayPal sign-up form, contains country and lc description 预填充我客户的 PayPal 注册表单,包含国家/地区和 lc 说明

Countries code 国家代码

I saw China is 'c2' not 'cz' ?我看到中国是“c2”而不是“cz”? am I wrong?我错了吗?

在此处输入图片说明

You might want to force a location.您可能想要强制一个位置。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM