Discrepency in total with tax between Registration and Confirmation screen
Overview
When using taxes, the total amount on the registration page of an event is not always the same as the total amount on the confirmation screen, which makes Stripe crashes.
To reproduce
(reproduced in https://dmaster.demo.civicrm.org/)
- set a financial account defining the taxes as 14.975 (i.e. Quebec taxes)
- add the taxes on one financial type
- create a price set with 1 checkboxes field with 3 options (using the taxable financial type) :
- $41.69
- $63.25
- $63.25
- create an event with this price set
When a user register on this event, on the registration page :
On the confirmation page :
Error in Stripe
For Stripe, this is a big deal because the payment is done in 2 steps and the amount must be the same, giving the following error :
This PaymentIntent's amount could not be updated because it has a status of requires_capture. You may only update the amount of a PaymentIntent with one of the following statuses: requires_payment_method, requires_confirmation, requires_action.
Reason of the problem
My understanding so far:
- The registration page is doing a sum of all non rounded prices + taxes and do a rounding on the total.
- The confirmation page is doing the rounding on the prices and taxes and then do the sum
My preference is to have the behavior of the confirmation page. The rounding should happen on each item individually and then summed to have a total.