我們已經嘗試過使用PayPal沙盒測試我們的網站,並且它可以完全扣除金額。在PHP支付寶API API快速結帳付款錯誤代碼13113
我們將API細節切換到Paypal和鏈接。我們已經嘗試了幾個PayPal賬戶,看它是否有效(所有這些賬戶都有足夠的資金進行交易)。
我們收到通過API我們RETURNURL頁面上這回 - 的API調用失敗
Array ([TIMESTAMP] => 2012%2d07%2d15T19%3a31%3a43Z [CORRELATIONID] => 927a89205e54a
[ACK] => Failure [VERSION] => 65%2e1 [BUILD] => 3300093 [L_ERRORCODE0] => 13113
[L_SHORTMESSAGE0] => Buyer%20Cannot%20Pay%2e [L_LONGMESSAGE0] =>
The%20Buyer%20cannot%20pay%20with%20PayPal%20for%20this%20Transaction%2e [L_SEVERITYCODE0] => Error)
PHP來作出最後的API調用 -
$APIUSERNAME="*****";
$APIPASSWORD="***";
$APISIGNATURE="*****";
$ENDPOINT = "https://api-3t.paypal.com/nvp";
//$ENDPOINT = "https://api-3t.sandbox.paypal.com/nvp";
$VERSION = "64";
//Build the Credential String:
$cred_str = "USER=" . $APIUSERNAME . "&PWD=" . $APIPASSWORD . "&SIGNATURE=" .
$APISIGNATURE . "&VERSION=" . $VERSION;
//Build NVP String for GetExpressCheckoutDetails
$nvp_str = "&METHOD=GetExpressCheckoutDetails&TOKEN=" . urldecode($token);
//Lets combine both strings then make the API call
$req_str = $cred_str . $nvp_str; $response = PPHttpPost($ENDPOINT, $req_str);
以上陣列來源於當我從paypal收到我的最終確認。
//check Response
if($doresponse['ACK'] == "Success" || $doresponse['ACK'] == "SuccessWithWarning") {
echo "completed"; //just put to test
include "finishtransaction.php"; //cancels my cart sessions
} else{
echo "The API Call Failed"; print_r($doresponse);
}
在谷歌上沒有太多關於這個錯誤的信息,甚至在API錯誤代碼中也沒有。有沒有人來過這個?
謝謝,我現在將檢查我的所有代碼:D – JP29 2012-07-15 19:57:18
確保在所有參數上使用'urlencode'。你甚至可以使用'urldecode($ token)',當我認爲你的意思是'urlencode($ token)' – cegfault 2012-07-15 20:05:13
謝謝,但它似乎並沒有這樣做。試過編碼。當然,如果這是一個促成因素,沙盒將無法工作。 – JP29 2012-07-15 20:31:11