diff --git a/paynlpaymentmethods/paynlpaymentmethods.php b/paynlpaymentmethods/paynlpaymentmethods.php index 0477bfc..5330430 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 (!empty($paymentMethod->external_logo)) { + $objPaymentMethod->setLogo($paymentMethod->external_logo); + } } $strDescription = empty($paymentMethod->description) ? null : $paymentMethod->description; @@ -716,10 +720,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) { @@ -1707,6 +1715,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 +1754,8 @@ private function getPaymentMethodsCombined() 'allowed_carriers' => [], 'fee_percentage' => false, 'fee_value' => '', - 'customer_type' => 'both' + 'customer_type' => 'both', + 'external_logo' => '' ]; foreach ($languages as $language) { @@ -1778,7 +1792,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] )); 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/css/PAY_checkout.css b/paynlpaymentmethods/views/css/PAY_checkout.css index 0d9bf43..62fa24d 100644 --- a/paynlpaymentmethods/views/css/PAY_checkout.css +++ b/paynlpaymentmethods/views/css/PAY_checkout.css @@ -1,11 +1,13 @@ -.PAYNL.payment-option img { +.payment-option img { 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 { diff --git a/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl b/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl index 196e9bb..d3916f4 100644 --- a/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl +++ b/paynlpaymentmethods/views/templates/hook/admin_paymentmethods.tpl @@ -179,6 +179,18 @@

+ + {if in_array($paymentmethod->id,$showExternalLogoList)} +
+ +
+ +

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

+
+
+ {/if}