在 SetExpressCheckout 和 nvp SDK 中使用 CURRENCYCODE 时出现 10605 错误

发布于 2024-12-08 21:38:43 字数 3825 浏览 0 评论 0原文

当我尝试使用 nvp SDK SetExpressCheckout 时,我遇到了一个大问题 将参数 &PAYMENTREQUEST_0_CURRENCYCODE 传递到结帐链接时,它返回错误,

    SetExpressCheckout failed: Array ( 
[TIMESTAMP] => 2011%2d10%2d11T00%3a58%3a56Z 
[CORRELATIONID] => fa1dd71c19e46 
[ACK] => Failure 
[VERSION] => 82%2e0 
[BUILD] => 2133933 
[L_ERRORCODE0] => 99998 
[L_ERRORCODE1] => 10605 
[L_SHORTMESSAGE0] => Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e 
[L_SHORTMESSAGE1] => Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e 
[L_LONGMESSAGE0] => Currency%20is%20not%20supported [L_LONGMESSAGE1] => Currency%20is%20not%20supported 
[L_SEVERITYCODE0] => Error [L_SEVERITYCODE1] => Error )

我已尽一切努力传递此错误,但我没有 我确定货币代码有效 我必须将其设置为 GBP,但即使将其设置为 USD,它也会返回错误 如果我删除此参数&PAYMENTREQUEST_0_CURRENCYCODE 一切正常,没有问题,但以美元为单位 如果我将此参数 &PAYMENTREQUEST_0_CURRENCYCODE 包含在任何货币代码中,它会返回相同的错误 完整的 var_dump

 array(13) { ["TIMESTAMP"]=> string(28) "2011%2d10%2d13T02%3a55%3a21Z" 
["CORRELATIONID"]=> string(13) "4e167b7f7ec44" 
["ACK"]=> string(7) "Failure" 
["VERSION"]=> string(6) "82%2e0" 
["BUILD"]=> string(7) "2183220" 
["L_ERRORCODE0"]=> string(5) "99998" 
["L_ERRORCODE1"]=> string(5) "10605" 
["L_SHORTMESSAGE0"]=> string(122) "Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e" 
["L_SHORTMESSAGE1"]=> string(122) "Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e" 
["L_LONGMESSAGE0"]=> string(31) "Currency%20is%20not%20supported" 
["L_LONGMESSAGE1"]=> string(31) "Currency%20is%20not%20supported" 
["L_SEVERITYCODE0"]=> string(5) "Error" 
["L_SEVERITYCODE1"]=> string(5) "Error" } bool(true) SetExpressCheckout failed:

这是 api 请求

$actions .= '
&L_PAYMENTREQUEST_0_NAME1=Name Example
&L_PAYMENTREQUEST_0_NUMBER1=Product Code Example
&L_PAYMENTREQUEST_0_DESC1=Product Title
&L_PAYMENTREQUEST_0_AMT1='.number_format(50, 2, '.', '').'
&L_PAYMENTREQUEST_0_QTY1=1';
$paymentAmount = urlencode($sum);
$ship = urlencode($del);
$tot = $paymentAmount + $ship ;
$currencyID = urlencode(GBP);                           // or other currency code ('GBP', 'EUR', 'JPY', 'CAD', 'AUD')
$returnURL = urlencode("http://www.example.net/index.php");
$cancelURL = urlencode('http://www.example.net/index.php');
$actions .= "
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_ITEMAMT=".$paymentAmount."
&PAYMENTREQUEST_0_SHIPPINGAMT=".$ship."
&PAYMENTREQUEST_0_AMT=".$tot."
&PAYMENTREQUEST_0_ALLOWNOTE=1
&PAYMENTREQUEST_0_CURRENCYCODE=".$currencyID."
";
// Add request-specific fields to the request string.
$nvpStr = "&$actions&ReturnUrl=$returnURL&CANCELURL=$cancelURL";

// Execute the API operation; see the PPHttpPost function above.
$httpParsedResponseAr = PPHttpPost('SetExpressCheckout', $nvpStr);

if("SUCCESS" == strtoupper($httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($httpParsedResponseAr["ACK"])) {
    // Redirect to paypal.com.
    $token = urldecode($httpParsedResponseAr["TOKEN"]);
    $payPalURL = "https://www.paypal.com/webscr&cmd=_express-checkout&token=$token";
    if("sandbox" === $environment || "beta-sandbox" === $environment) {
        $payPalURL = "https://www.$environment.paypal.com/webscr&cmd=_express-checkout&token=$token";
    }
    header("Location: $payPalURL");
    exit;
} else  {
    exit('SetExpressCheckout failed: ' . print_r($httpParsedResponseAr, true));
}

im facing a big problem when im trying to SetExpressCheckout using nvp SDK
when passing the parameter &PAYMENTREQUEST_0_CURRENCYCODE to the checkout link it return error

    SetExpressCheckout failed: Array ( 
[TIMESTAMP] => 2011%2d10%2d11T00%3a58%3a56Z 
[CORRELATIONID] => fa1dd71c19e46 
[ACK] => Failure 
[VERSION] => 82%2e0 
[BUILD] => 2133933 
[L_ERRORCODE0] => 99998 
[L_ERRORCODE1] => 10605 
[L_SHORTMESSAGE0] => Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e 
[L_SHORTMESSAGE1] => Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e 
[L_LONGMESSAGE0] => Currency%20is%20not%20supported [L_LONGMESSAGE1] => Currency%20is%20not%20supported 
[L_SEVERITYCODE0] => Error [L_SEVERITYCODE1] => Error )

i did everything to pass this error but i didn't
im sure that the currency code is valid
i have to set it GBP but even when set it to USD its return error
if i removed this parameter &PAYMENTREQUEST_0_CURRENCYCODE everything went ok with no problem but in USD
if i included this parameter &PAYMENTREQUEST_0_CURRENCYCODE with any currency code it return the same error
the full var_dump

 array(13) { ["TIMESTAMP"]=> string(28) "2011%2d10%2d13T02%3a55%3a21Z" 
["CORRELATIONID"]=> string(13) "4e167b7f7ec44" 
["ACK"]=> string(7) "Failure" 
["VERSION"]=> string(6) "82%2e0" 
["BUILD"]=> string(7) "2183220" 
["L_ERRORCODE0"]=> string(5) "99998" 
["L_ERRORCODE1"]=> string(5) "10605" 
["L_SHORTMESSAGE0"]=> string(122) "Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e" 
["L_SHORTMESSAGE1"]=> string(122) "Transaction%20refused%20because%20of%20an%20invalid%20argument%2e%20See%20additional%20error%20messages%20for%20details%2e" 
["L_LONGMESSAGE0"]=> string(31) "Currency%20is%20not%20supported" 
["L_LONGMESSAGE1"]=> string(31) "Currency%20is%20not%20supported" 
["L_SEVERITYCODE0"]=> string(5) "Error" 
["L_SEVERITYCODE1"]=> string(5) "Error" } bool(true) SetExpressCheckout failed:

this is the api request

$actions .= '
&L_PAYMENTREQUEST_0_NAME1=Name Example
&L_PAYMENTREQUEST_0_NUMBER1=Product Code Example
&L_PAYMENTREQUEST_0_DESC1=Product Title
&L_PAYMENTREQUEST_0_AMT1='.number_format(50, 2, '.', '').'
&L_PAYMENTREQUEST_0_QTY1=1';
$paymentAmount = urlencode($sum);
$ship = urlencode($del);
$tot = $paymentAmount + $ship ;
$currencyID = urlencode(GBP);                           // or other currency code ('GBP', 'EUR', 'JPY', 'CAD', 'AUD')
$returnURL = urlencode("http://www.example.net/index.php");
$cancelURL = urlencode('http://www.example.net/index.php');
$actions .= "
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_ITEMAMT=".$paymentAmount."
&PAYMENTREQUEST_0_SHIPPINGAMT=".$ship."
&PAYMENTREQUEST_0_AMT=".$tot."
&PAYMENTREQUEST_0_ALLOWNOTE=1
&PAYMENTREQUEST_0_CURRENCYCODE=".$currencyID."
";
// Add request-specific fields to the request string.
$nvpStr = "&$actions&ReturnUrl=$returnURL&CANCELURL=$cancelURL";

// Execute the API operation; see the PPHttpPost function above.
$httpParsedResponseAr = PPHttpPost('SetExpressCheckout', $nvpStr);

if("SUCCESS" == strtoupper($httpParsedResponseAr["ACK"]) || "SUCCESSWITHWARNING" == strtoupper($httpParsedResponseAr["ACK"])) {
    // Redirect to paypal.com.
    $token = urldecode($httpParsedResponseAr["TOKEN"]);
    $payPalURL = "https://www.paypal.com/webscr&cmd=_express-checkout&token=$token";
    if("sandbox" === $environment || "beta-sandbox" === $environment) {
        $payPalURL = "https://www.$environment.paypal.com/webscr&cmd=_express-checkout&token=$token";
    }
    header("Location: $payPalURL");
    exit;
} else  {
    exit('SetExpressCheckout failed: ' . print_r($httpParsedResponseAr, true));
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小苏打饼 2024-12-15 21:38:43

问题已解决 我在 url 中传递了货币代码,而不是在参数变量中定义它

problem resolved i passed the currency code within the url instead of define it in the parameters variable

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文