/// <summary> /// Gets payment options for a context /// </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="paymentOptionsRequest">The payment options request. (optional)</param> /// <returns>Task of PaymentOptionsResponse</returns> public async System.Threading.Tasks.Task <PaymentOptionsResponse> V1PaymentOptionsPostAsync(string authToken, PaymentOptionsRequest paymentOptionsRequest = null) { ApiResponse <PaymentOptionsResponse> localVarResponse = await V1PaymentOptionsPostAsyncWithHttpInfo(authToken, paymentOptionsRequest); return(localVarResponse.Data); }
/// <summary> /// Gets payment options for a context /// </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="paymentOptionsRequest">The payment options request. (optional)</param> /// <returns>Task of ApiResponse (PaymentOptionsResponse)</returns> public async System.Threading.Tasks.Task <ApiResponse <PaymentOptionsResponse> > V1PaymentOptionsPostAsyncWithHttpInfo(string authToken, PaymentOptionsRequest paymentOptionsRequest = null) { // verify the required parameter 'authToken' is set if (authToken == null) { throw new ApiException(400, "Missing required parameter 'authToken' when calling PaymentOptionsApi->V1PaymentOptionsPost"); } var localVarPath = "./v1/payment-options"; 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 (paymentOptionsRequest != null && paymentOptionsRequest.GetType() != typeof(byte[])) { localVarPostBody = this.Configuration.ApiClient.Serialize(paymentOptionsRequest); // http body (model) parameter } else { localVarPostBody = paymentOptionsRequest; // 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("V1PaymentOptionsPost", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <PaymentOptionsResponse>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => string.Join(",", x.Value)), (PaymentOptionsResponse)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(PaymentOptionsResponse)))); }
/// <summary> /// Gets payment options for a context /// </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="paymentOptionsRequest">The payment options request. (optional)</param> /// <returns>PaymentOptionsResponse</returns> public PaymentOptionsResponse V1PaymentOptionsPost(string authToken, PaymentOptionsRequest paymentOptionsRequest = null) { ApiResponse <PaymentOptionsResponse> localVarResponse = V1PaymentOptionsPostWithHttpInfo(authToken, paymentOptionsRequest); return(localVarResponse.Data); }