Skip to content

Commit

Permalink
Stripe tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesegrits committed Jan 13, 2017
1 parent 656d2c6 commit 1704b97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion plugins/fabrik_form/stripe/stripe-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion plugins/fabrik_form/stripe/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ define(['jquery', 'fab/fabrik'], function (jQuery, Fabrik) {
initialize: function (options) {
var self = this;
this.options = jQuery.extend(this.options, options);
Fabrik.FabrikStripeForm = null;

if (this.options.useCheckout) {
this.handler = StripeCheckout.configure({
Expand All @@ -51,11 +52,14 @@ define(['jquery', 'fab/fabrik'], function (jQuery, Fabrik) {
'type' : 'hidden'
}));
Fabrik.FabrikStripeForm.mockSubmit();
},
closed : function () {
Fabrik.FabrikStripeForm = null;
}
});

Fabrik.addEvent('fabrik.form.submit.start', function (form, event, btn) {
if (typeof Fabrik.FabrikStripeForm === 'undefined') {
if (typeof Fabrik.FabrikStripeForm === 'undefined' || Fabrik.FabrikStripeForm === null) {
Fabrik.FabrikStripeForm = form;
this.handler.open({
name : this.options.name,
Expand Down

0 comments on commit 1704b97

Please sign in to comment.