/// <summary> /// Increment an Authorization Use this service to authorize additional charges in a lodging or autorental transaction. Include the ID returned from the original authorization in the PATCH request to add additional charges to that authorization. /// </summary> /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">The ID returned from the original authorization request.</param> /// <param name="incrementAuthRequest"></param> /// <returns>Task of ApiResponse (PtsV2IncrementalAuthorizationPatch201Response)</returns> public async System.Threading.Tasks.Task <ApiResponse <PtsV2IncrementalAuthorizationPatch201Response> > IncrementAuthAsyncWithHttpInfo(string id, IncrementAuthRequest incrementAuthRequest) { LogUtility logUtility = new LogUtility(); // verify the required parameter 'id' is set if (id == null) { logger.Error("ApiException : Missing required parameter 'id' when calling PaymentsApi->IncrementAuth"); throw new ApiException(400, "Missing required parameter 'id' when calling PaymentsApi->IncrementAuth"); } // verify the required parameter 'incrementAuthRequest' is set if (incrementAuthRequest == null) { logger.Error("ApiException : Missing required parameter 'incrementAuthRequest' when calling PaymentsApi->IncrementAuth"); throw new ApiException(400, "Missing required parameter 'incrementAuthRequest' when calling PaymentsApi->IncrementAuth"); } var localVarPath = $"/pts/v2/payments/{id}"; var localVarPathParams = new Dictionary <string, string>(); var localVarQueryParams = new Dictionary <string, string>(); var localVarHeaderParams = new Dictionary <string, string>(Configuration.DefaultHeader); var localVarFormParams = new Dictionary <string, string>(); var localVarFileParams = new Dictionary <string, FileParameter>(); object localVarPostBody = null; // to determine the Content-Type header string[] localVarHttpContentTypes = new string[] { "application/json;charset=utf-8" }; string localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header string[] localVarHttpHeaderAccepts = new string[] { "application/hal+json;charset=utf-8" }; string localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (id != null) { localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter } logger.Debug($"HTTP Request Body :\n{logUtility.ConvertDictionaryToString(localVarPathParams)}"); if (incrementAuthRequest != null && incrementAuthRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(incrementAuthRequest); // http body (model) parameter } else { localVarPostBody = incrementAuthRequest; // byte array } if (logUtility.IsMaskingEnabled(logger)) { logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}"); } else { logger.Debug($"HTTP Request Body :\n{localVarPostBody}"); } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("IncrementAuth", localVarResponse); if (exception != null) { logger.Error($"Exception : {exception.Message}"); throw exception; } } return(new ApiResponse <PtsV2IncrementalAuthorizationPatch201Response>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (PtsV2IncrementalAuthorizationPatch201Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2IncrementalAuthorizationPatch201Response)))); // Return statement }
/// <summary> /// Increment an Authorization Use this service to authorize additional charges in a lodging or autorental transaction. Include the ID returned from the original authorization in the PATCH request to add additional charges to that authorization. /// </summary> /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="id">The ID returned from the original authorization request.</param> /// <param name="incrementAuthRequest"></param> /// <returns>ApiResponse of PtsV2IncrementalAuthorizationPatch201Response</returns> public ApiResponse <PtsV2IncrementalAuthorizationPatch201Response> IncrementAuthWithHttpInfo(string id, IncrementAuthRequest incrementAuthRequest) { // verify the required parameter 'id' is set if (id == null) { throw new ApiException(400, "Missing required parameter 'id' when calling PaymentsApi->IncrementAuth"); } // verify the required parameter 'incrementAuthRequest' is set if (incrementAuthRequest == null) { throw new ApiException(400, "Missing required parameter 'incrementAuthRequest' when calling PaymentsApi->IncrementAuth"); } var localVarPath = $"/pts/v2/payments/{id}"; var localVarPathParams = new Dictionary <string, string>(); var localVarQueryParams = new Dictionary <string, string>(); var localVarHeaderParams = new Dictionary <string, string>(Configuration.DefaultHeader); var localVarFormParams = new Dictionary <string, string>(); var localVarFileParams = new Dictionary <string, FileParameter>(); object localVarPostBody = null; // to determine the Content-Type header string[] localVarHttpContentTypes = new string[] { "application/json;charset=utf-8" }; string localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); // to determine the Accept header string[] localVarHttpHeaderAccepts = new string[] { "application/hal+json;charset=utf-8" }; string localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } if (id != null) { localVarPathParams.Add("id", Configuration.ApiClient.ParameterToString(id)); // path parameter } if (incrementAuthRequest != null && incrementAuthRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(incrementAuthRequest); // http body (model) parameter } else { localVarPostBody = incrementAuthRequest; // byte array } if (false) { } else { } // make the HTTP request IRestResponse localVarResponse = (IRestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.PATCH, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); int localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { Exception exception = ExceptionFactory("IncrementAuth", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <PtsV2IncrementalAuthorizationPatch201Response>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (PtsV2IncrementalAuthorizationPatch201Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PtsV2IncrementalAuthorizationPatch201Response)))); // Return statement }