Skip to content

Instantly share code, notes, and snippets.

@snez
Last active August 20, 2017 18:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save snez/9c7bca0199dddf07dca21d40c5d3fc2d to your computer and use it in GitHub Desktop.
Stripe.js patch for Lotusbreath OSC 4.1.1
diff --git a/skin/frontend/base/default/lotusbreath/onestepcheckout/js/osc.js b/skin/frontend/base/default/lotusbreath/onestepcheckout/js/osc.js
index 303bff9..ecc940a 100644
--- a/skin/frontend/base/default/lotusbreath/onestepcheckout/js/osc.js
+++ b/skin/frontend/base/default/lotusbreath/onestepcheckout/js/osc.js
@@ -276,6 +276,23 @@
);
},
+ cryozonicPlaceOrder: function()
+ {
+ if (payment.currentMethod != 'cryozonic_stripe')
+ return this.placeOrder();
+
+ var me = this;
+ createStripeToken(function(err)
+ {
+ if (err)
+ alert(err);
+ else
+ me.placeOrder();
+ });
+ },
+
placeOrder: function () {
window.oscObserver.beforeSubmitOrder();
@@ -441,13 +458,13 @@
_this._openConfirmExistEmail();
checkEmailOk = false;
} else {
- _this.placeOrder();
+ _this.cryozonicPlaceOrder();
checkEmailOk = true;
}
}
});
} else {
- _this.placeOrder();
+ _this.cryozonicPlaceOrder();
}
if (checkEmailOk == false)
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment