def search(self, *query):
        if isinstance(query[0], list):
            query = query[0]

        response = self.config.http().post("/customers/advanced_search_ids",
                                           {"search": self.__criteria(query)})
        return ResourceCollection(query, response, self.__fetch)
Exemplo n.º 2
0
 def expiring_between(start_date, end_date):
     """ Return a collection of credit cards expiring between the given dates. """
     formatted_start_date = start_date.strftime("%m%Y")
     formatted_end_date = end_date.strftime("%m%Y")
     query = "start=%s&end=%s" % (formatted_start_date, formatted_end_date)
     response = Http().post("/payment_methods/all/expiring_ids?" + query)
     return ResourceCollection(query, response, CreditCard.__fetch_existing_between)
Exemplo n.º 3
0
 def expiring_between(self, start_date, end_date):
     formatted_start_date = start_date.strftime("%m%Y")
     formatted_end_date = end_date.strftime("%m%Y")
     query = "start=%s&end=%s" % (formatted_start_date, formatted_end_date)
     response = self.config.http().post(
         "/payment_methods/all/expiring_ids?" + query)
     return ResourceCollection(query, response,
                               self.__fetch_existing_between)
Exemplo n.º 4
0
    def search(self, *query):
        if isinstance(query[0], list):
            query = query[0]

        response = self.config.http().post(
            self.config.base_merchant_path() +
            "/verifications/advanced_search_ids",
            {"search": self.__criteria(query)})
        return ResourceCollection(query, response, self.__fetch)
Exemplo n.º 5
0
    def search(self, *query):
        if isinstance(query[0], list):
            query = query[0]

        response = self.config.http().post(self.config.base_merchant_path() + "/transactions/advanced_search_ids", {"search": self.__criteria(query)})
        if "search_results" in response:
            return ResourceCollection(query, response, self.__fetch)
        else:
            raise RequestTimeoutError("search timeout")
    def search(self, *query):
        if isinstance(query[0], list):
            query = query[0]

        response = self.config.http().post("/transactions/advanced_search_ids",
                                           {"search": self.__criteria(query)})
        if "search_results" in response:
            return ResourceCollection(query, response, self.__fetch)
        else:
            raise DownForMaintenanceError("search timeout")
Exemplo n.º 7
0
    def search(query):
        """
        Allows searching on subscriptions. There are two types of fields that are searchable: text and
        multiple value fields. Searchable text fields are:
        - plan_id
        - days_past_due

        Searchable multiple value fields are:
        - status

        For text fields, you can search using the following operators: ==, !=, starts_with, ends_with
        and contains. For mutiple value fields, you can search using the in_list operator. An example::

            braintree.Subscription.search([
                braintree.SubscriptionSearch.plan_id.starts_with("abc"),
                braintree.SubscriptionSearch.days_past_due == "30",
                braintree.SubscriptionSearch.status.in_list([braintree.Subscription.Status.PastDue])
            ])
        """
        response = Http().post("/subscriptions/advanced_search_ids",
                               {"search": Subscription.__criteria(query)})
        return ResourceCollection(query, response, Subscription.__fetch)
Exemplo n.º 8
0
 def expired(self):
     response = self.config.http().post(self.config.base_merchant_path() +
                                        "/payment_methods/all/expired_ids")
     return ResourceCollection(None, response, self.__fetch_expired)
Exemplo n.º 9
0
 def all(self):
     response = self.config.http().post(self.config.base_merchant_path() + "/customers/advanced_search_ids")
     return ResourceCollection({}, response, self.__fetch)
Exemplo n.º 10
0
 def expired():
     """ Return a collection of expired credit cards. """
     response = Http().post("/payment_methods/all/expired_ids")
     return ResourceCollection(None, response, CreditCard.__fetch_expired)
Exemplo n.º 11
0
 def search(query):
     response = Http().post("/transactions/advanced_search_ids",
                            {"search": Transaction.__criteria(query)})
     return ResourceCollection(query, response, Transaction.__fetch)