Skip to content

Instantly share code, notes, and snippets.

@thenickcox
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thenickcox/9508784 to your computer and use it in GitHub Desktop.
Save thenickcox/9508784 to your computer and use it in GitHub Desktop.
<body class="app">
<div class="stripeInitialSpinner" id="stripeSpinner"></div>
<div class="stripeErrorMessage" id="stripeLoadError">
<p>Sorry, there was a problem loading Checkout. If this persists, please <a href="/mailto:support@stripe.com/">email support@stripe.com</a>
</p>
</div>
<script type="text/javascript">
(function () {
var hideSpinner = function () {
var spinner = document.getElementById('stripeSpinner');
if (spinner) {
spinner.className += ' animated';
setTimeout(function () {
spinner.className += ' hidden';
setTimeout(function () {
document.body.removeChild(spinner);
}, 300);
}, 1);
}
}
var showError = function () {
hideSpinner();
document.getElementById('stripeLoadError').style.display = 'block';
};
var initApp = function () {
var App = StripeCheckout.require('desktop/controllers/app');
var helpers = StripeCheckout.require('lib/helpers');
window.app = new App({
el: document.body,
onOpen: function () {
var spinner = document.getElementById('stripeSpinner');
if (spinner) spinner.style.display = 'block';
},
onLoad: function () {
hideSpinner();
},
onError: function () {
showError();
}
});
};
var head = (document.getElementsByTagName('head')[0] || document.documentElement);
var insert = function (el) {
head.insertBefore(el, head.firstChild);
};
var cssTag = document.createElement('link');
cssTag.rel = 'stylesheet';
cssTag.href = '/v3/checkout/desktop.css?version=HL-W7dCq0eMhKSEH8kkGKQ';
insert(cssTag);
var loadScript = function (src, load, err) {
var scriptTag = document.createElement('script');
scriptTag.src = src;
if (typeof load === 'function') {
//From http://stackoverflow.com/questions/6568890
var done;
scriptTag.onload = scriptTag.onreadystatechange = function () {
if (!done & amp; & amp;
(!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
done = true; // Give the script a chance to execute on IE
// Otherwise the Stripe.endpoint global gets clobbered
// and possibly other bad things happen
setTimeout(load, 0); // Handle memory leak in IE
scriptTag.onload = scriptTag.onreadystatechange = null;
}
};
}
if (typeof err === 'function') {
scriptTag.onerror = err;
}
insert(scriptTag);
};
loadScript("/js/raven.min.js?version=l0KqNMHa_QhUOamdDvGk-A", function () {
var options = {
ignoreErrors: [/Error connecting to extension hkcaohgalm/, ]
};
Raven.config('https://4e1e572dc6dc445ea955329cd5bb6329@errors.stripe.com/11').install();
});
var loadedToInit = 0;
loadScript('/v3/checkout/desktop.js?version=2nidrl_uZ8axRMyU1UTQgQ', function () {
loadedToInit += 1;
if (loadedToInit == 2)
initApp();
}, function () {
showError();
});
loadScript('https://js.stripe.com/v1/', function () {
loadedToInit += 1;
if (loadedToInit == 2) initApp();
});
loadScript('https://mpsnare.iesnare.com/snare.js');
})();
</script>
<script type="text/javascript">
var io_install_stm = false; // do not install Active X
var io_exclude_stm = 12; // do not run Active X
var io_install_flash = false; // do not install Flash
var io_enable_rip = true; // enable detection of Real IP
</script>
<div class="preloader"></div><span style="position:" top:=""><object width="1" height="1" align="right"
id="stmgwb2" classid=
"/clsid:d27cdb6e-ae6d-11cf-96b8-444553540000/">
<param value="always" name="allowScriptAccess" />
<param value="https://mpsnare.iesnare.com/stmgwb2.swf" name=
"movie" />
<param value="true" name="swLiveConnect" />
<embed width="1" height="1" pluginspage=
"http://www.macromedia.com/go/getflashplayer" type=
"application/x-shockwave-flash" allowscriptaccess=
"always" swliveconnect="true" name=
"stmgwb2" src=
"/https://mpsnare.iesnare.com/stmgwb2.swf/" />
</object></span>"
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment