PP REST API charge tax and shipping without sending address?

那年仲夏 提交于 2020-01-23 07:50:55

问题


Using the REST API, how can I charge tax or shipping if I send the user to PayPal to collect shipping information (and pay, of course)?

Doing some research it almost seems like that isn't possible, but I can't imagine that being the case. If I have to collect shipping information myself, the value prop for using PP is greatly reduced.


回答1:


With the REST API, just like the Classic API, a PayPal payment is executed in three steps:

1) Send initial information to PayPal to get a token. Redirect customer to PayPal. Customer authorizes payment. 2) Get payment details (like the shipping address) 3) Confirm payment.

So, in this case, after getting the shipping address, you display an order review page to the customer where it will generate the shipping options and tax amount to the customer. They then have to select a "Confirm Order" button which will then finalize the charge to PayPal with the new tax/shipping and final amount.

In API terms, the final step is done with the /execute command. This accepts the payer_id you received in step 2, and a transactions array that supports a new amount object.

The amount object includes a details object that includes shipping, tax, handling fee, insurance, etc.

Include the details the customer decides on your review page and PayPal will charge the updated amount to the customer's funding source of choice.



来源:https://stackoverflow.com/questions/24639720/pp-rest-api-charge-tax-and-shipping-without-sending-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!