/// <summary>
        /// Credit a card.
        /// </summary>
        /// <exception cref="pachirapay.Connector.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="authToken">Gets or sets the authentication token.</param>
        /// <param name="request"> (optional)</param>
        /// <returns>Task of CardPaymentCreditHolderResponse</returns>
        public async System.Threading.Tasks.Task <CardPaymentCreditHolderResponse> V1CardCreditHolderPostAsync(string authToken, CardPaymentCreditHolderRequest request = null)
        {
            ApiResponse <CardPaymentCreditHolderResponse> localVarResponse = await V1CardCreditHolderPostAsyncWithHttpInfo(authToken, request);

            return(localVarResponse.Data);
        }
        /// <summary>
        /// Credit a card.
        /// </summary>
        /// <exception cref="pachirapay.Connector.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="authToken">Gets or sets the authentication token.</param>
        /// <param name="request"> (optional)</param>
        /// <returns>Task of ApiResponse (CardPaymentCreditHolderResponse)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <CardPaymentCreditHolderResponse> > V1CardCreditHolderPostAsyncWithHttpInfo(string authToken, CardPaymentCreditHolderRequest request = null)
        {
            // verify the required parameter 'authToken' is set
            if (authToken == null)
            {
                throw new ApiException(400, "Missing required parameter 'authToken' when calling CardApi->V1CardCreditHolderPost");
            }

            var    localVarPath         = "./v1/card/creditHolder";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.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-patch+json",
                "application/json",
                "text/json",
                "application/_*+json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (authToken != null)
            {
                localVarHeaderParams.Add("authToken", this.Configuration.ApiClient.ParameterToString(authToken));                    // header parameter
            }
            if (request != null && request.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(request); // http body (model) parameter
            }
            else
            {
                localVarPostBody = request; // byte array
            }


            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                            Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                            localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("V1CardCreditHolderPost", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <CardPaymentCreditHolderResponse>(localVarStatusCode,
                                                                     localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)),
                                                                     (CardPaymentCreditHolderResponse)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CardPaymentCreditHolderResponse))));
        }
        /// <summary>
        /// Credit a card.
        /// </summary>
        /// <exception cref="pachirapay.Connector.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="authToken">Gets or sets the authentication token.</param>
        /// <param name="request"> (optional)</param>
        /// <returns>CardPaymentCreditHolderResponse</returns>
        public CardPaymentCreditHolderResponse V1CardCreditHolderPost(string authToken, CardPaymentCreditHolderRequest request = null)
        {
            ApiResponse <CardPaymentCreditHolderResponse> localVarResponse = V1CardCreditHolderPostWithHttpInfo(authToken, request);

            return(localVarResponse.Data);
        }