我正在通过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
)


以上是我从贝宝得到的回应。

我从这里尝试过所有卡: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);


请让我知道我在这里想念的东西。

最佳答案

该URL提供的卡在沙箱中已被大量使用,以至于它们根本无法使用。他们使用PayFlow,但不使用DoDirectPayment。

而是在需要时使用generate fresh numbers here。在那里生成的任何数字都可以使用任何安全代码和有效的到期日期。

关于php - Paypal 方法= DoDirectPayment#10759错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37496490/

10-09 06:13