private Request GetInternal(Refund refund)
        {
            refund.SetRequiredFields(new List <string> {
                GlobalConstants.Id
            });
            refund.CheckRequiredFields();

            return(new Request(
                       method: RequestType.Get,
                       uri: PrepareUri("/refunds/" + refund.Id())
                       ));
        }
예제 #2
0
        /// <summary>
        /// Get the Refund
        /// </summary>
        /// <param name="refund">Refund</param>
        /// <returns>Refund</returns>
        public Refund Get(Refund refund)
        {
            refund.SetRequiredFields(new List <string> {
                GlobalConstants.Id
            });
            refund.CheckRequiredFields();

            Request request = new Request(
                method: RequestType.Get,
                uri: PrepareUri("/refunds/" + refund.Id())
                );

            dynamic response = _client.ProcessRequest(request);

            return(new Refund(response));
        }
        private Request CancelRefundInternal(Refund refund)
        {
            refund.SetRequiredFields(new List <string> {
                GlobalConstants.Id
            });
            refund.CheckRequiredFields();

            Refund tmpRefund = new Refund();

            tmpRefund.Status("CANCELLED");

            return(new Request(
                       method: RequestType.Put,
                       uri: PrepareUri("/refunds/" + refund.Id()),
                       body: tmpRefund
                       ));
        }
예제 #4
0
        /// <summary>
        /// Cancel Refund
        /// </summary>
        /// <param name="refund">Refund</param>
        /// <returns>Refund</returns>
        public Refund CancelRefund(Refund refund)
        {
            refund.SetRequiredFields(new List <string> {
                GlobalConstants.Id
            });
            refund.CheckRequiredFields();

            Refund tmpRefund = new Refund();

            tmpRefund.Status("CANCELLED");

            Request request = new Request(
                method: RequestType.Put,
                uri: PrepareUri("/refunds/" + refund.Id()),
                body: tmpRefund
                );

            dynamic response = _client.ProcessRequest(request);

            return(new Refund(response));
        }