-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It looks like Stripe.js is not being loaded from https://js.stripe.com. Stripe does not support serving Stripe.js from your own domain. mrgalaxy_stripe.js: 35 #25
Comments
Just noticed this myself after upgrading a few minutes ago. The good news is it looks harmless: As you probably are aware, this package downloads a direct copy of Stripe.js ( |
Yes, I did notice a I will look into a workaround, possibly by going to Stripe directly. I'll have to check on how Meteor suggests doing that. In the meantime are there any other suggestions on how to fix this? |
In the past I've used two different approaches, both with their pros and cons (there may be newer, less hacky approaches but I haven't looked in awhile).
Template.altPaymentsCoinbase.rendered = function() {
//Define where to insert the script
var insertID = document.getElementById('js-coinbase');
//Define the script itself
var script = document.createElement('script');
script.type = 'text/javascript';
script.async = true; //Unsure if this is supported
script.src = 'https://coinbase.com/assets/button.js';
//Generate the script
insertID.appendChild(script);
}; |
What about something like this answer on SO? http://stackoverflow.com/a/17506335 It seems simple enough to include an HTML file which references the Stripe script on their servers. |
You know, that's definitely the simplest approach. The main value of this package imho (thank you btw!) is having Stripe for Node.js wrapped in a Meteor package. If the user doesn't mind having the Stripe scripts downloaded on all pages/routes, they can just include in head per the SO approach. If they want to limit it to specific pages/routes (my use case), they can use any one of the alternatives. I may have time for a PR later this week to add the per-page options if you'd find it useful. |
+1 Thanks for looking into this. Does the NPM package have the same error? |
1+ =) |
Okay this has been fixed with 26064fd. I considered this to be a "breaking change" so I've bumped the version to 2.0.0. Please let me know if anything is broken. :) Thanks everyone! |
Awesome! Thanks! |
@tyler-johnson I'm still getting the error, besides updating do I have to do anything else? |
You shouldn't need to. I recommend looking at the HTML source returned from the server. It should have a Otherwise you might be loading off an old version? Or perhaps another package is doing something with the content? |
@tyler-johnson I did find that but the warning is still there, what I'm noticing is that it appears after |
I'm still seeing the error after upgrading to 2.0.0. <script type="text/javascript" src="//js.stripe.com/v2/"></script> is in the |
I'm still seeing the error also and i just installed |
@tyler-johnson Any news on this issue? I see that I'm not the only one. Thanks |
No news yet, but I'm going to reopen while I investigate. |
To clarify things: I have |
Hi, I'm still getting the warning and also now receiving this error: Uncaught ReferenceError: Stripe is not defined And I do have the script loaded in the html <script type="text/javascript" src="//js.stripe.com/v2/"></script> |
Alright just pushed version 2.1.0. Please try to update and see if you are still having issues.
Okay, so it seems that Stripe.js wants to be loaded directly from https not from http. So when trying to load the insecure version, Stripe sends a redirect, but that tricked the script into thinking it wasn't loaded there. Sort of odd, but I fixed it by forcing the https version in the script tag.
Stripe.js is now loaded after all other Meteor scripts, which means it isn't available immediately anymore. Instead, you'll have to wait till after the app has started before using the variable. I modified the Usage section in the read me to detail this. Also, to keep everything consistent, I have moved Stripe Checkout to script tag in the |
That worked awesomely! Thanks! |
The error also happens with v3 when you don't pass the public token as instructed. (for future reference) |
Error in console after upgrading package to latest.
Was working prior.
The text was updated successfully, but these errors were encountered: