Beispiel #1
0
        /// <summary>
        /// Duplicate payment batch Achieve a batch of payments by copy of previously processed payments, with the same payment method.
        /// </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="duplicatePaymentBatchRequest">All data needed to make process the payment, with the reference to the previously payment. (optional)</param>
        /// <returns>Task of ApiResponse (CardPaymentResponse)</returns>
        public async System.Threading.Tasks.Task<ApiResponse<CardPaymentResponse>> V1PaymentsDuplicatePaymentBatchPostAsyncWithHttpInfo (string authToken, DuplicatePaymentBatchRequest duplicatePaymentBatchRequest = null)
        {
            // verify the required parameter 'authToken' is set
            if (authToken == null)
                throw new ApiException(400, "Missing required parameter 'authToken' when calling DuplicatePaymentApi->V1PaymentsDuplicatePaymentBatchPost");

            var localVarPath = "./v1/payments/duplicate-payment/batch";
            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 (duplicatePaymentBatchRequest != null && duplicatePaymentBatchRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(duplicatePaymentBatchRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = duplicatePaymentBatchRequest; // 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("V1PaymentsDuplicatePaymentBatchPost", localVarResponse);
                if (exception != null) throw exception;
            }

            return new ApiResponse<CardPaymentResponse>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)),
                (CardPaymentResponse) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CardPaymentResponse)));
        }
Beispiel #2
0
        /// <summary>
        /// Duplicate payment batch Achieve a batch of payments by copy of previously processed payments, with the same payment method.
        /// </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="duplicatePaymentBatchRequest">All data needed to make process the payment, with the reference to the previously payment. (optional)</param>
        /// <returns>Task of CardPaymentResponse</returns>
        public async System.Threading.Tasks.Task<CardPaymentResponse> V1PaymentsDuplicatePaymentBatchPostAsync (string authToken, DuplicatePaymentBatchRequest duplicatePaymentBatchRequest = null)
        {
             ApiResponse<CardPaymentResponse> localVarResponse = await V1PaymentsDuplicatePaymentBatchPostAsyncWithHttpInfo(authToken, duplicatePaymentBatchRequest);
             return localVarResponse.Data;

        }
Beispiel #3
0
 /// <summary>
 /// Duplicate payment batch Achieve a batch of payments by copy of previously processed payments, with the same payment method.
 /// </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="duplicatePaymentBatchRequest">All data needed to make process the payment, with the reference to the previously payment. (optional)</param>
 /// <returns>CardPaymentResponse</returns>
 public CardPaymentResponse V1PaymentsDuplicatePaymentBatchPost (string authToken, DuplicatePaymentBatchRequest duplicatePaymentBatchRequest = null)
 {
      ApiResponse<CardPaymentResponse> localVarResponse = V1PaymentsDuplicatePaymentBatchPostWithHttpInfo(authToken, duplicatePaymentBatchRequest);
      return localVarResponse.Data;
 }