我正在 Node js 后端创建订阅。它一直工作得很好,但今天我收到了这个错误。我没有对代码进行任何更改 - 它只是开始返回此错误。后端代码:
app.post('/api/subscription', async (req, res) => {
const { priceId } = req.body;
try {
const session = await stripe.checkout.sessions.create({
mode: "subscription",
payment_method_types: ["card"],
line_items: [
{
price: priceId,
// For metered billing, do not pass quantity
quantity: 1,
},
],
// {CHECKOUT_SESSION_ID} is a string literal; do not change it!
// the actual Session ID is returned in the query parameter when your customer
// is redirected to the success page.
success_url: 'https://someurl',
cancel_url: …
Run Code Online (Sandbox Code Playgroud)