pinax-stripe-light
pinax-stripe-light copied to clipboard
Cannot sync customers - KeyError Invoices
Issue Summary
Traceback (most recent call last): File "/Users/andy/Desktop/Projects/nufios/nufios_wt/env/lib/python3.7/site-packages/stripe/stripe_object.py", line 83, in getattr return self[k] File "/Users/andy/Desktop/Projects/nufios/nufios_wt/env/lib/python3.7/site-packages/stripe/stripe_object.py", line 122, in getitem raise err File "/Users/andy/Desktop/Projects/nufios/nufios_wt/env/lib/python3.7/site-packages/stripe/stripe_object.py", line 111, in getitem return super(StripeObject, self).getitem(k) KeyError: 'invoices'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./manage.py", line 12, in
If this is a bug instead of a question or feature request, please fill out the sections below.
Steps to Reproduce
This happens upon running ./manage.py sync_customers - not the initial use of it, but once putting in test customers
What were you expecting to happen?
Customers to sync
What actually happened?
The above error message
I am getting the same problem.
Care to fix it? :)
charges.py, change line 163 from:
for charge in customer.stripe_customer.charges().data:
to:
for charge in stripe.Charge.auto_paging_iter(customer=customer.stripe_id):
invoices.py, change line 134 from:
for invoice in customer.stripe_customer.invoices().data:
to:
for invoice in stripe.Invoice.auto_paging_iter(customer=customer.stripe_id):
Please consider creating a PR. I cannot promise it will be merged etc, but would make it easier. (I am not using this feature myself)
I have created PR based on the comment above for that issue as we are also facing the problem. Hope it will help.