2 ms·
We used to experience this exactly with stripe.js V2, our conclusion was it was some sort of connection issue and using this code to include stripe.js on both t
by samwillis 9y ago
We used to experience this exactly with stripe.js V2, our conclusion was it was some sort of connection issue and using this code to include stripe.js on both the checkout page but also our basket helped to ensure it has been loaded by the browser before it was needed. It massively reduced the instances of the error.
<script src="https://js.stripe.com/v3/"></script>
<script>window.Stripe || document.write('<script src="https://js.stripe.com/v3/"><\/script>')</script>
<script>window.Stripe || document.write('<script src="https://js.stripe.com/v3/"><\/script>')</script>
- inertial 9y agoThat's quite interesting. Was the issue specific to any particular browser/platform/country combination ? Stripe's server log might record/report failures in loading scripts. Perhaps someone from Stripe can chime in on the issue.
- samwillis 9y agoI can't remember exactly what browsers were affected but I think it was fairly broad. Certainly, mobile browsers and maybe people on a VPN but it was mostly random from memory which is why we concluded it was just a temporary connection problem. As an aside we also saw similar errors loading jQuery from a CDN and so used similar code to load it from our own server if it wasn't loaded from the CDN first. You cant do that with Stripe though.