我正试图使用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:无效间隔:必须是一天、一个月、一个星期或一个年份。
这个信息是非常明确的,因为除了日、月、周或年之外,它没有任何期望,但我想我是在问是否有人知道如何绕过这一问题。
感谢所有的帮助!
发布于 2015-04-06 01:45:19
季度只是3个月的另一种说法,因此您可以通过将间隔设置为month,将IntervalCount设置为3来设置季度计划。
https://stackoverflow.com/questions/29461604
复制相似问题