0

我正在尝试使用 Stripe.Net 制定一个按季度计费的计划,但恐怕它可能无法开箱即用。

到目前为止,这是我的代码,几乎直接取自 Stripe.Net 设置指南:

var myPlan = new StripePlanCreateOptions();
myPlan.Amount = 1000;           // all amounts on Stripe are in cents, pence, etc
myPlan.Currency = "usd";        // "usd" only supported right now
myPlan.Interval = "month";      // "month" or "year"
myPlan.IntervalCount = 1;       // optional
myPlan.Name = "Bronze";
myPlan.Id = "Bronze" + Guid.NewGuid().ToString();
myPlan.TrialPeriodDays = 30;    // amount of time that will lapse before the customer is billed

var planService = new StripePlanService();
StripePlan response = planService.Create(myPlan);

我希望我可以将间隔更改为“季度”之类的东西,但我得到了 StripeException:无效间隔:必须是天、月、周或年中的一个。

这条消息非常明确,除了日、月、周或年之外,它不会期待任何东西,但我想我是在问是否有人知道解决这个问题的方法。

感谢您的任何帮助!

4

1 回答 1

3

季度只是 3 个月的另一种说法,因此您可以通过将 Interval 设置为month,将 IntervalCount 设置为 3 来设置季度计划。

于 2015-04-06T01:45:19.803 回答