Archive for February 2018

How to charge a customer in Stripe using C# library

Note: In a production environment, you’ll have to write more code to see if the credit card is expired or not You’ll also have to know what credit card to charge (some customers have more than one credit card).   StripeConfiguration.SetApiKey(private_key); // Variables string cardId = string.Empty; // Retrieve the customer var customerService = new…

Read More

How to create a Stripe subscription plan using C# and

StripeConfiguration.SetApiKey(private_key); var planService = new StripePlanService(); StripePlanCreateOptions co = new StripePlanCreateOptions(); co.Amount = 15000; co.Currency = “USD”; co.TrialPeriodDays = 10; co.Name = “Test Plan”; co.StatementDescriptor = “Codw Lab Plan”; co.Interval = “month”; StripeRequestOptions rq = new StripeRequestOptions(); StripePlan plan = planService.Create(co, rq);     The code above will create a plan under stripe subscriptions.

Read More