Hasibur
Hasibur

Reputation: 205

The transaction currency specified must be the same as previously specified

Hello I try to create a payment with EURO in PayPal but getting an error. But it works fine when I use payment with USD.

[TIMESTAMP] => 2014-09-26T10:03:06Z
[CORRELATIONID] => 4d802c104e0ae
[ACK] => Failure
[VERSION] => 64
[BUILD] => 13055236
[L_ERRORCODE0] => 10444
[L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
[L_LONGMESSAGE0] => The transaction currency specified must be the same as previously specified.
[L_SEVERITYCODE0] => Error

Upvotes: 3

Views: 2249

Answers (2)

Md Hasibur Rahaman
Md Hasibur Rahaman

Reputation: 1061

Replace your code with this, paypal Deprecated some field like

PAYMENTACTION to PAYMENTREQUEST_n_PAYMENTACTION

AMT TO PAYMENTREQUEST_n_AMT

CUSTOM to PAYMENTREQUEST_n_CUSTOM

$nvpstr = "&TOKEN=" . $token;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_PAYMENTACTION=Sale";
$nvpstr = $nvpstr . "&PAYERID=" . $payerID;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_AMT=" . $paymentAmount;
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_CUSTOM=" . $userId;  
$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_CURRENCYCODE=".$currency;

you make these changes in "DoExpressCheckoutPayment" API call it should be fine.

Upvotes: 5

Eshan
Eshan

Reputation: 3677

You are passing two parameters related to the currency in the "SetExpressCheckout" API call like below :

$nvpstr = $nvpstr . "&CURRENCYCODE=" . $currencyCodeType;

$nvpstr.='&PAYMENTREQUEST_0_CURRENCYCODE='.$currencyCodeType;

But in the "DoExpressCheckoutPayment" API call you are passing only one :

$nvpstr = $nvpstr . "&PAYMENTREQUEST_0_CURRENCYCODE=".$currency;

You should pass only one parameter related to currency in both the API call : $nvpstr.='&PAYMENTREQUEST_0_CURRENCYCODE='.$currencyCodeType;

Once you make these changes in your "SetExpressCheckout" API call it should be fine

Upvotes: 0

Related Questions