diff --git a/hosting/management/commands/fetch_stripe_bills.py b/hosting/management/commands/fetch_stripe_bills.py index 2a37ed61..e321179d 100644 --- a/hosting/management/commands/fetch_stripe_bills.py +++ b/hosting/management/commands/fetch_stripe_bills.py @@ -35,7 +35,7 @@ class Command(BaseCommand): all_invoices_response = stripe_utils.get_all_invoices( user.stripecustomer.stripe_id, - created=created_gt + created_gt=created_gt ) if all_invoices_response['error'] is not None: self.stdout.write(self.style.ERROR(all_invoices_response['error'])) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index b43470fa..577eab80 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -123,19 +123,19 @@ class StripeUtils(object): return card_details @handleStripeError - def get_all_invoices(self, customer_id, created): + def get_all_invoices(self, customer_id, created_gt): return_list = [] has_more_invoices = True starting_after = False while has_more_invoices: if starting_after: invoices = stripe.Invoice.list( - limit=10, customer=customer_id, created=created, + limit=10, customer=customer_id, created={'gt': created_gt}, starting_after=starting_after ) else: invoices = stripe.Invoice.list( - limit=10, customer=customer_id, created=created + limit=10, customer=customer_id, created={'gt': created_gt} ) has_more_invoices = invoices.has_more for invoice in invoices.data: