From 1b1ba0d7145998d4034bd0f9a5066b0484ac4b5e Mon Sep 17 00:00:00 2001 From: Anne Date: Mon, 29 Jan 2024 15:37:25 +0100 Subject: [PATCH 01/28] Add pin moment option and checkout check --- Model/Config/Source/PinMoment.php | 37 +++++++++++++++++++ Model/ConfigProvider.php | 10 +++++ Model/Paymentmethod/PaymentMethod.php | 8 ++++ etc/adminhtml/paymentmethods/instore.xml | 11 ++++++ .../view/payment/method-renderer/default.js | 17 +++++++-- .../web/template/payment/default.html | 7 ++++ 6 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 Model/Config/Source/PinMoment.php diff --git a/Model/Config/Source/PinMoment.php b/Model/Config/Source/PinMoment.php new file mode 100644 index 00000000..7b57f676 --- /dev/null +++ b/Model/Config/Source/PinMoment.php @@ -0,0 +1,37 @@ +toArray(); + + $arrResult = []; + foreach ($arrOptions as $value => $label) { + $arrResult[] = ['value' => $value, 'label' => $label]; + } + return $arrResult; + } + + /** + * Get options in "key-value" format + * + * @return array + */ + public function toArray() + { + return [ + '0' => __("Don't show in checkout (default)"), + '1' => __('Show in checkout by pickup'), + ]; + } +} diff --git a/Model/ConfigProvider.php b/Model/ConfigProvider.php index 8fc86439..6d818d62 100755 --- a/Model/ConfigProvider.php +++ b/Model/ConfigProvider.php @@ -139,6 +139,7 @@ public function getConfig() $config['payment']['showkvk'][$code] = $this->getKVK($code); $config['payment']['showvat'][$code] = $this->getVAT($code); $config['payment']['showdob'][$code] = $this->getDOB($code); + $config['payment']['showpinmoment'][$code] = $this->getPinMoment($code); $config['payment']['showforcompany'][$code] = $this->getCompany($code); $config['payment']['showforgroup'][$code] = $this->getCustomerGroup($code); @@ -238,6 +239,15 @@ protected function getDOB($code) return $this->methods[$code]->getDOB(); } + /** + * @param $code + * @return mixed + */ + protected function getPinMoment($code) + { + return $this->methods[$code]->getPinMoment(); + } + /** * @param string $code * @return string diff --git a/Model/Paymentmethod/PaymentMethod.php b/Model/Paymentmethod/PaymentMethod.php index 54c1f5b0..eaabc81c 100644 --- a/Model/Paymentmethod/PaymentMethod.php +++ b/Model/Paymentmethod/PaymentMethod.php @@ -279,6 +279,14 @@ public function getDOB() return $this->_scopeConfig->getValue('payment/' . $this->_code . '/showdob', 'store'); } + /** + * @return mixed + */ + public function getPinMoment() + { + return $this->_scopeConfig->getValue('payment/' . $this->_code . '/pinmoment', 'store'); + } + /** * @return integer */ diff --git a/etc/adminhtml/paymentmethods/instore.xml b/etc/adminhtml/paymentmethods/instore.xml index 0d522d37..b8f289f3 100644 --- a/etc/adminhtml/paymentmethods/instore.xml +++ b/etc/adminhtml/paymentmethods/instore.xml @@ -45,6 +45,17 @@ + + + Paynl\Payment\Model\Config\Source\PinMoment + + 1 + + payment/paynl_payment_instore/pinmoment + + + + diff --git a/view/frontend/web/js/view/payment/method-renderer/default.js b/view/frontend/web/js/view/payment/method-renderer/default.js index 4d61c14f..57d278b5 100755 --- a/view/frontend/web/js/view/payment/method-renderer/default.js +++ b/view/frontend/web/js/view/payment/method-renderer/default.js @@ -58,9 +58,7 @@ define( } var disallowedShippingMethods = this.getDisallowedShipping(); if (disallowedShippingMethods) { - var carrier_code = typeof quote.shippingMethod().carrier_code !== 'undefined' ? quote.shippingMethod().carrier_code + '_' : ''; - var method_code = typeof quote.shippingMethod().method_code !== 'undefined' ? quote.shippingMethod().method_code : ''; - var currentShippingMethod = carrier_code + method_code; + var currentShippingMethod = this.getCurrentShippingMethod(); var disallowedShippingMethodsSplitted = disallowedShippingMethods.split(','); if (disallowedShippingMethodsSplitted.includes(currentShippingMethod) && currentShippingMethod.length > 0) { return false; @@ -80,6 +78,12 @@ define( } return true; }, + getCurrentShippingMethod: function () { + var carrier_code = typeof quote.shippingMethod().carrier_code !== 'undefined' ? quote.shippingMethod().carrier_code + '_' : ''; + var method_code = typeof quote.shippingMethod().method_code !== 'undefined' ? quote.shippingMethod().method_code : ''; + var currentShippingMethod = carrier_code + method_code; + return currentShippingMethod; + }, currentIpIsValid: function () { return window.checkoutConfig.payment.currentipisvalid[this.item.method]; }, @@ -145,6 +149,13 @@ define( getDOB: function () { return (typeof window.checkoutConfig.payment.showdob !== 'undefined') ? window.checkoutConfig.payment.showdob[this.item.method] : ''; }, + showPinMoment: function () { + return this.getPinMoment() > 0; + }, + getPinMoment: function () { + var currentShippingMethod = this.getCurrentShippingMethod(); + return (typeof window.checkoutConfig.payment.showpinmoment !== 'undefined' && currentShippingMethod === 'instore_pickup') ? window.checkoutConfig.payment.showpinmoment[this.item.method] : ''; + }, showKVKDOB: function () { return this.getKVKDOB() > 0; }, diff --git a/view/frontend/web/template/payment/default.html b/view/frontend/web/template/payment/default.html index 102ab173..bbafaa47 100644 --- a/view/frontend/web/template/payment/default.html +++ b/view/frontend/web/template/payment/default.html @@ -39,6 +39,13 @@ +
+ + +
From cf23d9fbecfb2c37a1f27d1b2ddb8c84f2ec044e Mon Sep 17 00:00:00 2001 From: Anne Date: Tue, 30 Jan 2024 14:16:57 +0100 Subject: [PATCH 02/28] Make order and redirect correctly --- Controller/Order/Pickup.php | 30 +++++++++++++++++++ Model/Paymentmethod/Instore.php | 13 ++++++-- Model/Paymentmethod/PaymentMethod.php | 4 +++ view/frontend/layout/paynl_order_pickup.xml | 25 ++++++++++++++++ .../view/payment/method-renderer/default.js | 4 ++- .../web/template/payment/default.html | 2 +- 6 files changed, 73 insertions(+), 5 deletions(-) create mode 100644 Controller/Order/Pickup.php create mode 100644 view/frontend/layout/paynl_order_pickup.xml diff --git a/Controller/Order/Pickup.php b/Controller/Order/Pickup.php new file mode 100644 index 00000000..51d1f26a --- /dev/null +++ b/Controller/Order/Pickup.php @@ -0,0 +1,30 @@ +_pageFactory = $pageFactory; + return parent::__construct($context); + } + + /** + * @return object + */ + public function execute() + { + return $this->_pageFactory->create(); + } +} diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 3b1aaad8..81db0d6d 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -63,6 +63,7 @@ public function startTransaction(Order $order, $fromAdmin = false) $url = $store->getBaseUrl() . 'checkout/cart/'; $additionalData = $order->getPayment()->getAdditionalInformation(); + $pinmoment = !$fromAdmin ? $additionalData['pinmoment'] : false; $terminalId = null; if (isset($additionalData['payment_option'])) { $terminalId = $additionalData['payment_option']; @@ -76,16 +77,22 @@ public function startTransaction(Order $order, $fromAdmin = false) $transaction = (new PayPaymentCreate($order, $this))->create(); - $instorePayment = \Paynl\Instore::payment(['transactionId' => $transaction->getTransactionId(), 'terminalId' => $terminalId]); + if ($pinmoment !== '1'){ + $instorePayment = \Paynl\Instore::payment(['transactionId' => $transaction->getTransactionId(), 'terminalId' => $terminalId]); + $additionalData['terminal_hash'] = $instorePayment->getHash(); + } $additionalData['transactionId'] = $transaction->getTransactionId(); - $additionalData['terminal_hash'] = $instorePayment->getHash(); $additionalData['payment_option'] = $terminalId; $order->getPayment()->setAdditionalInformation($additionalData); $order->save(); - $url = $instorePayment->getRedirectUrl(); + if ($pinmoment == '1') { + $url = $order->getStore()->getBaseUrl() . 'paynl/order/pickup'; + } else{ + $url = $instorePayment->getRedirectUrl(); + } } catch (\Exception $e) { $this->payHelper->logCritical($e->getMessage(), [], $store); diff --git a/Model/Paymentmethod/PaymentMethod.php b/Model/Paymentmethod/PaymentMethod.php index eaabc81c..99f5e93a 100644 --- a/Model/Paymentmethod/PaymentMethod.php +++ b/Model/Paymentmethod/PaymentMethod.php @@ -590,6 +590,10 @@ public function assignData(\Magento\Framework\DataObject $data) if (isset($additional_data['dob'])) { $this->getInfoInstance()->setAdditionalInformation('dob', $additional_data['dob']); } + + if (isset($additional_data['pinmoment'])) { + $this->getInfoInstance()->setAdditionalInformation('pinmoment', $additional_data['pinmoment']); + } } return $this; } diff --git a/view/frontend/layout/paynl_order_pickup.xml b/view/frontend/layout/paynl_order_pickup.xml new file mode 100644 index 00000000..624241bc --- /dev/null +++ b/view/frontend/layout/paynl_order_pickup.xml @@ -0,0 +1,25 @@ + + + + + Pickup Page + + + + + + Your order is reserved + + + + + + + + + \ No newline at end of file diff --git a/view/frontend/web/js/view/payment/method-renderer/default.js b/view/frontend/web/js/view/payment/method-renderer/default.js index 57d278b5..bd06144e 100755 --- a/view/frontend/web/js/view/payment/method-renderer/default.js +++ b/view/frontend/web/js/view/payment/method-renderer/default.js @@ -26,6 +26,7 @@ define( dateofbirth: null, billink_agree: null, companyfield: null, + pinmoment: null, initialize: function () { this._super(); @@ -231,7 +232,8 @@ define( "companyfield": this.companyfield, "dob": dob_format, "billink_agree": this.billink_agree, - "payment_option": this.paymentOption + "payment_option": this.paymentOption, + "pinmoment": this.pinmoment } }; }, diff --git a/view/frontend/web/template/payment/default.html b/view/frontend/web/template/payment/default.html index bbafaa47..7a5f5e7d 100644 --- a/view/frontend/web/template/payment/default.html +++ b/view/frontend/web/template/payment/default.html @@ -41,7 +41,7 @@
- From 046c9e6178c27ce0b20ea0a6e6d77c6c583876fe Mon Sep 17 00:00:00 2001 From: Anne Date: Tue, 30 Jan 2024 15:56:33 +0100 Subject: [PATCH 03/28] Cleanup by make shorthand --- Model/Paymentmethod/Instore.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 81db0d6d..98d67dbd 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -88,11 +88,7 @@ public function startTransaction(Order $order, $fromAdmin = false) $order->getPayment()->setAdditionalInformation($additionalData); $order->save(); - if ($pinmoment == '1') { - $url = $order->getStore()->getBaseUrl() . 'paynl/order/pickup'; - } else{ - $url = $instorePayment->getRedirectUrl(); - } + $url = ($pinmoment == '1') ? $order->getStore()->getBaseUrl() . 'paynl/order/pickup' : $instorePayment->getRedirectUrl(); } catch (\Exception $e) { $this->payHelper->logCritical($e->getMessage(), [], $store); From d2906b7e4910804181822fcfe5ea78a342301703 Mon Sep 17 00:00:00 2001 From: Anne Date: Tue, 30 Jan 2024 17:00:59 +0100 Subject: [PATCH 04/28] Cleanup, autoformat and shorthand --- Model/Config/Source/PinMoment.php | 2 +- Model/Paymentmethod/Instore.php | 2 +- etc/adminhtml/paymentmethods/instore.xml | 2 +- i18n/de_AT.csv | 6 ++++++ i18n/de_CH.csv | 6 ++++++ i18n/de_DE.csv | 6 ++++++ i18n/de_LU.csv | 6 ++++++ i18n/en_US.csv | 6 ++++++ i18n/fr_BE.csv | 6 ++++++ i18n/fr_CA.csv | 6 ++++++ i18n/fr_CH.csv | 6 ++++++ i18n/fr_FR.csv | 6 ++++++ i18n/fr_LU.csv | 6 ++++++ i18n/nl_BE.csv | 6 ++++++ i18n/nl_NL.csv | 6 ++++++ view/frontend/web/template/payment/default.html | 6 +++--- 16 files changed, 78 insertions(+), 6 deletions(-) diff --git a/Model/Config/Source/PinMoment.php b/Model/Config/Source/PinMoment.php index 7b57f676..c1b44b8a 100644 --- a/Model/Config/Source/PinMoment.php +++ b/Model/Config/Source/PinMoment.php @@ -31,7 +31,7 @@ public function toArray() { return [ '0' => __("Don't show in checkout (default)"), - '1' => __('Show in checkout by pickup'), + '1' => __("Show in checkout by pickup"), ]; } } diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 98d67dbd..efc8c826 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -77,7 +77,7 @@ public function startTransaction(Order $order, $fromAdmin = false) $transaction = (new PayPaymentCreate($order, $this))->create(); - if ($pinmoment !== '1'){ + if ($pinmoment !== '1') { $instorePayment = \Paynl\Instore::payment(['transactionId' => $transaction->getTransactionId(), 'terminalId' => $terminalId]); $additionalData['terminal_hash'] = $instorePayment->getHash(); } diff --git a/etc/adminhtml/paymentmethods/instore.xml b/etc/adminhtml/paymentmethods/instore.xml index b8f289f3..27b52a42 100644 --- a/etc/adminhtml/paymentmethods/instore.xml +++ b/etc/adminhtml/paymentmethods/instore.xml @@ -46,7 +46,7 @@ - + Paynl\Payment\Model\Config\Source\PinMoment 1 diff --git a/i18n/de_AT.csv b/i18n/de_AT.csv index a46d2fba..28fc37e3 100644 --- a/i18n/de_AT.csv +++ b/i18n/de_AT.csv @@ -160,3 +160,9 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" +"Pin moment","Pin-Moment" +"Pin right now","Jetzt pinnen" +"Pin at the store at pickup","PIN bei der Abholung im Geschäft" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Ermöglichen Sie es Kunden, bei der Abholung ihrer Bestellung im Geschäft per PIN zu bezahlen." +"Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" +"Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" diff --git a/i18n/de_CH.csv b/i18n/de_CH.csv index a46d2fba..28fc37e3 100644 --- a/i18n/de_CH.csv +++ b/i18n/de_CH.csv @@ -160,3 +160,9 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" +"Pin moment","Pin-Moment" +"Pin right now","Jetzt pinnen" +"Pin at the store at pickup","PIN bei der Abholung im Geschäft" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Ermöglichen Sie es Kunden, bei der Abholung ihrer Bestellung im Geschäft per PIN zu bezahlen." +"Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" +"Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv index a46d2fba..28fc37e3 100644 --- a/i18n/de_DE.csv +++ b/i18n/de_DE.csv @@ -160,3 +160,9 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" +"Pin moment","Pin-Moment" +"Pin right now","Jetzt pinnen" +"Pin at the store at pickup","PIN bei der Abholung im Geschäft" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Ermöglichen Sie es Kunden, bei der Abholung ihrer Bestellung im Geschäft per PIN zu bezahlen." +"Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" +"Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" diff --git a/i18n/de_LU.csv b/i18n/de_LU.csv index a46d2fba..28fc37e3 100644 --- a/i18n/de_LU.csv +++ b/i18n/de_LU.csv @@ -160,3 +160,9 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" +"Pin moment","Pin-Moment" +"Pin right now","Jetzt pinnen" +"Pin at the store at pickup","PIN bei der Abholung im Geschäft" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Ermöglichen Sie es Kunden, bei der Abholung ihrer Bestellung im Geschäft per PIN zu bezahlen." +"Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" +"Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" diff --git a/i18n/en_US.csv b/i18n/en_US.csv index a8d8558a..d05c3384 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -213,3 +213,9 @@ "Enter your company name","Enter your company name" "Invalid company","Invalid company" "Enter a valid company name","Enter a valid company name" +"Pin moment","Pin moment" +"Pin right now","Pin right now" +"Pin at the store at pickup","Pin at the store at pickup" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Make it possible for customers to choose to pay via pin when they are picking up their order at the store." +"Don't show in checkout (default)","Don't show in checkout (default)" +"Show in checkout by pickup","Show in checkout by pickup" diff --git a/i18n/fr_BE.csv b/i18n/fr_BE.csv index 5f6e08af..c461d832 100644 --- a/i18n/fr_BE.csv +++ b/i18n/fr_BE.csv @@ -159,3 +159,9 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" +"Pin moment","Moment de code PIN" +"Pin right now","Épingler maintenant" +"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Permettez aux clients de choisir de payer par code PIN lors du retrait de leur commande en magasin." +"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" +"Show in checkout by pickup","Présenter à la caisse lors du retrait" diff --git a/i18n/fr_CA.csv b/i18n/fr_CA.csv index 5f6e08af..c461d832 100644 --- a/i18n/fr_CA.csv +++ b/i18n/fr_CA.csv @@ -159,3 +159,9 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" +"Pin moment","Moment de code PIN" +"Pin right now","Épingler maintenant" +"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Permettez aux clients de choisir de payer par code PIN lors du retrait de leur commande en magasin." +"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" +"Show in checkout by pickup","Présenter à la caisse lors du retrait" diff --git a/i18n/fr_CH.csv b/i18n/fr_CH.csv index 5f6e08af..c461d832 100644 --- a/i18n/fr_CH.csv +++ b/i18n/fr_CH.csv @@ -159,3 +159,9 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" +"Pin moment","Moment de code PIN" +"Pin right now","Épingler maintenant" +"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Permettez aux clients de choisir de payer par code PIN lors du retrait de leur commande en magasin." +"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" +"Show in checkout by pickup","Présenter à la caisse lors du retrait" diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index 5f6e08af..c461d832 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -159,3 +159,9 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" +"Pin moment","Moment de code PIN" +"Pin right now","Épingler maintenant" +"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Permettez aux clients de choisir de payer par code PIN lors du retrait de leur commande en magasin." +"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" +"Show in checkout by pickup","Présenter à la caisse lors du retrait" diff --git a/i18n/fr_LU.csv b/i18n/fr_LU.csv index 5f6e08af..c461d832 100644 --- a/i18n/fr_LU.csv +++ b/i18n/fr_LU.csv @@ -159,3 +159,9 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" +"Pin moment","Moment de code PIN" +"Pin right now","Épingler maintenant" +"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Permettez aux clients de choisir de payer par code PIN lors du retrait de leur commande en magasin." +"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" +"Show in checkout by pickup","Présenter à la caisse lors du retrait" diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv index 364f3bab..3713c2b7 100644 --- a/i18n/nl_BE.csv +++ b/i18n/nl_BE.csv @@ -217,3 +217,9 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" +"Pin moment","Pin-moment" +"Pin right now","Nu pinnen" +"Pin at the store at pickup","Bij afhalen in de winkel pinnen" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Maak het mogelijk dat klanten kunnen kiezen om tijdens het afhalen van hun bestelling in de winkel te pinnen." +"Don't show in checkout (default)","Niet weergeven bij het afrekenen (standaard)" +"Show in checkout by pickup","Toon bij het afrekenen wanneer gekozen is voor afhalen" diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index 1f6d13fa..ea578a50 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -217,3 +217,9 @@ "Enter your company name","Voer uw bedrijfsnaam in" "Invalid company","Ongeldig bedrijf" "Enter a valid company name","Voer een geldige bedrijfsnaam in" +"Pin moment","Pin-moment" +"Pin right now","Nu pinnen" +"Pin at the store at pickup","Bij afhalen in de winkel pinnen" +"Make it possible for customers to choose to pay via pin when they are picking up their order at the store.","Maak het mogelijk dat klanten kunnen kiezen om tijdens het afhalen van hun bestelling in de winkel te pinnen." +"Don't show in checkout (default)","Niet weergeven bij het afrekenen (standaard)" +"Show in checkout by pickup","Toon bij het afrekenen wanneer gekozen is voor afhalen" diff --git a/view/frontend/web/template/payment/default.html b/view/frontend/web/template/payment/default.html index 7a5f5e7d..0c7e5e0d 100644 --- a/view/frontend/web/template/payment/default.html +++ b/view/frontend/web/template/payment/default.html @@ -40,10 +40,10 @@
- +
From 1657b12f1a0a0a07ad805fdda1efd39c4a8a5301 Mon Sep 17 00:00:00 2001 From: Anne Date: Wed, 31 Jan 2024 09:59:14 +0100 Subject: [PATCH 05/28] Linter --- Model/ConfigProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/ConfigProvider.php b/Model/ConfigProvider.php index 6d818d62..0b055fcc 100755 --- a/Model/ConfigProvider.php +++ b/Model/ConfigProvider.php @@ -240,7 +240,7 @@ protected function getDOB($code) } /** - * @param $code + * @param string $code * @return mixed */ protected function getPinMoment($code) From e6260d51c1bb177d959d6d588994468bd6528c96 Mon Sep 17 00:00:00 2001 From: Anne Date: Thu, 1 Feb 2024 10:44:28 +0100 Subject: [PATCH 06/28] Pay button and description change --- Plugin/InstoreButton.php | 6 +++++- etc/adminhtml/paymentmethods/instore.xml | 2 +- i18n/de_AT.csv | 2 +- i18n/de_CH.csv | 2 +- i18n/de_DE.csv | 2 +- i18n/de_LU.csv | 2 +- i18n/en_US.csv | 2 +- i18n/fr_BE.csv | 2 +- i18n/fr_CA.csv | 2 +- i18n/fr_CH.csv | 2 +- i18n/fr_FR.csv | 2 +- i18n/fr_LU.csv | 2 +- i18n/nl_BE.csv | 2 +- i18n/nl_NL.csv | 2 +- 14 files changed, 18 insertions(+), 14 deletions(-) diff --git a/Plugin/InstoreButton.php b/Plugin/InstoreButton.php index 33913f00..6a18212a 100644 --- a/Plugin/InstoreButton.php +++ b/Plugin/InstoreButton.php @@ -67,7 +67,11 @@ public function beforePushButtons( $currentUrl = $this->urlInterface->getCurrentUrl(); if (!isset($buttonList->getItems()['paynl']['start_instore_payment'])) { - if ($payment_method == 'paynl_payment_instore' && !$order->hasInvoices() && $store->getConfig('payment/paynl_payment_instore/show_pin_button') == 1) { + if ($payment_method == 'paynl_payment_instore' && !$order->hasInvoices() && + ( + $store->getConfig('payment/paynl_payment_instore/show_pin_button') == 1 || + $store->getConfig('payment/paynl_payment_instore/pinmoment') == 1 + )) { $instoreUrl = $this->backendUrl->getUrl('paynl/order/instore') . '?order_id=' . $order_id . '&return_url=' . urlencode($currentUrl); $buttonList->add( 'start_instore_payment', diff --git a/etc/adminhtml/paymentmethods/instore.xml b/etc/adminhtml/paymentmethods/instore.xml index 27b52a42..4e14da4e 100644 --- a/etc/adminhtml/paymentmethods/instore.xml +++ b/etc/adminhtml/paymentmethods/instore.xml @@ -53,7 +53,7 @@ payment/paynl_payment_instore/pinmoment - + Date: Thu, 1 Feb 2024 10:53:45 +0100 Subject: [PATCH 07/28] Don't start transaction at start --- Model/Paymentmethod/Instore.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index efc8c826..5213f2b3 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -75,14 +75,15 @@ public function startTransaction(Order $order, $fromAdmin = false) throw new \Exception(__('Please select a pin-terminal'), 201); } - $transaction = (new PayPaymentCreate($order, $this))->create(); - if ($pinmoment !== '1') { + $transaction = (new PayPaymentCreate($order, $this))->create(); + $instorePayment = \Paynl\Instore::payment(['transactionId' => $transaction->getTransactionId(), 'terminalId' => $terminalId]); + $additionalData['terminal_hash'] = $instorePayment->getHash(); + $additionalData['transactionId'] = $transaction->getTransactionId(); } - $additionalData['transactionId'] = $transaction->getTransactionId(); $additionalData['payment_option'] = $terminalId; $order->getPayment()->setAdditionalInformation($additionalData); From 994c0104b5f693944e0e1efa91ce7949198ae67b Mon Sep 17 00:00:00 2001 From: Anne Date: Thu, 1 Feb 2024 10:57:49 +0100 Subject: [PATCH 08/28] Linter --- Plugin/InstoreButton.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Plugin/InstoreButton.php b/Plugin/InstoreButton.php index 6a18212a..9f2bd01b 100644 --- a/Plugin/InstoreButton.php +++ b/Plugin/InstoreButton.php @@ -67,11 +67,9 @@ public function beforePushButtons( $currentUrl = $this->urlInterface->getCurrentUrl(); if (!isset($buttonList->getItems()['paynl']['start_instore_payment'])) { - if ($payment_method == 'paynl_payment_instore' && !$order->hasInvoices() && - ( + if ($payment_method == 'paynl_payment_instore' && !$order->hasInvoices() && ( $store->getConfig('payment/paynl_payment_instore/show_pin_button') == 1 || - $store->getConfig('payment/paynl_payment_instore/pinmoment') == 1 - )) { + $store->getConfig('payment/paynl_payment_instore/pinmoment') == 1)) { $instoreUrl = $this->backendUrl->getUrl('paynl/order/instore') . '?order_id=' . $order_id . '&return_url=' . urlencode($currentUrl); $buttonList->add( 'start_instore_payment', From a814d22467b806e6c196c251a8369253dfb5ce5c Mon Sep 17 00:00:00 2001 From: Anne Date: Thu, 1 Feb 2024 11:02:16 +0100 Subject: [PATCH 09/28] Linter --- Plugin/InstoreButton.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Plugin/InstoreButton.php b/Plugin/InstoreButton.php index 9f2bd01b..bb2f2126 100644 --- a/Plugin/InstoreButton.php +++ b/Plugin/InstoreButton.php @@ -67,9 +67,12 @@ public function beforePushButtons( $currentUrl = $this->urlInterface->getCurrentUrl(); if (!isset($buttonList->getItems()['paynl']['start_instore_payment'])) { - if ($payment_method == 'paynl_payment_instore' && !$order->hasInvoices() && ( - $store->getConfig('payment/paynl_payment_instore/show_pin_button') == 1 || - $store->getConfig('payment/paynl_payment_instore/pinmoment') == 1)) { + if ( + $payment_method == 'paynl_payment_instore' + && !$order->hasInvoices() + && ($store->getConfig('payment/paynl_payment_instore/show_pin_button') == 1 + || $store->getConfig('payment/paynl_payment_instore/pinmoment') == 1) + ) { $instoreUrl = $this->backendUrl->getUrl('paynl/order/instore') . '?order_id=' . $order_id . '&return_url=' . urlencode($currentUrl); $buttonList->add( 'start_instore_payment', From bde5db7a8dd323eeeb14836b36b88c2507c823a2 Mon Sep 17 00:00:00 2001 From: Anne Date: Thu, 1 Feb 2024 15:28:02 +0100 Subject: [PATCH 10/28] Style changes and added notes to order --- Model/Paymentmethod/Instore.php | 8 +++++++- i18n/de_AT.csv | 1 + i18n/de_CH.csv | 1 + i18n/de_DE.csv | 1 + i18n/de_LU.csv | 1 + i18n/en_US.csv | 1 + i18n/fr_BE.csv | 1 + i18n/fr_CA.csv | 1 + i18n/fr_CH.csv | 1 + i18n/fr_FR.csv | 1 + i18n/fr_LU.csv | 1 + i18n/nl_BE.csv | 1 + i18n/nl_NL.csv | 1 + view/frontend/web/css/paycheckout.css | 5 +++++ 14 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 5213f2b3..e198dc41 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -63,7 +63,13 @@ public function startTransaction(Order $order, $fromAdmin = false) $url = $store->getBaseUrl() . 'checkout/cart/'; $additionalData = $order->getPayment()->getAdditionalInformation(); - $pinmoment = !$fromAdmin ? $additionalData['pinmoment'] : false; + + $pinmoment = $additionalData['pinmoment']; + if ($pinmoment == "1" && !$fromAdmin){ + $order->addStatusHistoryComment(__('Pay.: Order was created for payment at moment of pick up at the store'))->save(); + } + $pinmoment = !$fromAdmin ? $pinmoment : false; + $terminalId = null; if (isset($additionalData['payment_option'])) { $terminalId = $additionalData['payment_option']; diff --git a/i18n/de_AT.csv b/i18n/de_AT.csv index f294e668..ee173da5 100644 --- a/i18n/de_AT.csv +++ b/i18n/de_AT.csv @@ -166,3 +166,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." "Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" "Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" \ No newline at end of file diff --git a/i18n/de_CH.csv b/i18n/de_CH.csv index f294e668..ee173da5 100644 --- a/i18n/de_CH.csv +++ b/i18n/de_CH.csv @@ -166,3 +166,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." "Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" "Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" \ No newline at end of file diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv index f294e668..ee173da5 100644 --- a/i18n/de_DE.csv +++ b/i18n/de_DE.csv @@ -166,3 +166,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." "Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" "Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" \ No newline at end of file diff --git a/i18n/de_LU.csv b/i18n/de_LU.csv index f294e668..ee173da5 100644 --- a/i18n/de_LU.csv +++ b/i18n/de_LU.csv @@ -166,3 +166,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." "Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" "Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" \ No newline at end of file diff --git a/i18n/en_US.csv b/i18n/en_US.csv index feb55384..a6a22648 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -219,3 +219,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view." "Don't show in checkout (default)","Don't show in checkout (default)" "Show in checkout by pickup","Show in checkout by pickup" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Order was created for payment at moment of pick up at the store" \ No newline at end of file diff --git a/i18n/fr_BE.csv b/i18n/fr_BE.csv index 17905ff8..b315a555 100644 --- a/i18n/fr_BE.csv +++ b/i18n/fr_BE.csv @@ -165,3 +165,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" "Show in checkout by pickup","Présenter à la caisse lors du retrait" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file diff --git a/i18n/fr_CA.csv b/i18n/fr_CA.csv index 17905ff8..b315a555 100644 --- a/i18n/fr_CA.csv +++ b/i18n/fr_CA.csv @@ -165,3 +165,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" "Show in checkout by pickup","Présenter à la caisse lors du retrait" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file diff --git a/i18n/fr_CH.csv b/i18n/fr_CH.csv index 17905ff8..b315a555 100644 --- a/i18n/fr_CH.csv +++ b/i18n/fr_CH.csv @@ -165,3 +165,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" "Show in checkout by pickup","Présenter à la caisse lors du retrait" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index 17905ff8..b315a555 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -165,3 +165,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" "Show in checkout by pickup","Présenter à la caisse lors du retrait" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file diff --git a/i18n/fr_LU.csv b/i18n/fr_LU.csv index 17905ff8..b315a555 100644 --- a/i18n/fr_LU.csv +++ b/i18n/fr_LU.csv @@ -165,3 +165,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" "Show in checkout by pickup","Présenter à la caisse lors du retrait" +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv index 9dc847cc..36819960 100644 --- a/i18n/nl_BE.csv +++ b/i18n/nl_BE.csv @@ -223,3 +223,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." "Don't show in checkout (default)","Niet weergeven bij het afrekenen (standaard)" "Show in checkout by pickup","Toon bij het afrekenen wanneer gekozen is voor afhalen" +"Pay.: Order was created for payment at moment of pick up at the store","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" \ No newline at end of file diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index a29da7fd..fb6b3e01 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -223,3 +223,4 @@ "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." "Don't show in checkout (default)","Niet weergeven bij het afrekenen (standaard)" "Show in checkout by pickup","Toon bij het afrekenen wanneer gekozen is voor afhalen" +"Pay.: Order was created for payment at moment of pick up at the store","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" \ No newline at end of file diff --git a/view/frontend/web/css/paycheckout.css b/view/frontend/web/css/paycheckout.css index b3744a09..2d18ba7e 100644 --- a/view/frontend/web/css/paycheckout.css +++ b/view/frontend/web/css/paycheckout.css @@ -51,4 +51,9 @@ .paynl .payment-method-content p { margin-bottom: 10px; position: inherit; +} + +.paynl .payment-method-content label[for="pinmoment"] { + margin: 20px 0 10px 18px; + display: inline-block; } \ No newline at end of file From caf3794b8084936fb2736f9e6e9876a7e9bfbe47 Mon Sep 17 00:00:00 2001 From: Anne Date: Thu, 1 Feb 2024 15:32:50 +0100 Subject: [PATCH 11/28] Autoformat --- Model/Paymentmethod/Instore.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index e198dc41..d771df32 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -65,7 +65,7 @@ public function startTransaction(Order $order, $fromAdmin = false) $additionalData = $order->getPayment()->getAdditionalInformation(); $pinmoment = $additionalData['pinmoment']; - if ($pinmoment == "1" && !$fromAdmin){ + if ($pinmoment == "1" && !$fromAdmin) { $order->addStatusHistoryComment(__('Pay.: Order was created for payment at moment of pick up at the store'))->save(); } $pinmoment = !$fromAdmin ? $pinmoment : false; From 672e889b5485cae1ad050cb3de668b7aa58301c6 Mon Sep 17 00:00:00 2001 From: Anne Date: Fri, 16 Feb 2024 11:50:44 +0100 Subject: [PATCH 12/28] Add changes listed in PLUG-3194 --- Model/Config/Source/PinMoment.php | 5 +++-- Model/Paymentmethod/Instore.php | 4 +++- i18n/de_LU.csv | 7 ++++--- i18n/en_US.csv | 7 ++++--- i18n/fr_BE.csv | 7 ++++--- i18n/fr_CA.csv | 7 ++++--- i18n/fr_CH.csv | 7 ++++--- i18n/fr_FR.csv | 7 ++++--- i18n/fr_LU.csv | 7 ++++--- i18n/nl_BE.csv | 7 ++++--- i18n/nl_NL.csv | 7 ++++--- .../js/view/payment/method-renderer/default.js | 15 ++++++++++++++- 12 files changed, 56 insertions(+), 31 deletions(-) diff --git a/Model/Config/Source/PinMoment.php b/Model/Config/Source/PinMoment.php index c1b44b8a..282d33bf 100644 --- a/Model/Config/Source/PinMoment.php +++ b/Model/Config/Source/PinMoment.php @@ -30,8 +30,9 @@ public function toOptionArray() public function toArray() { return [ - '0' => __("Don't show in checkout (default)"), - '1' => __("Show in checkout by pickup"), + '0' => __("Only provide direct payment option (default)"), + '1' => __("Only use payment when instore pickup is selected"), + '2' => __("Provide option to customer"), ]; } } diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index d771df32..37a9a65f 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -65,7 +65,9 @@ public function startTransaction(Order $order, $fromAdmin = false) $additionalData = $order->getPayment()->getAdditionalInformation(); $pinmoment = $additionalData['pinmoment']; - if ($pinmoment == "1" && !$fromAdmin) { + if (($pinmoment == "1" && !$fromAdmin) || + $this->getPinMoment() == "1" && !$fromAdmin) { + $pinmoment = ($this->getPinMoment() == "1") ? "1" : $pinmoment; $order->addStatusHistoryComment(__('Pay.: Order was created for payment at moment of pick up at the store'))->save(); } $pinmoment = !$fromAdmin ? $pinmoment : false; diff --git a/i18n/de_LU.csv b/i18n/de_LU.csv index ee173da5..a5186481 100644 --- a/i18n/de_LU.csv +++ b/i18n/de_LU.csv @@ -164,6 +164,7 @@ "Pin right now","Jetzt pinnen" "Pin at the store at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." -"Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" -"Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" \ No newline at end of file +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" +"Only provide direct payment option (default)","Nur Direktzahlungsoption bereitstellen (Standard)" +"Only use payment when instore pickup is selected","Verwenden Sie die Zahlung nur, wenn die Abholung im Geschäft ausgewählt ist" +"Provide option to customer","Bieten Sie dem Kunden eine Option" \ No newline at end of file diff --git a/i18n/en_US.csv b/i18n/en_US.csv index a6a22648..813f96eb 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -217,6 +217,7 @@ "Pin right now","Pin right now" "Pin at the store at pickup","Pin at the store at pickup" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view." -"Don't show in checkout (default)","Don't show in checkout (default)" -"Show in checkout by pickup","Show in checkout by pickup" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Order was created for payment at moment of pick up at the store" \ No newline at end of file +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Order was created for payment at moment of pick up at the store" +"Only provide direct payment option (default)","Only provide direct payment option (default)" +"Only use payment when instore pickup is selected","Only use payment when instore pickup is selected" +"Provide option to customer","Provide option to customer" \ No newline at end of file diff --git a/i18n/fr_BE.csv b/i18n/fr_BE.csv index b315a555..5ade77c0 100644 --- a/i18n/fr_BE.csv +++ b/i18n/fr_BE.csv @@ -163,6 +163,7 @@ "Pin right now","Épingler maintenant" "Pin at the store at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" -"Show in checkout by pickup","Présenter à la caisse lors du retrait" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Provide option to customer","Offrir le choix au client" \ No newline at end of file diff --git a/i18n/fr_CA.csv b/i18n/fr_CA.csv index b315a555..5ade77c0 100644 --- a/i18n/fr_CA.csv +++ b/i18n/fr_CA.csv @@ -163,6 +163,7 @@ "Pin right now","Épingler maintenant" "Pin at the store at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" -"Show in checkout by pickup","Présenter à la caisse lors du retrait" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Provide option to customer","Offrir le choix au client" \ No newline at end of file diff --git a/i18n/fr_CH.csv b/i18n/fr_CH.csv index b315a555..5ade77c0 100644 --- a/i18n/fr_CH.csv +++ b/i18n/fr_CH.csv @@ -163,6 +163,7 @@ "Pin right now","Épingler maintenant" "Pin at the store at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" -"Show in checkout by pickup","Présenter à la caisse lors du retrait" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Provide option to customer","Offrir le choix au client" \ No newline at end of file diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index b315a555..5ade77c0 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -163,6 +163,7 @@ "Pin right now","Épingler maintenant" "Pin at the store at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" -"Show in checkout by pickup","Présenter à la caisse lors du retrait" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Provide option to customer","Offrir le choix au client" \ No newline at end of file diff --git a/i18n/fr_LU.csv b/i18n/fr_LU.csv index b315a555..5ade77c0 100644 --- a/i18n/fr_LU.csv +++ b/i18n/fr_LU.csv @@ -163,6 +163,7 @@ "Pin right now","Épingler maintenant" "Pin at the store at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Don't show in checkout (default)","Ne pas afficher à la caisse (par défaut)" -"Show in checkout by pickup","Présenter à la caisse lors du retrait" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" \ No newline at end of file +"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Provide option to customer","Offrir le choix au client" \ No newline at end of file diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv index 36819960..539408f0 100644 --- a/i18n/nl_BE.csv +++ b/i18n/nl_BE.csv @@ -221,6 +221,7 @@ "Pin right now","Nu pinnen" "Pin at the store at pickup","Bij afhalen in de winkel pinnen" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." -"Don't show in checkout (default)","Niet weergeven bij het afrekenen (standaard)" -"Show in checkout by pickup","Toon bij het afrekenen wanneer gekozen is voor afhalen" -"Pay.: Order was created for payment at moment of pick up at the store","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" \ No newline at end of file +"Pay.: Order was created for payment at moment of pick up at the store","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" +"Only provide direct payment option (default)","Bied de betaaloptie direct aan aan (standaard)" +"Only use payment when instore pickup is selected","Gebruik alleen betaling als ophalen in de winkel is geselecteerd" +"Provide option to customer","Geef de klant de optie om te kiezen" \ No newline at end of file diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index fb6b3e01..9c4fdeb2 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -221,6 +221,7 @@ "Pin right now","Nu pinnen" "Pin at the store at pickup","Bij afhalen in de winkel pinnen" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." -"Don't show in checkout (default)","Niet weergeven bij het afrekenen (standaard)" -"Show in checkout by pickup","Toon bij het afrekenen wanneer gekozen is voor afhalen" -"Pay.: Order was created for payment at moment of pick up at the store","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" \ No newline at end of file +"Pay.: Order was created for payment at moment of pick up at the store","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" +"Only provide direct payment option (default)","Bied de betaaloptie direct aan aan (standaard)" +"Only use payment when instore pickup is selected","Gebruik alleen betaling als ophalen in de winkel is geselecteerd" +"Provide option to customer","Geef de klant de optie om te kiezen" \ No newline at end of file diff --git a/view/frontend/web/js/view/payment/method-renderer/default.js b/view/frontend/web/js/view/payment/method-renderer/default.js index bd06144e..2d296745 100755 --- a/view/frontend/web/js/view/payment/method-renderer/default.js +++ b/view/frontend/web/js/view/payment/method-renderer/default.js @@ -77,6 +77,9 @@ define( if (!this.currentAgentIsValid()) { return false; } + if (!this.showPin()){ + return false; + } return true; }, getCurrentShippingMethod: function () { @@ -155,7 +158,17 @@ define( }, getPinMoment: function () { var currentShippingMethod = this.getCurrentShippingMethod(); - return (typeof window.checkoutConfig.payment.showpinmoment !== 'undefined' && currentShippingMethod === 'instore_pickup') ? window.checkoutConfig.payment.showpinmoment[this.item.method] : ''; + return (typeof window.checkoutConfig.payment.showpinmoment !== 'undefined' && window.checkoutConfig.payment.showpinmoment[this.item.method] === '2' && currentShippingMethod === 'instore_pickup') ? window.checkoutConfig.payment.showpinmoment[this.item.method] : ''; + }, + showPin: function () { + var currentShippingMethod = this.getCurrentShippingMethod(); + var showPinMomentConfig = (typeof window.checkoutConfig.payment.showpinmoment !== 'undefined') ? window.checkoutConfig.payment.showpinmoment[this.item.method] : ''; + + if (showPinMomentConfig === '1' && currentShippingMethod !== 'instore_pickup') { + return false + } + + return true }, showKVKDOB: function () { return this.getKVKDOB() > 0; From fa4529075f9d8bc627ecef64e092a4341fe0ed76 Mon Sep 17 00:00:00 2001 From: Anne Date: Fri, 16 Feb 2024 12:01:35 +0100 Subject: [PATCH 13/28] linter --- Model/Paymentmethod/Instore.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 37a9a65f..a9389de1 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -65,8 +65,10 @@ public function startTransaction(Order $order, $fromAdmin = false) $additionalData = $order->getPayment()->getAdditionalInformation(); $pinmoment = $additionalData['pinmoment']; - if (($pinmoment == "1" && !$fromAdmin) || - $this->getPinMoment() == "1" && !$fromAdmin) { + if ( + ($pinmoment == "1" && !$fromAdmin) + || ($this->getPinMoment() == "1" && !$fromAdmin) + ) { $pinmoment = ($this->getPinMoment() == "1") ? "1" : $pinmoment; $order->addStatusHistoryComment(__('Pay.: Order was created for payment at moment of pick up at the store'))->save(); } From e9d20d903f0057e9f8fa77f719643a1a1f0a4407 Mon Sep 17 00:00:00 2001 From: woutse Date: Fri, 16 Feb 2024 15:19:17 +0100 Subject: [PATCH 14/28] Text updates --- Model/Paymentmethod/Instore.php | 17 +++++++---------- etc/adminhtml/paymentmethods/instore.xml | 2 +- i18n/de_AT.csv | 8 ++++---- i18n/de_CH.csv | 8 ++++---- i18n/de_DE.csv | 8 ++++---- i18n/de_LU.csv | 8 ++++---- i18n/en_US.csv | 8 ++++---- i18n/fr_BE.csv | 8 ++++---- i18n/fr_CA.csv | 8 ++++---- i18n/fr_CH.csv | 8 ++++---- i18n/fr_FR.csv | 8 ++++---- i18n/fr_LU.csv | 8 ++++---- i18n/nl_BE.csv | 8 ++++---- i18n/nl_NL.csv | 8 ++++---- view/frontend/web/template/payment/default.html | 6 +++--- 15 files changed, 59 insertions(+), 62 deletions(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index a9389de1..d25a802b 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -64,15 +64,12 @@ public function startTransaction(Order $order, $fromAdmin = false) $additionalData = $order->getPayment()->getAdditionalInformation(); - $pinmoment = $additionalData['pinmoment']; - if ( - ($pinmoment == "1" && !$fromAdmin) - || ($this->getPinMoment() == "1" && !$fromAdmin) - ) { - $pinmoment = ($this->getPinMoment() == "1") ? "1" : $pinmoment; - $order->addStatusHistoryComment(__('Pay.: Order was created for payment at moment of pick up at the store'))->save(); + $pinMoment = $additionalData['pinmoment']; + if (($pinMoment == "1" && !$fromAdmin) || ($this->getPinMoment() == "1" && !$fromAdmin)) { + $pinMoment = ($this->getPinMoment() == "1") ? "1" : $pinMoment; + $order->addStatusHistoryComment(__('PAY.: Payment at pick-up'))->save(); } - $pinmoment = !$fromAdmin ? $pinmoment : false; + $pinMoment = !$fromAdmin ? $pinMoment : false; $terminalId = null; if (isset($additionalData['payment_option'])) { @@ -85,7 +82,7 @@ public function startTransaction(Order $order, $fromAdmin = false) throw new \Exception(__('Please select a pin-terminal'), 201); } - if ($pinmoment !== '1') { + if ($pinMoment !== '1') { $transaction = (new PayPaymentCreate($order, $this))->create(); $instorePayment = \Paynl\Instore::payment(['transactionId' => $transaction->getTransactionId(), 'terminalId' => $terminalId]); @@ -99,7 +96,7 @@ public function startTransaction(Order $order, $fromAdmin = false) $order->getPayment()->setAdditionalInformation($additionalData); $order->save(); - $url = ($pinmoment == '1') ? $order->getStore()->getBaseUrl() . 'paynl/order/pickup' : $instorePayment->getRedirectUrl(); + $url = ($pinMoment == '1') ? $order->getStore()->getBaseUrl() . 'paynl/order/pickup' : $instorePayment->getRedirectUrl(); } catch (\Exception $e) { $this->payHelper->logCritical($e->getMessage(), [], $store); diff --git a/etc/adminhtml/paymentmethods/instore.xml b/etc/adminhtml/paymentmethods/instore.xml index 4e14da4e..8aa962b3 100644 --- a/etc/adminhtml/paymentmethods/instore.xml +++ b/etc/adminhtml/paymentmethods/instore.xml @@ -46,7 +46,7 @@ - + Paynl\Payment\Model\Config\Source\PinMoment 1 diff --git a/i18n/de_AT.csv b/i18n/de_AT.csv index f5b07b6e..546d2770 100644 --- a/i18n/de_AT.csv +++ b/i18n/de_AT.csv @@ -160,13 +160,13 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" -"Pin moment","Pin-Moment" -"Pin right now","Jetzt pinnen" -"Pin at the store at pickup","PIN bei der Abholung im Geschäft" +"Payment","Pin-Moment" +"Pay by card","Jetzt pinnen" +"Pay later, at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." "Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" "Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" +"PAY.: Payment at pick-up","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Dadurch wird sichergestellt, dass die Bestellung mit der tatsächlichen Zahlungsmethode aktualisiert wird, die zum Abschluss der Bestellung verwendet wurde. Diese kann von der ursprünglich gewählten Zahlungsart abweichen" "PAY.: Updated payment method from %1 to %2","PAY.: Zahlungsmethode geändert von %1 bis %2" diff --git a/i18n/de_CH.csv b/i18n/de_CH.csv index f5b07b6e..546d2770 100644 --- a/i18n/de_CH.csv +++ b/i18n/de_CH.csv @@ -160,13 +160,13 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" -"Pin moment","Pin-Moment" -"Pin right now","Jetzt pinnen" -"Pin at the store at pickup","PIN bei der Abholung im Geschäft" +"Payment","Pin-Moment" +"Pay by card","Jetzt pinnen" +"Pay later, at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." "Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" "Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" +"PAY.: Payment at pick-up","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Dadurch wird sichergestellt, dass die Bestellung mit der tatsächlichen Zahlungsmethode aktualisiert wird, die zum Abschluss der Bestellung verwendet wurde. Diese kann von der ursprünglich gewählten Zahlungsart abweichen" "PAY.: Updated payment method from %1 to %2","PAY.: Zahlungsmethode geändert von %1 bis %2" diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv index f5b07b6e..546d2770 100644 --- a/i18n/de_DE.csv +++ b/i18n/de_DE.csv @@ -160,13 +160,13 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" -"Pin moment","Pin-Moment" -"Pin right now","Jetzt pinnen" -"Pin at the store at pickup","PIN bei der Abholung im Geschäft" +"Payment","Pin-Moment" +"Pay by card","Jetzt pinnen" +"Pay later, at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." "Don't show in checkout (default)","Nicht im Checkout anzeigen (Standard)" "Show in checkout by pickup","Bei Abholung an der Kasse anzeigen" -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" +"PAY.: Payment at pick-up","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Dadurch wird sichergestellt, dass die Bestellung mit der tatsächlichen Zahlungsmethode aktualisiert wird, die zum Abschluss der Bestellung verwendet wurde. Diese kann von der ursprünglich gewählten Zahlungsart abweichen" "PAY.: Updated payment method from %1 to %2","PAY.: Zahlungsmethode geändert von %1 bis %2" diff --git a/i18n/de_LU.csv b/i18n/de_LU.csv index b96f3947..3cad832b 100644 --- a/i18n/de_LU.csv +++ b/i18n/de_LU.csv @@ -160,11 +160,11 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" -"Pin moment","Pin-Moment" -"Pin right now","Jetzt pinnen" -"Pin at the store at pickup","PIN bei der Abholung im Geschäft" +"Payment","Pin-Moment" +"Pay by card","Jetzt pinnen" +"Pay later, at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" +"PAY.: Payment at pick-up","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" "Only provide direct payment option (default)","Nur Direktzahlungsoption bereitstellen (Standard)" "Only use payment when instore pickup is selected","Verwenden Sie die Zahlung nur, wenn die Abholung im Geschäft ausgewählt ist" "Provide option to customer","Bieten Sie dem Kunden eine Option" diff --git a/i18n/en_US.csv b/i18n/en_US.csv index ec7ebe3a..88421e0d 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -213,11 +213,11 @@ "Enter your company name","Enter your company name" "Invalid company","Invalid company" "Enter a valid company name","Enter a valid company name" -"Pin moment","Pin moment" -"Pin right now","Pin right now" -"Pin at the store at pickup","Pin at the store at pickup" +"Payment","Payment" +"Pay by card","Pay by card" +"Pay later, at pickup","Pay later, at pickup" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view." -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: Order was created for payment at moment of pick up at the store" +"PAY.: Payment at pick-up","PAY.: Payment at pick-up" "Only provide direct payment option (default)","Only provide direct payment option (default)" "Only use payment when instore pickup is selected","Only use payment when instore pickup is selected" "Provide option to customer","Provide option to customer" diff --git a/i18n/fr_BE.csv b/i18n/fr_BE.csv index e1a7ae2e..f16a4dbc 100644 --- a/i18n/fr_BE.csv +++ b/i18n/fr_BE.csv @@ -159,11 +159,11 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Pin moment","Moment de code PIN" -"Pin right now","Épingler maintenant" -"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Payment","Moment de code PIN" +"Pay by card","Épingler maintenant" +"Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" "Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" "Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" "Provide option to customer","Offrir le choix au client" diff --git a/i18n/fr_CA.csv b/i18n/fr_CA.csv index e1a7ae2e..f16a4dbc 100644 --- a/i18n/fr_CA.csv +++ b/i18n/fr_CA.csv @@ -159,11 +159,11 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Pin moment","Moment de code PIN" -"Pin right now","Épingler maintenant" -"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Payment","Moment de code PIN" +"Pay by card","Épingler maintenant" +"Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" "Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" "Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" "Provide option to customer","Offrir le choix au client" diff --git a/i18n/fr_CH.csv b/i18n/fr_CH.csv index e1a7ae2e..f16a4dbc 100644 --- a/i18n/fr_CH.csv +++ b/i18n/fr_CH.csv @@ -159,11 +159,11 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Pin moment","Moment de code PIN" -"Pin right now","Épingler maintenant" -"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Payment","Moment de code PIN" +"Pay by card","Épingler maintenant" +"Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" "Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" "Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" "Provide option to customer","Offrir le choix au client" diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index e1a7ae2e..f16a4dbc 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -159,11 +159,11 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Pin moment","Moment de code PIN" -"Pin right now","Épingler maintenant" -"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Payment","Moment de code PIN" +"Pay by card","Épingler maintenant" +"Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" "Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" "Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" "Provide option to customer","Offrir le choix au client" diff --git a/i18n/fr_LU.csv b/i18n/fr_LU.csv index e1a7ae2e..f16a4dbc 100644 --- a/i18n/fr_LU.csv +++ b/i18n/fr_LU.csv @@ -159,11 +159,11 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Pin moment","Moment de code PIN" -"Pin right now","Épingler maintenant" -"Pin at the store at pickup","Épinglez en magasin lors du retrait" +"Payment","Moment de code PIN" +"Pay by card","Épingler maintenant" +"Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." -"Pay.: Order was created for payment at moment of pick up at the store","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" +"PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" "Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" "Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" "Provide option to customer","Offrir le choix au client" diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv index 6c48471c..58a77e3c 100644 --- a/i18n/nl_BE.csv +++ b/i18n/nl_BE.csv @@ -217,11 +217,11 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Pin moment","Pin-moment" -"Pin right now","Nu pinnen" -"Pin at the store at pickup","Bij afhalen in de winkel pinnen" +"Payment","Pin-moment" +"Pay by card","Nu pinnen" +"Pay later, at pickup","Bij afhalen in de winkel pinnen" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." -"Pay.: Order was created for payment at moment of pick up at the store","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" +"PAY.: Payment at pick-up","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" "Only provide direct payment option (default)","Bied de betaaloptie direct aan aan (standaard)" "Only use payment when instore pickup is selected","Gebruik alleen betaling als ophalen in de winkel is geselecteerd" "Provide option to customer","Geef de klant de optie om te kiezen" diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index b3673968..291dcb7f 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -217,11 +217,11 @@ "Enter your company name","Voer uw bedrijfsnaam in" "Invalid company","Ongeldig bedrijf" "Enter a valid company name","Voer een geldige bedrijfsnaam in" -"Pin moment","Pin-moment" -"Pin right now","Nu pinnen" -"Pin at the store at pickup","Bij afhalen in de winkel pinnen" +"Payment","Pin-moment" +"Pay by card","Nu pinnen" +"Pay later, at pickup","Bij afhalen in de winkel pinnen" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." -"Pay.: Order was created for payment at moment of pick up at the store","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" +"PAY.: Payment at pick-up","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" "Only provide direct payment option (default)","Bied de betaaloptie direct aan aan (standaard)" "Only use payment when instore pickup is selected","Gebruik alleen betaling als ophalen in de winkel is geselecteerd" "Provide option to customer","Geef de klant de optie om te kiezen" diff --git a/view/frontend/web/template/payment/default.html b/view/frontend/web/template/payment/default.html index 0c7e5e0d..0e212e31 100644 --- a/view/frontend/web/template/payment/default.html +++ b/view/frontend/web/template/payment/default.html @@ -40,10 +40,10 @@
- +
From f8794b2005e1955345dbf891bd729bc8db49ef8a Mon Sep 17 00:00:00 2001 From: woutse Date: Fri, 16 Feb 2024 15:28:56 +0100 Subject: [PATCH 15/28] Text updates --- Model/Config/Source/PinMoment.php | 12 +++++++++--- i18n/de_LU.csv | 6 +++--- i18n/en_US.csv | 6 +++--- i18n/fr_BE.csv | 6 +++--- i18n/fr_CA.csv | 6 +++--- i18n/fr_CH.csv | 6 +++--- i18n/fr_FR.csv | 6 +++--- i18n/fr_LU.csv | 6 +++--- i18n/nl_BE.csv | 6 +++--- i18n/nl_NL.csv | 6 +++--- 10 files changed, 36 insertions(+), 30 deletions(-) diff --git a/Model/Config/Source/PinMoment.php b/Model/Config/Source/PinMoment.php index 282d33bf..63b1a34b 100644 --- a/Model/Config/Source/PinMoment.php +++ b/Model/Config/Source/PinMoment.php @@ -30,9 +30,15 @@ public function toOptionArray() public function toArray() { return [ - '0' => __("Only provide direct payment option (default)"), - '1' => __("Only use payment when instore pickup is selected"), - '2' => __("Provide option to customer"), + + '0' => __("Directly payment initialization(default)"), + '1' => __("Let payment take place at the pickup location, only create a backorder"), + '2' => __("Show a selection for the checkout-user to choose between direct payment or payment at location"), + + +// '0' => __("Directly payment initialization(default)"), +// '1' => __("Let payment take place at the pickup location, only create a backorder"), +// '2' => __("Show a selection for the checkout-user to choose between direct payment or payment at location"), ]; } } diff --git a/i18n/de_LU.csv b/i18n/de_LU.csv index 3cad832b..5bc9033c 100644 --- a/i18n/de_LU.csv +++ b/i18n/de_LU.csv @@ -165,9 +165,9 @@ "Pay later, at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." "PAY.: Payment at pick-up","Pay.: Die Bestellung wurde zum Zeitpunkt der Abholung im Geschäft zur Zahlung erstellt" -"Only provide direct payment option (default)","Nur Direktzahlungsoption bereitstellen (Standard)" -"Only use payment when instore pickup is selected","Verwenden Sie die Zahlung nur, wenn die Abholung im Geschäft ausgewählt ist" -"Provide option to customer","Bieten Sie dem Kunden eine Option" +"Directly payment initialization(default)","Nur Direktzahlungsoption bereitstellen (Standard)" +"Let payment take place at the pickup location, only create a backorder","Verwenden Sie die Zahlung nur, wenn die Abholung im Geschäft ausgewählt ist" +"Show a selection for the checkout-user to choose between direct payment or payment at location","Bieten Sie dem Kunden eine Option" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Dadurch wird sichergestellt, dass die Bestellung mit der tatsächlichen Zahlungsmethode aktualisiert wird, die zum Abschluss der Bestellung verwendet wurde. Diese kann von der ursprünglich gewählten Zahlungsart abweichen" "PAY.: Updated payment method from %1 to %2","PAY.: Zahlungsmethode geändert von %1 bis %2" diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 88421e0d..fca692b7 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -218,9 +218,9 @@ "Pay later, at pickup","Pay later, at pickup" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view." "PAY.: Payment at pick-up","PAY.: Payment at pick-up" -"Only provide direct payment option (default)","Only provide direct payment option (default)" -"Only use payment when instore pickup is selected","Only use payment when instore pickup is selected" -"Provide option to customer","Provide option to customer" +"Directly payment initialization(default)","Directly payment initialization(default)" +"Let payment take place at the pickup location, only create a backorder","Let payment take place at the pickup location, only create a backorder" +"Show a selection for the checkout-user to choose between direct payment or payment at location","Show a selection for the checkout-user to choose between direct payment or payment at location" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected" "PAY.: Updated payment method from %1 to %2","PAY.: Updated payment method from %1 to %2" diff --git a/i18n/fr_BE.csv b/i18n/fr_BE.csv index f16a4dbc..66a36382 100644 --- a/i18n/fr_BE.csv +++ b/i18n/fr_BE.csv @@ -164,9 +164,9 @@ "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" -"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" -"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" -"Provide option to customer","Offrir le choix au client" +"Directly payment initialization(default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Let payment take place at the pickup location, only create a backorder","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Show a selection for the checkout-user to choose between direct payment or payment at location","Offrir le choix au client" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Cela garantira que la commande est mise à jour avec le mode de paiement réel utilisé pour finaliser la commande. Celui-ci peut différer du mode de paiement initialement sélectionné" "PAY.: Updated payment method from %1 to %2","PAY.: Mode de paiement modifié de %1 à %2" diff --git a/i18n/fr_CA.csv b/i18n/fr_CA.csv index f16a4dbc..66a36382 100644 --- a/i18n/fr_CA.csv +++ b/i18n/fr_CA.csv @@ -164,9 +164,9 @@ "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" -"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" -"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" -"Provide option to customer","Offrir le choix au client" +"Directly payment initialization(default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Let payment take place at the pickup location, only create a backorder","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Show a selection for the checkout-user to choose between direct payment or payment at location","Offrir le choix au client" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Cela garantira que la commande est mise à jour avec le mode de paiement réel utilisé pour finaliser la commande. Celui-ci peut différer du mode de paiement initialement sélectionné" "PAY.: Updated payment method from %1 to %2","PAY.: Mode de paiement modifié de %1 à %2" diff --git a/i18n/fr_CH.csv b/i18n/fr_CH.csv index f16a4dbc..66a36382 100644 --- a/i18n/fr_CH.csv +++ b/i18n/fr_CH.csv @@ -164,9 +164,9 @@ "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" -"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" -"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" -"Provide option to customer","Offrir le choix au client" +"Directly payment initialization(default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Let payment take place at the pickup location, only create a backorder","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Show a selection for the checkout-user to choose between direct payment or payment at location","Offrir le choix au client" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Cela garantira que la commande est mise à jour avec le mode de paiement réel utilisé pour finaliser la commande. Celui-ci peut différer du mode de paiement initialement sélectionné" "PAY.: Updated payment method from %1 to %2","PAY.: Mode de paiement modifié de %1 à %2" diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index f16a4dbc..66a36382 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -164,9 +164,9 @@ "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" -"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" -"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" -"Provide option to customer","Offrir le choix au client" +"Directly payment initialization(default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Let payment take place at the pickup location, only create a backorder","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Show a selection for the checkout-user to choose between direct payment or payment at location","Offrir le choix au client" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Cela garantira que la commande est mise à jour avec le mode de paiement réel utilisé pour finaliser la commande. Celui-ci peut différer du mode de paiement initialement sélectionné" "PAY.: Updated payment method from %1 to %2","PAY.: Mode de paiement modifié de %1 à %2" diff --git a/i18n/fr_LU.csv b/i18n/fr_LU.csv index f16a4dbc..66a36382 100644 --- a/i18n/fr_LU.csv +++ b/i18n/fr_LU.csv @@ -164,9 +164,9 @@ "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." "PAY.: Payment at pick-up","Pay.: La commande a été créée pour le paiement au moment du retrait au magasin" -"Only provide direct payment option (default)","Proposez uniquement l'option de paiement direct (par défaut)" -"Only use payment when instore pickup is selected","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" -"Provide option to customer","Offrir le choix au client" +"Directly payment initialization(default)","Proposez uniquement l'option de paiement direct (par défaut)" +"Let payment take place at the pickup location, only create a backorder","Utiliser le paiement uniquement lorsque le retrait en magasin est sélectionné" +"Show a selection for the checkout-user to choose between direct payment or payment at location","Offrir le choix au client" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Cela garantira que la commande est mise à jour avec le mode de paiement réel utilisé pour finaliser la commande. Celui-ci peut différer du mode de paiement initialement sélectionné" "PAY.: Updated payment method from %1 to %2","PAY.: Mode de paiement modifié de %1 à %2" diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv index 58a77e3c..be4119de 100644 --- a/i18n/nl_BE.csv +++ b/i18n/nl_BE.csv @@ -222,9 +222,9 @@ "Pay later, at pickup","Bij afhalen in de winkel pinnen" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." "PAY.: Payment at pick-up","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" -"Only provide direct payment option (default)","Bied de betaaloptie direct aan aan (standaard)" -"Only use payment when instore pickup is selected","Gebruik alleen betaling als ophalen in de winkel is geselecteerd" -"Provide option to customer","Geef de klant de optie om te kiezen" +"Directly payment initialization(default)","Bied de betaaloptie direct aan aan (standaard)" +"Let payment take place at the pickup location, only create a backorder","Gebruik alleen betaling als ophalen in de winkel is geselecteerd" +"Show a selection for the checkout-user to choose between direct payment or payment at location","Geef de klant de optie om te kiezen" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Dit zorgt ervoor dat de bestelling wordt bijgewerkt met de daadwerkelijke betaalmethode die is gebruikt om de bestelling te voltooien. Dit kan afwijken van de aanvankelijk gekozen betaalmethode" "PAY.: Updated payment method from %1 to %2","PAY.: Betaalmethode gewijzigd van %1 naar %2" diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index 291dcb7f..a37deb0f 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -222,9 +222,9 @@ "Pay later, at pickup","Bij afhalen in de winkel pinnen" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." "PAY.: Payment at pick-up","De bestelling is aangemaakt voor betaling op het moment van ophalen in de winkel" -"Only provide direct payment option (default)","Bied de betaaloptie direct aan aan (standaard)" -"Only use payment when instore pickup is selected","Gebruik alleen betaling als ophalen in de winkel is geselecteerd" -"Provide option to customer","Geef de klant de optie om te kiezen" +"Directly payment initialization(default)","Bied de betaaloptie direct aan aan (standaard)" +"Let payment take place at the pickup location, only create a backorder","Gebruik alleen betaling als ophalen in de winkel is geselecteerd" +"Show a selection for the checkout-user to choose between direct payment or payment at location","Geef de klant de optie om te kiezen" "Follow payment method","Follow payment method" "This will ensure the order is updated with the actual payment method used to complete the order. This can differ from the payment method initially selected","Dit zorgt ervoor dat de bestelling wordt bijgewerkt met de daadwerkelijke betaalmethode die is gebruikt om de bestelling te voltooien. Dit kan afwijken van de aanvankelijk gekozen betaalmethode" "PAY.: Updated payment method from %1 to %2","PAY.: Betaalmethode gewijzigd van %1 naar %2" From 12d754052b9c931229d6f63c26bdf068e433212c Mon Sep 17 00:00:00 2001 From: woutse Date: Fri, 16 Feb 2024 15:31:36 +0100 Subject: [PATCH 16/28] Text updates --- etc/adminhtml/paymentmethods/instore.xml | 2 +- i18n/de_AT.csv | 2 +- i18n/de_CH.csv | 2 +- i18n/de_DE.csv | 2 +- i18n/de_LU.csv | 2 +- i18n/en_US.csv | 2 +- i18n/fr_BE.csv | 2 +- i18n/fr_CA.csv | 2 +- i18n/fr_CH.csv | 2 +- i18n/fr_FR.csv | 2 +- i18n/fr_LU.csv | 2 +- i18n/nl_BE.csv | 2 +- i18n/nl_NL.csv | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/etc/adminhtml/paymentmethods/instore.xml b/etc/adminhtml/paymentmethods/instore.xml index 8aa962b3..0e67be0f 100644 --- a/etc/adminhtml/paymentmethods/instore.xml +++ b/etc/adminhtml/paymentmethods/instore.xml @@ -46,7 +46,7 @@ - + Paynl\Payment\Model\Config\Source\PinMoment 1 diff --git a/i18n/de_AT.csv b/i18n/de_AT.csv index 546d2770..c9e70cf0 100644 --- a/i18n/de_AT.csv +++ b/i18n/de_AT.csv @@ -160,7 +160,7 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" -"Payment","Pin-Moment" +"Payment location","Pin-Moment" "Pay by card","Jetzt pinnen" "Pay later, at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." diff --git a/i18n/de_CH.csv b/i18n/de_CH.csv index 546d2770..c9e70cf0 100644 --- a/i18n/de_CH.csv +++ b/i18n/de_CH.csv @@ -160,7 +160,7 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" -"Payment","Pin-Moment" +"Payment location","Pin-Moment" "Pay by card","Jetzt pinnen" "Pay later, at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv index 546d2770..c9e70cf0 100644 --- a/i18n/de_DE.csv +++ b/i18n/de_DE.csv @@ -160,7 +160,7 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" -"Payment","Pin-Moment" +"Payment location","Pin-Moment" "Pay by card","Jetzt pinnen" "Pay later, at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." diff --git a/i18n/de_LU.csv b/i18n/de_LU.csv index 5bc9033c..1eb43409 100644 --- a/i18n/de_LU.csv +++ b/i18n/de_LU.csv @@ -160,7 +160,7 @@ "Enter your company name","Geben Sie Ihren Firmennamen ein" "Invalid company","Ungültiger firma" "Enter a valid company name","Geben Sie einen gültigen Firmennamen ein" -"Payment","Pin-Moment" +"Payment location","Pin-Moment" "Pay by card","Jetzt pinnen" "Pay later, at pickup","PIN bei der Abholung im Geschäft" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Ermöglichen Sie den Kunden, bei der Abholung der Bestellung im Geschäft zu bezahlen. In der Bestellansicht wird ein Pin-Button angezeigt." diff --git a/i18n/en_US.csv b/i18n/en_US.csv index fca692b7..539100f7 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -213,7 +213,7 @@ "Enter your company name","Enter your company name" "Invalid company","Invalid company" "Enter a valid company name","Enter a valid company name" -"Payment","Payment" +"Payment location","Payment location" "Pay by card","Pay by card" "Pay later, at pickup","Pay later, at pickup" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view." diff --git a/i18n/fr_BE.csv b/i18n/fr_BE.csv index 66a36382..85cb15f7 100644 --- a/i18n/fr_BE.csv +++ b/i18n/fr_BE.csv @@ -159,7 +159,7 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Payment","Moment de code PIN" +"Payment location","Moment de code PIN" "Pay by card","Épingler maintenant" "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." diff --git a/i18n/fr_CA.csv b/i18n/fr_CA.csv index 66a36382..85cb15f7 100644 --- a/i18n/fr_CA.csv +++ b/i18n/fr_CA.csv @@ -159,7 +159,7 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Payment","Moment de code PIN" +"Payment location","Moment de code PIN" "Pay by card","Épingler maintenant" "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." diff --git a/i18n/fr_CH.csv b/i18n/fr_CH.csv index 66a36382..85cb15f7 100644 --- a/i18n/fr_CH.csv +++ b/i18n/fr_CH.csv @@ -159,7 +159,7 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Payment","Moment de code PIN" +"Payment location","Moment de code PIN" "Pay by card","Épingler maintenant" "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv index 66a36382..85cb15f7 100644 --- a/i18n/fr_FR.csv +++ b/i18n/fr_FR.csv @@ -159,7 +159,7 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Payment","Moment de code PIN" +"Payment location","Moment de code PIN" "Pay by card","Épingler maintenant" "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." diff --git a/i18n/fr_LU.csv b/i18n/fr_LU.csv index 66a36382..85cb15f7 100644 --- a/i18n/fr_LU.csv +++ b/i18n/fr_LU.csv @@ -159,7 +159,7 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Payment","Moment de code PIN" +"Payment location","Moment de code PIN" "Pay by card","Épingler maintenant" "Pay later, at pickup","Épinglez en magasin lors du retrait" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Permettez aux clients de choisir de payer lors du retrait de la commande en magasin. Un bouton épingle sera visible dans la vue commande." diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv index be4119de..832688e6 100644 --- a/i18n/nl_BE.csv +++ b/i18n/nl_BE.csv @@ -217,7 +217,7 @@ "Enter your company name","Entrez le nom de votre entreprise" "Invalid company","Entreprise invalide" "Entrez un nom d'entreprise valide","Voer een geldige bedrijfsnaam in" -"Payment","Pin-moment" +"Payment location","Pin-moment" "Pay by card","Nu pinnen" "Pay later, at pickup","Bij afhalen in de winkel pinnen" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv index a37deb0f..868984a4 100644 --- a/i18n/nl_NL.csv +++ b/i18n/nl_NL.csv @@ -217,7 +217,7 @@ "Enter your company name","Voer uw bedrijfsnaam in" "Invalid company","Ongeldig bedrijf" "Enter a valid company name","Voer een geldige bedrijfsnaam in" -"Payment","Pin-moment" +"Payment location","Pin locatie" "Pay by card","Nu pinnen" "Pay later, at pickup","Bij afhalen in de winkel pinnen" "Allow customers to choose to pay when picking up the order at the store. 'Start Pay. Pin' button will be visible in the order view.","Geef klanten de mogelijkheid om te kiezen om te betalen bij het ophalen van de bestelling in de winkel. In het orderoverzicht is een pinknop zichtbaar." From f574435272b843125b13c1fb884b4e683f9b9910 Mon Sep 17 00:00:00 2001 From: woutse Date: Fri, 16 Feb 2024 15:35:02 +0100 Subject: [PATCH 17/28] Text updates --- etc/adminhtml/paymentmethods/instore.xml | 2 +- i18n/de_AT.csv | 2 +- i18n/de_CH.csv | 2 +- i18n/de_DE.csv | 2 +- i18n/de_LU.csv | 2 +- i18n/en_US.csv | 2 +- i18n/fr_BE.csv | 2 +- i18n/fr_CA.csv | 2 +- i18n/fr_CH.csv | 2 +- i18n/fr_FR.csv | 2 +- i18n/fr_LU.csv | 2 +- i18n/nl_BE.csv | 2 +- i18n/nl_NL.csv | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/etc/adminhtml/paymentmethods/instore.xml b/etc/adminhtml/paymentmethods/instore.xml index 0e67be0f..a4c20f7f 100644 --- a/etc/adminhtml/paymentmethods/instore.xml +++ b/etc/adminhtml/paymentmethods/instore.xml @@ -53,7 +53,7 @@ payment/paynl_payment_instore/pinmoment - + Date: Wed, 21 Feb 2024 14:09:16 +0100 Subject: [PATCH 18/28] Follow-up part 3 --- Controller/Checkout/Finish.php | 23 +++++++++--- Model/Config.php | 1 + Model/Config/Source/PinMoment.php | 6 ---- Model/ConfigProvider.php | 10 ++++++ Model/Paymentmethod/Instore.php | 10 +++++- Plugin/InstoreButton.php | 2 +- etc/adminhtml/paymentmethods/instore.xml | 8 +++++ .../view/payment/method-renderer/default.js | 35 +++++++++++++++++-- .../web/template/payment/default.html | 4 +-- 9 files changed, 83 insertions(+), 16 deletions(-) diff --git a/Controller/Checkout/Finish.php b/Controller/Checkout/Finish.php index b212e7b1..beaca6fd 100644 --- a/Controller/Checkout/Finish.php +++ b/Controller/Checkout/Finish.php @@ -94,14 +94,18 @@ public function __construct( * @param Order $order * @param string $orderId * @param Session $session + * @param $pickupMode * @return void */ - private function checkSession(Order $order, string $orderId, Session $session) + private function checkSession(Order $order, string $orderId, Session $session, $pickupMode = null) { if ($session->getLastOrderId() != $order->getId()) { $additionalInformation = $order->getPayment()->getAdditionalInformation(); $transactionId = (isset($additionalInformation['transactionId'])) ? $additionalInformation['transactionId'] : null; - if ($orderId == $transactionId) { + if ( + ($orderId == $transactionId) + || (!empty($pickupMode)) + ) { $this->checkoutSession->setLastQuoteId($order->getQuoteId()) ->setLastSuccessQuoteId($order->getQuoteId()) ->setLastOrderId($order->getId()) @@ -139,6 +143,7 @@ public function execute() $orderStatusId = empty($params['orderStatusId']) ? null : (int)$params['orderStatusId']; $magOrderId = empty($params['entityid']) ? null : $params['entityid']; $orderIds = empty($params['order_ids']) ? null : $params['order_ids']; + $pickupMode = !empty($params['pickup']); $bSuccess = $orderStatusId === Config::ORDERSTATUS_PAID; $bPending = in_array($orderStatusId, Config::ORDERSTATUS_PENDING); $bDenied = $orderStatusId === Config::ORDERSTATUS_DENIED; @@ -148,6 +153,15 @@ public function execute() $multiShipFinish = is_array($orderIds); try { + if ($pickupMode) { + $order = $this->orderRepository->get($magOrderId); + $payOrderId = ''; + $this->deactivateCart($order, $payOrderId, true); + $successUrl = Config::FINISH_PICKUP; + $resultRedirect->setPath($successUrl, ['_query' => ['utm_nooverride' => '1']]); + return $resultRedirect; + } + $this->checkEmpty($payOrderId, 'payOrderid', 101); $this->checkEmpty($magOrderId, 'magOrderId', 1012); @@ -260,14 +274,15 @@ private function handlePin(string $hash, Order $order) /** * @param Order $order * @param string $payOrderId + * @param $pickupMode * @return void */ - private function deactivateCart(Order $order, string $payOrderId) + private function deactivateCart(Order $order, string $payOrderId, $pickupMode = null) { # Make the cart inactive $session = $this->checkoutSession; - $this->checkSession($order, $payOrderId, $session); + $this->checkSession($order, $payOrderId, $session, $pickupMode); $quote = $session->getQuote(); $quote->setIsActive(false); diff --git a/Model/Config.php b/Model/Config.php index 0d007f20..283be96d 100755 --- a/Model/Config.php +++ b/Model/Config.php @@ -16,6 +16,7 @@ class Config public const PENDING_PAY = 'paynl/order/pending'; public const CANCEL_PAY = 'paynl/order/cancel'; public const FINISH_STANDARD = 'checkout/onepage/success'; + public const FINISH_PICKUP = 'paynl/order/pickup'; public const ORDERSTATUS_PAID = 100; public const ORDERSTATUS_PENDING = array(20, 25, 40, 50, 90); public const ORDERSTATUS_DENIED = -63; diff --git a/Model/Config/Source/PinMoment.php b/Model/Config/Source/PinMoment.php index 63b1a34b..ed5a242d 100644 --- a/Model/Config/Source/PinMoment.php +++ b/Model/Config/Source/PinMoment.php @@ -30,15 +30,9 @@ public function toOptionArray() public function toArray() { return [ - '0' => __("Directly payment initialization(default)"), '1' => __("Let payment take place at the pickup location, only create a backorder"), '2' => __("Show a selection for the checkout-user to choose between direct payment or payment at location"), - - -// '0' => __("Directly payment initialization(default)"), -// '1' => __("Let payment take place at the pickup location, only create a backorder"), -// '2' => __("Show a selection for the checkout-user to choose between direct payment or payment at location"), ]; } } diff --git a/Model/ConfigProvider.php b/Model/ConfigProvider.php index 0b055fcc..15839f14 100755 --- a/Model/ConfigProvider.php +++ b/Model/ConfigProvider.php @@ -140,6 +140,7 @@ public function getConfig() $config['payment']['showvat'][$code] = $this->getVAT($code); $config['payment']['showdob'][$code] = $this->getDOB($code); $config['payment']['showpinmoment'][$code] = $this->getPinMoment($code); + $config['payment']['pinmomentterminal'][$code] = $this->getPinMomentTerminal($code); $config['payment']['showforcompany'][$code] = $this->getCompany($code); $config['payment']['showforgroup'][$code] = $this->getCustomerGroup($code); @@ -248,6 +249,15 @@ protected function getPinMoment($code) return $this->methods[$code]->getPinMoment(); } + /** + * @param string $code + * @return mixed + */ + protected function getPinMomentTerminal($code) + { + return $this->methods[$code]->getPinMomentTerminal(); + } + /** * @param string $code * @return string diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index d25a802b..5c5628c9 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -96,7 +96,7 @@ public function startTransaction(Order $order, $fromAdmin = false) $order->getPayment()->setAdditionalInformation($additionalData); $order->save(); - $url = ($pinMoment == '1') ? $order->getStore()->getBaseUrl() . 'paynl/order/pickup' : $instorePayment->getRedirectUrl(); + $url = ($pinMoment == '1') ? $order->getStore()->getBaseUrl() . 'paynl/checkout/finish/?entityid=' . $order->getEntityId() . '&pickup=1' : $instorePayment->getRedirectUrl(); } catch (\Exception $e) { $this->payHelper->logCritical($e->getMessage(), [], $store); @@ -200,6 +200,14 @@ public function getDefaultPaymentOption() return $this->_scopeConfig->getValue('payment/' . $this->_code . '/default_terminal', 'store'); } + /** + * @return mixed + */ + public function getPinMomentTerminal() + { + return $this->_scopeConfig->getValue('payment/' . $this->_code . '/pinmoment_terminal', 'store'); + } + /** * @return boolean */ diff --git a/Plugin/InstoreButton.php b/Plugin/InstoreButton.php index bb2f2126..78830046 100644 --- a/Plugin/InstoreButton.php +++ b/Plugin/InstoreButton.php @@ -71,7 +71,7 @@ public function beforePushButtons( $payment_method == 'paynl_payment_instore' && !$order->hasInvoices() && ($store->getConfig('payment/paynl_payment_instore/show_pin_button') == 1 - || $store->getConfig('payment/paynl_payment_instore/pinmoment') == 1) + || $store->getConfig('payment/paynl_payment_instore/pinmoment') > 0) ) { $instoreUrl = $this->backendUrl->getUrl('paynl/order/instore') . '?order_id=' . $order_id . '&return_url=' . urlencode($currentUrl); $buttonList->add( diff --git a/etc/adminhtml/paymentmethods/instore.xml b/etc/adminhtml/paymentmethods/instore.xml index a4c20f7f..ec1c76e0 100644 --- a/etc/adminhtml/paymentmethods/instore.xml +++ b/etc/adminhtml/paymentmethods/instore.xml @@ -56,6 +56,14 @@ + + + Paynl\Payment\Model\Config\Source\PinTerminals + + 0 + + payment/paynl_payment_instore/pinmoment_terminal + diff --git a/view/frontend/web/js/view/payment/method-renderer/default.js b/view/frontend/web/js/view/payment/method-renderer/default.js index 2d296745..b12e6570 100755 --- a/view/frontend/web/js/view/payment/method-renderer/default.js +++ b/view/frontend/web/js/view/payment/method-renderer/default.js @@ -10,9 +10,10 @@ define( 'Magento_Ui/js/modal/alert', 'Magento_Checkout/js/model/payment/additional-validators', 'mage/translate', - 'Magento_Customer/js/model/customer' + 'Magento_Customer/js/model/customer', + 'ko' ], - function ($, Component, url, placeOrderAction, quote, alert, additionalValidators, translate, customer) { + function ($, Component, url, placeOrderAction, quote, alert, additionalValidators, translate, customer, ko) { 'use strict'; return Component.extend({ redirectAfterPlaceOrder: false, @@ -176,9 +177,36 @@ define( getKVKDOB: function () { return (this.getDOB() > 0 && this.getKVK() > 0); }, + showPinOption: ko.observable(true), showPaymentOptions: function () { + var pinmoment = window.checkoutConfig.payment.showpinmoment[this.item.method]; + var currentShippingMethod = this.getCurrentShippingMethod(); + + if ( + currentShippingMethod === 'instore_pickup' + && pinmoment === '1' + && typeof window.checkoutConfig.payment.pinmomentterminal !== 'undefined' + && window.checkoutConfig.payment.pinmomentterminal[this.item.method] !== '0' + ) { + this.paymentOption = this.getDefaultPaymomentTerminal(); + return false; + } + return window.checkoutConfig.payment.paymentoptions[this.item.method].length > 0 && window.checkoutConfig.payment.showpaymentoptions[this.item.method] == 1; }, + pinmomentChange: function (obj, event) { + if ( + event.target.value === '1' + && window.checkoutConfig.payment.showpinmoment[this.item.method] === '2' + && typeof window.checkoutConfig.payment.pinmomentterminal !== 'undefined' + && window.checkoutConfig.payment.pinmomentterminal[this.item.method] !== '0' + ) { + this.paymentOption = this.getDefaultPaymomentTerminal(); + this.showPinOption(false); + } else { + this.showPinOption(true); + } + }, showPaymentOptionsList: function () { return window.checkoutConfig.payment.paymentoptions[this.item.method].length >= 1 && window.checkoutConfig.payment.showpaymentoptions[this.item.method] == 2; }, @@ -224,6 +252,9 @@ define( getDefaultPaymentOption: function () { return window.checkoutConfig.payment.defaultpaymentoption[this.item.method]; }, + getDefaultPaymomentTerminal: function () { + return window.checkoutConfig.payment.pinmomentterminal[this.item.method]; + }, afterPlaceOrder: function () { window.location.replace(url.build('paynl/checkout/redirect?nocache=' + (new Date().getTime()))); }, diff --git a/view/frontend/web/template/payment/default.html b/view/frontend/web/template/payment/default.html index 0e212e31..0caf27ee 100644 --- a/view/frontend/web/template/payment/default.html +++ b/view/frontend/web/template/payment/default.html @@ -23,7 +23,7 @@

- +
@@ -41,7 +41,7 @@
- From 240c5dfc065441d3a9dbab422a321d42f4dd7285 Mon Sep 17 00:00:00 2001 From: Anne Date: Wed, 21 Feb 2024 14:15:24 +0100 Subject: [PATCH 19/28] Linter --- Controller/Checkout/Finish.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Controller/Checkout/Finish.php b/Controller/Checkout/Finish.php index beaca6fd..4dbb49b7 100644 --- a/Controller/Checkout/Finish.php +++ b/Controller/Checkout/Finish.php @@ -94,10 +94,10 @@ public function __construct( * @param Order $order * @param string $orderId * @param Session $session - * @param $pickupMode + * @param bool $pickupMode * @return void */ - private function checkSession(Order $order, string $orderId, Session $session, $pickupMode = null) + private function checkSession(Order $order, string $orderId, Session $session, bool $pickupMode = null) { if ($session->getLastOrderId() != $order->getId()) { $additionalInformation = $order->getPayment()->getAdditionalInformation(); @@ -274,10 +274,10 @@ private function handlePin(string $hash, Order $order) /** * @param Order $order * @param string $payOrderId - * @param $pickupMode + * @param bool $pickupMode * @return void */ - private function deactivateCart(Order $order, string $payOrderId, $pickupMode = null) + private function deactivateCart(Order $order, string $payOrderId, bool $pickupMode = null) { # Make the cart inactive $session = $this->checkoutSession; From ea635f643abc7605f2933e9a2fa92333163c951a Mon Sep 17 00:00:00 2001 From: Anne Date: Wed, 21 Feb 2024 14:16:36 +0100 Subject: [PATCH 20/28] Linter --- Controller/Checkout/Finish.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Controller/Checkout/Finish.php b/Controller/Checkout/Finish.php index 4dbb49b7..14b3489f 100644 --- a/Controller/Checkout/Finish.php +++ b/Controller/Checkout/Finish.php @@ -94,10 +94,10 @@ public function __construct( * @param Order $order * @param string $orderId * @param Session $session - * @param bool $pickupMode + * @param boolean $pickupMode * @return void */ - private function checkSession(Order $order, string $orderId, Session $session, bool $pickupMode = null) + private function checkSession(Order $order, string $orderId, Session $session, $pickupMode = null) { if ($session->getLastOrderId() != $order->getId()) { $additionalInformation = $order->getPayment()->getAdditionalInformation(); @@ -274,10 +274,10 @@ private function handlePin(string $hash, Order $order) /** * @param Order $order * @param string $payOrderId - * @param bool $pickupMode + * @param boolean $pickupMode * @return void */ - private function deactivateCart(Order $order, string $payOrderId, bool $pickupMode = null) + private function deactivateCart(Order $order, string $payOrderId, $pickupMode = null) { # Make the cart inactive $session = $this->checkoutSession; From 14f2fd2543068dc6f386403e8e6df4eb2a226773 Mon Sep 17 00:00:00 2001 From: woutse Date: Tue, 18 Jun 2024 10:38:06 +0200 Subject: [PATCH 21/28] Code polish --- Controller/Checkout/Finish.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Controller/Checkout/Finish.php b/Controller/Checkout/Finish.php index 14b3489f..1969c554 100644 --- a/Controller/Checkout/Finish.php +++ b/Controller/Checkout/Finish.php @@ -102,10 +102,8 @@ private function checkSession(Order $order, string $orderId, Session $session, $ if ($session->getLastOrderId() != $order->getId()) { $additionalInformation = $order->getPayment()->getAdditionalInformation(); $transactionId = (isset($additionalInformation['transactionId'])) ? $additionalInformation['transactionId'] : null; - if ( - ($orderId == $transactionId) - || (!empty($pickupMode)) - ) { + + if ($orderId == $transactionId || !empty($pickupMode)) { $this->checkoutSession->setLastQuoteId($order->getQuoteId()) ->setLastSuccessQuoteId($order->getQuoteId()) ->setLastOrderId($order->getId()) From cc24ffee0f893a65ac52c1454c95e2a01f280517 Mon Sep 17 00:00:00 2001 From: woutse Date: Tue, 18 Jun 2024 12:59:00 +0200 Subject: [PATCH 22/28] Code polish --- Model/Config/Source/PinMoment.php | 10 +++++++--- Model/ConfigProvider.php | 6 +++--- Model/Paymentmethod/Instore.php | 33 ++++++++++++++++++++++--------- 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/Model/Config/Source/PinMoment.php b/Model/Config/Source/PinMoment.php index ed5a242d..8b44ce98 100644 --- a/Model/Config/Source/PinMoment.php +++ b/Model/Config/Source/PinMoment.php @@ -6,6 +6,10 @@ class PinMoment implements ArrayInterface { + const LOCATION_CHECKOUT = 0; + const LOCATION_PICKUP = 1; + const LOCATION_CHOICE = 2; + /** * Options getter * @@ -30,9 +34,9 @@ public function toOptionArray() public function toArray() { return [ - '0' => __("Directly payment initialization(default)"), - '1' => __("Let payment take place at the pickup location, only create a backorder"), - '2' => __("Show a selection for the checkout-user to choose between direct payment or payment at location"), + '0' => __("Direct checkout payment (default)"), + '1' => __("Payment takes place at the pickup location, only create a backorder"), + '2' => __("Provide this choice in the checkout"), ]; } } diff --git a/Model/ConfigProvider.php b/Model/ConfigProvider.php index 15839f14..80ed9d82 100755 --- a/Model/ConfigProvider.php +++ b/Model/ConfigProvider.php @@ -140,7 +140,7 @@ public function getConfig() $config['payment']['showvat'][$code] = $this->getVAT($code); $config['payment']['showdob'][$code] = $this->getDOB($code); $config['payment']['showpinmoment'][$code] = $this->getPinMoment($code); - $config['payment']['pinmomentterminal'][$code] = $this->getPinMomentTerminal($code); + $config['payment']['pinmomentterminal'][$code] = $this->getPinLocationTerminal($code); $config['payment']['showforcompany'][$code] = $this->getCompany($code); $config['payment']['showforgroup'][$code] = $this->getCustomerGroup($code); @@ -253,9 +253,9 @@ protected function getPinMoment($code) * @param string $code * @return mixed */ - protected function getPinMomentTerminal($code) + protected function getPinLocationTerminal($code) { - return $this->methods[$code]->getPinMomentTerminal(); + return $this->methods[$code]->getPinLocationTerminal(); } /** diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 5c5628c9..cc62d882 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -4,6 +4,7 @@ use Magento\Sales\Model\Order; use Paynl\Payment\Helper\PayHelper; +use Paynl\Payment\Model\Config\Source\PinMoment; use Paynl\Payment\Model\PayPaymentCreate; class Instore extends PaymentMethod @@ -63,13 +64,17 @@ public function startTransaction(Order $order, $fromAdmin = false) $url = $store->getBaseUrl() . 'checkout/cart/'; $additionalData = $order->getPayment()->getAdditionalInformation(); + $pinLocation = PinMoment::LOCATION_CHECKOUT; - $pinMoment = $additionalData['pinmoment']; - if (($pinMoment == "1" && !$fromAdmin) || ($this->getPinMoment() == "1" && !$fromAdmin)) { - $pinMoment = ($this->getPinMoment() == "1") ? "1" : $pinMoment; - $order->addStatusHistoryComment(__('PAY.: Payment at pick-up'))->save(); + if ($fromAdmin === false) { + # Betaling start vanuit checkout + if ($this->getPinMoment() == PinMoment::LOCATION_CHOICE) { + # Checkout gebruiker maakt de keuze + $pinLocation = $additionalData['pinmoment'] ?? PinMoment::LOCATION_CHECKOUT; + } else { + $pinLocation = $this->getPinMoment(); + } } - $pinMoment = !$fromAdmin ? $pinMoment : false; $terminalId = null; if (isset($additionalData['payment_option'])) { @@ -79,24 +84,34 @@ public function startTransaction(Order $order, $fromAdmin = false) try { if (empty($terminalId)) { + if (!$fromAdmin) { + $this->messageManager->addNoticeMessage(__('Please select a pin-termina')); + return; + } throw new \Exception(__('Please select a pin-terminal'), 201); } - if ($pinMoment !== '1') { + $this->payHelper->logDebug('pinlocation', [$pinLocation], $store); + + if ($pinLocation != PinMoment::LOCATION_PICKUP) { + $this->payHelper->logDebug('pay here', [$pinLocation], $store); $transaction = (new PayPaymentCreate($order, $this))->create(); $instorePayment = \Paynl\Instore::payment(['transactionId' => $transaction->getTransactionId(), 'terminalId' => $terminalId]); $additionalData['terminal_hash'] = $instorePayment->getHash(); $additionalData['transactionId'] = $transaction->getTransactionId(); + + $url = $instorePayment->getRedirectUrl(); + } else { + $url = $order->getStore()->getBaseUrl() . 'paynl/checkout/finish/?entityid=' . $order->getEntityId() . '&pickup=1'; + $order->addStatusHistoryComment(__('PAY.: Payment at pick-up')); } $additionalData['payment_option'] = $terminalId; $order->getPayment()->setAdditionalInformation($additionalData); $order->save(); - - $url = ($pinMoment == '1') ? $order->getStore()->getBaseUrl() . 'paynl/checkout/finish/?entityid=' . $order->getEntityId() . '&pickup=1' : $instorePayment->getRedirectUrl(); } catch (\Exception $e) { $this->payHelper->logCritical($e->getMessage(), [], $store); @@ -203,7 +218,7 @@ public function getDefaultPaymentOption() /** * @return mixed */ - public function getPinMomentTerminal() + public function getPinLocationTerminal() { return $this->_scopeConfig->getValue('payment/' . $this->_code . '/pinmoment_terminal', 'store'); } From 8f3b0d0abc56360df6f3b466210285daed500ac3 Mon Sep 17 00:00:00 2001 From: woutse Date: Tue, 18 Jun 2024 13:06:34 +0200 Subject: [PATCH 23/28] Code polish --- Model/Paymentmethod/Instore.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index cc62d882..6afb86c8 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -67,12 +67,11 @@ public function startTransaction(Order $order, $fromAdmin = false) $pinLocation = PinMoment::LOCATION_CHECKOUT; if ($fromAdmin === false) { - # Betaling start vanuit checkout - if ($this->getPinMoment() == PinMoment::LOCATION_CHOICE) { - # Checkout gebruiker maakt de keuze + $pinLocation = $this->getPinMoment(); + # Payment starts from checkout + if ($pinLocation == PinMoment::LOCATION_CHOICE) { + # Checkout user chooses pinlocation $pinLocation = $additionalData['pinmoment'] ?? PinMoment::LOCATION_CHECKOUT; - } else { - $pinLocation = $this->getPinMoment(); } } From a08c6da526eefa634904787268eed76361319a5a Mon Sep 17 00:00:00 2001 From: Anne Date: Tue, 18 Jun 2024 16:22:28 +0200 Subject: [PATCH 24/28] Formatting change --- Model/Config/Source/PinMoment.php | 8 ++++---- Model/Paymentmethod/Instore.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Model/Config/Source/PinMoment.php b/Model/Config/Source/PinMoment.php index 8b44ce98..d12082ff 100644 --- a/Model/Config/Source/PinMoment.php +++ b/Model/Config/Source/PinMoment.php @@ -6,10 +6,10 @@ class PinMoment implements ArrayInterface { - const LOCATION_CHECKOUT = 0; - const LOCATION_PICKUP = 1; - const LOCATION_CHOICE = 2; - + public const LOCATION_CHECKOUT = 0; + public const LOCATION_PICKUP = 1; + public const LOCATION_CHOICE = 2; + /** * Options getter * diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 7f7c871f..2c230594 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -95,7 +95,7 @@ public function startTransaction(Order $order, $fromAdmin = false) if ($pinLocation != PinMoment::LOCATION_PICKUP) { $this->payHelper->logDebug('pay here', [$pinLocation], $store); $transaction = (new PayPaymentCreate($order, $this))->create(); - + if ($this->getPaymentOptionId() === 1927) { $additionalData['terminal_hash'] = $transaction->getData()['terminal']['hash']; $url = $transaction->getRedirectUrl(); @@ -104,7 +104,7 @@ public function startTransaction(Order $order, $fromAdmin = false) $additionalData['terminal_hash'] = $instorePayment->getHash(); $url = $instorePayment->getRedirectUrl(); } - + $additionalData['transactionId'] = $transaction->getTransactionId(); } else { $url = $order->getStore()->getBaseUrl() . 'paynl/checkout/finish/?entityid=' . $order->getEntityId() . '&pickup=1'; From 4d113438b04494cd794861421a54f5c1a3335ec8 Mon Sep 17 00:00:00 2001 From: woutse Date: Tue, 18 Jun 2024 21:13:41 +0200 Subject: [PATCH 25/28] Code polish --- Model/Paymentmethod/Instore.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 2c230594..0a5730c7 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -61,7 +61,7 @@ public function initialize($paymentAction, $stateObject) public function startTransaction(Order $order, $fromAdmin = false) { $store = $order->getStore(); - $url = $store->getBaseUrl() . 'checkout/cart/'; + $redirectUrl = $store->getBaseUrl() . 'checkout/cart/'; $additionalData = $order->getPayment()->getAdditionalInformation(); $pinLocation = PinMoment::LOCATION_CHECKOUT; @@ -84,7 +84,7 @@ public function startTransaction(Order $order, $fromAdmin = false) try { if (empty($terminalId)) { if (!$fromAdmin) { - $this->messageManager->addNoticeMessage(__('Please select a pin-termina')); + $this->messageManager->addNoticeMessage(__('Please select a pin-terminal')); return; } throw new \Exception(__('Please select a pin-terminal'), 201); @@ -92,23 +92,22 @@ public function startTransaction(Order $order, $fromAdmin = false) $this->payHelper->logDebug('pinlocation', [$pinLocation], $store); - if ($pinLocation != PinMoment::LOCATION_PICKUP) { - $this->payHelper->logDebug('pay here', [$pinLocation], $store); + if ($pinLocation == PinMoment::LOCATION_PICKUP) { + $redirectUrl = $order->getStore()->getBaseUrl() . 'paynl/checkout/finish/?entityid=' . $order->getEntityId() . '&pickup=1'; + $order->addStatusHistoryComment(__('PAY.: Payment at pick-up')); + } else { $transaction = (new PayPaymentCreate($order, $this))->create(); if ($this->getPaymentOptionId() === 1927) { $additionalData['terminal_hash'] = $transaction->getData()['terminal']['hash']; - $url = $transaction->getRedirectUrl(); + $redirectUrl = $transaction->getRedirectUrl(); } else { $instorePayment = \Paynl\Instore::payment(['transactionId' => $transaction->getTransactionId(), 'terminalId' => $terminalId]); $additionalData['terminal_hash'] = $instorePayment->getHash(); - $url = $instorePayment->getRedirectUrl(); + $redirectUrl = $instorePayment->getRedirectUrl(); } $additionalData['transactionId'] = $transaction->getTransactionId(); - } else { - $url = $order->getStore()->getBaseUrl() . 'paynl/checkout/finish/?entityid=' . $order->getEntityId() . '&pickup=1'; - $order->addStatusHistoryComment(__('PAY.: Payment at pick-up')); } $additionalData['payment_option'] = $terminalId; @@ -133,7 +132,7 @@ public function startTransaction(Order $order, $fromAdmin = false) } } - return $url; + return $redirectUrl; } /** From ccbca2a7c1a3963e3e1b976c4f339dfcb297e6a6 Mon Sep 17 00:00:00 2001 From: woutse Date: Tue, 18 Jun 2024 21:20:21 +0200 Subject: [PATCH 26/28] Code polish --- Controller/Checkout/Finish.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Controller/Checkout/Finish.php b/Controller/Checkout/Finish.php index 52933658..cb0e2703 100644 --- a/Controller/Checkout/Finish.php +++ b/Controller/Checkout/Finish.php @@ -151,21 +151,17 @@ public function execute() $multiShipFinish = is_array($orderIds); try { + $this->checkEmpty($magOrderId, 'magOrderId', 1012); + $order = $this->orderRepository->get($magOrderId); + $this->checkEmpty($order, 'order', 1013); + if ($pickupMode) { - $order = $this->orderRepository->get($magOrderId); - $payOrderId = ''; - $this->deactivateCart($order, $payOrderId, true); - $successUrl = Config::FINISH_PICKUP; - $resultRedirect->setPath($successUrl, ['_query' => ['utm_nooverride' => '1']]); + $this->deactivateCart($order, '', true); + $resultRedirect->setPath(Config::FINISH_PICKUP, ['_query' => ['utm_nooverride' => '1']]); return $resultRedirect; } $this->checkEmpty($payOrderId, 'payOrderid', 101); - $this->checkEmpty($magOrderId, 'magOrderId', 1012); - - $order = $this->orderRepository->get($magOrderId); - $this->checkEmpty($order, 'order', 1013); - $this->config->setStore($order->getStore()); $payment = $order->getPayment(); From 1ce0ca1c378aae5f18ec9de981cc1759e560dcf3 Mon Sep 17 00:00:00 2001 From: Anne Date: Wed, 19 Jun 2024 11:34:19 +0200 Subject: [PATCH 27/28] Extra check if key exists --- Model/Paymentmethod/Instore.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 0a5730c7..3b73c591 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -99,7 +99,12 @@ public function startTransaction(Order $order, $fromAdmin = false) $transaction = (new PayPaymentCreate($order, $this))->create(); if ($this->getPaymentOptionId() === 1927) { - $additionalData['terminal_hash'] = $transaction->getData()['terminal']['hash']; + if (array_key_exists('terminal', $transaction->getData())){ + $additionalData['terminal_hash'] = $transaction->getData()['terminal']['hash']; + } else { + throw new \Exception(__('Pin transaction can not be started in test mode')); + } + $redirectUrl = $transaction->getRedirectUrl(); } else { $instorePayment = \Paynl\Instore::payment(['transactionId' => $transaction->getTransactionId(), 'terminalId' => $terminalId]); From 7a03fbe1498f415e6e0d9bb211e5ccecd2a25d37 Mon Sep 17 00:00:00 2001 From: Anne Date: Wed, 19 Jun 2024 11:34:37 +0200 Subject: [PATCH 28/28] Format --- Model/Paymentmethod/Instore.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Paymentmethod/Instore.php b/Model/Paymentmethod/Instore.php index 3b73c591..4572c41c 100644 --- a/Model/Paymentmethod/Instore.php +++ b/Model/Paymentmethod/Instore.php @@ -99,7 +99,7 @@ public function startTransaction(Order $order, $fromAdmin = false) $transaction = (new PayPaymentCreate($order, $this))->create(); if ($this->getPaymentOptionId() === 1927) { - if (array_key_exists('terminal', $transaction->getData())){ + if (array_key_exists('terminal', $transaction->getData())) { $additionalData['terminal_hash'] = $transaction->getData()['terminal']['hash']; } else { throw new \Exception(__('Pin transaction can not be started in test mode'));