diff --git a/stubs/stripe/__init__.pyi b/stubs/stripe/__init__.pyi index d39c268459..3563c53a56 100644 --- a/stubs/stripe/__init__.pyi +++ b/stubs/stripe/__init__.pyi @@ -23,7 +23,7 @@ class Customer: ... @staticmethod - def save(idempotency_key: str) -> Customer: + def save() -> Customer: ... class Invoice: diff --git a/zilencer/lib/stripe.py b/zilencer/lib/stripe.py index ee26ef33fb..bfdbe423f7 100644 --- a/zilencer/lib/stripe.py +++ b/zilencer/lib/stripe.py @@ -165,9 +165,7 @@ def do_replace_payment_source(user: UserProfile, stripe_token: str) -> stripe.Cu # Deletes existing card: https://stripe.com/docs/api#update_customer-source # This can also have other side effects, e.g. it will try to pay certain past-due # invoices: https://stripe.com/docs/api#update_customer - updated_stripe_customer = stripe_customer.save( - # stripe_token[:4] = 'tok_', so 8 characters of entropy - idempotency_key='do_replace_payment_source:%s' % (stripe_token[:12])) + updated_stripe_customer = stripe_customer.save() RealmAuditLog.objects.create( realm=user.realm, acting_user=user, event_type=RealmAuditLog.STRIPE_CARD_ADDED, event_time=timezone_now())