我们已经使用贝宝(Paypal)沙箱尝试并测试了我们的网站,它可以完全扣除该金额。
我们已将API详细信息切换为Paypal和链接。我们尝试了几个Paypal帐户,以查看其是否有效(它们都有足够的资金来进行交易)。
我们通过returnUrl页面上的API收到了此信息-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 )
Run Code Online (Sandbox Code Playgroud)
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);
Run Code Online (Sandbox Code Playgroud)
上面的数组来自当我收到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);
}
Run Code Online (Sandbox Code Playgroud)
在Google上关于此错误的信息不多,甚至API错误代码也没有。有人来过吗?
在贝宝API错误代码诚然不是非常有帮助。
错误代码13113或“买方无法为此交易使用PayPal付款”表示PayPal已通过拒绝处理交易采取了安全措施。可能由于以下原因之一而发生这种情况(有更多原因,但是这里有几个原因):
不幸的是,如果没有彻底浏览代码,几乎没有人可以告诉您。我将检查我的代码,并确保设置了所有适当的标志和“什么”。如果您等了几个小时仍遇到错误(特别是在多个/新帐户上),则需要联系PayPal。
我知道这很糟糕,但是只有PayPal才能告诉您交易为什么会失败。
| 归档时间: |
|
| 查看次数: |
5447 次 |
| 最近记录: |