1

I am getting this error on paypal :

PayPal NVP gateway errors: 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)

Can any one help me?

1 Answer 1

0

Override file: module-paypal/Model/Apiu/Nvp.php in your custom module

Inside function callSetExpressCheckout()

add before $response = $this->call(self::SET_EXPRESS_CHECKOUT, $request);

Add below code:

$TAXAMT = array_key_exists('TAXAMT', $request)?$request['TAXAMT']:0;
$SHIPPINGAMT = array_key_exists('SHIPPINGAMT', $request)?$request['SHIPPINGAMT']:0;
$request['ITEMAMT'] = $request['AMT'] - $TAXAMT - $SHIPPINGAMT;

Then go to function callDoExpressCheckoutPayment()

Add below code before :

$response = $this->call(self::DO_EXPRESS_CHECKOUT_PAYMENT, $request);

$TAXAMT = array_key_exists('TAXAMT', $request)?$request['TAXAMT']:0;
$SHIPPINGAMT = array_key_exists('SHIPPINGAMT', $request)?$request['SHIPPINGAMT']:0;
$request['AMT'] = $request['ITEMAMT'] + $TAXAMT + $SHIPPINGAMT;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.