Skip to content

Commit

Permalink
Merge pull request #161 from Resgrid/develop
Browse files Browse the repository at this point in the history
CU-868a7khdq trying to fix sub bug
  • Loading branch information
ucswift authored Oct 12, 2024
2 parents b1c15a4 + f1fa63c commit 4eae821
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Core/Resgrid.Services/SubscriptionsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,9 @@ public async Task<CreateStripeSessionForUpdateData> CreateStripeSessionForUpdate
{
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
{
if (string.IsNullOrWhiteSpace(stripeCustomerId))
stripeCustomerId = " ";

var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
var request = new RestRequest($"/api/Billing/CreateStripeSessionForUpdate", Method.Get);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
Expand Down Expand Up @@ -1018,6 +1021,9 @@ public async Task<GetCanceledPlanFromStripeData> GetActiveStripeSubscriptionAsyn
{
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
{
if (string.IsNullOrWhiteSpace(stripeCustomerId))
stripeCustomerId = " ";

var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
var request = new RestRequest($"/api/Billing/GetActiveStripeSubscription", Method.Get);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
Expand All @@ -1042,6 +1048,9 @@ public async Task<GetCanceledPlanFromStripeData> GetActivePTTStripeSubscriptionA
{
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
{
if (string.IsNullOrWhiteSpace(stripeCustomerId))
stripeCustomerId = " ";

var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
var request = new RestRequest($"/api/Billing/GetActivePTTStripeSubscription", Method.Get);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
Expand All @@ -1066,6 +1075,9 @@ public async Task<bool> ModifyPTTAddonSubscriptionAsync(string stripeCustomerId,
{
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
{
if (string.IsNullOrWhiteSpace(stripeCustomerId))
stripeCustomerId = " ";

var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
var request = new RestRequest($"/api/Billing/ModifyPTTAddonSubscription", Method.Get);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
Expand All @@ -1092,6 +1104,9 @@ public async Task<bool> CancelSubscriptionAsync(string stripeCustomerId)
{
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
{
if (string.IsNullOrWhiteSpace(stripeCustomerId))
stripeCustomerId = " ";

var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
var request = new RestRequest($"/api/Billing/CancelSubscription", Method.Get);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
Expand All @@ -1116,6 +1131,9 @@ public async Task<CreateStripeBillingPortalSessionData> CreateStripeSessionForCu
{
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
{
if (string.IsNullOrWhiteSpace(stripeCustomerId))
stripeCustomerId = " ";

var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
var request = new RestRequest($"/api/Billing/CreateStripeSessionForCustomerPortal", Method.Get);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
Expand Down Expand Up @@ -1152,6 +1170,9 @@ public async Task<CreateStripeSessionForUpdateData> CreateStripeSessionForSub(in
{
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
{
if (string.IsNullOrWhiteSpace(stripeCustomerId))
stripeCustomerId = " ";

var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
var request = new RestRequest($"/api/Billing/CreateStripeSessionForSubscriptionCheckout", Method.Get);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
Expand Down Expand Up @@ -1182,6 +1203,9 @@ public async Task<ChangeActiveSubscriptionData> ChangeActiveSubscriptionAsync(st
{
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
{
if (string.IsNullOrWhiteSpace(stripeCustomerId))
stripeCustomerId = " ";

var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
var request = new RestRequest($"/api/Billing/ChangeActiveSubscription", Method.Get);
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
Expand Down

0 comments on commit 4eae821

Please sign in to comment.