2012-02-07 25 views
1

我下載了.NET SDK的Payflow網關和隨後these instructions上設置我的Payflow網關測試帳戶,然後修改兩行DOSecureTokenAuth.cs,的用戶和連接變量:PayPal的Payflow網關SDK示例不工作

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

幫助!什麼導致模糊的錯誤?!

回答

2

原來,示例cs文件將初始安全令牌請求發送爲「無提示」,默認情況下「靜音」模式未啓用。註釋掉該行(或啓用靜默模式)解決了該問題。

0

經過幾年前的類似考驗,我建議您嘗試在Paypal Developer Network尋求幫助。

當我開發對他們的測試API時,我沒有成功。事實證明,我碰到的測試URI是一個陳舊過時的版本,它仍然列在我正在編寫的當前文檔中。

獲得有關信息的唯一方法來自實際支持測試支付網關的人員。那些人經常與我關聯的Paypal開發者論壇。

祝你好運!

0

您配置了實際工作的沙盒帳戶沙盒帳戶?
如果不是這樣,它可能是另一個帳戶設置。請通過https://www.papyal.com/mts聯繫PayPal支持,他們應該能夠爲您解決問題。

+7

只是沒有人會感到困惑,「Sandbox」僅用於PayPal測試,這與Payflow測試不同。 Payflow測試你必須使用現場網站(manager.paypal。com),爲了創建一個「測試」帳戶,一旦獲取了財務信息,就會取消註冊過程。精美的設計! – inanutshellus 2012-02-07 14:35:22