简体   繁体   中英

Changing Shipping Address on Order Confirmation Step in PayPal Express Checkout

I am using the Express Checkout API to accept payments for my online store. The payment flow is as follows:

1) User adds Item to Cart

2) User proceeds to PayPal

3) User enters or selects existing shipping address, confirms, and is redirected to order confirmation step

4) Order Details such as Shipping Address are retrieved from PayPal using GetExpressCheckoutDetails.

5) On the order confirmation step (prior to DoExpressCheckoutPayment), user has the option to change the shipping address returned by PayPal. If user changes the shipping address, I need to recalculate the shipping cost to this new address, and submit the new shipping cost, as well as the new address back to PayPal

6) I am attempting to do this as part of the DoExpressCheckoutPayment payment call, using PAYMENTREQUEST_0_SHIPTONAME etc, but the shipping address within the transaction details does not change. (Likely because these are deprecated) Instead, the address chosen or entered on PayPal remains.

How can I submit a new shipping address to PayPal without having the user re-enter the transaction funnel from the beginning?

The shipping parameters in DECP are not deprecated. The documentation is a little bit misleading. It's the old version of those parameters, prior to when they added the ability to do parallel payments to EC, that are deprecated.

So, for example, SHIPTONAME is deprecated. Instead, you should now use PAYMENTREQUEST_n_SHIPTONAME like you have.

That said, whatever you send in the DECP request should be carried over to PayPal and end up being what is used for the payment's shipping address. In fact, if you don't include an address in DECP it shouldn't end up as part of the payment details in my experience.

If you want to provide a sample of the API requests during a checkout I'll be happy to take a look and see if I can figure out where you're going wrong.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM