简体   繁体   English

为什么 Paypal 沙盒不处理付款?

[英]Why is the Paypal Sandbox not processing payments?

I'm making an e-commerce site and the paypal integration is seemingly working.我正在制作一个电子商务网站,paypal 集成似乎正在工作。 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.我有一个购物车,将里面的所有物品加起来,加上运费,然后用这些行将该数字发送到 paypal。

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然后我使用 HTTPWebResponse 从 paypal 中提取响应并解析出令牌并将用户重定向到

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.当用户到达 paypal 然后登录并点击“立即付款”按钮并重定向到我网站的结帐页面。

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.最常见的原因是重定向 url 中缺少 useraction=commit 参数,但它在那里,所以这不是问题。

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.一旦用户在 paypal 上确认付款后返回您的站点,您仍然需要向 paypal 服务器发送 DoExpressCheckoutPayment 请求以处理付款。

You would supply the PayerID and TOKEN to DoExpressCheckoutPayment to process it.您将向 DoExpressCheckoutPayment 提供 PayerID 和 TOKEN 以进行处理。 The PayerID is appended in the URL of your RETURNURL, or can be retrieved by calling GetExpressCheckoutDetails with the TOKEN. PayerID 附加在您的 RETURNURL 的 URL 中,或者可以通过使用 TOKEN 调用 GetExpressCheckoutDetails 来检索。

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.如果您将 go 发送到您的买家帐户,您可以在待处理的 state 中看到您的付款,并在几天内获得批准,商家帐户的行为相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM