PayPal的Payflow Gateway SDK示例不起作用

时间:2012-02-07 04:50:40

标签: payment-gateway paypal

我为Payflow Gateway下载了.NET SDK,并在设置我的Payflow Gateway测试帐户后跟these instructions,然后修改了两行DOSecureTokenAuth.cs,用户和连接变量:

        UserInfo User = new UserInfo("myacctname", "myacctname", 
                                     "PayPal", "passwd");
        PayflowConnectionData Connection = new PayflowConnectionData(
                                     "pilot-payflowpro.paypal.com", 443);

当我运行DOSecureTokenAuth.cs时,会打开一个命令行窗口说:

------------------------------------------------------
Executing Sample from File: DOSecureTokenAuth.cs
------------------------------------------------------
RESULT = 0
RESPMSG = Approved
SECURETOKEN = 3BZVLoht6cESPxMkScSau4g4l
SECURETOKENID = 9e09209a562b43739dd5d1a44a3e2d73
DUPLICATE =
Transaction was successful.

The next step would be to redirect to PayPal to display the hosted
checkout page to allow your customer to select and enter payment.

This is only a simple example, which does not take into account things like
RETURN or SILENT POST URL, etc.

Press <Enter> to redirect to PayPal.

Transaction Successful.
Press Enter to Exit ...

显然很成功。好极了。但是,下一步,将用户引导至PayPal的托管结账页面始终失败,并出现以下错误:

Some required information is missing or incorrect. Please correct the fields below and try again.
Error: An error has occurred. Please contact the system administrator.

Payflow Gateway文档说我应该将我的SECURETOKENID和SECURETOKEN提交给http://payflowlink.paypal.com(即使你想使用Payflow PRO ???),这是我尝试的一个例子(下面是GET但是POST以同样的方式失败):

https://payflowlink.paypal.com/?securetoken=3BZVLoht6cESPxMkScSau4g4l&securetokenid=9e09209a562b43739dd5d1a44a3e2d73&MODE=test&USER1=testuser1&ACCT=5105105105105100&EXPDATE=1212&CVV2=123

我甚至根据上面链接的PHP示例创建了一个可爱的小HTML表单页面:

<form method='post' action='https://payflowlink.paypal.com/'>
<input type='text' name='SECURETOKEN' value='3BZVLoht6cESPxMkScSau4g4l' />
<input type='text' name='SECURETOKENID' value='9e09209a562b43739dd5d1a44a3e2d73' />
<input type='hidden' name='MODE' value='test' />
<input type='submit' />
</form>

正如预期的那样,它死于同样模糊的错误,这意味着我以不正确的方式配置了我的帐户。我没有提供真实的财务信息,因为这个帐户只是一个不打算在实际网站上使用的开发人员测试帐户,但如果我正确阅读文档,这是预期的方法。

由于我假设它的配置,我的帐户配置了以下设置:

PayPal Express Checkout = Enabled
PayPal Email Address and PayPal Sandbox Email Address are configured and going to the same address
Show Confirmation Page = On a PayPal hosted page
Use Silent Post = No
Send email = Yes
AVS Check = No
CVC Check = No
Enable Secure Token = Yes

帮助!是什么导致了模糊的错误?!

3 个答案:

答案 0 :(得分:2)

原来,示例cs文件将初始安全令牌请求发送为“Silent”,默认情况下“Silent”模式未启用。注释掉该行(或启用静默模式)修复了该问题。

答案 1 :(得分:0)

几年前经历过类似的考验,我建议您尝试在Paypal Developer Network寻求帮助。

当我针对他们的测试API进行开发时,我没有成功。事实证明,我所测试的测试URI是一个旧的,过时的版本,它仍然列在我正在使用的当前文档中。

获取相关信息的唯一方法是实际支持测试支付网关的人员。那些人经常访问我链接的Paypal Developer论坛。

祝你好运!

答案 2 :(得分:0)

您是否已为Sandbox帐户配置了实际可用的 Sandbox 帐户?
如果不是这样,则可能是另一个帐户设置。通过https://www.papyal.com/mts联系PayPal支持,他们应该可以为您排序。