Home » Php » php – Showing the cost/price in Paypal's express checkout API

php – Showing the cost/price in Paypal's express checkout API

Posted by: admin July 12, 2020 Leave a comment

Questions:

I’ve just implemented Paypal’s express checkout API to one of our websites, which works for what I want but it does not display any information on the Paypal confirm page (see pic) about what the user is paying for or how much it is. If I really wanted too I could submit a different amount to what the user is paying and they would have no idea! (Which would be wrong but it is possible…).

Anyway, I was reading this: https://cms.paypal.com/cms_content/GB/en_GB/files/developer/PP_ExpressCheckoutAPIUserGuide.pdf

And I’ve added the parameters like it says but I must be missing something as it’s not changed anything.

Here’s a screenshot of what the Paypal screen looks like:

paypal

Would be extremely useful to either show the total amount or a break down of items like in the PDF linked above.

How to&Answers:

You have to change the redirect URL from

https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=[token returned in the SetEC response] 

to

https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token=[token returned in the SetEC response] 

Express Checkout does not show order details by default, because your website is supposed to do this before and after your buyers are directed to PayPal.

EDIT

As Joe says below, the difference is adding “useraction=commit”

This tells PayPal you expect the buyer to “commit to the purchase” on PayPal’s site, not your own. This way, they will show the amount to they buyer so they can see what they’re committing to.