mirror of https://github.com/zulip/zulip.git
stripe: Pass ids, not objects, to pagination API.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
9ca64b21f3
commit
385cd038b0
|
@ -5264,8 +5264,9 @@ def get_all_invoices_for_customer(customer: Customer) -> Generator[stripe.Invoic
|
|||
for invoice in invoices:
|
||||
yield invoice
|
||||
last_invoice = invoice
|
||||
assert last_invoice.id is not None
|
||||
invoices = 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
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -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:
|
||||
break
|
||||
for event in events_old_to_new:
|
||||
|
|
Loading…
Reference in New Issue