Skip to content

Limit surcharge checkout refresh to gateways with active surcharge#1202

Open
extenlab wants to merge 4 commits intomollie:dev/developfrom
extenlab:dev/develop
Open

Limit surcharge checkout refresh to gateways with active surcharge#1202
extenlab wants to merge 4 commits intomollie:dev/developfrom
extenlab:dev/develop

Conversation

@extenlab
Copy link
Copy Markdown

Summary

This PR limits the classic checkout refresh triggered by the Mollie surcharge script.

Previously, the surcharge script triggered update_checkout on every input[name="payment_method"] change, including non-Mollie gateways. This caused unnecessary checkout refreshes when switching between payment methods that cannot affect Mollie surcharge totals.

The refresh is now only triggered when the previous or current payment method is a Mollie gateway with active payment_surcharge settings. It also keeps the previous payment method state in sync after updated_checkout.

Order-pay surcharge handling is unchanged.

Testing

Manually tested on classic checkout with:

  • one Mollie gateway with active surcharge
  • one Mollie gateway with payment_surcharge = no_fee
  • non-Mollie gateways such as Cash on Delivery and bank transfer

Verified that:

  • switching between non-Mollie gateways does not trigger the Mollie surcharge checkout refresh
  • switching to or away from a Mollie gateway with active surcharge still triggers checkout recalculation
  • Mollie gateways with payment_surcharge = no_fee do not trigger the surcharge refresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant