From 70beb58339b6ffdc8ca15b7f8b7eaf5c5f512c58 Mon Sep 17 00:00:00 2001 From: Olivier Benz Date: Mon, 20 Dec 2021 09:30:07 +0100 Subject: [PATCH] Fix 'Donate again' - Make it work with latest version of Stripe --- fosspay/blueprints/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fosspay/blueprints/html.py b/fosspay/blueprints/html.py index f1379ca..1e5eeaf 100644 --- a/fosspay/blueprints/html.py +++ b/fosspay/blueprints/html.py @@ -236,7 +236,7 @@ def donate(): db.add(user) else: customer = stripe.Customer.retrieve(user.stripe_customer) - new_source = customer.sources.create(source=stripe_token) + new_source = customer.create_source(user.stripe_customer, source=stripe_token) customer.default_source = new_source.id customer.save()