From a3ce43fd53dec10497d4960f4ae392df53a29a15 Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Sun, 15 Oct 2017 23:32:16 +0200 Subject: [PATCH] Add add_card_to_stripe_customer function --- utils/stripe_utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index 5e0f0646..9dd17b63 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -78,6 +78,10 @@ class StripeUtils(object): customer.source = token customer.save() + def add_card_to_stripe_customer(self, stripe_customer_id, token): + customer = stripe.Customer.retrieve(stripe_customer_id) + self.update_customer_token(customer, token) + @handleStripeError def update_customer_card(self, customer_id, token): customer = stripe.Customer.retrieve(customer_id)