private Request GetStandaloneCreditsInternal(StandaloneCredits standalonescredits, Filter filter)
        {
            Dictionary <String, String> queryStr = new Dictionary <String, String>();

            if (standalonescredits != null && !String.IsNullOrWhiteSpace(standalonescredits.MerchantRefNum()))
            {
                queryStr.Add("merchantRefNum", standalonescredits.MerchantRefNum());
            }
            if (filter != null)
            {
                if (filter.Limit != null)
                {
                    queryStr.Add("limit", filter.Limit.ToString());
                }
                if (filter.Offset != null)
                {
                    queryStr.Add("offset", filter.Offset.ToString());
                }
                if (!String.IsNullOrWhiteSpace(filter.StartDate))
                {
                    queryStr.Add("startDate", filter.StartDate);
                }
                if (!String.IsNullOrWhiteSpace(filter.EndDate))
                {
                    queryStr.Add("endDate", filter.EndDate);
                }
            }

            return(new Request(
                       method: RequestType.Get,
                       uri: PrepareUri(_client.Account() + "/standalonecredits"),
                       queryString: queryStr
                       ));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create submit for Standalone Credits
        /// </summary>
        /// <param name="submit">submit</param>
        /// <returns>StandaloneCredits</returns>
        public StandaloneCredits Submit(StandaloneCredits standalonecredits)
        {
            standalonecredits.SetRequiredFields(new List <string> {
                GlobalConstants.MerchantRefNum,
                GlobalConstants.Amount,
            });
            standalonecredits.CheckRequiredFields();
            standalonecredits.SetOptionalFields(new List <string> {
                GlobalConstants.CustomerIp,
                GlobalConstants.DupCheck,
                GlobalConstants.Ach,
                GlobalConstants.Bacs,
                GlobalConstants.Eft,
                GlobalConstants.BillingDetails,
                GlobalConstants.Profile,
            });
            Request request = new Request(
                method: RequestType.Post,
                uri: PrepareUri(_client.Account() + "/standalonecredits"),
                body: standalonecredits
                );
            dynamic response = _client.ProcessRequest(request);

            return(new StandaloneCredits(response));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create cancel for Standalone Credits
        /// </summary>
        /// <param name="cancel">cancel</param>
        /// <returns>StandaloneCredits</returns>
        public StandaloneCredits Cancel(StandaloneCredits standalonecredits)
        {
            standalonecredits.SetRequiredFields(new List <string> {
                GlobalConstants.Status,
                GlobalConstants.Id
            });
            standalonecredits.CheckRequiredFields();
            standalonecredits.SetOptionalFields(new List <string> {
                GlobalConstants.Ach,
                GlobalConstants.Bacs,
                GlobalConstants.Eft,
            });

            Request request = new Request(
                method: RequestType.Put,
                uri: PrepareUri(_client.Account() + "/standalonecredits/" + standalonecredits.Id()),
                body: standalonecredits
                );
            dynamic response = _client.ProcessRequest(request);

            StandaloneCredits returnVal = new StandaloneCredits(response);

            returnVal.Id(standalonecredits.Id());
            return(returnVal);
        }
        /// <summary>
        /// Create get
        /// </summary>
        /// <param name="get">get</param>
        /// <returns>StandaloneCredits</returns>
        public StandaloneCredits Get(StandaloneCredits standalonescredits)
        {
            var     request  = GetInternal(standalonescredits);
            dynamic response = _client.ProcessRequest(request);

            return(new StandaloneCredits(response));
        }
        public async Task <Pagerator <StandaloneCredits> > GetStandaloneCreditsAsync(StandaloneCredits standalonescredits = null, Filter filter = null)
        {
            var     request  = GetStandaloneCreditsInternal(standalonescredits, filter);
            dynamic response = await _client.ProcessRequestAsync(request);

            return(new Pagerator <StandaloneCredits>(_client, typeof(StandaloneCredits), response));
        }
        public async Task <StandaloneCredits> GetAsync(StandaloneCredits standalonescredits)
        {
            var     request  = GetInternal(standalonescredits);
            dynamic response = await _client.ProcessRequestAsync(request);

            return(new StandaloneCredits(response));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Create submit for Standalone Credits
        /// </summary>
        /// <param name="submit">submit</param>
        /// <returns>StandaloneCredits</returns>
        public StandaloneCredits submit(StandaloneCredits standalonecredits)
        {
            standalonecredits.setRequiredFields(new List <string> {
                DirectDebitConstants.merchantRefNum,
                DirectDebitConstants.amount,
            });
            standalonecredits.checkRequiredFields();
            standalonecredits.setOptionalFields(new List <string> {
                DirectDebitConstants.customerIp,
                DirectDebitConstants.dupCheck,
                DirectDebitConstants.ach,
                DirectDebitConstants.bacs,
                DirectDebitConstants.eft,
                DirectDebitConstants.billingDetails,
                DirectDebitConstants.profile,
            });
            Request request = new Request(
                method: RequestType.POST,
                uri: this.prepareURI(client.account() + "/standalonecredits"),
                body: standalonecredits
                );
            dynamic response = this.client.processRequest(request);

            return(new StandaloneCredits(response));
        }
Exemplo n.º 8
0
        /// <summary>
        /// Create cancel for Standalone Credits
        /// </summary>
        /// <param name="cancel">cancel</param>
        /// <returns>StandaloneCredits</returns>
        public StandaloneCredits cancel(StandaloneCredits standalonecredits)
        {
            standalonecredits.setRequiredFields(new List <string> {
                DirectDebitConstants.status,
                DirectDebitConstants.id
            });
            standalonecredits.checkRequiredFields();
            standalonecredits.setOptionalFields(new List <string> {
                DirectDebitConstants.ach,
                DirectDebitConstants.bacs,
                DirectDebitConstants.eft,
            });

            Request request = new Request(
                method: RequestType.PUT,
                uri: this.prepareURI(client.account() + "/standalonecredits/" + standalonecredits.id()),
                body: standalonecredits
                );
            dynamic response = this.client.processRequest(request);

            StandaloneCredits returnVal = new StandaloneCredits(response);

            returnVal.id(standalonecredits.id());
            return(returnVal);
        }
        public async Task <StandaloneCredits> CancelAsync(StandaloneCredits standalonecredits)
        {
            var     request  = CancelInternal(standalonecredits);
            dynamic response = await _client.ProcessRequestAsync(request);

            StandaloneCredits returnVal = new StandaloneCredits(response);

            returnVal.Id(standalonecredits.Id());
            return(returnVal);
        }
        /// <summary>
        /// Create cancel for Standalone Credits
        /// </summary>
        /// <param name="cancel">cancel</param>
        /// <returns>StandaloneCredits</returns>
        public StandaloneCredits Cancel(StandaloneCredits standalonecredits)
        {
            var     request  = CancelInternal(standalonecredits);
            dynamic response = _client.ProcessRequest(request);

            StandaloneCredits returnVal = new StandaloneCredits(response);

            returnVal.Id(standalonecredits.Id());
            return(returnVal);
        }
 private Request GetInternal(StandaloneCredits standalonescredits)
 {
     standalonescredits.SetRequiredFields(new List <string> {
         GlobalConstants.Id,
     });
     standalonescredits.CheckRequiredFields();
     standalonescredits.SetOptionalFields(new List <string> {
         GlobalConstants.Ach,
         GlobalConstants.Bacs,
         GlobalConstants.Eft,
     });
     return(new Request(
                method: RequestType.Get,
                uri: PrepareUri(_client.Account() + "/standalonecredits/" + standalonescredits.Id()),
                body: standalonescredits
                ));
 }
Exemplo n.º 12
0
        /// <summary>
        /// Get matching StandaloneCredits
        /// </summary>
        /// <param name="standalonescredits"></param>
        /// <param name="filter"></param>
        /// <returns></returns>
        public Pagerator <StandaloneCredits> GetStandaloneCredits(StandaloneCredits standalonescredits = null, Filter filter = null)
        {
            Dictionary <String, String> queryStr = new Dictionary <String, String>();

            if (standalonescredits != null && !String.IsNullOrWhiteSpace(standalonescredits.MerchantRefNum()))
            {
                queryStr.Add("merchantRefNum", standalonescredits.MerchantRefNum());
            }
            if (filter != null)
            {
                if (filter.Limit != null)
                {
                    queryStr.Add("limit", filter.Limit.ToString());
                }
                if (filter.Offset != null)
                {
                    queryStr.Add("offset", filter.Offset.ToString());
                }
                if (!String.IsNullOrWhiteSpace(filter.StartDate))
                {
                    queryStr.Add("startDate", filter.StartDate);
                }
                if (!String.IsNullOrWhiteSpace(filter.EndDate))
                {
                    queryStr.Add("endDate", filter.EndDate);
                }
            }

            Request request = new Request(
                method: RequestType.Get,
                uri: PrepareUri(_client.Account() + "/standalonecredits"),
                queryString: queryStr
                );

            dynamic response = _client.ProcessRequest(request);

            return(new Pagerator <StandaloneCredits>(_client, typeof(StandaloneCredits), response));
        }
 private Request SubmitInternal(StandaloneCredits standalonecredits)
 {
     standalonecredits.SetRequiredFields(new List <string>
     {
         GlobalConstants.MerchantRefNum,
         GlobalConstants.Amount,
     });
     standalonecredits.CheckRequiredFields();
     standalonecredits.SetOptionalFields(new List <string>
     {
         GlobalConstants.CustomerIp,
         GlobalConstants.DupCheck,
         GlobalConstants.Ach,
         GlobalConstants.Bacs,
         GlobalConstants.Eft,
         GlobalConstants.BillingDetails,
         GlobalConstants.Profile,
     });
     return(new Request(
                method: RequestType.Post,
                uri: PrepareUri(_client.Account() + "/standalonecredits"),
                body: standalonecredits
                ));
 }