-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manage.py sync_customers broken - AttributeError: invoices #582
Comments
Reverting to pinax-stripe 4.3.1 and stripe-python 1.84.2 fixes issue. |
@mcastle If you're interested, this is a quick hack we came up with to be able to support latest Please keep in mind that we only tested the above mentioned BTW, this is the |
@bonidjukic |
The problem is that the tests mock the call out to Basically, a fix would involve replicating the code to fetch all the invoices for the given user, doing the same thing the removed code did: stripe/stripe-python@d416e9e#diff-0399a8a9696e3c2e5288d50b66a3c81cL30 def get_invoices_for_customer(customer):
params = {customer_id: customer.id}
invoices = Invoice.list(customer.api_key, **params)
return invoices |
Here's actually how I solved it, which I also think should be backwards compatible with the previous version of the stripe-python library: def sync_invoices_for_customer(customer):
stripe_customer = customer.stripe_customer
stripe_invoices = stripe.Invoice.list(customer=stripe_customer.id)
for invoice in stripe_invoices.data:
sync_invoice_from_stripe_data(invoice, send_receipt=False) |
The invoices method was removed on the stripe.Customer object in stripe/stripe-python@d416e9e This replaces that same logic to fetch the invoices and sync them and does it within the method itself. This should be backwards compatible with stripe-python < 2.0 as well as the 2.0 and up release. Fixes pinax#582
The invoices method was removed on the stripe.Customer object in stripe/stripe-python@d416e9e This replaces that same logic to fetch the invoices and sync them and does it within the method itself. This should be backwards compatible with stripe-python < 2.0 as well as the 2.0 and up release. Fixes pinax#582
Running manage.py sync_customers is broken and throws an AttributeError: invoices.
I first noticed this after upgrading to pinax-stripe 4.4.0 and stripe-python 2.4.0.
The text was updated successfully, but these errors were encountered: