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
                       ));
        }
Example #2
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));
        }