2010-05-11 177 views
0

一個問題,我從 https://cms.paypal.com/cms_content/US/en_US/files/developer/nvp_DoDirectPayment_php.txt約貝寶IPN

運行下載示例代碼,並得到

TIMESTAMP=2010%2d05%2d11T04%3a42%3a06Z&CORRELATIONID=ac15852d1e958&ACK=Failure&VERSION=51%2e0&BUILD=1268624&L_ERRORCODE0=10002&L_SHORTMESSAGE0=Security%20error&L_LONGMESSAGE0=Security%20header%20is%20not%20valid&L_SEVERITYCODE0=Error' (length=233) 

是什麼問題呢? api用戶名? API傳遞?簽名或其他什麼?

此Infor的我填寫源碼:

// Set request-specific fields. 
$paymentType = urlencode('Authorization');    // or 'Sale' 
$firstName = urlencode('Nguyen'); 
$lastName = urlencode('Quang Trung'); 
$creditCardType = urlencode('Visa'); 
$creditCardNumber = urlencode(' 

4111111111111111'); 
$expDateMonth = '04'; 
// Month must be padded with leading zero 
$padDateMonth = urlencode(str_pad($expDateMonth, 2, '0', STR_PAD_LEFT)); 

$expDateYear = urlencode('2015'); 
$cvv2Number = urlencode('5360 '); 
$address1 = urlencode('ha noi'); 
$address2 = urlencode('hcm'); 
$city = urlencode('ha noi'); 
$state = urlencode('ha noi state'); 
$zip = urlencode('84'); 
$country = urlencode('viet nam');    // US or other valid country code 
$amount = urlencode('900'); 
$currencyID = urlencode('USD');       // or other currency ('GBP', 'EUR', 'JPY', 'CAD', 'AUD') 
+0

呃...什麼?到底是什麼問題? – 2010-05-11 04:57:33

+0

當我得到TIMESTAMP = 2010%2d05%2d11T04%3a42%3a06Z&的correlationID = ac15852d1e958&ACK =失敗&VERSION = 51%2E0&BUILD = 1268624&L_ERRORCODE0 = 10002&L_SHORTMESSAGE0 =安全%20error&L_LONGMESSAGE0 =安全%20header%20is%20not%20有效&L_SEVERITYCODE0 =錯誤'(長度= 233) ACK =失敗和查看代碼,我認爲付款失敗並不知道爲什麼停止。交易? – Chameron 2010-05-11 05:05:07

回答

0

參考的錯誤代碼here。另外貝寶的反應很明顯說有一個Security Header is not valid

LONGMESSAGE0=Security%20header%20is%20not%20valid 

確保您輸入了正確的密碼API,用戶名等

+0

謝謝你,我會試試看。但是在沙箱中,如何填寫所有信用卡信息,還沒有信用卡:D – Chameron 2010-05-11 05:09:56

+0

我想你可以試試4111111111111111這是一種有效的信用卡格式。 – Shoban 2010-05-11 08:46:51

0

正如前面提到的答案,你需要一個有效的卡號。它是very easy來組成你自己的,我之前使用過MS Excel。但您只需使用this site即可獲得快捷方便的卡號。

另外,我建議您創建一個sandbox account(如果您還沒有),因爲它可以幫助您調試大部分問題。

P.S.只注意到它的2010的問題:(