Paypal Express Checkout: Apply order discount

Viewed 6668

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.

3 Answers

Add the discount value to the PAYMENTREQUEST_0_ITEMAMT parameter and it will works fine.

In other words, if you consider your discount as a product, passing it through L_PAYMENTREQUEST_0_NAME(i), L_PAYMENTREQUEST_0_AMT(i) and L_PAYMENTREQUEST_0_QTY(i), then you have to sum the discount value to the products value and pass the result into the PAYMENTREQUEST_0_ITEMAMT param.

Related