Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

api

paypal

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.

like image 331
ingh.am Avatar asked Sep 01 '11 17:09

ingh.am


1 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.

like image 129
SgtPooki Avatar answered Oct 02 '22 21:10

SgtPooki