为什么贝宝沙箱不处理付款? [英] Why is the Paypal Sandbox not processing payments?

查看:118
本文介绍了为什么贝宝沙箱不处理付款?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我作出的电子商务网站和PayPal的整合工作看似。我有一个购物车,这总计达内的所有项目,加运费价格,然后发送一个报数与这些线路贝宝。

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



然后我拉来自PayPal的响应与HTTPWebResponse并解析出令牌,将用户重定向到

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

当用户获取到PayPal然后登录并点击立即付款按钮,并重定向到我的网站的结账页面。

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.

最常见的原因是useraction = commit参数中的重定向URL为失踪,但它的有这样是没有问题的。

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.

推荐答案

要谁比谁后来在这个问题上跌倒。
我没有解决这个问题。一旦确认对贝宝付款后,用户返回到你的网站,你还是得送DoExpressCheckoutPayment请求到贝宝的服务器,以获得付款处理。

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.

您将供应在PayerID和令牌DoExpressCheckoutPayment对其进行处理。该PayerID被附加在你的RETURNURL的网址,也可以通过调用令牌GetExpressCheckoutDetails进行检索。

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.

这篇关于为什么贝宝沙箱不处理付款?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆