在Paypal智能付款按钮上设置国家/地区电话
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Paypal智能付款按钮上设置国家/地区电话相关的知识,希望对你有一定的参考价值。
[使用Smart Payment Buttons向PayPal发送动态付款时,我试图设置国家和电话号码。
我确保与REST应用程序关联的沙箱帐户也来自加拿大。
这是我在actions.order.create()
中输入的订单:
{
"purchase_units": [{
"items": [{
"name": "Test Item",
"quantity": 1,
"unit_amount": {
"value": "125.01",
"currency_code": "CAD"
}
}, {
"name": "Beach Therapy",
"quantity": 1,
"unit_amount": {
"value": "1010.00",
"currency_code": "CAD"
}
}],
"amount": {
"value": "1135.01",
"currency_code": "CAD",
"breakdown": {
"item_total": {
"value": "1135.01",
"currency_code": "CAD"
}
}
}
}],
"application_context": {
"brand_name": "TEST",
"landing_page": "BILLING",
"shipping_preference": "NO_SHIPPING",
"user_action": "PAY_NOW",
"locale": "en-CA"
},
"payer": {
"email_address": "wafe@fewa.com",
"phone": {
"phone_number": {
"national_number": "16135802400"
}
},
"address": {
"address_line_1": "",
"address_line_2": "",
"admin_area_2": "Ottawa",
"admin_area_1": "ON",
"postal_code": "K1P",
"country_code": "CA"
}
}
}
答案
不完整的答案:]
刚刚碰到这个。期待尝试。
<script src="https://www.paypal.com/sdk/js?client-id=sb"></script>
<script>paypal.Buttons({
enableStandardCardFields: true,
createOrder: function(data, actions) {
return actions.order.create({
intent: 'CAPTURE',
payer: {
name: {
given_name: "PayPal",
surname: "Customer"
},
address: {
address_line_1: '123 Fake Street',
address_line_2: 'Apt 2',
admin_area_2: 'San Jose',
admin_area_1: 'CA',
postal_code: '95121',
country_code: 'US'
},
email_address: "customer@domain.com",
phone: {
phone_type: "MOBILE",
phone_number: {
national_number: "14082508100"
}
}
},
purchase_units: [
{
amount: {
value: '15.00',
currency_code: 'USD'
},
shipping: {
address: {
address_line_1: '2211 N First Street',
address_line_2: 'Building 17',
admin_area_2: 'San Jose',
admin_area_1: 'CA',
postal_code: '95131',
country_code: 'US'
}
},
}
]
});
}
}).render("body");
</script>
来源:Paypal - Standard Card Fields
以上是关于在Paypal智能付款按钮上设置国家/地区电话的主要内容,如果未能解决你的问题,请参考以下文章
WooCommerce Paypal - 不允许基于 PayPal 帐单地址的付款(国家/地区限制)
PayPal 智能按钮:是不是有任何方式 onApprove 在付款未完成的情况下运行?