You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List all balance transactions related to a customer, potentially within a specified time frame.
Potential solutions
Querying BalanceTransaction database is not easy since there is no customer field for this class. This class does have a source, but this is not a ForeignKey so I cannot query by something like source.customer.id = request.user.customer.id. It is possible to check BalanceTransaction.get_source_instance().customer after retrieving all transactions, but that would be very inefficient.
Stripe provides an API for list customer balance transaction, which returns a list of balance transactions. However, using this API means that I will have to query stripe directly, ignoring all BalanceTransactions that are already available locally.
Perhaps dj-stripe can provide a function Customer.list_balance_transactions?
The text was updated successfully, but these errors were encountered:
What are you trying to accomplish?
List all balance transactions related to a customer, potentially within a specified time frame.
Potential solutions
Querying
BalanceTransaction
database is not easy since there is nocustomer
field for this class. This class does have asource
, but this is not aForeignKey
so I cannot query by something likesource.customer.id = request.user.customer.id
. It is possible to checkBalanceTransaction.get_source_instance().customer
after retrieving all transactions, but that would be very inefficient.Stripe provides an API for list customer balance transaction, which returns a list of balance transactions. However, using this API means that I will have to query
stripe
directly, ignoring allBalanceTransactions
that are already available locally.Perhaps
dj-stripe
can provide a functionCustomer.list_balance_transactions
?The text was updated successfully, but these errors were encountered: