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

发布于 2024-11-18 12:47:14 字数 998 浏览 3 评论 0原文

我正在制作一个电子商务网站,贝宝集成似乎正在运行。我有一个购物车,它汇总了里面的所有物品,加上运费,然后用这些行将该数字发送到贝宝。

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);

然后,我使用 HTTPWebResponse 提取来自 paypal 的响应,解析出令牌并将用户重定向到

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

当用户访问 paypal 时,然后登录并点击“立即付款”按钮,然后重定向到我网站的结帐页面。

所以一切看起来都很好。但当我检查沙箱帐户时,实际上没有任何资金被转移。

最常见的原因是重定向 URL 中缺少 useraction=commit 参数,但它确实存在,所以这不是问题。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

这个俗人 2024-11-25 12:47:14

对于后来偶然发现这个问题的任何人。
我确实解决了。一旦用户在 PayPal 上确认付款后返回您的网站,您仍然需要向 PayPal 服务器发送 DoExpressCheckoutPayment 请求以处理付款。

您将向 DoExpressCheckoutPayment 提供 PayerID 和 TOKEN 来处理它。 PayerID 附加在您的 RETURNURL 的 URL 中,或者可以通过使用 TOKEN 调用 GetExpressCheckoutDetails 来检索。

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.

雪若未夕 2024-11-25 12:47:14

当我集成 PayPal 时,我遇到了同样的问题,似乎他们的系统进行了一些修改。

如果您转到买家帐户,您可以看到您的付款处于待处理状态,并将在几天内获得批准,商家帐户的行为相同。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文