private Request RefundInternal(Refund newRefund)
        {
            newRefund.SetRequiredFields(new List <string> {
                GlobalConstants.SettlementId
            });
            newRefund.CheckRequiredFields();
            newRefund.SetRequiredFields(new List <string> {
                GlobalConstants.MerchantRefNum
            });
            newRefund.SetOptionalFields(new List <string> {
                GlobalConstants.Amount,
                GlobalConstants.DupCheck
            });

            return(new Request(
                       method: RequestType.Post,
                       uri: PrepareUri("/settlements/" + newRefund.SettlementId() + "/refunds"),
                       body: newRefund
                       ));
        }
        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())
                       ));
        }
Example #3
0
        /// <summary>
        /// Refund
        /// </summary>
        /// <param name="refund">Refund</param>
        /// <returns>Refund</returns>
        public Refund Refund(Refund newRefund)
        {
            newRefund.SetRequiredFields(new List <string> {
                GlobalConstants.SettlementId
            });
            newRefund.CheckRequiredFields();
            newRefund.SetRequiredFields(new List <string> {
                GlobalConstants.MerchantRefNum
            });
            newRefund.SetOptionalFields(new List <string> {
                GlobalConstants.Amount,
                GlobalConstants.DupCheck
            });

            Request request = new Request(
                method: RequestType.Post,
                uri: PrepareUri("/settlements/" + newRefund.SettlementId() + "/refunds"),
                body: newRefund
                );

            dynamic response = _client.ProcessRequest(request);

            return(new Refund(response));
        }
Example #4
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
                       ));
        }
Example #6
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));
        }