Fixed-amount bundle discount breaks payment gateway validation
-
Subject: Fixed-amount bundle discount breaks payment gateway validation (line items total ≠ order total)
Plugin: WOOSB – WPC Product Bundles for WooCommerce (WPClever)
Related plugin: CAWL for WooCommerce (Worldline payment gateway)Summary
When a bundle discount is configured as a fixed amount (“Discount amount”), WOOSB does not redistribute that discount across the individual cart line items — it only adjusts the bundle’s displayed total. The sum of the individual line item prices sent downstream (e.g. to a payment gateway) therefore no longer matches the actual order total. Our payment gateway (Worldline, via the CAWL for WooCommerce plugin) validates that the sum of order line items equals the order total, and rejects the payment request when they don’t match, causing a fatal error at checkout (before the customer is even redirected to the bank page).
With a percentage discount, this issue does not occur: WOOSB correctly recalculates and rewrites each line item’s price proportionally, so the sum of lines always matches the total.
Environment
- WordPress 7.1 + WooCommerce 11.1.0
- WPC Product Bundles 8.6.4
- Payment gateway: CAWL for WooCommerce (Worldline Hosted Checkout) Version 2.5.27
- Test performed on a production environment with the payment gateway in test mode
Steps to reproduce
- Create a bundle of 15 simple products, each priced at 22 €.
- In the bundle’s pricing settings, set a fixed amount discount of 100 € (Discount amount field).
- Add the bundle to the cart and proceed to checkout with a gem/order-total consistency (in our case, Worldline via CAWL).
- Observe: the bundle total is correctly displayed as 330 € (15 × 22 €) before discount, and 230 € after the 100 € discount — but each cart line item still shows its full, undiscounted price (22 €), summing to
- Submit payment → the gateway rejects the request immediately with a validation error (in our case, an ArgumentCountError-adjacent ValidationException thrown by the Worldline SDK, TOTAL_AMOUNT mismatch–type errWooCommerce with status “Pending payment” but the customernever reaches the bank’s payment page.
Expected behavior
When a fixed-amount discount is applied to a bundle, the discount should be distributed across the bundled line items (proportionally, similar to how the
percentage discount already works), so that the sum of individquals the bundle’s discounted total — keeping the cart/orderdata internally consistent for any downstream consumer (payment gateways, invoicing, accounting integrations, etc.) that relies on sum(line items) ==
order total.Comparison test performed (confirms root cause)
┌─────────────┬──────────────────────────────────────┬────────────────┐
│ Discount type │ Line items in cart │ Sum of lines │ Displayed bundle total │ Payment result │
├─────────────┼──────────────────────────────────────┼────────────────┤
│ Percentage (10%) │ Recalculated per line (e.g. 19.80 €) │ Matches total │ Correct │ Accepted │
├─────────────┼──────────────────────────────────────┼────────────────┤
│ Fixed amount (100 €)│ Unchanged (22 € each) │ 330 € │ 230 € │ Rejected │
└─────────────┴──────────────────────────────────────┴────────────────┘This isolates the issue specifically to the fixed-amount discodent of any other product-level promotion or pricingconfiguration (confirmed with a clean bundle of 15 identical, non-discounted products).
Additional (secondary) observation
Separately, we also noticed a minor discrepancy in the bundle’s own displayed subtotal when one bundled item had an active WooCommerce sale price: the bundle showed 318 € instead of the correct 320 € (14 × 22 € + before any bundle-level discount was applied. We did notinvestigate this further once the fixed-amount discount issue above was isolated as the primary cause of the payment failures, but it may be a related calculation issue worth checking as well.
Question
Is there a setting or filter to force WOOSB to redistribute a bundled line items (rather than only adjusting the total),similar to how percentage discounts are handled? We checked the “Bundle price calculation” settings (regular price vs. sale price basis) and found no option addressing this.
Thank you for looking into this — happy to provide further test details (order IDs, debug logs) if useful.
You must be logged in to reply to this topic.