diff --git a/pass/lang/de/order.json b/pass/lang/de/order.json index a449d2ac857e1dba37f221646dc9bd91f242181e..ce124f7814b5f4af872d466913774b71bef0db9a 100644 --- a/pass/lang/de/order.json +++ b/pass/lang/de/order.json @@ -41,6 +41,7 @@ }, "revocation": { "input": { + "error": "Dieses Feld ist erforderlich", "label": "Ich stimme der Ausführung des Vertrages vor Ablauf der Widerrufsfrist ausdrücklich zu. Ich habe zur Kenntnis genommen, dass das <a href=\"{{revocation_link}}\" target=\"_blank\">Widerrufsrecht</a> mit Beginn der Ausführung des Vertrages erlischt. Stattdessen gewähren wir Ihnen ein freiwilliges <a href=\"{{refundlink}}\" target=\"_blank\">30-tägiges Rückgaberecht</a>." } }, diff --git a/pass/public/styles/key/checkout-payment.less b/pass/public/styles/key/checkout-payment.less index 2705ea09d90561c074639d9b410dc54dd41e5a47..b1326edc3e78c7c2e312160b48e0a4395e438e50 100644 --- a/pass/public/styles/key/checkout-payment.less +++ b/pass/public/styles/key/checkout-payment.less @@ -103,6 +103,9 @@ display: grid; gap: 1rem; margin: 1rem 0; + > div.error { + display: none; + } } #paypal-payment-card #paypal-card-form { display: grid; diff --git a/pass/resources/js/checkout_paypal.js b/pass/resources/js/checkout_paypal.js index ee19b9e32fb6e30d560a242a502d081e46e16ad2..fecea2fef70cfb2ef39bf1f16d1cc42f91e48f4c 100644 --- a/pass/resources/js/checkout_paypal.js +++ b/pass/resources/js/checkout_paypal.js @@ -86,9 +86,14 @@ function get_paypal_checkout_data(funding_source) { fundingSource: funding_source, onClick: () => { let revocation_checkbox = document.getElementById("revocation"); + console.log(revocation_checkbox); if (!revocation_checkbox.checkValidity()) { - revocation_checkbox.reportValidity(); + if (!revocation_checkbox.reportValidity()) { + document.querySelector("#revocation-container > div.revocation-required-error").style.display = "block"; + } return; + } else { + document.querySelector("#revocation-container > div.revocation-required-error").style.display = "none"; } }, createOrder: () => { diff --git a/pass/views/templates/revocation.ejs b/pass/views/templates/revocation.ejs index 10774255630ccbb4009296ef79be71342483b585..8d2e43b9a7f854472b4d2743d29e96bd5ae99905 100644 --- a/pass/views/templates/revocation.ejs +++ b/pass/views/templates/revocation.ejs @@ -1,3 +1,4 @@ +<div class="error revocation-required-error"><%= req.t("revocation.input.error", {ns: "order"}) _%></div> <div class="input-group checkbox"> <input type="checkbox" name="revocation" id="revocation" required /> <label for="revocation"><%- req.t("revocation.input.label", {ns: "order", revocation_link: `${baseDir}/agb#revocation`, refundlink: `${baseDir}/agb#refund`}) _%></label>