#rtm_stripejs-electron
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1230982487962947705
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
Hi!
You see that warning when you are in livemode (using your live publishable key to initialize Stripe.JS)?
Really that error should only show in test mode and Stripe.JS should fail to initialize if you are serving it over HTTP and not HTTPS in live mode
I'm still in development mode. Using test keys. Are you saying if I use the live keys stripe.js will not load?
Yes if it is not served over HTTPS
But it is totally fine if you are developing locally right now and just in test mode
Then you can ignore that warning as it is just letting you know that you can't serve locally (over HTTP) with your live key
This is a desktop app. The local files are always going to be served via localhost, even in production. Not sure if you are familiar with ElectronJS or Tauri but that's how it works.
I'm just using Stripe.js on the app to load Stripe elements but all the logic and Stripe usage with private keys happens in the backend server. The app communicates with the server in HTTPS.
Hmm no I'm not familiar with those frameworks but Stripe.JS does require HTTPS for securely transmitting card data
It does use HTTPS to load stripe.js and all the communication from the desktop app to the backend server also uses HTTPS
It's just that the load of stripe.js will have origin http://127.0.0.1:1420
rtm_stripejs-electron
your domain has to be over https. if it's not it won't work in production
yeah file:// is different, you said you used http://
it's also 5 years old and unlikely to be current
I mean the easiest solution is to try your Live API key and see what happens!
How does that apply when using <script src="https://js.stripe.com/v3" async></script>? I guess I could host stripe.js locally and use file://
I'm trying now with the live keys
this is irrelevant with the way you load Stripe.js. They are completely separate thing. IT's about how your website or webapp is rendered/loaded, like the topmost origin of the page
I used the live publishable key on the app part and it loads fine. I still get the warning though. It's actually using a custom protocol as the origin when built in release mode. It uses tauri://localhost
as long as everything renders with a live key you should be fine