Skip to content

Commit

Permalink
UNZER-475 Fix error handling by B2B Paylater-Invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Tkachev committed Oct 8, 2024
1 parent ad88d58 commit f9c141d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions views/twig/frontend/tpl/order/unzer_invoice.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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(
(
Expand Down Expand Up @@ -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 %}
Expand Down

0 comments on commit f9c141d

Please sign in to comment.