【发布时间】: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
【问题讨论】: