diff --git a/woocommerce-qenta-checkout-seamless/assets/scripts/payment.js b/woocommerce-qenta-checkout-seamless/assets/scripts/payment.js index 6712c51..022980f 100644 --- a/woocommerce-qenta-checkout-seamless/assets/scripts/payment.js +++ b/woocommerce-qenta-checkout-seamless/assets/scripts/payment.js @@ -29,12 +29,34 @@ * Please do not use the plugin if you do not agree to these terms of use! */ -function changeWCSPayment(code) { + function changeWCSPayment(code) { var changer = document.getElementById('wcs_payment_method_changer'); changer.value = code; qenta_wcs.build_iframe(code.toLowerCase()); } +const umlautMap = { + '\u00dc': 'UE', + '\u00c4': 'AE', + '\u00d6': 'OE', + '\u00fc': 'ue', + '\u00e4': 'ae', + '\u00f6': 'oe', + '\u00df': 'ss', +} + +// thx to https://stackoverflow.com/a/54346022 +function replaceUmlaute(str) { + return str + .replace(/[\u00dc|\u00c4|\u00d6][a-z]/g, (a) => { + const big = umlautMap[a.slice(0, 1)]; + return big.charAt(0) + big.charAt(1).toLowerCase() + a.slice(1); + }) + .replace(new RegExp('['+Object.keys(umlautMap).join('|')+']',"g"), + (a) => umlautMap[a] + ); +} + if (!Element.prototype.trigger) { Element.prototype.trigger = function (event) { var ev; @@ -185,7 +207,12 @@ let qenta_wcs = { }; if (this.get_data(type + 'cardholder')) - payment_information.cardholdername = this.get_data(type + 'cardholder'); + payment_information.cardholdername = replaceUmlaute( + this.get_data(type + 'cardholder') + .trim() + ) + .replace(/[^a-z\ ]/gi, '') + .replace(/\ +/, ' '); if (this.get_data(type + 'issueMonth')) payment_information.issueMonth = this.get_data(type + 'issueMonth'); if (this.get_data(type + 'issueYear')) @@ -246,9 +273,6 @@ form.addEventListener('submit', (event) => { var giropay = document.getElementById('payment_method_wcs_GIROPAY'); var pmArray = Array.from(document.querySelectorAll('input.input-radio.qcs_payment_method_list')); - if(pmArray.length == 1) { - pmArray[0].click(); - } var pmSelected = !!pmArray.filter(function (pm) { return pm.checked; diff --git a/woocommerce-qenta-checkout-seamless/classes/class-qenta-config.php b/woocommerce-qenta-checkout-seamless/classes/class-qenta-config.php index ddd0440..95c03a6 100644 --- a/woocommerce-qenta-checkout-seamless/classes/class-qenta-config.php +++ b/woocommerce-qenta-checkout-seamless/classes/class-qenta-config.php @@ -31,7 +31,7 @@ */ define( 'WOOCOMMERCE_GATEWAY_QMORE_NAME', 'QentaCheckoutSeamless' ); -define( 'WOOCOMMERCE_GATEWAY_QMORE_VERSION', '2.0.5' ); +define( 'WOOCOMMERCE_GATEWAY_QMORE_VERSION', '2.0.5.1' ); /** * Config class diff --git a/woocommerce-qenta-checkout-seamless/classes/includes/form_fields.php b/woocommerce-qenta-checkout-seamless/classes/includes/form_fields.php index 434dde9..9a2c469 100644 --- a/woocommerce-qenta-checkout-seamless/classes/includes/form_fields.php +++ b/woocommerce-qenta-checkout-seamless/classes/includes/form_fields.php @@ -176,7 +176,7 @@ 'creditcardoptions' => array( 'woo_wcs_saqacompliance' => array( 'type' => 'switch', - 'default' => 0, + 'default' => 1, 'title' => __( 'SAQ A compliance', 'woocommerce-qenta-checkout-seamless' ), 'description' => __( 'Selecting \'NO\', the stringent SAQ A-EP is applicable. Selecting \'YES\', Qenta Checkout Seamless is integrated with the \'PCI DSS SAQ A Compliance\' feature and SAQ A is applicable.', 'woocommerce-qenta-checkout-seamless' ) diff --git a/woocommerce-qenta-checkout-seamless/languages/woocommerce-qenta-checkout-seamless-de_DE.po b/woocommerce-qenta-checkout-seamless/languages/woocommerce-qenta-checkout-seamless-de_DE.po index 2dab55b..34ce78d 100644 --- a/woocommerce-qenta-checkout-seamless/languages/woocommerce-qenta-checkout-seamless-de_DE.po +++ b/woocommerce-qenta-checkout-seamless/languages/woocommerce-qenta-checkout-seamless-de_DE.po @@ -1,6 +1,6 @@ msgid "" msgstr "" -"Project-Id-Version: QentaCheckoutSeamless 2.0.5\n" +"Project-Id-Version: QentaCheckoutSeamless 2.0.5.1\n" "Report-Msgid-Bugs-To: https://github.com/qenta-cee/woocommerce-qcs/issues\n" "POT-Creation-Date: 2017-05-05 10:52+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/woocommerce-qenta-checkout-seamless/languages/woocommerce-qenta-checkout-seamless-en_US.po b/woocommerce-qenta-checkout-seamless/languages/woocommerce-qenta-checkout-seamless-en_US.po index efef996..a63e326 100644 --- a/woocommerce-qenta-checkout-seamless/languages/woocommerce-qenta-checkout-seamless-en_US.po +++ b/woocommerce-qenta-checkout-seamless/languages/woocommerce-qenta-checkout-seamless-en_US.po @@ -1,6 +1,6 @@ msgid "" msgstr "" -"Project-Id-Version: QentaCheckoutSeamless 2.0.5\n" +"Project-Id-Version: QentaCheckoutSeamless 2.0.5.1\n" "Report-Msgid-Bugs-To: https://github.com/qenta-cee/woocommerce-qcs\n" "POT-Creation-Date: 2017-05-05 10:52+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/woocommerce-qenta-checkout-seamless/readme.txt b/woocommerce-qenta-checkout-seamless/readme.txt index 6c0e67c..bf76db3 100644 --- a/woocommerce-qenta-checkout-seamless/readme.txt +++ b/woocommerce-qenta-checkout-seamless/readme.txt @@ -2,8 +2,8 @@ Contributors: Tags: visa, mastercard, sofort, paypal, credit card, klarna, eps, giropay, sepa, ecommerce, checkout, payment Requires at least: 5.5.1 -Tested up to: 5.8.3 -Stable tag: 2.0.5 +Tested up to: 5.9 +Stable tag: 2.0.5.1 License: GPLv2 License URI: https://www.gnu.org/licenses/gpl-2.0.html diff --git a/woocommerce-qenta-checkout-seamless/woocommerce-qenta-checkout-seamless.php b/woocommerce-qenta-checkout-seamless/woocommerce-qenta-checkout-seamless.php index c9df569..1a229c1 100644 --- a/woocommerce-qenta-checkout-seamless/woocommerce-qenta-checkout-seamless.php +++ b/woocommerce-qenta-checkout-seamless/woocommerce-qenta-checkout-seamless.php @@ -3,9 +3,9 @@ * Plugin Name: Qenta Checkout Seamless * Plugin URI: https://github.com/qenta-cee/woocommerce-qcs * Description: Qenta Checkout Seamless plugin for WooCommerce - * Version: 2.0.5 + * Version: 2.0.5.1 * Author: Qenta Payment CEE GmbH - * Author URI: https://www.qenta-cee.at/ + * Author URI: https://www.qenta.com/ * License: GPL2 */