PayPal REST API does not accept configured delivery address

I am executing a PayPal API API link at https://developer.paypal.com/webapps/developer/docs/api/ to create and execute payments.

To create a payment, I send the following data to PayPal. The data contains "shipping_address". Payment 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" } } }] 

}

Then I redirect the web browser to the URL_ statement (for example, https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=EC-343434SADSDSAD34 ) specified in the PayPal answer for user login and approval payment. The user login appears and the PayPal viewing web page appears. I expect that the individual delivery address that I previously provided when the payment was created should be indicated on this review page. However, the PayPal review address is instead indicated on the PayPal review webpage.

So my question is, how do I get the PayPal review webpage to display the configured delivery address instead of the PayPal owner address? If this cannot be done, how can I get the delivery address that the user selected on the PayPal review webpage (when I call the API to make the payment, the selected delivery address is not included in the payer_info object!).

Thanks.

+6
source share
2 answers

After testing the code, I can not find any errors. The answer that I get when completing the payment:

 { "id": "PAY-xxxxxxx", "create_time": "2014-05-01T23:54:00Z", "update_time": "2014-05-01T23:59:35Z", "state": "approved", "intent": "sale", "payer": { "payment_method": "paypal", "payer_info": { "email": " test@paypal.com ", "first_name": "John", "last_name": "Smith", "payer_id": "GPV2878GCMNGE", "shipping_address": { "line1": "441 Waterdale RD", "city": "Heidelberg West", "state": "Victoria", "postal_code": "3081", "country_code": "AU" } } }, "transactions": [ { "amount": { "total": "10.00", "currency": "USD", "details": { "subtotal": "10.00" } }, "item_list": { "items": [ { "name": "Apples", "price": "10.00", "currency": "USD", "quantity": "1" } ], "shipping_address": { "recipient_name": "John", "line1": "441 Waterdale RD", "city": "Heidelberg West", "state": "VICTORIA", "postal_code": "3081", "country_code": "AU" } }, ..... } 

If you do not see this, I would contact Paypal Technical Support and apply for a call. Since this is the answer you should get.

0
source

You will need to create an experience profile with the address_override parameter set to 1. The client will not be able to change the delivery address that you transferred to PayPal.

When starting a sale, you must include test_profile_id in the JSON request.

0
source

Source: https://habr.com/ru/post/956453/


All Articles