Why is the Paypal Sandbox not processing payments?

烈酒焚心 提交于 2019-12-12 07:07:04

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/6554998/why-is-the-paypal-sandbox-not-processing-payments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!