Why do we have to repeat the fields in DoExpressCheckoutPayment while they were already set in SetExpressCheckout?

StackOverflow https://stackoverflow.com/questions/21376713

  •  03-10-2022
  •  | 
  •  

Question

Why do we have to repeat the fields like L_PAYMENTREQUEST_0_NAME0 or L_PAYMENTREQUEST_0_DESC0 or PAYMENTREQUEST_0_DESC or even PAYMENTREQUEST_0_AMT in DoExpressCheckoutPayment if we already set them in SetExpressCheckout? Shouldn't they be stored in the session that we've created in the first step?

Était-ce utile?

La solution

SEC simply prepares the system for a checkout and gives you a token. Much could change between the SEC and the DECP call, so it's left up to DECP to finalize everything.

For example, with SEC you might pass a shipping address, but then during checkout the buyer changes it to one of their PayPal addresses. Then when you call GetExpressCheckoutDetails you'd get back this address, so then the system wouldn't know which one you wanted to actually include with the order. It would use whatever you pass into DECP.

Same with tax information, shipping, etc. which of course adjusts the final amount, too. Maybe you don't have any address during SEC so you have to wait for GECD to get an address and calculate shipping and tax based on that. Then the values for those parameters and the total would be different between SEC and DECP.

Those are just a couple of examples, but again, there are lots of things that could change between SEC and DECP depending on your application, so you just need to make sure that whatever you want to be included in the final payment details is included in DECP.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top