gpt4 book ai didi

php - 安全 header 无效 - 1002

转载 作者:太空宇宙 更新时间:2023-11-03 15:59:18 28 4
gpt4 key购买 nike

我正在尝试将 nvp API 用于 ExpressCheckout,

我已经在我的 php 页面中设置了这个:

$userPaypal = "****";
$passPaypal = "****";
$signaturePaypal = "*****";

$params = array(
'METHOD' => 'SetExpressCheckout',
'VERSION' => '202.0',
'USER' => $userPaypal,
'SIGNATURE' => $signaturePaypal,
'PWD' => $passPaypal,
'RETURNURL' => 'process.php',
'CANCELURL' => 'cancel.php',

'PAYMENTREQUEST_0_AMT' => '10',
'PAYMENTREQUEST_0_CURRENCYCODE' => 'EUR');

$params = http_build_query($params);

$endpoint = 'https://api-3t.sandbox.paypal.com/nvp';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $endpoint,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $params,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_VERBOSE => 1
));

$response = curl_exec($curl);
$responseArray = array();
parse_str($response, $responseArray);
var_dump($responseArray);
curl_close($curl);

这是 var_dump 给我的:

array (size=9)

'TIMESTAMP' => string '2015-12-17T17:05:44Z' (length=20)

'CORRELATIONID' => string '287a4dff68c2f' (length=13)

'ACK' => string 'Failure' (length=7)

'VERSION' => string '202.0' (length=5)

'BUILD' => string '18308778' (length=8)

'L_ERRORCODE0' => string '10002' (length=5)

'L_SHORTMESSAGE0' => string 'Security error' (length=14)

'L_LONGMESSAGE0' => string 'Security header is not valid' (length=28)

'L_SEVERITYCODE0' => string 'Error' (length=5)

有人知道如何解决“安全 header 无效”问题吗?

谢谢,罗宾。

最佳答案

此错误表示 API 凭据不正确。请仔细检查您的 API 凭据并确保您没有将 paypal live API 凭据用于沙箱 API。

关于php - 安全 header 无效 - 1002,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34340448/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com