Exemplo n.º 1
0
 def _fetch_merchant_accounts(self, current_page):
     response = self.config.http().get(self.config.base_merchant_path() +
                                       "/merchant_accounts/?page=" +
                                       str(current_page))
     body = response["merchant_accounts"]
     merchant_accounts = [
         MerchantAccount(self.gateway, merchant_account)
         for merchant_account in ResourceCollection._extract_as_array(
             body, "merchant_account")
     ]
     return PaginatedResult(body["total_items"], body["page_size"],
                            merchant_accounts)
Exemplo n.º 2
0
    def __fetch_disputes(self, page):
        response = self.config.http().post(
            self.config.base_merchant_path() +
            "/disputes/advanced_search?page=" + str(page),
            {"search": self.search_criteria})
        body = response["disputes"]

        disputes = [
            Dispute(item) for item in ResourceCollection._extract_as_array(
                response["disputes"], "dispute")
        ]
        return PaginatedResult(body["total_items"], body["page_size"],
                               disputes)