Set default card for newly added card in hosting flow
This commit is contained in:
parent
a17a5f66bc
commit
4be105a0a9
1 changed files with 5 additions and 1 deletions
|
@ -915,10 +915,14 @@ class OrdersHostingDetailView(LoginRequiredMixin,
|
|||
json.dumps(response), content_type="application/json"
|
||||
)
|
||||
if 'token' in request.session:
|
||||
UserCardDetail.get_or_create_user_card_detail(
|
||||
ucd = UserCardDetail.get_or_create_user_card_detail(
|
||||
stripe_customer=self.request.user.stripecustomer,
|
||||
card_details=card_details_response
|
||||
)
|
||||
ucd.save_default_card(
|
||||
self.request.user.stripecustomer.stripe_id,
|
||||
card_details_response['card_id']
|
||||
)
|
||||
user = {
|
||||
'name': self.request.user.name,
|
||||
'email': self.request.user.email,
|
||||
|
|
Loading…
Reference in a new issue