Have an ecommerce site running ZNode. We send tax, shipping, order total, etc. Everything works fine until an order level discount is applied (say 50%). We get a response from PayPal that says the following:
The totals of the cart item amounts do not match order amounts.
I’m traversing the API, and I can’t find anything to apply an order level discount. FWIW, the user is applying discount codes on our site, and then is being transferred to PayPal.
I think your problem is not the PayPal API.
You checked that everything works perfect with your parameters passed to paypal in this 50% discount case?
After the PayPal Documentation you should provide a negative value to reflect a discount on an order. So everything adds up to the total amount.
Source: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_ECCustomizing
Update with code: (by Nick)
I have a paypal service that does all kinds of stuff, but the following code should give you an idea of how the discount works. The discount is not a special type, it’s a product just like any other except it’s disguised by naming it like a discount and setting it’s price to a negative number.