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

java - How to ensure two Stripe Subscriptions have the exact same billing cycle and invoice creation time - Stack Overflow

programmeradmin4浏览0评论

I’m using Stripe’s API to create two subscriptions for the same customer, and I need both to:

  • Have the same billing cycle date.
  • Generate invoices at the exact same time (it's related I believe to my previous bullet).

I've tried setting the billing_cycle_anchor of the second subscription to match the first one's period end date. The subscriptions are created on different days rather than simultaneously.

builder = builder.setBillingCycleAnchor(new Date(firstSubscription.getCurrentPeriodEnd() * 1000).toInstant().getEpochSecond());

Despite these efforts, there's a slight delay in invoice creation. It's odd because the first set of invoices in December had the same creation date, but the subsequent pairs in January and February were created a day apart (as shown in the screenshot below).

My only hunch is that it might be related to timezones — for example, if the subscription's billing cycle is close to midnight UTC.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论