Conversation
Added an Init method to be called prior to Stripe Response on form submit. Disabling the button wasn't enough in my use case.
|
You authored this thing awhile ago, but I figured I'd propose this change anyways in case you were interested. It ended up being really handy for me. |
|
Sorry for taking too long to reply. There's really no excuse for that. 😁 Thanks for contributing! 🍻 |
|
No problem on the response time. It's been awhile since I used it, but the use case was needing a hook to apply a "requesting" state while submitting the Stripe form. This would come in handy for things like modifying a submit button's text while the form is submitting, then changing it back in the response method. Simplified: <form stripe-form="stripeResponse" stripe-init="stripeInit">
...
<button type="submit" ng-disabled="form.requesting">
<span ng-if="!form.requesting">Make Payment</span>
<span ng-if="form.requesting">Making Payment...</span>
</button>
</form>$scope.stripeInit = function() {
$scope.form.requesting = true;
}
$scope.stripeResponse = function(status, response) {
$scope.form.requesting = false;
}Essentially, it could be used as a hook to toggle any desired behavior during form submit whether it's a loading spinner, making form inputs read-only, fieldsets disabled, or any sort of notification. Upside is that it doesn't assume anything and leaves Revisiting this, I'm not sure |
Added an Init method to be called prior to Stripe Response on form submit. Disabling the button wasn't enough in my use case.