Added name parameter for creating StripeCustomer and set description to this

This commit is contained in:
PCoder 2017-08-15 16:05:52 +05:30
commit 3be7fbe2ee
2 changed files with 7 additions and 7 deletions

View file

@ -173,7 +173,6 @@ class StripeCustomer(models.Model):
Check if there is a registered stripe customer with that email
or create a new one
"""
stripe_customer = None
try:
stripe_utils = StripeUtils()
stripe_customer = cls.objects.get(user__email=email)
@ -189,7 +188,7 @@ class StripeCustomer(models.Model):
user = CustomUser.objects.get(email=email)
stripe_utils = StripeUtils()
stripe_data = stripe_utils.create_customer(token, email)
stripe_data = stripe_utils.create_customer(token, email, user.name)
if stripe_data.get('response_object'):
stripe_cus_id = stripe_data.get('response_object').get('id')