Skip to content

Commit 4eae821

Browse files
authored
Merge pull request #161 from Resgrid/develop
CU-868a7khdq trying to fix sub bug
2 parents b1c15a4 + f1fa63c commit 4eae821

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Core/Resgrid.Services/SubscriptionsService.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,9 @@ public async Task<CreateStripeSessionForUpdateData> CreateStripeSessionForUpdate
991991
{
992992
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
993993
{
994+
if (string.IsNullOrWhiteSpace(stripeCustomerId))
995+
stripeCustomerId = " ";
996+
994997
var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
995998
var request = new RestRequest($"/api/Billing/CreateStripeSessionForUpdate", Method.Get);
996999
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
@@ -1018,6 +1021,9 @@ public async Task<GetCanceledPlanFromStripeData> GetActiveStripeSubscriptionAsyn
10181021
{
10191022
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
10201023
{
1024+
if (string.IsNullOrWhiteSpace(stripeCustomerId))
1025+
stripeCustomerId = " ";
1026+
10211027
var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
10221028
var request = new RestRequest($"/api/Billing/GetActiveStripeSubscription", Method.Get);
10231029
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
@@ -1042,6 +1048,9 @@ public async Task<GetCanceledPlanFromStripeData> GetActivePTTStripeSubscriptionA
10421048
{
10431049
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
10441050
{
1051+
if (string.IsNullOrWhiteSpace(stripeCustomerId))
1052+
stripeCustomerId = " ";
1053+
10451054
var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
10461055
var request = new RestRequest($"/api/Billing/GetActivePTTStripeSubscription", Method.Get);
10471056
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
@@ -1066,6 +1075,9 @@ public async Task<bool> ModifyPTTAddonSubscriptionAsync(string stripeCustomerId,
10661075
{
10671076
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
10681077
{
1078+
if (string.IsNullOrWhiteSpace(stripeCustomerId))
1079+
stripeCustomerId = " ";
1080+
10691081
var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
10701082
var request = new RestRequest($"/api/Billing/ModifyPTTAddonSubscription", Method.Get);
10711083
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
@@ -1092,6 +1104,9 @@ public async Task<bool> CancelSubscriptionAsync(string stripeCustomerId)
10921104
{
10931105
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
10941106
{
1107+
if (string.IsNullOrWhiteSpace(stripeCustomerId))
1108+
stripeCustomerId = " ";
1109+
10951110
var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
10961111
var request = new RestRequest($"/api/Billing/CancelSubscription", Method.Get);
10971112
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
@@ -1116,6 +1131,9 @@ public async Task<CreateStripeBillingPortalSessionData> CreateStripeSessionForCu
11161131
{
11171132
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
11181133
{
1134+
if (string.IsNullOrWhiteSpace(stripeCustomerId))
1135+
stripeCustomerId = " ";
1136+
11191137
var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
11201138
var request = new RestRequest($"/api/Billing/CreateStripeSessionForCustomerPortal", Method.Get);
11211139
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
@@ -1152,6 +1170,9 @@ public async Task<CreateStripeSessionForUpdateData> CreateStripeSessionForSub(in
11521170
{
11531171
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
11541172
{
1173+
if (string.IsNullOrWhiteSpace(stripeCustomerId))
1174+
stripeCustomerId = " ";
1175+
11551176
var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
11561177
var request = new RestRequest($"/api/Billing/CreateStripeSessionForSubscriptionCheckout", Method.Get);
11571178
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);
@@ -1182,6 +1203,9 @@ public async Task<ChangeActiveSubscriptionData> ChangeActiveSubscriptionAsync(st
11821203
{
11831204
if (!String.IsNullOrWhiteSpace(Config.SystemBehaviorConfig.BillingApiBaseUrl) && !String.IsNullOrWhiteSpace(Config.ApiConfig.BackendInternalApikey))
11841205
{
1206+
if (string.IsNullOrWhiteSpace(stripeCustomerId))
1207+
stripeCustomerId = " ";
1208+
11851209
var client = new RestClient(Config.SystemBehaviorConfig.BillingApiBaseUrl, configureSerialization: s => s.UseNewtonsoftJson());
11861210
var request = new RestRequest($"/api/Billing/ChangeActiveSubscription", Method.Get);
11871211
request.AddHeader("X-API-Key", Config.ApiConfig.BackendInternalApikey);

0 commit comments

Comments
 (0)