问题描述
我下载了 .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失败的方式相同):
https://payflowlink.paypal.com/?securetoken=3BZVLoht6cESPxMkScSau4g4l&securetokenid=9e09209a562b43739dd5d1a44a3e2d73&MODE=test&USER1=testuser1&ACCT=5105 我甚至根据上面链接的PHP示例制作了一个可爱的HTML表单页面: 与预期的一样,它因相同的模糊错误而死亡,这意味着我以某种错误的方式配置了我的帐户.我没有输入真实的财务信息,因为该帐户只是开发人员测试帐户,不打算在实时站点上使用,但是如果我没看错文档,这是预期的方法. 由于我假设是配置,所以我的帐户配置了以下设置: 帮助!是什么导致模糊的错误?! 事实证明,示例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: When I run DOSecureTokenAuth.cs a commandline window opens saying: Clearly successful. Yay. However, the next step, directing the user to PayPal's Hosted Checkout Page always fails with the following error: 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): I even made a cute little HTML form page based on the PHP example linked above: 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: 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示例不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!<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
UserInfo User = new UserInfo("myacctname", "myacctname",
"PayPal", "passwd");
PayflowConnectionData Connection = new PayflowConnectionData(
"pilot-payflowpro.paypal.com", 443);
------------------------------------------------------
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 ...
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.
<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