简体   繁体   English

重定向到条带结帐时出错

[英]Error when redirection to stripe checkout

I am building out an e-commerce site, with next.js and stripe checkout.我正在建立一个电子商务网站,其中包含 next.js 和条带结帐。 I keep running into this error when I am going to checkout.当我要结帐时,我一直遇到这个错误。 I am using the use-shopping-cart package as well, and I'm starting to think it maybe causing the below response error from stripe-checkout我也在use-shopping-cart package,我开始认为它可能会导致stripe-checkout出现以下响应错误

  "error": {
    "message": "Invalid API Key provided: undefined",
    "type": "invalid_request_error"
  }
}

What is super confusing is that the checkout session in created, along with the cart and payment intent (I know this to be true because I can verify this information thru the stripe dashboard).超级令人困惑的是,结帐 session 连同购物车和付款意图一起创建(我知道这是真的,因为我可以通过条纹仪表板验证此信息)。 Currently the stripe dashboard does not indicate there is an error either.目前,条带仪表板也不表示存在错误。

Has anyone experienced this, and does anyone have any idea on how to fix it?有没有人经历过这个,有没有人知道如何解决它?

Thanks in advance!提前致谢!

the solution is ridiculously easy.解决方案非常简单。 I just needed to prefix my env variable with NEXT_PUBLIC_ .我只需要在我的环境变量前面加上NEXT_PUBLIC_

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

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