我是 Stripe 新手,我决定使用 stripe.net ( https://github.com/jaymedavis/stripe.net )。
我想做的是让客户制定一个每月向他们收费的计划。我还想为他们提供取消订阅该计划的选项。这是 stripe.net 项目显示使用的代码。
StripeConfiguration.SetApiKey("[your api key here]");
var myCustomer = new StripeCustomerCreateOptions();
// set these properties if it makes you happy
myCustomer.Email = "pork@email.com";
myCustomer.Description = "Johnny Tenderloin (pork@email.com)";
// set these properties if using a card
myCustomer.CardNumber = "4242424242424242";
myCustomer.CardExpirationYear = "2012";
myCustomer.CardExpirationMonth = "10";
myCustomer.CardAddressCountry = "US";
myCustomer.PlanId = *planId*;
var customerService = new StripeCustomerService();
StripeCustomer stripeCustomer = customerService.Create(myCustomer);
我要做的就是让客户接受按月收费的计划吗?并取消计划...
var customerService = new StripeCustomerService();
StripeSubscription subscription = customerService.CancelSubscription(*customerId*);
这就是我所要做的吗?stripe.net 页面上还有一个部分用于创建费用,我不确定我是否需要对此做任何事情。