【发布时间】:2013-09-18 14:52:35
【问题描述】:
我是 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 页面上还有一个用于创建费用的部分,我不确定是否需要对此做任何事情。
【问题讨论】:
-
Stripe Payment Integration in Asp.net Web Forms 及其 100% 工作代码,您也可以下载应用程序code2night.com/Blog/MyBlog/…
标签: c# asp.net asp.net-mvc-4 stripe-payments