我是新手,决定使用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页面还有一个创建charge的部分,我不确定是否需要进行任何操作。