From 6ed6855c4641f27d98b8a27a05224ef57b98fc75 Mon Sep 17 00:00:00 2001 From: Lars Kusch Date: Sat, 10 Dec 2022 06:58:37 +0100 Subject: [PATCH] Further fixes --- lang/en/texts.php | 1 + resources/js/clients/payments/stripe-klarna.js | 8 ++++---- .../portal/ninja2020/gateways/stripe/klarna/pay.blade.php | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lang/en/texts.php b/lang/en/texts.php index 9fc9764b2a61..dd5b953622c3 100644 --- a/lang/en/texts.php +++ b/lang/en/texts.php @@ -2503,6 +2503,7 @@ $LANG = array( 'alipay' => 'Alipay', 'sofort' => 'Sofort', 'sepa' => 'SEPA Direct Debit', + 'translation_name_without_special_characters' => 'Please enter a name with only the letter a-z and whitespaces', 'enable_alipay' => 'Accept Alipay', 'enable_sofort' => 'Accept EU bank transfers', 'stripe_alipay_help' => 'These gateways also need to be activated in :link.', diff --git a/resources/js/clients/payments/stripe-klarna.js b/resources/js/clients/payments/stripe-klarna.js index f4a123b301aa..fa5ea63b6327 100644 --- a/resources/js/clients/payments/stripe-klarna.js +++ b/resources/js/clients/payments/stripe-klarna.js @@ -46,12 +46,12 @@ class ProcessKlarna { handle = () => { document.getElementById('pay-now').addEventListener('click', (e) => { let errors = document.getElementById('errors'); - let name = document.querySelector('meta[name=name]').content; - if (! "/^[A-Za-z\s]*$/".test(name)){ - document.getElementById('klarna-name').textContent = name.replace("/^[A-Za-z\s]*$/", "") + let name = document.getElementById("klarna-name").value; + if (! /^[A-Za-z\s]*$/.test(name)){ + document.getElementById('klarna-name').textContent = name.replace(/^[A-Za-z\s]*$/, "") document.getElementById('klarna-name').focus(); errors.textContent = document.querySelector( - 'meta[name=translation-email-required]' + 'meta[name=translation-name-without-special-characters]' ).content; errors.hidden = false; } diff --git a/resources/views/portal/ninja2020/gateways/stripe/klarna/pay.blade.php b/resources/views/portal/ninja2020/gateways/stripe/klarna/pay.blade.php index c582cce5da91..6ab1d2d42d24 100644 --- a/resources/views/portal/ninja2020/gateways/stripe/klarna/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/stripe/klarna/pay.blade.php @@ -12,7 +12,6 @@ -