当前位置: 首页>>代码示例>>Python>>正文


Python resource_collection.ResourceCollection类代码示例

本文整理汇总了Python中braintree.resource_collection.ResourceCollection的典型用法代码示例。如果您正苦于以下问题:Python ResourceCollection类的具体用法?Python ResourceCollection怎么用?Python ResourceCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ResourceCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __fetch

 def __fetch(query, ids):
     criteria = Transaction.__criteria(query)
     criteria["ids"] = braintree.transaction_search.TransactionSearch.ids.in_list(ids).to_param()
     response = Http().post("/transactions/advanced_search", {"search": criteria})
     return [
         Transaction(item)
         for item in ResourceCollection._extract_as_array(response["credit_card_transactions"], "transaction")
     ]
开发者ID:szaboat,项目名称:braintree_python_examples,代码行数:8,代码来源:transaction.py

示例2: __fetch

 def __fetch(self, query, ids):
     criteria = self.__criteria(query)
     criteria["ids"] = braintree.subscription_search.SubscriptionSearch.ids.in_list(ids).to_param()
     response = self.config.http().post("/subscriptions/advanced_search", {"search": criteria})
     return [
         Subscription(self.gateway, item)
         for item in ResourceCollection._extract_as_array(response["subscriptions"], "subscription")
     ]
开发者ID:Getaround,项目名称:braintree_python,代码行数:8,代码来源:subscription_gateway.py

示例3: __fetch_existing_between

 def __fetch_existing_between(self, query, ids):
     criteria = {}
     criteria["ids"] = IdsSearch.ids.in_list(ids).to_param()
     response = self.config.http().post("/payment_methods/all/expiring?" + query, {"search": criteria})
     return [
         CreditCard(self.gateway, item)
         for item in ResourceCollection._extract_as_array(response["payment_methods"], "credit_card")
     ]
开发者ID:omixen,项目名称:braintree_python,代码行数:8,代码来源:credit_card_gateway.py

示例4: __fetch

 def __fetch(self, query, ids):
     criteria = self.__criteria(query)
     criteria["ids"] = braintree.transaction_search.TransactionSearch.ids.in_list(ids).to_param()
     response = self.config.http().post(self.config.base_merchant_path() + "/transactions/advanced_search", {"search": criteria})
     if "credit_card_transactions" in response:
         return [Transaction(self.gateway, item) for item in ResourceCollection._extract_as_array(response["credit_card_transactions"], "transaction")]
     else:
         raise DownForMaintenanceError("search timeout")
开发者ID:braintree,项目名称:braintree_python,代码行数:8,代码来源:transaction_gateway.py

示例5: __fetch

 def __fetch(self, query, ids):
     criteria = self.__criteria(query)
     criteria["ids"] = braintree.customer_search.CustomerSearch.ids.in_list(ids).to_param()
     response = self.config.http().post("/customers/advanced_search", {"search": criteria})
     return [
         Customer(self.gateway, item)
         for item in ResourceCollection._extract_as_array(response["customers"], "customer")
     ]
开发者ID:blueprinthealth,项目名称:braintree_python,代码行数:8,代码来源:customer_gateway.py

示例6: __fetch

    def __fetch(self, query, ids):
        criteria = self.__criteria(query)

        criteria["ids"] = UsBankAccountVerificationSearch.ids.in_list(ids).to_param()

        response = self.config.http().post(
            self.config.base_merchant_path() + "/us_bank_account_verifications/advanced_search",
            {"search": criteria}
        )

        collection_array = ResourceCollection._extract_as_array(
            response["us_bank_account_verifications"],
            "us_bank_account_verification"
        )

        return [UsBankAccountVerification(self.gateway, item) for item in collection_array]
开发者ID:braintree,项目名称:braintree_python,代码行数:16,代码来源:us_bank_account_verification_gateway.py

示例7: all

 def all(self):
     response = self.config.http().get("/discounts/")
     discounts = {"discount": response["discounts"]}
     return [Discount(self.gateway, item) for item in ResourceCollection._extract_as_array(discounts, "discount")]
开发者ID:DongHuaLu,项目名称:mdcom,代码行数:4,代码来源:discount_gateway.py

示例8: all

 def all(self):
     response = self.config.http().get("/add_ons/")
     add_ons = {"add_on": response["add_ons"]}
     return [AddOn(self.gateway, item) for item in ResourceCollection._extract_as_array(add_ons, "add_on")]
开发者ID:DongHuaLu,项目名称:mdcom,代码行数:4,代码来源:add_on_gateway.py

示例9: __fetch_verifications

 def __fetch_verifications(self, query, verification_ids):
     criteria = {}
     criteria["ids"] = IdsSearch.ids.in_list(verification_ids).to_param()
     response = self.config.http().post(self.config.base_merchant_path() + "/verifications/advanced_search", {"search": criteria})
     return [CreditCardVerification(self.gateway, item) for item in ResourceCollection._extract_as_array(response["credit_card_verifications"], "verification")]
开发者ID:atulparmar,项目名称:braintree_python,代码行数:5,代码来源:credit_card_verification_gateway.py

示例10: __fetch

 def __fetch(self, query, ids):
     criteria = self.__criteria(query)
     criteria["ids"] = CreditCardVerificationSearch.ids.in_list(ids).to_param()
     response = self.config.http().post("/verifications/advanced_search", {"search": criteria})
     return [CreditCardVerification(self.gateway, item) for item in
             ResourceCollection._extract_as_array(response["credit_card_verifications"], "verification")]
开发者ID:quantm,项目名称:custom_django_oscar,代码行数:6,代码来源:credit_card_verification_gateway.py

示例11: all

 def all(self):
     response = self.config.http().get(self.config.base_merchant_path() + "/plans/")
     return [Plan(self.gateway, item) for item in ResourceCollection._extract_as_array(response, "plans")]
开发者ID:LikeALocal,项目名称:braintree_python,代码行数:3,代码来源:plan_gateway.py

示例12: all

 def all(self):
     response = self.config.http().get("/plans/")
     plans = {"plan": response["plans"]}
     return [Plan(self.gateway, item) for item in ResourceCollection._extract_as_array(plans, "plan")]
开发者ID:MichaelBlume,项目名称:braintree_python,代码行数:4,代码来源:plan_gateway.py

示例13: _fetch_merchant_accounts

 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)
开发者ID:braintree,项目名称:braintree_python,代码行数:5,代码来源:merchant_account_gateway.py

示例14: __fetch_expired

 def __fetch_expired(query, ids):
     criteria = {}
     criteria["ids"] = IdsSearch.ids.in_list(ids).to_param()
     response = Http().post("/payment_methods/all/expired", {"search": criteria})
     return [CreditCard(item) for item in ResourceCollection._extract_as_array(response["payment_methods"], "credit_card")]
开发者ID:algae,项目名称:braintree_python_examples,代码行数:5,代码来源:credit_card.py

示例15: __fetch_disputes

    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)
开发者ID:braintree,项目名称:braintree_python,代码行数:6,代码来源:dispute_gateway.py


注:本文中的braintree.resource_collection.ResourceCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。