/// <summary>
        /// This endpoint performs a payment capture for the full value of the payment plan.
        /// </summary>
        /// <exception cref="MerchantApi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body">CaptureFull Body, required.</param>
        /// <returns>ApiResponse of Payment</returns>
        public Payment PaymentFullCapture(CaptureFull body = null)
        {
            // verify the required parameter 'body' is set
            if (body == null)
            {
                throw new ApiException(400, "Missing required parameter 'body' when calling PaymentsApi->PaymentFullCapture");
            }

            ApiResponse <Payment> localVarResponse = PaymentFullCaptureWithHttpInfo(body);

            return(localVarResponse.Data);
        }
Exemple #2
0
        public void PaymentFullCapture()
        {
            // TODO uncomment below to test the method and replace null with proper value
            string orderToken = null;

            var authorization = authorizationApi.AuthorizationCreateToken();

            orderToken = "001.u0hglki77ko70iuavgnb31vo2qq4ehold53brkdngfj9l73f";

            var capture = new CaptureFull(orderToken, "Capture for Order");

            var captureResponse = instance.PaymentFullCapture(capture);

            Assert.IsInstanceOf <Payment>(captureResponse, "response is Payment");
        }
Exemple #3
0
 public void Init()
 {
     // TODO uncomment below to create an instance of Charge
     instance = new CaptureFull("token", "merchantReference");
 }
        /// <summary>
        /// This endpoint performs a payment capture for the full value of the payment plan.
        /// </summary>
        /// <exception cref="MerchantApi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body">CaptureFull Body, required.</param>
        /// <returns>ApiResponse of Payment</returns>
        public ApiResponse <Payment> PaymentFullCaptureWithHttpInfo(CaptureFull body = null)
        {
            var    localVarPath         = GetBasePath() + "payments/capture";
            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"
            };
            String localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

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

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

            // set "format" to json by default
            // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json
            localVarPathParams.Add("format", "json");
            if (body != null && body.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter
            }
            else
            {
                localVarPostBody = body; // byte array
            }

            // authentication (Authorization) required
            if (!String.IsNullOrEmpty(Configuration.GetApiKeyWithPrefix("Authorization")))
            {
                localVarHeaderParams["Authorization"] = Configuration.GetApiKeyWithPrefix("Authorization");
            }

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

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponse <Payment>(localVarStatusCode,
                                             localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                             (Payment)Configuration.ApiClient.Deserialize(localVarResponse, typeof(Payment))));
        }