Set preferred field as in card_details
This commit is contained in:
parent
8759e2a4b5
commit
d14a643171
1 changed files with 5 additions and 1 deletions
|
@ -254,6 +254,9 @@ class UserCardDetail(AssignPermissionsMixin, models.Model):
|
|||
exp_year=card_details['exp_year']
|
||||
)
|
||||
except UserCardDetail.DoesNotExist:
|
||||
preferred = False
|
||||
if 'preferred' in card_details:
|
||||
preferred = card_details['preferred']
|
||||
card_detail = UserCardDetail.create(
|
||||
stripe_customer=stripe_customer,
|
||||
last4=card_details['last4'],
|
||||
|
@ -261,7 +264,8 @@ class UserCardDetail(AssignPermissionsMixin, models.Model):
|
|||
fingerprint=card_details['fingerprint'],
|
||||
exp_month=card_details['exp_month'],
|
||||
exp_year=card_details['exp_year'],
|
||||
card_id=card_details['card_id']
|
||||
card_id=card_details['card_id'],
|
||||
preferred=preferred
|
||||
)
|
||||
return card_detail
|
||||
|
||||
|
|
Loading…
Reference in a new issue