From 6bd49a933d94672ec616d55e13807f1dbe751f93 Mon Sep 17 00:00:00 2001 From: Ivascu Madalin Date: Tue, 19 Sep 2023 13:17:38 +0000 Subject: [PATCH] Fix giftcards results --- Magewire/Payment/Method/Giftcards.php | 4 ++-- i18n/de_DE.csv | 0 i18n/es_ES.csv | 0 i18n/fr_FR.csv | 0 i18n/nl_BE.csv | 0 i18n/nl_NL.csv | 7 +++++++ view/frontend/templates/component/payment/before.phtml | 2 -- .../templates/component/payment/method/giftcards.phtml | 1 - 8 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 i18n/de_DE.csv create mode 100644 i18n/es_ES.csv create mode 100644 i18n/fr_FR.csv create mode 100644 i18n/nl_BE.csv create mode 100644 i18n/nl_NL.csv diff --git a/Magewire/Payment/Method/Giftcards.php b/Magewire/Payment/Method/Giftcards.php index a4cd20d..118590a 100644 --- a/Magewire/Payment/Method/Giftcards.php +++ b/Magewire/Payment/Method/Giftcards.php @@ -142,10 +142,10 @@ public function applyGiftcard( $quote, $this->buildGiftcardRequest($quote, $card, $cardNumber, $pin)->send() ); - $this->emit("giftcard_response", $response); + $this->emit("giftcard_response", [$response]); } catch (\Throwable $th) { $this->logger->addDebug((string)$th); - $this->emit("giftcard_response", ["error" => __('Cannot apply giftcard')]); + $this->emit("giftcard_response", [["error" => __('Cannot apply giftcard')]]); } } diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv new file mode 100644 index 0000000..e69de29 diff --git a/i18n/es_ES.csv b/i18n/es_ES.csv new file mode 100644 index 0000000..e69de29 diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv new file mode 100644 index 0000000..e69de29 diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv new file mode 100644 index 0000000..e69de29 diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv new file mode 100644 index 0000000..453e86c --- /dev/null +++ b/i18n/nl_NL.csv @@ -0,0 +1,7 @@ +"MM/YY","MM/JJ" +"Expiration:","Expiration:" +"Billing Middle Name:","Billing Middle Name:" +"Select giftcard issuer:","Select giftcard issuer:" +"PIN / Security code:","PIN / Security code:" +"Please select issuer","Please select issuer" +"Voucher code:","Voucher code:" \ No newline at end of file diff --git a/view/frontend/templates/component/payment/before.phtml b/view/frontend/templates/component/payment/before.phtml index af96475..36caf30 100644 --- a/view/frontend/templates/component/payment/before.phtml +++ b/view/frontend/templates/component/payment/before.phtml @@ -25,7 +25,6 @@ } buckaroo_load_sdk().then(() => { - hyva.formValidation.addRule('bk-validateCardNumber', (value) => { if (!BuckarooClientSideEncryption.V001.validateCardNumber(value.replace(/\s+/g, ''))) { return 'escapeJs(__('Please enter a valid creditcard number.')) ?>'; @@ -94,7 +93,6 @@ }, initModal() { window.addEventListener('buckaroo-modal-show', (event) => { - console.log(event); if(event.detail.data) { this.showModal = true; Object.keys(event.detail.data).forEach((key) => { diff --git a/view/frontend/templates/component/payment/method/giftcards.phtml b/view/frontend/templates/component/payment/method/giftcards.phtml index 330dbb9..986dcfa 100644 --- a/view/frontend/templates/component/payment/method/giftcards.phtml +++ b/view/frontend/templates/component/payment/method/giftcards.phtml @@ -55,7 +55,6 @@ if (!$magewire->isRedirect()) { }, listenToSubmit() { this.$wire.on('giftcard_response', async (response) => { - console.log(response); if (response.error) { this.displayError(response.error); } else if(response.remainder_amount === undefined) {