From 80e618eed0eebf4f8072ec87b8e7db99b57008b3 Mon Sep 17 00:00:00 2001 From: bonidjukic Date: Sun, 9 Sep 2018 16:32:37 +0200 Subject: [PATCH] Fix stripe/pinax-stripe versions mismatch bug --- pinax/stripe/actions/charges.py | 5 ++++- pinax/stripe/actions/invoices.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pinax/stripe/actions/charges.py b/pinax/stripe/actions/charges.py index 375f8ffda..41fd1394a 100644 --- a/pinax/stripe/actions/charges.py +++ b/pinax/stripe/actions/charges.py @@ -160,7 +160,10 @@ def sync_charges_for_customer(customer): Args: customer: a pinax.stripe.models.Customer object """ - for charge in customer.stripe_customer.charges().data: + charges = stripe.Charge.list( + settings.PINAX_STRIPE_SECRET_KEY, + customer=customer.stripe_customer.stripe_id) + for charge in charges.data: sync_charge_from_stripe_data(charge) diff --git a/pinax/stripe/actions/invoices.py b/pinax/stripe/actions/invoices.py index 100b621c7..cf5b5743b 100644 --- a/pinax/stripe/actions/invoices.py +++ b/pinax/stripe/actions/invoices.py @@ -131,7 +131,10 @@ def sync_invoices_for_customer(customer): Args: customer: the customer for whom to synchronize all invoices """ - for invoice in customer.stripe_customer.invoices().data: + invoices = stripe.Invoice.list( + settings.PINAX_STRIPE_SECRET_KEY, + customer=customer.stripe_customer.stripe_id) + for invoice in invoices.data: sync_invoice_from_stripe_data(invoice, send_receipt=False)