Save vat_number after payment is submitted

This commit is contained in:
PCoder 2019-12-17 23:57:15 +05:30
parent 6ea486b527
commit 24edf05e7a
2 changed files with 5 additions and 0 deletions

View file

@ -491,6 +491,9 @@ class PaymentOrderView(FormView):
customer = StripeCustomer.get_or_create( customer = StripeCustomer.get_or_create(
email=this_user.get('email'), token=token email=this_user.get('email'), token=token
) )
request.user.vat_number = address_form.cleaned_data.get(
"vat_number")
request.user.save()
else: else:
user_email = address_form.cleaned_data.get('email') user_email = address_form.cleaned_data.get('email')
user_name = address_form.cleaned_data.get('name') user_name = address_form.cleaned_data.get('name')

View file

@ -779,6 +779,8 @@ class PaymentVMView(LoginRequiredMixin, FormView):
reverse('hosting:payment') + '#payment_error') reverse('hosting:payment') + '#payment_error')
request.session['token'] = token request.session['token'] = token
request.session['billing_address_data'] = billing_address_data request.session['billing_address_data'] = billing_address_data
owner.vat_number = billing_address_data.get("vat_number")
owner.save()
self.request.session['order_confirm_url'] = "{url}?{query_params}".format( self.request.session['order_confirm_url'] = "{url}?{query_params}".format(
url=reverse('hosting:order-confirmation'), url=reverse('hosting:order-confirmation'),
query_params='page=payment') query_params='page=payment')