Last active
August 20, 2017 18:04
-
-
Save snez/89b55331dc602305a2aef5fdb4a1d664 to your computer and use it in GitHub Desktop.
Stripe.js patch for TypoStores OneStepCheckout 4.1.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/skin/frontend/base/default/typostores/onestepcheckout/opcheckout.js b/skin/frontend/base/default/typostores/onestepcheckout/opcheckout.js | |
index de885a6..7e41327 100755 | |
--- a/skin/frontend/base/default/typostores/onestepcheckout/opcheckout.js | |
+++ b/skin/frontend/base/default/typostores/onestepcheckout/opcheckout.js | |
@@ -100,9 +100,32 @@ | |
}); | |
this.element | |
.on('click', this.options.checkout.continueSelector, function(e) { | |
+ var me = this; | |
e.preventDefault(); | |
- $.proxy(_this._save($(this)), _this); | |
- $(".mage-error").show(); | |
+ | |
+ var proceed = function() | |
+ { | |
+ $.proxy(_this._save($(me)), _this); | |
+ $(".mage-error").show(); | |
+ }; | |
+ | |
+ if (payment.currentMethod != 'cryozonic_stripe' && payment.currentMethod !== "") | |
+ { | |
+ proceed(); | |
+ } | |
+ else | |
+ { | |
+ createStripeToken(function(err) | |
+ { | |
+ if (err) | |
+ alert(err); | |
+ else | |
+ proceed(); | |
+ }); | |
+ } | |
+ | |
return false; | |
}) | |
var that = this; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment