My base currency is in Canadian Dollars (CAD)., when I go to PayPal express checkout, everything is working fine I can checkout in CAD.
PROBLEM IS: Whenever I switch currency to USD, USD is a conversion on my website.
PayPal express throws an error:
PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details).
I debugged PAYPAL and here is the error I get when I checkout in USD (non base).. 110.00 USD —> 150.00 CAD
[PAYMENTACTION] => Authorization
[AMT] => 110.00
[CURRENCYCODE] => USD
[INVNUM] => 10000012
[SOLUTIONTYPE] => Mark
[LOCALECODE] => en_CA
[ITEMAMT] => 150.00
[TAXAMT] => 0.00
[SHIPPINGAMT] => 0.00
[METHOD] => SetExpressCheckout
[VERSION] => 72.0
[BUTTONSOURCE] => IWD_SI_MagentoCE_WPS
)
Best Answer
The issue you faced is related to Magento bug due to which the logic of actions of TAX calculation is performed in the wrong order.
To resolve the problem, you just need to navigate to file:
find _getSortedCollectorCodes() function and replace with below code
Note : Please override core file. Do not change core file. Clear cache