public IEnumerable <Stripe.Plan> GetPlans() { var planService = new Stripe.PlanService(PrivateKey); IEnumerable <Stripe.Plan> response = planService.List(); return(response); }
public Stripe.Plan[] GetPlans() { var service = new Stripe.PlanService(); var options = new Stripe.PlanListOptions { }; return(service.List(options).ToArray <Stripe.Plan>()); }
public PlanService( StripePlanService planService, ILogger <PlanService> logger, IServiceProvider serviceProvider) : base(serviceProvider) { _planService = planService; _logger = logger; }
public async Task <IEnumerable <Plan> > GetAvailablePlans(bool basic = true) { var planService = new PlanService(); var plans = await planService.ListAsync(new PlanListOptions() { Active = true, }); // only get those specified in products.json if (basic && plans.Any()) { var productNames = StripeConfiguration.GetProducts().Products.First().Plans.Select(x => x.Name); // only one product.. 3 subscriptions plans.Data = plans.Data.Where(x => productNames.Contains(x.Nickname)).ToList(); } return(plans); }