Add add_card_to_stripe_customer function

This commit is contained in:
M.Ravi 2017-10-15 23:32:16 +02:00
parent 83363f4701
commit a3ce43fd53

View file

@ -78,6 +78,10 @@ class StripeUtils(object):
customer.source = token customer.source = token
customer.save() 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 @handleStripeError
def update_customer_card(self, customer_id, token): def update_customer_card(self, customer_id, token):
customer = stripe.Customer.retrieve(customer_id) customer = stripe.Customer.retrieve(customer_id)