首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何利用Stripe.Net建立季度收费计划

如何利用Stripe.Net建立季度收费计划
EN

Stack Overflow用户
提问于 2015-04-05 19:58:51
回答 1查看 659关注 0票数 0

我正试图使用Stripe.Net建立一个季度账单计划,但恐怕这是不可能的。

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

代码语言:javascript
复制
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:无效间隔:必须是一天、一个月、一个星期或一个年份。

这个信息是非常明确的,因为除了日、月、周或年之外,它没有任何期望,但我想我是在问是否有人知道如何绕过这一问题。

感谢所有的帮助!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-04-06 01:45:19

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

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29461604

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档