To offer different discounts based on the selected payment method, I have created two Cart Price Rules (one for each payment method) to apply the "Percent of product price discount" action. After selecting one of these two payment methods on the checkout page, the corresponding Cart Price Rule discount is applied over the subtotal. If I select another payment method (either with or without a Cart Price Rule associated), the discount amount does not reset or update. This happens in both local and test environments. Is there a way to trigger the recalculation of the discount amount in my custom module? Or at least reset the discount amount?
I am using Magento version 2.4.0.