Set preferred for the card that's used for a subscription

This commit is contained in:
PCoder 2017-10-28 15:45:05 +02:00
parent 6212c9df50
commit b6d1e8df6b

View file

@ -911,10 +911,10 @@ class OrdersHostingDetailView(LoginRequiredMixin,
' the payment page.') ' the payment page.')
) )
} }
return HttpResponse(json.dumps(response), return HttpResponse(
content_type="application/json") json.dumps(response), content_type="application/json"
)
if 'token' in request.session: if 'token' in request.session:
card_details_response['preferred']=True
UserCardDetail.get_or_create_user_card_detail( UserCardDetail.get_or_create_user_card_detail(
stripe_customer=self.request.user.stripecustomer, stripe_customer=self.request.user.stripecustomer,
card_details=card_details_response card_details=card_details_response