简体   繁体   English

Stripe Payment 仅适用于我的 LocalHost,但不适用于 Heroku 服务器

[英]Stripe Payment Works only in my LocalHost but Does not work on Heroku server

I'm learning web development and I was building this project but I have this problem Stripe Payment Works on LocalHost but Does not work on Heroku.我正在学习 web 开发,我正在构建这个项目,但我有这个问题 Stripe Payment Works on LocalHost 但不适用于 Heroku。

https://i.stack.imgur.com/UsMKp.png https://i.stack.imgur.com/UsMKp.png

and this is the current code https://github.com/unmalnickname/Ebook-Seller-App这是当前代码https://github.com/unmalnickname/Ebook-Seller-App

and the Heroku site https://powerful-oasis-51375.herokuapp.com和 Heroku 站点https://powerful-oasis-51375.herokuapp.com

Thank you for your time and help感谢您的时间和帮助

I accessed your site hosted in Heroku and tried to use the Stripe Checkout modal, it shows the error messages 我访问了您在Heroku中托管的网站,并尝试使用Stripe Checkout模式,它显示了错误消息

"Invalid Publishable Keys" “无效的可发布密钥”

Stripe Checkout requires you to pass the correct publishable keys to perform the checking. 条纹签出要求您传递正确的可发布密钥以执行检查。

So based on the error message, I am fairly sure that the Environment params [0] were not passed in properly in your Heroku Deployment. 因此,基于错误消息,我相当确定环境参数[0]没有在Heroku部署中正确传递。 Either it is running in dev mode or the parameters are not passed in during node start. 它正在开发模式下运行,或者在节点启动期间未传递参数。

Hope the above helps 希望以上帮助

[0] https://github.com/unmalnickname/Ebook-Seller-App/blob/master/config/keys.js#L1 [0] https://github.com/unmalnickname/Ebook-Seller-App/blob/master/config/keys.js#L1

Could be that you have not added the stripe api key to the heroku Config Vars.可能是您没有将条带 api 键添加到 heroku 配置变量中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM