简体   繁体   中英

Why is the Paypal Sandbox not processing payments?

I'm making an e-commerce site and the paypal integration is seemingly working. I have a shopping cart, that totals up all the items inside, adds the shipping price and then sends that number off to paypal with these lines.

string address = "https://api-3t.sandbox.paypal.com/nvp?USER=<username>&PWD=<password>&VERSION=71.0&SIGNATURE=<signature>&METHOD=SetExpressCheckout&PAYMENTREQUEST_0_AMT=" + lblTotal.Text + "&PAYMENTREQUEST_0_CURRENCYCODE=USD&RETURNURL=http://www.secretskeletonminiatures.com/checkout.aspx&CANCELURL=http://www.secretskeletonminiatures.com/cart.aspx&PAYMENTREQUEST_0_PAYMENTACTION=Sale";

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);

Then I pull in the response from paypal with a HTTPWebResponse and parse out the token and redirect users to

Response.Redirect("https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_express-checkout&useraction=commit&token=" + token);

When the user gets to paypal then log in and hit the "Pay Now" button and get redirected to the checkout page of my site.

So everything seems ok. But when I check the sandbox accounts, none of the money is actually getting transferred.

The most common cause is the useraction=commit parameter being missing from the redirect url but it's there so that isn't the problem.

To anyone else who stumbles on this question later. I did solve it. Once the user returns to your site after confirming the payment on paypal you still have to send a DoExpressCheckoutPayment request to the paypal servers to get the payment to process.

You would supply the PayerID and TOKEN to DoExpressCheckoutPayment to process it. The PayerID is appended in the URL of your RETURNURL, or can be retrieved by calling GetExpressCheckoutDetails with the TOKEN.

I faced same issue when I integrated pay pal and it seems that there has been some modification in their system.

if you go to your buyer account you could see your payments in pending state and to be approved in a couple of days, same behavior for merchant account.

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