最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Stripe Subscription - Invoice does not auto finalize - Stack Overflow

programmeradmin0浏览0评论

I'm using Stripe to do subscriptions and based on the docs, invoices will auto finalize after 1 hour.

I use test clocks to simulate the subscription, and for some reason, the invoice does not finalize after simulating a clock advancement of 1 hour (even weeks).

Here are my steps to reproduce:

  1. In invoice.created webhook event, i set auto_advance to true.
  2. Advance test clock to 1 hour later, I expect invoice to be finalized, but remains in Draft

Code:

case 'invoice.created':
    const invoiceId = event.data.object.id
    try {
       const update = await stripe.invoices.update(invoiceId, {'auto_advance': true})
    } catch (error) {
        console.log(error)
    }
    break

What am I missing?

发布评论

评论列表(0)

  1. 暂无评论