{"id":19016660,"date":"2026-09-10T13:40:44","date_gmt":"2026-09-10T13:40:44","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/fixed-amount-bundle-discount-breaks-payment-gateway-validation\/"},"modified":"2026-09-10T13:40:44","modified_gmt":"2026-09-10T13:40:44","slug":"fixed-amount-bundle-discount-breaks-payment-gateway-validation","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/fixed-amount-bundle-discount-breaks-payment-gateway-validation\/","title":{"rendered":"Fixed-amount bundle discount breaks payment gateway validation"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Subject: Fixed-amount bundle discount breaks payment gateway validation (line items total \u2260 order total)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Plugin: WOOSB \u2013 WPC Product Bundles for WooCommerce (WPClever)<br \/>Related plugin: CAWL for WooCommerce (Worldline payment gateway)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Summary<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When a bundle discount is configured as a fixed amount (&#8220;Discount amount&#8221;), WOOSB does not redistribute that discount across the individual cart line items \u2014 it only adjusts the bundle&#8217;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&#8217;t match, causing a fatal error at checkout (before the customer is even redirected to the bank page).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With a percentage discount, this issue does not occur: WOOSB correctly recalculates and rewrites each line item&#8217;s price proportionally, so the sum of lines always matches the total.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Environment<\/p>\n\n\n\n<ul>\n<li>WordPress 7.1 + WooCommerce 11.1.0<\/li>\n\n\n\n<li>WPC Product Bundles 8.6.4<\/li>\n\n\n\n<li>Payment gateway: CAWL for WooCommerce (Worldline Hosted Checkout) Version 2.5.27<\/li>\n\n\n\n<li>Test performed on a production environment with the payment gateway in test mode<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Steps to reproduce<\/p>\n\n\n\n<ol>\n<li>Create a bundle of 15 simple products, each priced at 22 \u20ac.<\/li>\n\n\n\n<li>In the bundle&#8217;s pricing settings, set a fixed amount discount of 100 \u20ac (Discount amount field).<\/li>\n\n\n\n<li>Add the bundle to the cart and proceed to checkout with a gem\/order-total consistency (in our case, Worldline via CAWL).<\/li>\n\n\n\n<li>Observe: the bundle total is correctly displayed as 330 \u20ac (15 \u00d7 22 \u20ac) before discount, and 230 \u20ac after the 100 \u20ac discount \u2014 but each cart line item still shows its full, undiscounted price (22 \u20ac), summing to<\/li>\n\n\n\n<li>Submit payment \u2192 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\u2013type errWooCommerce with status &#8220;Pending payment&#8221; but the customernever reaches the bank&#8217;s payment page.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Expected behavior<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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<br \/>percentage discount already works), so that the sum of individquals the bundle&#8217;s discounted total \u2014 keeping the cart\/orderdata internally consistent for any downstream consumer (payment gateways, invoicing, accounting integrations, etc.) that relies on sum(line items) ==<br \/>order total.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Comparison test performed (confirms root cause)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\u2502 Discount type           \u2502 Line items in cart     \u2502 Sum of lines \u2502 Displayed bundle total \u2502 Payment result                 \u2502<br \/>\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\u2502 Percentage (10%)     \u2502 Recalculated per line (e.g. 19.80 \u20ac) \u2502 Matches total \u2502 Correct \u2502 Accepted                         \u2502<br \/>\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\u2502 Fixed amount (100 \u20ac)\u2502 Unchanged (22 \u20ac each)                  \u2502 330 \u20ac              \u2502 230 \u20ac    \u2502 Rejected                          \u2502<br \/>\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Additional (secondary) observation<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Separately, we also noticed a minor discrepancy in the bundle&#8217;s own displayed subtotal when one bundled item had an active WooCommerce sale price: the bundle showed 318 \u20ac instead of the correct 320 \u20ac (14 \u00d7 22 \u20ac + 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Question<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 &#8220;Bundle price calculation&#8221; settings (regular price vs. sale price basis) and found no option addressing this.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you for looking into this \u2014 happy to provide further test details (order IDs, debug logs) if useful.<\/p>\n","protected":false},"template":"","class_list":["post-19016660","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19016660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19016660\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19016660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}