What's new
Xen Factory

Register today to become a member! Once signed in, you'll be able to start purchasing our products, ask questions, request support and suggest new ideas!

Bug Percentage/Fixed Amount Discount Coupon Sales Rejected By PayPal (Legacy)

ZEODE

New Member
I noticed percentage discount coupons would cause failure at checkout, with PayPal (Legacy) rejecting the transaction. I am also using your Cart plugin.

On debugging with browser dev tools I was able to diagnose rounding errors, which meant the totals sent were rejected by PayPal as it didn't match their expected rounded amount.

Percentage discounts produced amounts with 3-decimal values (e.g. 9.995), but PayPal requires 2-decimal currency values, causing “invalid amount” errors.

Fixed-amount discounts are applied only to the order total, not distributed across item line prices, causing the sum of item amounts to differ from the order total and triggering PayPal “total mismatch” errors.

I tested initially by editing your original files in RMMarketplace addon, but have since created a class extension to fix the issue for me rather than edit the original files and deal with the unexpected contents nag. Happy to share my edits if required.
 
Last edited:
I will PM it to you when I am next at home within a couple of days. I am away with work currently. I thought it was doing it on single purchase page, but not you mention it I am not 100% sure. Either way I will forward my modified files to you asap.

Thanks.
 

From bespoke add-on development to complex integrations and specialized enhancements, we offer a range of XenForo development services designed to help your community thrive.

Start discussing your needs
Back
Top
Cart