我正在尝试使用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);
我希望我可以将Interval更改为“ quarter”,但是我得到了StripeException:无效的间隔:必须是日,月,周或年之一。
该消息非常明确,因为除了日,月,周或年之外,它什么也不会期望,但是我想我想问的是是否有人知道解决此问题的方法。
感谢您提供的所有帮助!
四分之一是3个月的另一种表示方式,因此您可以通过将Interval设置为month
,将IntervalCount设置为3来设置季度计划。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句