Paypal Express works fine if there's no coupon applied. If there's a coupon applied, it fails with the usual #10413 error "totals of the cart item amounts do not match order amounts".
I have a requirement to customize the discount logic so that the discounts are reflected in the unit prices and not in the standard lump sum. There is a rounding issue when the quantities are large and Paypal will reject the payment. After hacking the Paypal module code, I can send a correct AMT = ITEMAMT + SHIPPING.
However, after returning from the Paypal payment confirmation page to Magento, for some reason the error #10413 appears again because AMT is changed (not the AMT that was sent to Paypal). I am not able to figure out why or how AMT is changed.
I am using Magento community version 126.96.36.199.