Magento: Paypal Express Checkout response error

qooking
New Community Member

Hello, 

I've been trying to debug the following issue with no luck, hope some of you can give me a hand!

 

I have configured Paypal Express Checkout on my Magento store and I manage to be successfully redirected to Paypal to authorise the payment for an order (in fact, by looking at the log, the request looks just fine) but then I get an error when I am redirected back to my website. Specifically, by looking at the log for the response, it seems like the order amount is recalculated and does not match the one contained in the request. Most of the time it seems like in the recalculation, tax amounts are added twice (bear in mind that my store is set up in a way that prices already include taxes) but some other times it seems like it's not considering discounts.

Please find below an example of request and response from my log and look how the total order amount is changed from 24.02 to 25.71.

 

Thanks in advance for your help.

Luca

 

 


2018-04-27T09:48:16+00:00 DEBUG (7): Array
(
[url] => https://api-3t.sandbox.paypal.com/nvp
[SetExpressCheckout] => Array
(
[PAYMENTACTION] => Sale
[AMT] => 24.02
[CURRENCYCODE] => EUR
[RETURNURL] => https://beta.xxxxyyyy.it/it/paypal/express/return/
[CANCELURL] => https://beta.xxxxyyyy.it/it/paypal/express/cancel/
[INVNUM] => 200000047
[SOLUTIONTYPE] => Mark
[GIROPAYCANCELURL] => https://beta.xxxyyyy.it/it/paypal/express/cancel/
[GIROPAYSUCCESSURL] => https://beta.xxxxyyyy.it/it/checkout/onepage/success/
[BANKTXNPENDINGURL] => https://beta.xxxxyyyy.it/it/checkout/onepage/success/
[LOCALECODE] => it_IT
[ITEMAMT] => 20.03
[TAXAMT] => 0
[SHIPPINGAMT] => 3.99
[BUSINESS] =>
[NOTETEXT] =>
[EMAIL] => test
[FIRSTNAME] => test
[LASTNAME] => test
[MIDDLENAME] =>
[SALUTATION] =>
[SUFFIX] =>
[COUNTRYCODE] => IT
[STATE] =>
[CITY] => test
[STREET] => test
[ZIP] => 3252
[PHONENUM] => 32579261
[SHIPTOCOUNTRYCODE] => IT
[SHIPTOSTATE] =>
[SHIPTOCITY] => test
[SHIPTOSTREET] => test
[SHIPTOZIP] => 3252
[SHIPTOPHONENUM] => 32579261
[SHIPTOSTREET2] =>
[STREET2] =>
[SHIPTONAME] => test test
[ADDROVERRIDE] => 1
[METHOD] => SetExpressCheckout
[VERSION] => 72.0
[USER] => ****
[PWD] => ****
[SIGNATURE] => ****
[BUTTONSOURCE] => Magestore_SI_MagentoCE
)

[response] => Array
(
[TOKEN] => EC-64E87400UE8379807
[TIMESTAMP] => 2018-04-27T09:48:16Z
[CORRELATIONID] => c162e31dd3ae9
[ACK] => Success
[VERSION] => 72.0
[BUILD] => 46007304
)

[__pid] => 20364
)

2018-04-27T09:48:34+00:00 DEBUG (7): Array
(
[url] => https://api-3t.sandbox.paypal.com/nvp
[GetExpressCheckoutDetails] => Array
(
[TOKEN] => EC-64E87400UE8379807
[METHOD] => GetExpressCheckoutDetails
[VERSION] => 72.0
[USER] => ****
[PWD] => ****
[SIGNATURE] => ****
[BUTTONSOURCE] => Magestore_SI_MagentoCE
[TAXAMT] => 0
)

[response] => Array
(
[TOKEN] => EC-64E87400UE8379807
[BILLINGAGREEMENTACCEPTEDSTATUS] => 0
[CHECKOUTSTATUS] => PaymentActionNotInitiated
[TIMESTAMP] => 2018-04-27T09:48:34Z
[CORRELATIONID] => 9249a20e8fc1
[ACK] => Success
[VERSION] => 72.0
[BUILD] => 46007304
[EMAIL] => 
[PAYERID] => FCQGUP3C5AZTW
[PAYERSTATUS] => verified
[FIRSTNAME] => test
[LASTNAME] => buyer
[COUNTRYCODE] => IT
[SHIPTONAME] => test test
[SHIPTOSTREET] => test
[SHIPTOCITY] => test
[SHIPTOZIP] => 3252
[SHIPTOCOUNTRYCODE] => IT
[SHIPTOPHONENUM] => 32579261
[SHIPTOCOUNTRYNAME] => Italy
[ADDRESSSTATUS] => Confirmed
[CURRENCYCODE] => EUR
[AMT] => 24.02
[ITEMAMT] => 20.03
[SHIPPINGAMT] => 3.99
[HANDLINGAMT] => 0.00
[TAXAMT] => 0.00
[INVNUM] => 200000047
[INSURANCEAMT] => 0.00
[SHIPDISCAMT] => 0.00
[INSURANCEOPTIONOFFERED] => false
[PAYMENTREQUEST_0_CURRENCYCODE] => EUR
[PAYMENTREQUEST_0_AMT] => 24.02
[PAYMENTREQUEST_0_ITEMAMT] => 20.03
[PAYMENTREQUEST_0_SHIPPINGAMT] => 3.99
[PAYMENTREQUEST_0_HANDLINGAMT] => 0.00
[PAYMENTREQUEST_0_TAXAMT] => 0.00
[PAYMENTREQUEST_0_INVNUM] => 200000047
[PAYMENTREQUEST_0_INSURANCEAMT] => 0.00
[PAYMENTREQUEST_0_SHIPDISCAMT] => 0.00
[PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID] => 
[PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED] => false
[PAYMENTREQUEST_0_SHIPTONAME] => test test
[PAYMENTREQUEST_0_SHIPTOSTREET] => test
[PAYMENTREQUEST_0_SHIPTOCITY] => test
[PAYMENTREQUEST_0_SHIPTOZIP] => 3252
[PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => IT
[PAYMENTREQUEST_0_SHIPTOPHONENUM] => 32579261
[PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME] => Italy
[PAYMENTREQUEST_0_ADDRESSSTATUS] => Confirmed
[PAYMENTREQUESTINFO_0_ERRORCODE] => 0
)

[__pid] => 20273
)

2018-04-27T09:48:36+00:00 DEBUG (7): Array
(
[url] => https://api-3t.sandbox.paypal.com/nvp
[DoExpressCheckoutPayment] => Array
(
[TOKEN] => EC-64E87400UE8379807
[PAYERID] => FCQGUP3C5AZTW
[PAYMENTACTION] => Sale
[AMT] => 25.71
[CURRENCYCODE] => EUR
[BUTTONSOURCE] => Magestore_SI_MagentoCE
[NOTIFYURL] => https://beta.xxxxyyyy.it/it/paypal/ipn/
[RETURNFMFDETAILS] => 1
[ITEMAMT] => 20.95
[TAXAMT] => 0
[SHIPPINGAMT] => 3.99
[METHOD] => DoExpressCheckoutPayment
[VERSION] => 72.0
[USER] => ****
[PWD] => ****
[SIGNATURE] => ****
)

[response] => Array
(
[TOKEN] => EC-64E87400UE8379807
[SUCCESSPAGEREDIRECTREQUESTED] => false
[TIMESTAMP] => 2018-04-27T09:48:35Z
[CORRELATIONID] => 2b1ce98359068
[ACK] => Failure
[VERSION] => 72.0
[BUILD] => 46007304
[L_ERRORCODE0] => 10413
[L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
[L_LONGMESSAGE0] => The totals of the cart item amounts do not match order amounts.
[L_SEVERITYCODE0] => Error
)

[__pid] => 20273
)

Login to Me Too
1 REPLY 1

MTS_Justin
Moderator
Moderator
Hello,

Check the requests your submitting, specifically the values being provided considering the error states "the total of the cart item amounts do not match order amounts".

## SetExpressCheckout
amt "24.02"
itemamt "20.03"
shippingamt "3.99"

##DoExpressCheckout
amt "25.71"
itemamt "20.95"
shippingamt "3.99"

The value for "amt" should be the value when "itemamt" and "shippingamt" are added together.

Was my post helpful? If so, please give me a kudos!
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.