Question

I have integrated paypal express-checkout in a website. All seems to work fine. When customer is redirected to paypal for payment, the button Pay Now appears, since I am using:useraction=commit, i.e.:

https://www.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=MYTOKEN&useraction=commit

Customer logs in from Paypal and clicks on the Pay Now button. Paypal gives no error, everything seems to be successful and customer is redirected at the RETURNURL, but no transaction is created in the buyer or in the seller account.

Was it helpful?

Solution

I'm afraid I missed some points from Paypal API documentation.useraction=commit will NOT complete the transaction. After returning from Paypal, we still need to execute DoExpressCheckoutPayment in order to complete the transaction.

OTHER TIPS

Like George said, useraction=commit does not complete the transaction. It only changes the PayPal UI so the customer feels they have confirmed it there, so you don't have to add confirmation UI on your site. You still need to make the request behind the scenes to confirm it.

PayPal's docs say this:

The useraction URL parameter in your redirect to PayPal determines whether buyers complete their purchases on PayPal or on your website. If you set useraction to commit, PayPal sets the button text to Pay Now on the PayPal Review your informaton page. This text lets buyers know that they complete their purchases if they click the button.

After PayPal redirects buyers to your site, call GetExpressCheckoutDetails and DoExpressCheckoutPayment to have PayPal complete the payment successfully. Call DoExpressCheckoutPayment without waiting for buyer interaction. Use information in the GetExpressCheckoutDetails response to fill out your order confirmation page.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top