@@ -631,12 +631,15 @@ public async Task<List<PaymentAddon>> GetCurrentPaymentAddonsForDepartmentAsync(
631631 {
632632 if ( ! String . IsNullOrWhiteSpace ( Config . SystemBehaviorConfig . BillingApiBaseUrl ) && ! String . IsNullOrWhiteSpace ( Config . ApiConfig . BackendInternalApikey ) )
633633 {
634+ if ( planAddonIds == null || planAddonIds . Count == 0 )
635+ return new List < PaymentAddon > ( ) ;
636+
634637 var client = new RestClient ( Config . SystemBehaviorConfig . BillingApiBaseUrl , configureSerialization : s => s . UseNewtonsoftJson ( ) ) ;
635- var request = new RestRequest ( $ "/api/Billing/GetCurrentPaymentAddonsForDepartment ", Method . Get ) ;
638+ var request = new RestRequest ( $ "/api/Billing/GetCurrentPaymentAddonsForDepartmentPost ", Method . Post ) ;
636639 request . AddHeader ( "X-API-Key" , Config . ApiConfig . BackendInternalApikey ) ;
637- request . AddHeader ( "Content-Type" , "application/json" ) ;
638- request . AddParameter ( "departmentId" , departmentId , ParameterType . QueryString ) ;
639- request . AddParameter ( "planAddonIds" , planAddonIds . ToString ( ) , ParameterType . QueryString ) ;
640+ request . AddHeader ( "Content-Type" , "application/json; charset=utf-8 " ) ;
641+ // request.AddParameter("departmentId", departmentId, ParameterType.QueryString);
642+ request . AddBody ( new { DepartmentId = departmentId , PlanAddonIds = planAddonIds . ToArray ( ) } ) ;
640643
641644 var response = await client . ExecuteAsync < GetAllPaymentAddonsForDepartmentResult > ( request ) ;
642645
@@ -680,7 +683,7 @@ public async Task<List<PlanAddon>> GetAllAddonPlansByTypeAsync(PlanAddonTypes pl
680683 var request = new RestRequest ( $ "/api/Billing/GetAllAddonPlansByType", Method . Get ) ;
681684 request . AddHeader ( "X-API-Key" , Config . ApiConfig . BackendInternalApikey ) ;
682685 request . AddHeader ( "Content-Type" , "application/json" ) ;
683- request . AddParameter ( "planAddonType " , planAddonType , ParameterType . QueryString ) ;
686+ request . AddParameter ( "type " , ( int ) planAddonType , ParameterType . QueryString ) ;
684687
685688 var response = await client . ExecuteAsync < GetAllPlanAddonsByTypeResult > ( request ) ;
686689
0 commit comments