Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
stripe: Pass ids, not objects, to pagination API.
Anders Kaseorg385cd038b068
diff --git a/corporate/lib/stripe.py b/corporate/lib/stripe.pyindex 2671854e70b..d883f491e29 100644--- a/corporate/lib/stripe.py+++ b/corporate/lib/stripe.py@@ -5264,8 +5264,9 @@ def get_all_invoices_for_customer(customer: Customer) -> Generator[stripe.Invoicfor invoice in invoices:yield invoicelast_invoice = invoice+ assert last_invoice.id is not Noneinvoices = stripe.Invoice.list(- customer=customer.stripe_customer_id, starting_after=last_invoice, limit=100+ customer=customer.stripe_customer_id, starting_after=last_invoice.id, limit=100)diff --git a/corporate/tests/test_stripe.py b/corporate/tests/test_stripe.pyindex d37d0d47593..2472ef7b2c5 100644--- a/corporate/tests/test_stripe.py+++ b/corporate/tests/test_stripe.py@@ -557,7 +557,9 @@ class StripeTestCase(ZulipTestCase):def send_stripe_webhook_events(self, most_recent_event: stripe.Event) -> None:while True:- events_old_to_new = list(reversed(stripe.Event.list(ending_before=most_recent_event)))+ events_old_to_new = list(+ reversed(stripe.Event.list(ending_before=most_recent_event.id))+ )if len(events_old_to_new) == 0:breakfor event in events_old_to_new: