craft-freeform
craft-freeform copied to clipboard
Stripe could not load payment element error
What happened?
We have a form with a Stripe field set to allow dynamic payments via an 'amount' field.
Using the form Rules we have the Stripe field set to only display if a checkbox is ticked.
The checkbox appears before the amount field in the order of fields within the form.
We've noticed that if the checkbox is ticked, there is an AJAX request sent to initialise the Stripe Element which fails because there is so far no 'Amount' set - that makes sense. However when an amount is then set within the field, that AJAX request isn't being re-run meaning the Stripe element is then never initialised.
I believe this has only started to be the case since Freeform v5.6.3. Beforehand it seemed as though any change or keyup for the amount field would re-trigger the Javascript.
Errors and Stack Trace (if available)
No response
How can we reproduce this?
- Create a form that uses a Stripe field set to have a dynamic amount based on a number input field
- Have the Stripe field hidden until a checkbox is ticked
- Tick the checkbox and notice the Stripe field appear but is not rendered
- Enter an amount in the number field and notice the Stripe field remains uninitialised
Freeform Edition
Pro
Freeform Version
5.6.3
Craft Version
4.12.5
When did this issue start?
No response
Previous Freeform Version
5.6.2