如何获取客户(python)的所有交易

How to obtain all transactions of customer (python)

我需要实现一个包含客户所有交易的页面。 在 docs 中写着客户包含 transactions 属性,但在最新版本的 api (3.10.0) 中这不是真的。我怎样才能获得给定客户的所有交易? 我还查看了 api,特别是我发现在 braintree.Transaction class 中有方法 search,但在文档中没有写如何使用它。

@staticmethod
def search(*query):
    return Configuration.gateway().transaction.search(*query)

这个方法有用吗?

谢谢

我在布伦特里工作。感谢您发现文档中的错误。如果您需要更多帮助,请get in touch with our support team.

customer.transactions 方法是 Braintree 文档中的一个错误。你可以 search for transactions using customer id:

search_results = braintree.Transaction.search(
    braintree.TransactionSearch.customer_id == "the_customer_id"
)