Handle invalid VAT number case
This commit is contained in:
parent
8cc766b62f
commit
785f99311d
3 changed files with 31 additions and 2 deletions
|
|
@ -547,6 +547,16 @@ class PaymentOrderView(FormView):
|
|||
vat_number=address_form.cleaned_data.get('vat_number')
|
||||
)
|
||||
|
||||
if 'response_object' in validate_result:
|
||||
address_form.add_error(
|
||||
"__all__", validate_result["error"]
|
||||
)
|
||||
return self.render_to_response(
|
||||
self.get_context_data(
|
||||
billing_address_form=address_form
|
||||
)
|
||||
)
|
||||
|
||||
request.session["vat_validation_status"] = validate_result["status"]
|
||||
request.session["vat_validated_on"] = validate_result["validated_on"]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue