PayPal REST API没有采用自定义的送货地址 [英] PayPal REST API does not take the customized shipping address

查看:199
本文介绍了PayPal REST API没有采用自定义的送货地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过 https://developer.paypal.com/webapps/developer访问PayPal REST API参考. /docs/api/创建和执行付款.

I am following the PayPal REST API Reference at https://developer.paypal.com/webapps/developer/docs/api/ to create and execute payments.

要创建付款,我将以下数据发送到PayPal.数据包含"shipping_address".付款创建成功.

To create a payment, I send the following data to PayPal. The data contain "shipping_address". The payment is created successfully.

{
"intent": "sale",
"payer": {
    "payment_method": "paypal"
},
"redirect_urls": {
    "return_url": "http://www.somethingabc.com/approve",
    "cancel_url": "http://www.somethingabc.com/cancel"
},
"transactions": [{
    "amount": {
        "currency": "USD",
        "total": "10.00",
        "details": {
            "shipping": "0.00",
            "subtotal": "10.00",
            "tax": "0.00"
        }
    },
    "item_list": {
        "items": [{
            "quantity": "1",
            "name": "Apples",
            "price": "10.00",
            "currency": "USD"
        }],
        "shipping_address": {
            "recipient_name": "John",
            "type": "residential",
            "line1": "441 Waterdale RD",
            "city": "Heidelberg West",
            "country_code": "AU",
            "postal_code": "3081",
            "state": "VICTORIA"
        }
    }
}]

}

然后,我将网络浏览器重定向到Approval_url(例如,

Then, I redirect the web browser to the approval_url (e.g., https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-343434SADSDSAD34) given in the PayPal response for the user to login and approve the payment. The user logins and a PayPal review web page appears. I expect that this review page should show the customized shipping address which I have provided previously when the payment was created. However, the PayPal review web page shows the PayPal owner's address instead.

所以,我的问题是如何强制PayPal审核网页显示自定义的送货地址,而不是PayPal所有者的地址?如果无法做到这一点,我如何获得用户在PayPal审核网页上选择的送货地址(当我调用API执行付款时,所选的送货地址未包含在payer_info对象中!)

So, my question is how to force the PayPal review web page to show the customized shipping address instead of the PayPal owner's address? If this can't be done, how can I get the shipping address which the user has selected on the PayPal review web page (when I call the API to execute the payment, the selected shipping address is not included in the payer_info object!).

谢谢.

推荐答案

您将需要创建一个配置文件,其中address_override选项设置为1.客户将无法更改您传递给PayPal的送货地址.

You will need to create an Experience Profile with the address_override option set to 1. The customer will then be unable to change the shipping address you have passed to PayPal.

发起销售时,您会在JSON请求中包含experience_profile_id.

You would include the experience_profile_id in your JSON request when initiating the sale.

这篇关于PayPal REST API没有采用自定义的送货地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆