From f9c141d949e0db2bf19760bf8d0ceda2cdb6c1b7 Mon Sep 17 00:00:00 2001 From: Daniil Tkachev Date: Tue, 8 Oct 2024 12:06:33 +0200 Subject: [PATCH] UNZER-475 Fix error handling by B2B Paylater-Invoice --- views/twig/frontend/tpl/order/unzer_invoice.html.twig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/views/twig/frontend/tpl/order/unzer_invoice.html.twig b/views/twig/frontend/tpl/order/unzer_invoice.html.twig index 046c5cbb..3b887200 100644 --- a/views/twig/frontend/tpl/order/unzer_invoice.html.twig +++ b/views/twig/frontend/tpl/order/unzer_invoice.html.twig @@ -153,13 +153,12 @@ errorHolderId: 'error-holder', }) - // Handle payment form submission. document.querySelector( "#payment-form" ).addEventListener('submit', function( event ) { event.preventDefault(); paylaterInvoice.createResource() .then(function(result) { let typeId = result.id; - // submit the payment type ID to your server-side integration + let selectConsumer = '{{ customerType }}'; if( ( @@ -227,6 +226,9 @@ } else { document.querySelector( '.unzerCompanyForm' ).classList.remove("text-danger"); } + document.querySelector('#error-holder').innerHTML = ''; + document.querySelector("#submitOrder").classList.add("submitable"); + document.querySelector("#submitOrder").disabled = false; }); {% endif %}