PayPal的Payflow Gateway SDK示例不起作用 [英] PayPal's Payflow Gateway SDK Example not working

查看:253
本文介绍了PayPal的Payflow Gateway SDK示例不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了 .NET SDK 用于Payflow Gateway和按照这些说明设置我的Payflow Gateway测试帐户,然后修改了两行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网关文档说我应该将我的SECURETOKENID和SECURETOKEN提交到 http://payflowlink.paypal.com (即使您要使用Payflow PRO ???),这也是我尝试的示例(以下是GET,但POST失败的方式相同):

解决方案

事实证明,示例cs文件将初始安全令牌请求发送为"Silent",并且默认情况下未启用"Silent"模式.注释掉该行(或启用静默模式)可以解决此问题.

I downloaded the .NET SDK for Payflow Gateway and followed these instructions on setting up my Payflow Gateway test account, then modified two lines of DOSecureTokenAuth.cs, the User and Connection variables:

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

When I run DOSecureTokenAuth.cs a commandline window opens saying:

------------------------------------------------------
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 ...

Clearly successful. Yay. However, the next step, directing the user to PayPal's Hosted Checkout Page always fails with the following error:

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.

The Payflow Gateway docs say I should submit my SECURETOKENID and SECURETOKEN to http://payflowlink.paypal.com (even if you're wanting to use Payflow PRO???), and here's an example of me trying (below is a GET but POST fails the same way):

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

I even made a cute little HTML form page based on the PHP example linked above:

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

And as expected it died with the same vague error, which implies I have configured my account in some incorrect way. I haven't put in real financial information, because this account is just a developer test account not intended to be used on a live site, but if I read the docs right, this is the expected way to do it.

Since I assume it's configuration, my account is configured with the following settings:

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

Help! What's causing the vague error?!

解决方案

Turns out that the example cs file sends the initial secure token request as "Silent" and by default "Silent" mode isn't enabled. Commenting out that line (or enabling Silent mode) fixed the issue.

这篇关于PayPal的Payflow Gateway SDK示例不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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