Last active
December 30, 2017 11:44
-
-
Save snez/e5c6d797264b5f7bd6cdcf5cc5aba045 to your computer and use it in GitHub Desktop.
Stripe.js patch for MageStore OneStepCheckout 3.2.0
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/app/design/frontend/base/default/template/onestepcheckout/onestepcheckout.phtml b/app/design/frontend/base/default/template/onestepcheckout/onestepcheckout.phtml | |
index e7971e7..6902b59 100755 | |
--- a/app/design/frontend/base/default/template/onestepcheckout/onestepcheckout.phtml | |
+++ b/app/design/frontend/base/default/template/onestepcheckout/onestepcheckout.phtml | |
@@ -693,7 +693,17 @@ | |
var options = document.getElementsByName('payment[method]'); | |
for (var i = 0; i < options.length; i++) { | |
if ($(options[i].id).checked) { | |
- if (options[i].id.indexOf("tco") != -1) { | |
+ if (options[i].id.indexOf("cryozonic_stripe") != -1) { | |
+ createStripeToken(function(err) | |
+ { | |
+ if (err) | |
+ alert(err); | |
+ else | |
+ $('one-step-checkout-form').submit(); | |
+ }); | |
+ break; | |
+ } | |
+ else if (options[i].id.indexOf("tco") != -1) { | |
var params = Form.serialize('one-step-checkout-form'); | |
var request = new Ajax.Request( | |
'<?php echo $this->getCheckoutUrl() . 'isAjax/tco'; ?>', |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What the hell is this ?