chargeafter-rnd_chargeafter-plugin-for-nopcommerce/Nop.Plugin.Payments.ChargeAfter/Charges/ChargeCaptureRequest.cs
using System;
using System.IO;
using System.Net.Http;
using Nop.Plugin.Payments.ChargeAfter.Core.Http;
using Nop.Plugin.Payments.ChargeAfter.Payments;

namespace Nop.Plugin.Payments.ChargeAfter.Charges
{
    public class ChargeCaptureRequest : HttpRequest
    {
        public ChargeCaptureRequest(string ChargeId) : base("/post-sale/charges/{charge_id}/settles", HttpMethod.Post, typeof(ChargeCapture))
        {
            try
            {
                this.Path = this.Path.Replace("{charge_id}", Uri.EscapeDataString(Convert.ToString(ChargeId)));
            }
            catch (IOException) { }

            this.ContentType = "application/json";
        }

        public ChargeCaptureRequest RequestBody(CaptureRequest captureRequest)
        {
            this.Body = captureRequest;
            return this;
        }
    }
}
