【问题标题】:Paypal send shipping country (use different values lc and country fields)Paypal 发送发货国家(使用不同的值 lc 和国家字段)
【发布时间】:2020-01-01 12:12:36
【问题描述】:

我尝试在我的网站上集成一个 paypal 按钮支付。 该网站接受来自许多国家的用户。 该网站的语言是英语。 我的用户在我的网站中定义了送货地址,我将其与表单一起提供给 Paypal。 但是,当我在没有更改 lc 参数的情况下发送另一个国家/地区时,Paypal 不会用新的参数预先填写国家/地区。

我的问题与此相反:Paypal Hosted language bug. Based on 'country' instead of 'lc' for Paypal Express button

示例(我的表单):

<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>

在这种情况下,Paypal 将页面语言设置为 GB(由 lc 字段提供) 但是 Paypal 的 Country 字段是预先填写了 United Kingdom,见截图:

但我希望 Paypal 将我的国家/地区字段(价值 CZ)考虑在内。


将 lc 字段设置为 CZ 行为

如果我将 lc 字段设置为 CZ :

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

我在 CZ 中获得 两种 语言,并在 CZ 中预填用户国家/地区:


简短的问题:

你知道一种方法吗:

  • 预填用户国家/地区 (CZ)
  • 保留选择的语言 (GB)

其他信息

  • 除此语言问题外,该表单有效
  • 我使用自定义 PHP 后端技术(不是带有插件的 CMS)

贝宝文档

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

Countries code

【问题讨论】:

    标签: php paypal


    【解决方案1】:

    我看到中国是“c2”而不是“cz”?我错了吗?

    【讨论】:

    • 感谢您的回答,但是 CZ 这不是错误。这是捷克共和国的国家代码。
    【解决方案2】:

    您可能想要强制定位。

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

    【讨论】:

    • 没问题,你试图帮助我。但我需要将 lc(语言字段为 GB)和 country(发货国家字段)定义为 CZ。但就我而言,lc 字段同时定义了语言和发货国家/地区。
    猜你喜欢
    • 2018-09-25
    • 2015-06-21
    • 1970-01-01
    • 1970-01-01
    • 2013-06-12
    • 1970-01-01
    • 2018-08-20
    • 2017-03-02
    • 2020-10-04
    相关资源
    最近更新 更多