Magento Checkout Error: PayPal gateway has rejected request.

Spread the love

We recently did a troubleshooting for an escalated ticket from one of our Magento clients. They were having occasionally checkout failure. Their customer reported that they ran into an error when trying to check out using PayPal. After clicking ‘Place Order’ button, they got redirected to the cart page, and an error message is showing like below:

PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts.

We did not receive the checkout failure emails from Magento. As the error message suggests, PayPal is declining the transaction because the order total does not match the total price for each product adding up together.  In other words, say you are buying item A ($1), and item B ($2), PayPal is seeing a total which is not $3.

After digging into it, we figured out this error will occur whenever the customer is checkout with a gift card applied and the rest on PayPal. Obviously, PayPal knows nothing about a gift card has been used, and total being brought down by it so it will decline the transition. The error must be cast on the PayPal side. Because we are fine using a credit card to check out.

If you have any 3rd part extension installed on your Magento that will update order total, for example, a promotion extension, which applies a discount to the order, or maybe a layaway extensin, and in our case, a gift card extension, you can possibly run into an error like this.

How to resolve it

After reviewing the options for resolving this error, we decided not to debug the gift card plugin and make it  ‘PayPal compatible’. Instead, we chose to turn off the ‘Transfer Cart Line Items’ option for PayPal payment method in Magento(where to turn it off? see the screenshot below).

By doing so, the price for each item in the order will not be transferred to PayPal, and your customer will not be able to see the cart detail when they go to PayPal to finish checkout. PayPal will not notice the mismatch between order total and the sum of all items’ price. So the transaction will not be declined. This should be the most straightforward way. After we turned off the option, the error went away.

Magento PayPal gateway has rejected request. The totals of the cart item amounts do not match order amounts

I hope my post can help you when you run into a similar issue just like this. If you have noticed a different cause of this error or a different solution. Please leave a comment. Appreciate your help and time to the community!

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *