We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 19429e72 authored by Rik ter Beek's avatar Rik ter Beek

#67 fix skinCode for PayByMail and added genericConfigProvider for general...

#67 fix skinCode for PayByMail and added genericConfigProvider for general setting to show icons or not
parent d4010f8a
...@@ -132,7 +132,7 @@ class PayByMailCommand implements CommandInterface ...@@ -132,7 +132,7 @@ class PayByMailCommand implements CommandInterface
$orderCurrencyCode = $order->getOrderCurrencyCode(); $orderCurrencyCode = $order->getOrderCurrencyCode();
// check if paybymail has it's own skin // check if paybymail has it's own skin
$skinCode = trim($this->_adyenHelper->getAdyenHppConfigData('skin_code')); $skinCode = trim($this->_adyenHelper->getAdyenPayByMailConfigData('skin_code'));
if ($skinCode == "") { if ($skinCode == "") {
// use HPP skin and HMAC // use HPP skin and HMAC
$skinCode = $this->_adyenHelper->getAdyenHppConfigData('skin_code'); $skinCode = $this->_adyenHelper->getAdyenHppConfigData('skin_code');
......
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Model\Ui;
use Magento\Checkout\Model\ConfigProviderInterface;
class AdyenGenericConfigProvider implements ConfigProviderInterface
{
/**
* @var \Adyen\Payment\Helper\Data
*/
protected $_adyenHelper;
/**
* AdyenGenericConfigProvider constructor.
*
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public function __construct(\Adyen\Payment\Helper\Data $adyenHelper) {
$this->_adyenHelper = $adyenHelper;
}
/**
* Define foreach payment methods the RedirectUrl
*
* @return array
*/
public function getConfig()
{
$config = [
'payment' => []
];
// show logos turned on by default
if ($this->_showLogos()) {
$config['payment']['adyen']['showLogo'] = true;
} else {
$config['payment']['adyen']['showLogo'] = false;
}
return $config;
}
/**
* Return redirect URL for method
*
* @param string $code
* @return mixed
*/
protected function getMethodRedirectUrl($code)
{
return $this->_methods[$code]->getCheckoutRedirectUrl();
}
/**
* @return bool
*/
protected function _showLogos()
{
$showLogos = $this->_adyenHelper->getAdyenAbstractConfigData('title_renderer');
if ($showLogos == \Adyen\Payment\Model\Config\Source\RenderMode::MODE_TITLE_IMAGE) {
return true;
}
return false;
}
}
\ No newline at end of file
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
<payment> <payment>
<adyen_abstract> <adyen_abstract>
<active>0</active> <active>0</active>
<model>Adyen\Payment\Model\Method\AdyenAbstract</model>
<recurring_type>ONECLICK</recurring_type> <recurring_type>ONECLICK</recurring_type>
<order_status>pending</order_status> <order_status>pending</order_status>
<demo_mode>0</demo_mode> <demo_mode>0</demo_mode>
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<type name="Magento\Checkout\Model\CompositeConfigProvider"> <type name="Magento\Checkout\Model\CompositeConfigProvider">
<arguments> <arguments>
<argument name="configProviders" xsi:type="array"> <argument name="configProviders" xsi:type="array">
<item name="adyen_generic_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenGenericConfigProvider</item>
<item name="adyen_cc_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenCcConfigProvider</item> <item name="adyen_cc_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenCcConfigProvider</item>
<item name="adyen_oneclick_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenOneclickConfigProvider</item> <item name="adyen_oneclick_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenOneclickConfigProvider</item>
<item name="adyen_hpp_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenHppConfigProvider</item> <item name="adyen_hpp_config_provider" xsi:type="object">Adyen\Payment\Model\Ui\AdyenHppConfigProvider</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment