public StripePaymentProcessor(StripeSettings settings, Plans plans, ILogger <StripePaymentProcessor> logger) { RequestOptions = new RequestOptions() { ApiKey = settings.SecretKey }; Customers = new CustomerService(); Subscriptions = new SubscriptionService(); SubscriptionItems = new SubscriptionItemService(); Sources = new SourceService(); this.plans = plans; this.logger = logger; }
public static Plan?GetPlanForStripePrice(this Plans plans, string priceId) { foreach (var plan in plans.All) { if (plan.Stripe is StripePlan stripePlan) { if (stripePlan.PriceId == priceId) { return(plan); } } } return(null); }
public StripeWebhookEndpoint(StripeSettings stripeSettings, Plans plans, IHttpContextAccessor contextAccessor, ILogger <StripeWebhookEndpoint> logger) : base(contextAccessor, logger) { endpointSecret = stripeSettings.WebhookSecret; this.plans = plans; }