Marco
Marco

Reputation: 867

10605 error when using CURRENCYCODE within SetExpressCheckout and nvp SDK

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));
}

Upvotes: 0

Views: 2172

Answers (1)

Marco
Marco

Reputation: 867

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

Upvotes: 1

Related Questions