Exemplo n.º 1
0
        private List<Customer> FetchCustomers(String[] ids)
        {
            IdsSearchRequest query = new IdsSearchRequest().
                Ids.IncludedIn(ids);

            NodeWrapper response = new NodeWrapper(Service.Post("/customers/advanced_search", query));

            List<Customer> customers = new List<Customer>();
            foreach (NodeWrapper node in response.GetList("customer"))
            {
                customers.Add(new Customer(node, Service));
            }
            return customers;
        }
Exemplo n.º 2
0
        public virtual ResourceCollection<CreditCard> Expired()
        {
            NodeWrapper response = new NodeWrapper(Service.Post("/payment_methods/all/expired_ids"));

            return new ResourceCollection<CreditCard>(response, delegate(String[] ids) {
                IdsSearchRequest query = new IdsSearchRequest().
                    Ids.IncludedIn(ids);

                NodeWrapper fetchResponse = new NodeWrapper(Service.Post("/payment_methods/all/expired", query));

                List<CreditCard> creditCards = new List<CreditCard>();
                foreach (NodeWrapper node in fetchResponse.GetList("credit-card"))
                {
                    creditCards.Add(new CreditCard(node, Service));
                }
                return creditCards;
            });
        }
Exemplo n.º 3
0
        public virtual ResourceCollection <CreditCard> Expired()
        {
            var response = new NodeWrapper(service.Post(service.MerchantPath() + "/payment_methods/all/expired_ids"));

            return(new ResourceCollection <CreditCard>(response, delegate(string[] ids) {
                var query = new IdsSearchRequest().
                            Ids.IncludedIn(ids);

                var fetchResponse = new NodeWrapper(service.Post(service.MerchantPath() + "/payment_methods/all/expired", query));

                var creditCards = new List <CreditCard>();
                foreach (var node in fetchResponse.GetList("credit-card"))
                {
                    creditCards.Add(new CreditCard(node, gateway));
                }
                return creditCards;
            }));
        }
        public virtual ResourceCollection<CreditCard> Expired()
        {
            var response = new NodeWrapper(service.Post(service.MerchantPath() + "/payment_methods/all/expired_ids"));

            return new ResourceCollection<CreditCard>(response, delegate(string[] ids) {
                var query = new IdsSearchRequest().
                    Ids.IncludedIn(ids);

                var fetchResponse = new NodeWrapper(service.Post(service.MerchantPath() + "/payment_methods/all/expired", query));

                var creditCards = new List<CreditCard>();
                foreach (var node in fetchResponse.GetList("credit-card"))
                {
                    creditCards.Add(new CreditCard(node, gateway));
                }
                return creditCards;
            });
        }
Exemplo n.º 5
0
        public virtual ResourceCollection <CreditCard> Expired()
        {
            NodeWrapper response = new NodeWrapper(Service.Post("/payment_methods/all/expired_ids"));

            return(new ResourceCollection <CreditCard>(response, delegate(String[] ids) {
                IdsSearchRequest query = new IdsSearchRequest().
                                         Ids.IncludedIn(ids);

                NodeWrapper fetchResponse = new NodeWrapper(Service.Post("/payment_methods/all/expired", query));

                List <CreditCard> creditCards = new List <CreditCard>();
                foreach (NodeWrapper node in fetchResponse.GetList("credit-card"))
                {
                    creditCards.Add(new CreditCard(node, Service));
                }
                return creditCards;
            }));
        }
Exemplo n.º 6
0
        public virtual ResourceCollection<CreditCard> ExpiringBetween(DateTime start, DateTime end)
        {
            String queryString = String.Format("start={0:MMyyyy}&end={1:MMyyyy}", start, end);

            NodeWrapper response = new NodeWrapper(Service.Post("/payment_methods/all/expiring_ids?" + queryString));

            return new ResourceCollection<CreditCard>(response, delegate(String[] ids) {
                IdsSearchRequest query = new IdsSearchRequest().
                    Ids.IncludedIn(ids);

                NodeWrapper fetchResponse = new NodeWrapper(Service.Post("/payment_methods/all/expiring?" + queryString, query));

                List<CreditCard> creditCards = new List<CreditCard>();
                foreach (NodeWrapper node in fetchResponse.GetList("credit-card"))
                {
                    creditCards.Add(new CreditCard(node, Service));
                }
                return creditCards;
            });
        }
Exemplo n.º 7
0
        public virtual async Task <ResourceCollection <CreditCard> > ExpiringBetweenAsync(DateTime start, DateTime end)
        {
            string queryString = string.Format("start={0:MMyyyy}&end={1:MMyyyy}", start, end);

            var response = new NodeWrapper(await service.PostAsync(service.MerchantPath() + "/payment_methods/all/expiring_ids?" + queryString).ConfigureAwait(false));

            return(new ResourceCollection <CreditCard>(response, delegate(string[] ids) {
                var query = new IdsSearchRequest().
                            Ids.IncludedIn(ids);

                var fetchResponse = new NodeWrapper(service.Post(service.MerchantPath() + "/payment_methods/all/expiring?" + queryString, query));

                var creditCards = new List <CreditCard>();
                foreach (var node in fetchResponse.GetList("credit-card"))
                {
                    creditCards.Add(new CreditCard(node, gateway));
                }
                return creditCards;
            }));
        }
Exemplo n.º 8
0
        public virtual ResourceCollection <CreditCard> ExpiringBetween(DateTime start, DateTime end)
        {
            String queryString = String.Format("start={0:MMyyyy}&end={1:MMyyyy}", start, end);

            NodeWrapper response = new NodeWrapper(Service.Post("/payment_methods/all/expiring_ids?" + queryString));

            return(new ResourceCollection <CreditCard>(response, delegate(String[] ids) {
                IdsSearchRequest query = new IdsSearchRequest().
                                         Ids.IncludedIn(ids);

                NodeWrapper fetchResponse = new NodeWrapper(Service.Post("/payment_methods/all/expiring?" + queryString, query));

                List <CreditCard> creditCards = new List <CreditCard>();
                foreach (NodeWrapper node in fetchResponse.GetList("credit-card"))
                {
                    creditCards.Add(new CreditCard(node, Service));
                }
                return creditCards;
            }));
        }
Exemplo n.º 9
0
        public virtual ResourceCollection <CreditCard> ExpiringBetween(DateTime start, DateTime end)
        {
            string queryString = $"start={start:MMyyyy}&end={end:MMyyyy}";

            var response = new NodeWrapper(service.Post(service.MerchantPath() + "/payment_methods/all/expiring_ids?" + queryString));

            return(new ResourceCollection <CreditCard>(response, delegate(string[] ids) {
                var query = new IdsSearchRequest().
                            Ids.IncludedIn(ids);

                var fetchResponse = new NodeWrapper(service.Post(service.MerchantPath() + "/payment_methods/all/expiring?" + queryString, query));

                var creditCards = new List <CreditCard>();
                foreach (var node in fetchResponse.GetList("credit-card"))
                {
                    creditCards.Add(new CreditCard(node, gateway));
                }
                return creditCards;
            }));
        }