/// <summary> /// Creates the subcription plan. /// </summary> /// <param name="request">The request.</param> /// <returns></returns> public async Task <APIResponse> CreateSubcriptionPlan(CreateSubscriptionPlanRequest request) { try { var client = httpClientFactory.CreateClient(VendorServiceOperation.serviceName); var param = JsonConvert.SerializeObject(request); HttpContent contentPost = new StringContent(param, Encoding.UTF8, "application/json"); var response = await client.PostAsync(servicesConfig.Vendor + VendorServiceOperation.CreateSubcriptionPlan(), contentPost); return(JsonConvert.DeserializeObject <APIResponse>(await response.Content.ReadAsStringAsync())); } catch (Exception ex) { logger.Error(ex, "Exception in method 'CreateSubcriptionPlan()'"); var exMessage = ex.InnerException != null ? ex.InnerException.Message : ex.Message; return(new APIResponse(exMessage, HttpStatusCode.InternalServerError)); } }