Skip to content
Snippets Groups Projects
Commit 658743a0 authored by mattwire's avatar mattwire
Browse files

Add event crmStripeBillingFormReloadComplete

parent c297b0dc
No related branches found
No related tags found
1 merge request!1246.5
...@@ -22,6 +22,9 @@ Example code: ...@@ -22,6 +22,9 @@ Example code:
This event is triggered when the form has completed reloading and is ready for use (Stripe element visible etc.). This event is triggered when the form has completed reloading and is ready for use (Stripe element visible etc.).
It is useful for clearing any "loading" indicators and unfreezing form elements. It is useful for clearing any "loading" indicators and unfreezing form elements.
### crmStripeBillingFormReloadComplete
This event is triggered when the form has completed reloading, is ready for use and the selected payment processor is Stripe.
### crmBillingFormReloadFailed ### crmBillingFormReloadFailed
This event is triggered when the form fails to complete reloading and is NOT ready for use. It usually happens if there This event is triggered when the form fails to complete reloading and is NOT ready for use. It usually happens if there
is a problem (such as a network issue) when loading the Stripe elements. is a problem (such as a network issue) when loading the Stripe elements.
......
...@@ -289,6 +289,7 @@ ...@@ -289,6 +289,7 @@
debugging("Script loaded and executed."); debugging("Script loaded and executed.");
loadStripeBillingBlock(); loadStripeBillingBlock();
triggerEvent('crmBillingFormReloadComplete'); triggerEvent('crmBillingFormReloadComplete');
triggerEvent('crmStripeBillingFormReloadComplete');
}) })
.fail(function() { .fail(function() {
stripeLoading = false; stripeLoading = false;
...@@ -299,7 +300,7 @@ ...@@ -299,7 +300,7 @@
else { else {
loadStripeBillingBlock(); loadStripeBillingBlock();
if (checkPaymentElementsAreValid()) { if (checkPaymentElementsAreValid()) {
triggerEvent('crmBillingFormReloadComplete'); triggerEvent('crmStripeBillingFormReloadComplete');
} }
else { else {
debugging('Failed to load payment elements'); debugging('Failed to load payment elements');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment