douzuan5365 2015-12-31 00:37
浏览 68

即使使用正确的凭据和API端点(仅在实时模式下)和Curl 230错误,PayPal Express - 10002安全标头也无效错误

Before starting, I have to say know this is probably the moston common error faced by people using PP API and that it's mostly caused by human error.

However, after changing my gateway from sandbox mode to live (changed the api to the right endpoint, added my correct api credentials for live account) I keep getting error 10002.

I have carefully checked all the api details, white spaces, api endpoint etc, so this is starting to drive me crazy.

Here is the api call which works perfectly fine with sandbox.

$ppurl = "https://api-3t.paypal.com/nvp";
$feesforpurchase = calculateFees($planPrice);
$total = $planPrice + $feesforpurchase;
$SetExpressCheckoutURL = $ppurl."?USER=".$apiuser."&PWD=".$apipwd."&SIGNATURE=".$apisig."&METHOD=SetExpressCheckout&VERSION=93&PAYMENTREQUEST_0_PAYMENTACTION=SALE&PAYMENTREQUEST_0_AMT=".$total."&PAYMENTREQUEST_0_ITEMAMT=".$planPrice."&PAYMENTREQUEST_0_SHIPPINGAMT=".$feesforpurchase."&PAYMENTREQUEST_0_CURRENCYCODE=USD&RETURNURL=http://example.com/thanks.php pid=".$pid."&CANCELURL=http://example.com&PAYMENTREQUEST_0_CUSTOM=".base64_encode($userid."-".$planID."-".$total."-".$pid);

$cURL = curl_init();
curl_setopt($cURL, CURLOPT_HEADER, false);
curl_setopt($cURL, CURLOPT_URL, $SetExpressCheckoutURL);
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cURL, CURLOPT_TIMEOUT, 5);
$response = curl_exec($cURL); 

$count++;
if($count >= $max_tries) {
    break;
    $success = false;
}
}
while(curl_errno($cURL) == 28 OR curl_errno($cURL) == 35 OR curl_errno($cURL) == 7);

if($success == false) {

echo 'Payment failed please retry <br />';
// If it got here it tried 5 times and still didn't get a result.
// More code here for what you want to do...

} 

echo 'Curl error: ' . curl_error($cURL);
echo var_dump($response);

Any clue what else may be causing this 10002 error ? Already checked api multiple times and there is absolutely nothing wrong with the credentials, as echoing the checkout url shows.

The curl error also returns 230 so var_dump($response) is string(230).

Curl error: string(230)

Really appreciate any help regarding this

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大