From 3e0bcf533dd6ed669668c392e2997a27d0689306 Mon Sep 17 00:00:00 2001 From: Anne Date: Tue, 20 Dec 2022 12:09:34 +0100 Subject: [PATCH 1/5] Eigen logo toevoegen cadeaukaart Givacard --- paynlpaymentmethods/paynlpaymentmethods.php | 14 ++++++++++++-- paynlpaymentmethods/views/css/PAY_checkout.css | 2 +- .../views/templates/hook/admin_paymentmethods.tpl | 11 +++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/paynlpaymentmethods/paynlpaymentmethods.php b/paynlpaymentmethods/paynlpaymentmethods.php index 8719148..6d1781c 100644 --- a/paynlpaymentmethods/paynlpaymentmethods.php +++ b/paynlpaymentmethods/paynlpaymentmethods.php @@ -449,7 +449,11 @@ private function getPaymentMethods($cart = null) ]); if ($bShowLogo) { - $objPaymentMethod->setLogo($this->_path . 'views/images/' . $paymentMethod->brand_id . '.png'); + $objPaymentMethod->setLogo($this->_path . 'views/images/' . $paymentMethod->brand_id . '.png'); + + if ($paymentMethod->id == 1657 && !empty($paymentMethod->external_logo)) { + $objPaymentMethod->setLogo($paymentMethod->external_logo); + } } $strDescription = empty($paymentMethod->description) ? null : $paymentMethod->description; @@ -1707,6 +1711,11 @@ private function getPaymentMethodsCombined() $changed = true; } + if (!isset($paymentmethod->external_logo)) { + $paymentmethod->external_logo = ''; + $changed = true; + } + foreach ($languages as $language) { $key_name = 'name_' . $language['iso_code']; if (!isset($paymentmethod->$key_name)) { @@ -1741,7 +1750,8 @@ private function getPaymentMethodsCombined() 'allowed_carriers' => [], 'fee_percentage' => false, 'fee_value' => '', - 'customer_type' => 'both' + 'customer_type' => 'both', + 'external_logo' => '' ]; foreach ($languages as $language) { diff --git a/paynlpaymentmethods/views/css/PAY_checkout.css b/paynlpaymentmethods/views/css/PAY_checkout.css index 0d9bf43..8690889 100644 --- a/paynlpaymentmethods/views/css/PAY_checkout.css +++ b/paynlpaymentmethods/views/css/PAY_checkout.css @@ -1,4 +1,4 @@ -.PAYNL.payment-option img { +.payment-option img { margin-top: 0px; float: left; margin-right: 10px; diff --git a/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl b/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl index 196e9bb..d32f340 100644 --- a/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl +++ b/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl @@ -179,6 +179,17 @@

+ {if $paymentmethod->id == 1657} +
+ +
+ +

+ {l s='URL to a different logo to be used in the checkout' mod='paynlpaymentmethods'} +

+
+
+ {/if} From 7321333e9aa2e22dac59b159161bf21988bd3446 Mon Sep 17 00:00:00 2001 From: Anne Date: Fri, 30 Dec 2022 13:40:52 +0100 Subject: [PATCH 2/5] requested changes --- paynlpaymentmethods/views/css/PAY_checkout.css | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/paynlpaymentmethods/views/css/PAY_checkout.css b/paynlpaymentmethods/views/css/PAY_checkout.css index 8690889..62fa24d 100644 --- a/paynlpaymentmethods/views/css/PAY_checkout.css +++ b/paynlpaymentmethods/views/css/PAY_checkout.css @@ -2,10 +2,12 @@ margin-top: 0px; float: left; margin-right: 10px; - width: 50px; cursor: pointer; position: relative; top: -15px; + width: 50px; + height: 50px; + object-fit: contain; } .payment-options form.paynl { From 263fa7fe5effcf63a8b147e51833226e3da49bab Mon Sep 17 00:00:00 2001 From: "k.verschoor@pay.nl" Date: Wed, 4 Jan 2023 09:10:53 +0100 Subject: [PATCH 3/5] PLUG-1664 - Add fix from issue 52 --- paynlpaymentmethods/paynlpaymentmethods.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/paynlpaymentmethods/paynlpaymentmethods.php b/paynlpaymentmethods/paynlpaymentmethods.php index 8719148..7f51829 100644 --- a/paynlpaymentmethods/paynlpaymentmethods.php +++ b/paynlpaymentmethods/paynlpaymentmethods.php @@ -716,10 +716,14 @@ public function processPayment($transactionId, &$message = null) $amountPaid = in_array(round($cartTotalPrice, 2), $arrPayAmounts) ? $cartTotalPrice : null; if (is_null($amountPaid)) { - $amountPaid = in_array(round($cart->getOrderTotal(), 2), $arrPayAmounts) ? $cart->getOrderTotal() : null; + if (in_array(round($cart->getOrderTotal(), 2), $arrPayAmounts)) { + $amountPaid = $cart->getOrderTotal(); + } elseif (in_array(round($cart->getOrderTotal(false), 2), $arrPayAmounts)) { + $amountPaid = $cart->getOrderTotal(false); + } } - $this->payLog('processPayment (order)', 'getOrderTotal: ' . $cart->getOrderTotal() . '. cartTotalPrice: ' . $cartTotalPrice . ' - ' . print_r($arrPayAmounts, true), $cartId, $transactionId); + $this->payLog('processPayment (order)', 'getOrderTotal: ' . $cart->getOrderTotal() . ' getOrderTotal(false): ' . $cart->getOrderTotal(false) . '. cartTotalPrice: ' . $cartTotalPrice . ' - ' . print_r($arrPayAmounts, true), $cartId, $transactionId); if ($orderId) { From 0d6b5257c1018c11c496df05b6956f54c9db7211 Mon Sep 17 00:00:00 2001 From: woutse Date: Wed, 4 Jan 2023 10:48:56 +0100 Subject: [PATCH 4/5] Replaced id with constant --- paynlpaymentmethods/paynlpaymentmethods.php | 5 +++-- paynlpaymentmethods/src/PaymentMethod.php | 1 + .../views/templates/hook/admin_paymentmethods.tpl | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/paynlpaymentmethods/paynlpaymentmethods.php b/paynlpaymentmethods/paynlpaymentmethods.php index 6d1781c..6f7817f 100644 --- a/paynlpaymentmethods/paynlpaymentmethods.php +++ b/paynlpaymentmethods/paynlpaymentmethods.php @@ -451,7 +451,7 @@ private function getPaymentMethods($cart = null) if ($bShowLogo) { $objPaymentMethod->setLogo($this->_path . 'views/images/' . $paymentMethod->brand_id . '.png'); - if ($paymentMethod->id == 1657 && !empty($paymentMethod->external_logo)) { + if (!empty($paymentMethod->external_logo)) { $objPaymentMethod->setLogo($paymentMethod->external_logo); } } @@ -1788,7 +1788,8 @@ public function renderPaymentMethodsForm() 'available_carriers' => $this->getCarriers(), 'image_url' => $this->_path . 'views/images/', 'languages' => Language::getLanguages(true), - 'paymentmethods' => (array) $this->getPaymentMethodsCombined() + 'paymentmethods' => (array) $this->getPaymentMethodsCombined(), + 'showExternalLogoList' => [PaymentMethod::METHOD_GIVACARD, PaymentMethod::METHOD_OVERBOEKING] )); return $this->display(__FILE__, 'admin_paymentmethods.tpl'); diff --git a/paynlpaymentmethods/src/PaymentMethod.php b/paynlpaymentmethods/src/PaymentMethod.php index 7c29b9b..b3915cd 100644 --- a/paynlpaymentmethods/src/PaymentMethod.php +++ b/paynlpaymentmethods/src/PaymentMethod.php @@ -13,6 +13,7 @@ class PaymentMethod const METHOD_SOFORT = 556; const METHOD_INSTORE = 1729; const METHOD_INSTORE_PROFILE_ID = 1633; + const METHOD_GIVACARD = 1657; /** * @param null $transactionId diff --git a/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl b/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl index d32f340..d3916f4 100644 --- a/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl +++ b/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl @@ -179,7 +179,8 @@

- {if $paymentmethod->id == 1657} + + {if in_array($paymentmethod->id,$showExternalLogoList)}
From c08c34e82108fef72103de4f72dc74f5f8a7942e Mon Sep 17 00:00:00 2001 From: Wouter Jonker Date: Fri, 6 Jan 2023 13:30:54 +0100 Subject: [PATCH 5/5] Update paynlpaymentmethods.php --- paynlpaymentmethods/paynlpaymentmethods.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paynlpaymentmethods/paynlpaymentmethods.php b/paynlpaymentmethods/paynlpaymentmethods.php index 6f7817f..896a8ef 100644 --- a/paynlpaymentmethods/paynlpaymentmethods.php +++ b/paynlpaymentmethods/paynlpaymentmethods.php @@ -1789,7 +1789,7 @@ public function renderPaymentMethodsForm() 'image_url' => $this->_path . 'views/images/', 'languages' => Language::getLanguages(true), 'paymentmethods' => (array) $this->getPaymentMethodsCombined(), - 'showExternalLogoList' => [PaymentMethod::METHOD_GIVACARD, PaymentMethod::METHOD_OVERBOEKING] + 'showExternalLogoList' => [PaymentMethod::METHOD_GIVACARD] )); return $this->display(__FILE__, 'admin_paymentmethods.tpl');