jeffharrell / minicart

The minicart is a great way to improve your PayPal shopping cart integration.
MIT License
500 stars 209 forks source link

Incorrect Item Amount Format #222

Closed ypinskiy closed 10 years ago

ypinskiy commented 10 years ago

I am attempting to add a negative price product as a discount. Using the addToCart on var DiscountProd = { "business": "test@email.com", "item_name": "January Discount", "amount": -10.00, "currency_code": "USD" }; makes it show up correctly in the cart. However, checking out gives me a Paypal error page where it tells me that the item amount is incorrectly formatted. Attached are images of the cart and the error page. cart error detected paypal

jeffharrell commented 10 years ago

This is not specific to the minicart -- PayPal does not allow for negative item amounts. If you want to pass a discount please pass the discount_amount value per the PayPal Buy Now button spec. See https://github.com/jeffharrell/minicart/blob/master/test/unit/product.js#L102 for an example