本文整理汇总了Python中braintree.resource_collection.ResourceCollection._extract_as_array方法的典型用法代码示例。如果您正苦于以下问题:Python ResourceCollection._extract_as_array方法的具体用法?Python ResourceCollection._extract_as_array怎么用?Python ResourceCollection._extract_as_array使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类braintree.resource_collection.ResourceCollection
的用法示例。
在下文中一共展示了ResourceCollection._extract_as_array方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __fetch
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")
]
示例2: __fetch
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")
]
示例3: __fetch_existing_between
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")
]
示例4: __fetch
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")
示例5: __fetch
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")
]
示例6: __fetch
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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]
示例7: all
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")]
示例8: all
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")]
示例9: __fetch_verifications
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")]
示例10: __fetch
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")]
示例11: all
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")]
示例12: all
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")]
示例13: _fetch_merchant_accounts
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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)
示例14: __fetch_expired
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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")]
示例15: __fetch_disputes
# 需要导入模块: from braintree.resource_collection import ResourceCollection [as 别名]
# 或者: from braintree.resource_collection.ResourceCollection import _extract_as_array [as 别名]
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)