简体   繁体   English

无法在 Stripe 上创建订阅

[英]Can't create subscriptions on Stripe

I can't create stripe subscription due to Missing required param: items.由于Missing required param: items. . . I request it with items although.虽然我要求它与items

The error:错误:

{
  "error": {
    "code": "parameter_missing",
    "doc_url": "https://stripe.com/docs/error-codes/parameter-missing",
    "message": "Missing required param: items.",
    "param": "items",
    "type": "invalid_request_error"
  }
}

The code:编码:

    const stripeCustomer = await stripe.customers.create({
      name: name,
      email: email,
      plan: basicPlan,
    })
    const stripeSubscription = await stripe.subscriptions.create({
      items: [{ plan: basicPlan }],
      customer: stripeCustomer.id,
    })

Stripe Customer account was successfully added. Stripe 客户帐户已成功添加。

Got the same problem.遇到了同样的问题。 I've found out I'm lacking some package details我发现我缺少一些 package 详细信息

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

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