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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…