PayPal METHOD = DoDirectPayment#10759错误

时间:2016-05-28 07:37:53

标签: php wordpress paypal

我通过DoDirectPayment方法使用Paypal交易,我已经验证了我的API凭据大约100次;没错。

 Array (
        [TIMESTAMP] => 0000-00-00T00:00:00Z
        [CORRELATIONID] => 0000000000
        [ACK] => Failure
        [VERSION] => 56.0
        [BUILD] => 000000
        [L_ERRORCODE0] => 10759
        [L_SHORTMESSAGE0] => Transaction cannot be processed.
        [L_LONGMESSAGE0] => Please use a different payment card.
        [L_SEVERITYCODE0] => Error
        [AMT] => 0.50
        [CURRENCYCODE] => USD
)

以上是我从paypal获得的回应。

我从这里尝试了所有卡片:https://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm

我的代码:

$request  = 'METHOD=DoDirectPayment';
$request .= '&VERSION=56.0';
$request .= '&USER='.$paypal_user;
$request .= '&PWD='.$paypal_pass;
$request .= '&SIGNATURE='.$paypal_sign;
$request .= '&CUSTREF=' . $post_id;
$request .= '&PAYMENTACTION=Authorization';
$request .= '&AMT='.$amount;
$request .= '&EXPDATE=' . $expmonth . $expyear;
$request .= '&CVV2=' . $ccv;
$request .= '&ACCT=' . $card_number;
$request .= '&CURRENCYCODE=USD';
$request .= '&IPADDRESS=' . urlencode($_SERVER['REMOTE_ADDR']);
$request .= '&CREDITCARDTYPE=' . $cardtype; // VISA AND ALL

$curl = curl_init($apiurl);
curl_setopt($curl, CURLOPT_PORT, 443);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FORBID_REUSE, 1);
curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $request);

// Request to paypal
$response = curl_exec($curl);

请告诉我这里缺少的东西。

2 个答案:

答案 0 :(得分:4)

该网址提供的卡片已经在沙盒中使用了很多,以至于它们根本不再起作用了。使用PayFlow,但不能使用DoDirectPayment。

相反,generate fresh numbers here当你需要它们时。生成的任何数字都适用于任何安全代码和有效的到期日期。

答案 1 :(得分:1)

您可以尝试在下一页的步骤4中创建新的虚拟卡信息,然后再次尝试测试。

https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1413