私はストライプを初めて使用し、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 ページには料金を作成するためのセクションがあり、それで何かをする必要があるかどうかはわかりません。