Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/Core/Billing/Services/IStripeAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ Task<CustomerBalanceTransaction> CreateCustomerBalanceTransactionAsync(string cu
Task<List<Product>> ListProductsAsync(ProductListOptions options = null);
Task<StripeList<Subscription>> ListSubscriptionsAsync(SubscriptionListOptions options = null);
Task<Session> CreateBillingPortalSessionAsync(SessionCreateOptions options);
Task<SubscriptionSchedule> CreateSubscriptionScheduleAsync(SubscriptionScheduleCreateOptions options);
Task<SubscriptionSchedule> GetSubscriptionScheduleAsync(string id, SubscriptionScheduleGetOptions options = null);
Task<StripeList<SubscriptionSchedule>> ListSubscriptionSchedulesAsync(SubscriptionScheduleListOptions options);
Task<SubscriptionSchedule> UpdateSubscriptionScheduleAsync(string id, SubscriptionScheduleUpdateOptions options);
Task<SubscriptionSchedule> ReleaseSubscriptionScheduleAsync(string id, SubscriptionScheduleReleaseOptions options = null);
}
20 changes: 20 additions & 0 deletions src/Core/Billing/Services/Implementations/StripeAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class StripeAdapter : IStripeAdapter
private readonly CouponService _couponService;
private readonly ProductService _productService;
private readonly SessionService _billingPortalSessionService;
private readonly SubscriptionScheduleService _subscriptionScheduleService;

public StripeAdapter()
{
Expand All @@ -51,6 +52,7 @@ public StripeAdapter()
_couponService = new CouponService();
_productService = new ProductService();
_billingPortalSessionService = new SessionService();
_subscriptionScheduleService = new SubscriptionScheduleService();
}

/**************
Expand Down Expand Up @@ -243,4 +245,22 @@ public Task<StripeList<Subscription>> ListSubscriptionsAsync(SubscriptionListOpt
**********************/
public Task<Session> CreateBillingPortalSessionAsync(SessionCreateOptions options) =>
_billingPortalSessionService.CreateAsync(options);

/***************************
** SUBSCRIPTION SCHEDULE **
***************************/
public Task<SubscriptionSchedule> CreateSubscriptionScheduleAsync(SubscriptionScheduleCreateOptions options) =>
_subscriptionScheduleService.CreateAsync(options);

public Task<SubscriptionSchedule> GetSubscriptionScheduleAsync(string id, SubscriptionScheduleGetOptions options = null) =>
_subscriptionScheduleService.GetAsync(id, options);

public Task<StripeList<SubscriptionSchedule>> ListSubscriptionSchedulesAsync(SubscriptionScheduleListOptions options) =>
_subscriptionScheduleService.ListAsync(options);

public Task<SubscriptionSchedule> UpdateSubscriptionScheduleAsync(string id, SubscriptionScheduleUpdateOptions options) =>
_subscriptionScheduleService.UpdateAsync(id, options);

public Task<SubscriptionSchedule> ReleaseSubscriptionScheduleAsync(string id, SubscriptionScheduleReleaseOptions options = null) =>
_subscriptionScheduleService.ReleaseAsync(id, options);
}
1 change: 1 addition & 0 deletions src/Core/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ public static class FeatureFlagKeys
public const string PM29108_EnablePersonalDiscounts = "pm-29108-enable-personal-discounts";
public const string PM29593_PremiumToOrganizationUpgrade = "pm-29593-premium-to-organization-upgrade";
public const string PM32581_UseUpdateOrganizationSubscriptionCommand = "pm-32581-use-update-organization-subscription-command";
public const string PM32645_DeferPriceMigrationToRenewal = "pm-32645-defer-price-migration-to-renewal";

/* Key Management Team */
public const string PrivateKeyRegeneration = "pm-12241-private-key-regeneration";
Expand Down
Loading