'Stripe checkout working on localhost, but not with live heroku nodejs
I am building a e-commerce site from scratch with nodejs. I have implemented stripe as payment, and works on localhost, but when I push code to heroku, it doesn’t take me to stripe payment page.
Is it possible that I need to upgrade my plan on heroku (currently on free tier), or maybe it has to do with running http instead of https?
Solution 1:[1]
i also noticed that checkout only works on floralfashionboutique.herokuapp.com . Is heroku unreliable for this kind of thing?
Solution 2:[2]
Took a quick look at your site and confirmed that it’s because you’re not using HTTPS. Here’s the error from your console log:
Uncaught IntegrationError: Live Stripe.js integrations must use HTTPS.
You can check out https://stripe.com/docs/security/guide#tls for more information. If you want to take advantage of Heroku’s Automated Certificate Management (https://devcenter.heroku.com/articles/automated-certificate-management), you’ll need to upgrade to a paid dyno. If you want to stay on Heroku’s free tier, you can manually upload your own certificate (https://devcenter.heroku.com/articles/ssl#manually-uploading-certificates-and-intermediaries).
Solution 3:[3]
Stripe forces HTTPS for all services using TLS (SSL). This includes the checkout page. https://stripe.com/docs/security/stripe
You might need to configure Heroku to use SSL cert. Luckily they have a straightforward ACM system that manages the SSL setup.
https://devcenter.heroku.com/articles/automated-certificate-management
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gianluca |
| Solution 2 | karbi |
| Solution 3 | pancakeF |
