Open jbrozena22 opened 9 years ago
same issue... not possible to add in head as it's telescope... need only for specific template usage....
in the end i had success using manuelschoebel:wait-on-lib package with iron:router to control only loading on the stripe-using template and wrapping the stripe setup with a .rendered function...
Template.myTemplate.rendered = function(){ STRIPE_PUBLISHABLE_KEY = Meteor.settings.public.stripePublishableKey; Stripe.setPublishableKey(STRIPE_PUBLISHABLE_KEY); }
I've done a pull request to remove the header part responsible for this : https://github.com/tyler-johnson/stripe-meteor/pull/43
If you don't want to add an other package to load stripe dependencies, you can also use $.getScript inside a Template.myTemplate.rendered block. It worked well for me.
I am experiencing nearly a second load times waiting for the checkout.js.map to load from Stripe. This is fine on the page where I do my purchase, but I would prefer to not have the script loaded on all other pages to improve their load times.
Is there anyway to have the package insert the script into the html head only on pages of your choosing?
Thanks.