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 ebd7532e authored by Rik ter Beek's avatar Rik ter Beek

Merge pull request #6 from Adyen/develop

Merge branch 'develop'
parents 0dc4ef11 50c8820a
......@@ -25,7 +25,6 @@ namespace Adyen\Payment\Block\Form;
class Cc extends \Magento\Payment\Block\Form
{
private $logger;
/**
* @var string
*/
......@@ -38,21 +37,54 @@ class Cc extends \Magento\Payment\Block\Form
*/
protected $_paymentConfig;
/**
* @var \Adyen\Payment\Helper\Data
*/
protected $_adyenHelper;
/**
* @var \Magento\Store\Model\StoreManagerInterface
*/
protected $_storeManager;
/**
* @param \Magento\Framework\View\Element\Template\Context $context
* @param \Magento\Payment\Model\Config $paymentConfig
* @param \Psr\Log\LoggerInterface $logger
* @param array $data
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Payment\Model\Config $paymentConfig,
\Psr\Log\LoggerInterface $logger,
\Adyen\Payment\Helper\Data $adyenHelper,
\Magento\Store\Model\StoreManagerInterface $storeManager,
array $data = []
) {
parent::__construct($context, $data);
$this->_paymentConfig = $paymentConfig;
$this->logger = $logger;
$this->_adyenHelper = $adyenHelper;
$this->_storeManager = $storeManager;
}
public function getCsePublicKey()
{
// get storeId for admin
if (!$this->_appState->getAreaCode() === \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) {
$storeId = $this->_storeManager->getStore()->getId();
} else {
$storeId = null;
}
$demoMode = $this->_adyenHelper->getAdyenAbstractConfigDataFlag('demo_mode', $storeId);
if($demoMode) {
$cseKey = $this->_adyenHelper->getAdyenCcConfigData('cse_publickey_test', $storeId);
} else {
$cseKey = $this->_adyenHelper->getAdyenCcConfigData('cse_publickey_live', $storeId);
}
return $cseKey;
}
/**
......@@ -118,14 +150,6 @@ class Cc extends \Magento\Payment\Block\Form
public function hasVerification()
{
return true;
// if ($this->getMethod()) {
// $configData = $this->getMethod()->getConfigData('useccv');
// if ($configData === null) {
// return true;
// }
// return (bool)$configData;
// }
// return true;
}
/**
......
......@@ -21,13 +21,12 @@
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Model;
class RecurringType {
CONST NONE = '';
const ONECLICK = 'ONECLICK';
const ONECLICK_RECURRING = 'ONECLICK_RECURRING';
const RECURRING = 'RECURRING';
namespace Adyen\Payment\Block\Form;
class Oneclick extends \Adyen\Payment\Block\Form\Cc
{
/**
* @var string
*/
protected $_template = 'Adyen_Payment::form/oneclick.phtml';
}
\ No newline at end of file
<?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\Block\Info;
use Magento\Framework\View\Element\Template;
class AbstractInfo extends \Magento\Payment\Block\Info
{
/**
* @var \Adyen\Payment\Helper\Data
*/
protected $_adyenHelper;
/**
* Constructor
*
* @param Template\Context $context
* @param array $data
*/
public function __construct(
\Adyen\Payment\Helper\Data $adyenHelper,
Template\Context $context,
array $data = []
)
{
parent::__construct($context, $data);
$this->_adyenHelper = $adyenHelper;
}
public function getAdyenPspReference()
{
return $this->getInfo()->getAdyenPspReference();
}
public function isDemoMode()
{
$storeId = $this->getInfo()->getOrder()->getStoreId();
return $this->_adyenHelper->getAdyenAbstractConfigDataFlag('demo_mode', $storeId);
}
}
\ No newline at end of file
......@@ -21,23 +21,30 @@
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Logger;
namespace Adyen\Payment\Block\Info;
use Monolog\Logger;
class AdyenLogger extends Logger
class Cc extends AbstractInfo
{
/**
* @var string
*/
protected $_template = 'Adyen_Payment::info/adyen_cc.phtml';
/**
* Adds a log record.
* Return credit cart type
*
* @param integer $level The logging level
* @param string $message The log message
* @param array $context The log context
* @return Boolean Whether the record has been processed
* @return string
*/
public function addRecord($level, $message, array $context = [])
public function getCcTypeName()
{
$context['is_exception'] = $message instanceof \Exception;
return parent::addRecord($level, $message, $context);
$types = $this->_adyenHelper->getAdyenCcTypes();
$ccType = $this->getInfo()->getCcType();
if (isset($types[$ccType])) {
return $types[$ccType]['name'];
} else {
return __('Unknown');
}
}
}
\ No newline at end of file
}
......@@ -23,20 +23,15 @@
namespace Adyen\Payment\Block\Info;
class Cc extends \Magento\Payment\Block\Info
class Hpp extends AbstractInfo
{
/**
* @var string
*/
protected $_template = 'Adyen_Payment::info/adyen_cc.phtml';
protected $_template = 'Adyen_Payment::info/adyen_hpp.phtml';
/**
* @return string
*/
// public function toPdf()
// {
// $this->setTemplate('Magento_OfflinePayments::info/pdf/checkmo.phtml');
// return $this->toHtml();
// }
public function isPaymentSelectionOnAdyen()
{
return $this->_adyenHelper->getAdyenHppConfigDataFlag('payment_selection_on_adyen');
}
}
......@@ -23,12 +23,7 @@
namespace Adyen\Payment\Block\Info;
class Hpp extends \Magento\Payment\Block\Info
class Oneclick extends Cc
{
/**
* @var string
*/
protected $_template = 'Adyen_Payment::info/adyen_hpp.phtml';
}
......@@ -75,6 +75,7 @@ class Redirect extends \Magento\Payment\Block\Form
}
} catch(Exception $e) {
// do nothing for now
throw($e);
}
return $result;
......
......@@ -46,18 +46,26 @@ class Json extends \Magento\Framework\App\Action\Action
*/
protected $_adyenHelper;
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
protected $_adyenLogger;
/**
* @param \Magento\Framework\App\Action\Context $context
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
*/
public function __construct(
\Magento\Framework\App\Action\Context $context,
\Adyen\Payment\Helper\Data $adyenHelper
\Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger
) {
parent::__construct($context);
$this->_objectManager = $context->getObjectManager();
$this->_resultFactory = $context->getResultFactory();
$this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;
}
/**
......@@ -67,6 +75,10 @@ class Json extends \Magento\Framework\App\Action\Action
{
try {
$notificationItems = json_decode(file_get_contents('php://input'), true);
// log the notification
$this->_adyenLogger->addAdyenNotification("The content of the notification is: " . print_r($notificationItems,1));
$notificationMode = isset($notificationItems['live']) ? $notificationItems['live'] : "";
if($notificationMode != "" && $this->_validateNotificationMode($notificationMode))
......@@ -79,6 +91,9 @@ class Json extends \Magento\Framework\App\Action\Action
return;
}
}
$this->_adyenLogger->addAdyenNotification("The result is accepted");
$this->getResponse()
->clearHeader('Content-Type')
->setHeader('Content-Type', 'text/html')
......@@ -171,6 +186,8 @@ class Json extends \Magento\Framework\App\Action\Action
throw new \Magento\Framework\Exception\LocalizedException(__($e->getMessage()));
}
}
} else {
return "401";
}
}
......
......@@ -85,7 +85,7 @@ class Result extends \Magento\Framework\App\Action\Action
public function execute()
{
$response = $this->getRequest()->getParams();
$this->_adyenLogger->info(print_r($response, true));
$this->_adyenLogger->addAdyenResult(print_r($response, true));
$result = $this->validateResponse($response);
......@@ -122,18 +122,14 @@ class Result extends \Magento\Framework\App\Action\Action
{
$result = true;
$this->_debugData['Step1'] = 'Processing ResultUrl';
$this->_adyenLogger->addAdyenResult('Processing ResultUrl');
$storeId = null;
if (empty($response)) {
$this->_debugData['error'] = 'Response is empty, please check your webserver that the result url accepts parameters';
$this->_adyenLogger->addAdyenResult('Response is empty, please check your webserver that the result url accepts parameters');
throw new \Magento\Framework\Exception\LocalizedException(__('Response is empty, please check your webserver that the result url accepts parameters'));
}
// Log the results in log file and adyen_debug table
$this->_debugData['response'] = $response;
// authenticate result url
$authStatus = $this->_authenticate($response);
if (!$authStatus) {
......@@ -166,7 +162,7 @@ class Result extends \Magento\Framework\App\Action\Action
]);
} else {
throw new \Magento\Framework\Exception\LocalizedException(__('Order does not exists with increment_id: %s1', $incrementId));
throw new \Magento\Framework\Exception\LocalizedException(__('Order does not exists with increment_id: %1', $incrementId));
}
} else {
throw new \Magento\Framework\Exception\LocalizedException(__('Empty merchantReference'));
......@@ -182,7 +178,7 @@ class Result extends \Magento\Framework\App\Action\Action
{
$result = false;
$this->_debugData['Step2'] = 'Updating the order';
$this->_adyenLogger->addAdyenResult('Updating the order');
$authResult = $response['authResult'];
$paymentMethod = isset($response['paymentMethod']) ? trim($response['paymentMethod']) : '';
......@@ -210,24 +206,24 @@ class Result extends \Magento\Framework\App\Action\Action
case \Adyen\Payment\Model\Notification::PENDING:
// do nothing wait for the notification
$result = true;
$this->_debugData['Step4'] = 'Do nothing wait for the notification';
$this->_adyenLogger->addAdyenResult('Do nothing wait for the notification');
break;
case \Adyen\Payment\Model\Notification::CANCELLED:
$this->_debugData['Step4'] = 'Cancel or Hold the order';
$this->_adyenLogger->addAdyenResult('Cancel or Hold the order');
$result = false;
break;
case \Adyen\Payment\Model\Notification::REFUSED:
// if refused there will be a AUTHORIZATION : FALSE notification send only exception is ideal
$this->_debugData['Step4'] = 'Cancel or Hold the order';
// if refused there will be a AUTHORIZATION : FALSE notification send only exception is idea
$this->_adyenLogger->addAdyenResult('Cancel or Hold the order');
$result = false;
break;
case \Adyen\Payment\Model\Notification::ERROR:
//attempt to hold/cancel
$this->_debugData['Step4'] = 'Cancel or Hold the order';
$this->_adyenLogger->addAdyenResult('Cancel or Hold the order');
$result = false;
break;
default:
$this->_debugData['error'] = 'This event is not supported: ' . $authResult;
$this->_adyenLogger->addAdyenResult('This event is not supported: ' . $authResult);
$result = false;
break;
}
......
......@@ -62,23 +62,27 @@ class Validate3d extends \Magento\Framework\App\Action\Action
public function execute()
{
$active = null;
// check if 3d is active
$order = $this->_getOrder();
$active = $order->getPayment()->getAdditionalInformation('3dActive');
$md = $order->getPayment()->getAdditionalInformation('md');
if($order->getPayment()) {
$active = $order->getPayment()->getAdditionalInformation('3dActive');
}
// check if 3D secure is active. If not just go to success page
if($active) {
$this->_adyenLogger->info("3D secure is active");
$this->_adyenLogger->addAdyenResult("3D secure is active");
// check if it is already processed
if ($this->getRequest()->isPost()) {
$this->_adyenLogger->info("Process 3D secure payment");
$this->_adyenLogger->addAdyenResult("Process 3D secure payment");
$requestMD = $this->getRequest()->getPost('MD');
$requestPaRes = $this->getRequest()->getPost('PaRes');
$md = $order->getPayment()->getAdditionalInformation('md');
if ($requestMD == $md) {
......@@ -101,7 +105,7 @@ class Validate3d extends \Magento\Framework\App\Action\Action
}
}
} else {
$this->_adyenLogger->info("Customer was redirected to bank for 3D-secure validation.");
$this->_adyenLogger->addAdyenResult("Customer was redirected to bank for 3D-secure validation.");
$order->addStatusHistoryComment(__('Customer was redirected to bank for 3D-secure validation.'))->save();
$this->_view->loadLayout();
......
......@@ -32,30 +32,34 @@ class Data extends AbstractHelper
{
/**
* Core store config
*
* @var \Magento\Framework\App\Config\ScopeConfigInterface
* @var \Magento\Framework\Encryption\EncryptorInterface
*/
protected $_scopeConfig;
protected $_encryptor;
/**
* @var \Magento\Framework\Encryption\EncryptorInterface
* @var \Magento\Payment\Model\Config
*/
protected $_encryptor;
protected $_config;
/**
* @var \Magento\Framework\Config\DataInterface
*/
protected $_dataStorage;
/**
* @param Context $context
*/
public function __construct(
\Magento\Framework\App\Helper\Context $context,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Framework\Encryption\EncryptorInterface $encryptor
\Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Magento\Payment\Model\Config $config,
\Magento\Framework\Config\DataInterface $dataStorage
)
{
parent::__construct($context);
$this->_scopeConfig = $scopeConfig;
$this->_encryptor = $encryptor;
$this->_config = $config;
$this->_dataStorage = $dataStorage;
}
......@@ -258,6 +262,28 @@ class Data extends AbstractHelper
return $this->getConfigData($field, 'adyen_hpp', $storeId, true);
}
/**
* @desc Gives back adyen_hpp configuration values
* @param $field
* @param null $storeId
* @return mixed
*/
public function getAdyenOneclickConfigData($field, $storeId = null)
{
return $this->getConfigData($field, 'adyen_oneclick', $storeId);
}
/**
* @desc Gives back adyen_hpp configuration values as flag
* @param $field
* @param null $storeId
* @return mixed
*/
public function getAdyenOneclickConfigDataFlag($field, $storeId = null)
{
return $this->getConfigData($field, 'adyen_oneclick', $storeId, true);
}
/**
* @desc Retrieve decrypted hmac key
* @return string
......@@ -358,6 +384,40 @@ class Data extends AbstractHelper
}
}
/**
* Creditcard type that is selected is different from creditcard type that we get back from the request this
* function get the magento creditcard type this is needed for getting settings like installments
* @param $ccType
* @return mixed
*/
public function getMagentoCreditCartType($ccType)
{
$ccTypesMapper = $this->getCcTypesAltData();
if(isset($ccTypesMapper[$ccType])) {
$ccType = $ccTypesMapper[$ccType]['code'];
}
return $ccType;
}
public function getCcTypesAltData()
{
$adyenCcTypes = $this->getAdyenCcTypes();
$types = array();
foreach ($adyenCcTypes as $key => $data) {
$types[$data['code_alt']] = $data;
$types[$data['code_alt']]['code'] = $key;
}
return $types;
}
public function getAdyenCcTypes()
{
return $this->_dataStorage->get('adyen_credit_cards');
}
/**
* @desc Retrieve information from payment configuration
* @param $field
......@@ -371,9 +431,9 @@ class Data extends AbstractHelper
$path = 'payment/' . $paymentMethodCode . '/' . $field;
if(!$flag) {
return $this->_scopeConfig->getValue($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);
return $this->scopeConfig->getValue($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);
} else {
return $this->_scopeConfig->isSetFlag($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);
return $this->scopeConfig->isSetFlag($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);
}
}
......
<?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\Logger;
use Monolog\Logger;
class AdyenLogger extends Logger
{
/**
* Detailed debug information
*/
const ADYEN_DEBUG = 101;
const ADYEN_NOTIFICATION = 201;
const ADYEN_RESULT = 202;
const ADYEN_NOTIFICATION_CRONJOB = 203;
/**
* Logging levels from syslog protocol defined in RFC 5424
* Overrule the default to add Adyen specific loggers to log into seperate files
*
* @var array $levels Logging levels
*/
protected static $levels = array(
100 => 'DEBUG',
101 => 'ADYEN_DEBUG',
200 => 'INFO',
201 => 'ADYEN_NOTIFICATION',
202 => 'ADYEN_RESULT',
203 => 'ADYEN_NOTIFICATION_CRONJOB',
250 => 'NOTICE',
300 => 'WARNING',
400 => 'ERROR',
500 => 'CRITICAL',
550 => 'ALERT',
600 => 'EMERGENCY',
);
/**
* Adds a log record at the INFO level.
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @return Boolean Whether the record has been processed
*/
public function addAdyenNotification($message, array $context = array())
{
return $this->addRecord(static::ADYEN_NOTIFICATION, $message, $context);
}
public function addAdyenDebug($message, array $context = array())
{
return $this->addRecord(static::ADYEN_DEBUG, $message, $context);
}
public function addAdyenResult($message, array $context = array())
{
return $this->addRecord(static::ADYEN_RESULT, $message, $context);
}
public function addAdyenNotificationCronjob($message, array $context = array())
{
return $this->addRecord(static::ADYEN_NOTIFICATION_CRONJOB, $message, $context);
}
/**
* Adds a log record.
*
* @param integer $level The logging level
* @param string $message The log message
* @param array $context The log context
* @return Boolean Whether the record has been processed
*/
public function addRecord($level, $message, array $context = [])
{
$context['is_exception'] = $message instanceof \Exception;
return parent::addRecord($level, $message, $context);
}
/**
* Adds a log record at the INFO level.
*
* This method allows for compatibility with common interfaces.
*
* @param string $message The log message
* @param array $context The log context
* @return Boolean Whether the record has been processed
*/
public function addNotificationLog($message, array $context = array())
{
return $this->addRecord(static::INFO, $message, $context);
}
}
\ No newline at end of file
......@@ -28,12 +28,12 @@ use Monolog\Formatter\LineFormatter;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
class AdyenDebug extends StreamHandler
class AdyenBase extends StreamHandler
{
/**
* @var string
*/
protected $fileName = '/var/log/adyen/debug.log';
protected $fileName;
/**
* @var int
......@@ -76,4 +76,14 @@ class AdyenDebug extends StreamHandler
parent::write($record);
}
}
/**
* overwrite core it needs to be the exact level otherwise use different handler
*
* {@inheritdoc}
*/
public function isHandling(array $record)
{
return $record['level'] == $this->level;
}
}
\ No newline at end of file
<?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\Logger\Handler;
use Monolog\Logger;
use Adyen\Payment\Logger\AdyenLogger;
class AdyenCronjob extends AdyenBase
{
/**
* @var string
*/
protected $fileName = '/var/log/adyen/cronjob.log';
/**
* @var int
*/
protected $loggerType = AdyenLogger::ADYEN_NOTIFICATION_CRONJOB;
protected $level = AdyenLogger::ADYEN_NOTIFICATION_CRONJOB;
}
<?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\Logger\Handler;
use Adyen\Payment\Logger\AdyenLogger;
use Monolog\Logger;
class AdyenDebug extends AdyenBase
{
/**
* @var string
*/
protected $fileName = '/var/log/adyen/debug.log';
/**
* @var int
*/
protected $loggerType = AdyenLogger::ADYEN_DEBUG;
protected $level = AdyenLogger::ADYEN_DEBUG;
}
<?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\Logger\Handler;
use Adyen\Payment\Logger\AdyenLogger;
use Monolog\Logger;
class AdyenError extends AdyenBase
{
/**
* @var string
*/
protected $fileName = '/var/log/adyen/error.log';
/**
* @var int
*/
protected $loggerType = AdyenLogger::ERROR;
protected $level = AdyenLogger::ERROR;
}
<?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\Logger\Handler;
use Adyen\Payment\Logger\AdyenLogger;
use Monolog\Logger;
class AdyenInfo extends AdyenBase
{
/**
* @var string
*/
protected $fileName = '/var/log/adyen/info.log';
/**
* @var int
*/
protected $loggerType = AdyenLogger::INFO;
protected $level = AdyenLogger::INFO;
}
<?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\Logger\Handler;
use Monolog\Logger;
use Adyen\Payment\Logger\AdyenLogger;
class AdyenNotification extends AdyenBase
{
/**
* @var string
*/
protected $fileName = '/var/log/adyen/notification.log';
/**
* @var int
*/
protected $loggerType = AdyenLogger::ADYEN_NOTIFICATION;
protected $level = AdyenLogger::ADYEN_NOTIFICATION;
}
<?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\Logger\Handler;
use Monolog\Logger;
use Adyen\Payment\Logger\AdyenLogger;
class AdyenResult extends AdyenBase
{
/**
* @var string
*/
protected $fileName = '/var/log/adyen/result.log';
/**
* @var int
*/
protected $loggerType = AdyenLogger::ADYEN_RESULT;
protected $level = AdyenLogger::ADYEN_RESULT;
}
\ No newline at end of file
......@@ -84,10 +84,19 @@ class AdyenCcConfigProvider extends CcGenericConfigProvider
$cseEnabled = $this->adyenHelper->getAdyenCcConfigDataFlag('cse_enabled');
$recurringType = $this->adyenHelper->getAdyenAbstractConfigData('recurring_type');
$canCreateBillingAgreement = false;
if($recurringType == "ONECLICK" || $recurringType == "ONECLICK,RECURRING") {
$canCreateBillingAgreement = true;
}
$config['payment'] ['adyenCc']['cseKey'] = $cseKey;
$config['payment'] ['adyenCc']['cseEnabled'] = $cseEnabled;
$config['payment'] ['adyenCc']['cseEnabled'] = $cseEnabled;
$config['payment']['adyenCc']['generationTime'] = date("c");
$config['payment']['adyenCc']['canCreateBillingAgreement'] = $canCreateBillingAgreement;
foreach ($this->methodCodes as $code) {
if ($this->methods[$code]->isAvailable()) {
......
This diff is collapsed.
<?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;
use Magento\Payment\Model\CcGenericConfigProvider;
use Magento\Payment\Helper\Data as PaymentHelper;
class AdyenOneclickConfigProvider extends CcGenericConfigProvider
{
/**
* @var Config
*/
protected $config;
/**
* @var string[]
*/
protected $methodCodes = [
\Adyen\Payment\Model\Method\Oneclick::METHOD_CODE
];
/**
* @var \Magento\Payment\Model\Method\AbstractMethod[]
*/
protected $methods = [];
/**
* @var PaymentHelper
*/
protected $_paymentHelper;
/**
* @var \Adyen\Payment\Helper\Data
*/
protected $_adyenHelper;
/**
* @var Resource\Billing\Agreement\CollectionFactory
*/
protected $_billingAgreementCollectionFactory;
/**
* @var \Magento\Customer\Model\Session
*/
protected $_customerSession;
/**
* @var \Magento\Checkout\Model\Session
*/
protected $_session;
/**
* @var \Magento\Framework\App\State
*/
protected $_appState;
/**
* @var \Magento\Store\Model\StoreManagerInterface
*/
protected $_storeManager;
/**
* @param \Magento\Payment\Model\CcConfig $ccConfig
* @param PaymentHelper $paymentHelper
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Payment\Model\CcConfig $ccConfig,
PaymentHelper $paymentHelper,
\Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Model\Resource\Billing\Agreement\CollectionFactory $billingAgreementCollectionFactory,
\Magento\Customer\Model\Session $customerSession,
\Magento\Checkout\Model\Session $session,
\Magento\Store\Model\StoreManagerInterface $storeManager
) {
parent::__construct($ccConfig, $paymentHelper, $this->methodCodes);
$this->_paymentHelper = $paymentHelper;
$this->_adyenHelper = $adyenHelper;
$this->_billingAgreementCollectionFactory = $billingAgreementCollectionFactory;
$this->_customerSession = $customerSession;
$this->_session = $session;
$this->_appState = $context->getAppState();
$this->_storeManager = $storeManager;
}
public function getConfig()
{
$config = parent::getConfig();
$demoMode = $this->_adyenHelper->getAdyenAbstractConfigDataFlag('demo_mode');
if($demoMode) {
$cseKey = $this->_adyenHelper->getAdyenCcConfigData('cse_publickey_test');
} else {
$cseKey = $this->_adyenHelper->getAdyenCcConfigData('cse_publickey_live');
}
$cseEnabled = $this->_adyenHelper->getAdyenCcConfigDataFlag('cse_enabled');
$recurringType = $this->_adyenHelper->getAdyenAbstractConfigData('recurring_type');
$canCreateBillingAgreement = false;
if($recurringType == "ONECLICK" || $recurringType == "ONECLICK,RECURRING") {
$canCreateBillingAgreement = true;
}
$config['payment'] ['adyenOneclick']['cseKey'] = $cseKey;
$config['payment'] ['adyenOneclick']['cseEnabled'] = $cseEnabled;
$config['payment'] ['adyenOneclick']['cseEnabled'] = $cseEnabled;
$config['payment']['adyenOneclick']['generationTime'] = date("c");
$config['payment']['adyenOneclick']['canCreateBillingAgreement'] = $canCreateBillingAgreement;
foreach ($this->methodCodes as $code) {
if ($this->methods[$code]->isAvailable()) {
$config['payment']['adyenOneclick']['redirectUrl'][$code] = $this->getMethodRedirectUrl($code);
$config['payment'] ['adyenOneclick']['billingAgreements'] = $this->getAdyenOneclickPaymentMethods();
$recurringContractType = $this->_getRecurringContractType();
$config['payment'] ['adyenOneclick']['recurringContractType'] = $recurringContractType;
if($recurringContractType == \Adyen\Payment\Model\RecurringType::ONECLICK) {
$config['payment'] ['adyenOneclick']['hasCustomerInteraction'] = true;
} else {
$config['payment'] ['adyenOneclick']['hasCustomerInteraction'] = false;
}
$config['payment']['adyenOneclick']['redirectUrl'][$code] = $this->getMethodRedirectUrl($code);
}
}
return $config;
}
/**
* Return redirect URL for method
*
* @param string $code
* @return mixed
*/
protected function getMethodRedirectUrl($code)
{
return $this->methods[$code]->getCheckoutRedirectUrl();
}
public function getAdyenOneclickPaymentMethods()
{
$billingAgreements = [];
if ($this->_customerSession->isLoggedIn()) {
$customerId = $this->_customerSession->getCustomerId();
// is admin?
if ($this->_appState->getAreaCode() === \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) {
//retrieve storeId from quote
$store = $this->_session->getQuote()->getStore();
} else {
$store = $this->_storeManager->getStore();
}
$baCollection = $this->_billingAgreementCollectionFactory->create();
$baCollection->addFieldToFilter('customer_id', $customerId);
$baCollection->addFieldToFilter('store_id', $store->getId());
$baCollection->addFieldToFilter('method_code', 'adyen_oneclick');
$baCollection->addActiveFilter();
$recurringPaymentType = $this->_getRecurringContractType();
foreach ($baCollection as $billingAgreement) {
$agreementData = $billingAgreement->getAgreementData();
// check if AgreementLabel is set and if contract has an recurringType
if($billingAgreement->getAgreementLabel()) {
$data = ['reference_id' => $billingAgreement->getReferenceId(),
'agreement_label' => $billingAgreement->getAgreementLabel(),
'agreement_data' => $agreementData
];
$billingAgreements[] = $data;
}
}
}
return $billingAgreements;
}
/**
* @param Adyen_Payment_Model_Billing_Agreement $billingAgreement
* @param Mage_Core_Model_Store $store
*
* @return bool
*/
protected function _createPaymentMethodFromBA($billingAgreement, $store)
{
$methodInstance = $billingAgreement->getPaymentMethodInstance();
if (! $methodInstance || ! $methodInstance->getConfigData('active', $store)) {
return false;
}
$methodNewCode = 'adyen_oneclick_'.$billingAgreement->getReferenceId();
$methodData = array('model' => 'adyen/adyen_oneclick')
+ $billingAgreement->getOneClickData()
+ Mage::getStoreConfig('payment/adyen_oneclick', $store);
foreach ($methodData as $key => $value) {
$store->setConfig('payment/'.$methodNewCode.'/'.$key, $value);
}
return true;
}
protected function _getRecurringContractType()
{
return $this->_adyenHelper->getAdyenOneclickConfigData('recurring_payment_type');
}
}
\ No newline at end of file
This diff is collapsed.
<?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\Billing;
class Agreement extends \Magento\Paypal\Model\Billing\Agreement
{
/**
* @var \Adyen\Payment\Helper\Data
*/
private $_adyenHelper;
/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Payment\Helper\Data $paymentData
* @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param array $data
*/
public function __construct(
\Adyen\Payment\Helper\Data $adyenHelper,
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Payment\Helper\Data $paymentData,
\Magento\Paypal\Model\ResourceModel\Billing\Agreement\CollectionFactory $billingAgreementFactory,
\Magento\Framework\Stdlib\DateTime\DateTimeFactory $dateFactory,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
)
{
parent::__construct($context, $registry, $paymentData, $billingAgreementFactory, $dateFactory, $resource, $resourceCollection, $data);
$this->_adyenHelper = $adyenHelper;
}
/**
* Not yet possible to set different reference on customer level like magento 1.x version
*
* @return int
*/
public function getCustomerReference()
{
return $this->getCustomerId();
}
public function parseRecurringContractData($data)
{
$this
->setMethodCode('adyen_oneclick')
->setReferenceId($data['recurringDetailReference'])
->setCreatedAt($data['creationDate']);
$creationDate = str_replace(' ', '-', $data['creationDate']);
$this->setCreatedAt($creationDate);
//Billing agreement SEPA
if (isset($data['bank_iban'])) {
$this->setAgreementLabel(__('%1, %2',
$data['bank_iban'],
$data['bank_ownerName']
));
}
// Billing agreement is CC
if (isset($data['card']['number'])) {
$ccType = $data['variant'];
$ccTypes = $this->_adyenHelper->getCcTypesAltData();
if (isset($ccTypes[$ccType])) {
$ccType = $ccTypes[$ccType]['name'];
}
$label = __('%1, %2, **** %3',
$ccType,
$data['card']['holderName'],
$data['card']['number'],
$data['card']['expiryMonth'],
$data['card']['expiryYear']
);
$this->setAgreementLabel($label);
}
if ($data['variant'] == 'paypal') {
$label = __('PayPal %1',
$data['lastKnownShopperEmail']
);
$this->setAgreementLabel($label);
}
$this->setAgreementData($data);
return $this;
}
public function setAgreementData($data)
{
if (is_array($data)) {
unset($data['creationDate']);
unset($data['recurringDetailReference']);
unset($data['payment_method']);
}
$this->setData('agreement_data', json_encode($data));
return $this;
}
public function getAgreementData()
{
return json_decode($this->getData('agreement_data'), true);
}
}
\ No newline at end of file
<?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>
*/
/**
* Payment Config Converter
*/
namespace Adyen\Payment\Model\Config;
class Converter implements \Magento\Framework\Config\ConverterInterface
{
/**
* {@inheritdoc}
*/
public function convert($source)
{
$xpath = new \DOMXPath($source);
return [
'adyen_credit_cards' => $this->convertCreditCards($xpath),
];
}
/**
* Convert credit cards xml tree to array
*
* @param \DOMXPath $xpath
* @return array
*/
protected function convertCreditCards(\DOMXPath $xpath)
{
$creditCards = [];
/** @var \DOMNode $type */
foreach ($xpath->query('/payment/adyen_credit_cards/type') as $type) {
$typeArray = [];
/** @var $typeSubNode \DOMNode */
foreach ($type->childNodes as $typeSubNode) {
switch ($typeSubNode->nodeName) {
case 'label':
$typeArray['name'] = $typeSubNode->nodeValue;
break;
case 'code_alt':
$typeArray['code_alt'] = $typeSubNode->nodeValue;
default:
break;
}
}
$typeAttributes = $type->attributes;
$typeArray['order'] = $typeAttributes->getNamedItem('order')->nodeValue;
$ccId = $typeAttributes->getNamedItem('id')->nodeValue;
$creditCards[$ccId] = $typeArray;
}
uasort($creditCards, [$this, '_compareCcTypes']);
$config = [];
foreach ($creditCards as $code => $data) {
$config[$code] = $data;
}
return $config;
}
/**
* Compare sort order of CC Types
*
* @SuppressWarnings(PHPMD.UnusedPrivateMethod) Used in callback.
*
* @param array $left
* @param array $right
* @return int
*/
private function _compareCcTypes($left, $right)
{
return $left['order'] - $right['order'];
}
/**
* Convert methods xml tree to array
*
* @param \DOMXPath $xpath
* @return array
*/
protected function convertMethods(\DOMXPath $xpath)
{
$config = [];
/** @var \DOMNode $method */
foreach ($xpath->query('/payment/methods/method') as $method) {
$name = $method->attributes->getNamedItem('name')->nodeValue;
/** @var $methodSubNode \DOMNode */
foreach ($method->childNodes as $methodSubNode) {
if ($methodSubNode->nodeType != XML_ELEMENT_NODE) {
continue;
}
$config[$name][$methodSubNode->nodeName] = $methodSubNode->nodeValue;
}
}
return $config;
}
}
......@@ -20,50 +20,78 @@
*
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Controller\Process;
use Symfony\Component\Config\Definition\Exception\Exception;
/**
* Class Json
* @package Adyen\Payment\Controller\Process
* Loads catalog attributes configuration from multiple XML files by merging them together
*/
class Cron extends \Magento\Framework\App\Action\Action
{
namespace Adyen\Payment\Model\Config;
class Reader extends \Magento\Framework\Config\Reader\Filesystem
{
/**
* @var \Magento\Framework\ObjectManagerInterface
* List of identifier attributes for merging
*
* @var array
*/
protected $_objectManager;
protected $_idAttributes = [
'/payment/adyen_credit_cards/type' => 'id'
];
/**
* @var \Magento\Framework\Controller\Result\RawFactory
*/
protected $_resultFactory;
/**
* @param \Magento\Framework\App\Action\Context $context
* Load configuration scope
*
* @param string|null $scope
* @return array
*/
public function __construct(
\Magento\Framework\App\Action\Context $context
) {
parent::__construct($context);
$this->_objectManager = $context->getObjectManager();
$this->_resultFactory = $context->getResultFactory();
public function read($scope = null)
{
$scope = $scope ?: $this->_defaultScope;
$fileList = $this->_fileResolver->get($this->_fileName, $scope);
if (!count($fileList)) {
return [];
}
$output = $this->_readFiles($fileList);
return $output;
}
/**
* Read configuration files
*
* @param array $fileList
* @return array
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function execute()
protected function _readFiles($fileList)
{
/** @var \Magento\Framework\Config\Dom $configMerger */
$configMerger = null;
foreach ($fileList as $key => $content) {
try {
if (!$configMerger) {
$configMerger = $this->_createConfigMerger($this->_domDocumentClass, $content);
} else {
$configMerger->merge($content);
}
} catch (\Magento\Framework\Config\Dom\ValidationException $e) {
throw new \Magento\Framework\Exception\LocalizedException(
new \Magento\Framework\Phrase("Invalid XML in file %1:\n%2", [$key, $e->getMessage()])
);
}
}
if ($this->validationState->isValidationRequired()) {
$errors = [];
if ($configMerger && !$configMerger->validate($this->_schemaFile, $errors)) {
$message = "Invalid Document \n";
throw new \Magento\Framework\Exception\LocalizedException(
new \Magento\Framework\Phrase($message . implode("\n", $errors))
);
}
}
$cron = $this->_objectManager->create('Adyen\Payment\Model\Cron');
$cron->processNotification();
die();
$output = [];
if ($configMerger) {
$output = $this->_converter->convert($configMerger->getDom());
}
return $output;
}
}
\ No newline at end of file
}
......@@ -20,77 +20,66 @@
*
* Author: Adyen <magento@adyen.com>
*/
/**
* Locator for payment config XSD schemas.
*/
namespace Adyen\Payment\Model\Config;
namespace Adyen\Payment\Model;
use Magento\Checkout\Model\ConfigProviderInterface;
use Magento\Payment\Helper\Data as PaymentHelper;
use Magento\Framework\Module\Dir;
class AdyenHppConfigProvider implements ConfigProviderInterface
class SchemaLocator implements \Magento\Framework\Config\SchemaLocatorInterface
{
/**
* @var Config
* Merged config schema file name
*/
protected $config;
const MERGED_CONFIG_SCHEMA = 'adyen_payment_file.xsd';
/**
* @var string[]
* Per file validation schema file name
*/
protected $methodCodes = [
'adyen_hpp'
];
const PER_FILE_VALIDATION_SCHEMA = 'adyen_payment.xsd';
/**
* @var \Magento\Payment\Model\Method\AbstractMethod[]
* Path to corresponding XSD file with validation rules for merged config
*
* @var string
*/
protected $methods = [];
protected $_schema = null;
/**
* @var PaymentHelper
* Path to corresponding XSD file with validation rules for separate config files
*
* @var string
*/
protected $paymentHelper;
protected $_perFileSchema = null;
/**
* @param PaymentHelper $paymentHelper
* @param \Magento\Framework\Module\Dir\Reader $moduleReader
*/
public function __construct(
PaymentHelper $paymentHelper
) {
$this->paymentHelper = $paymentHelper;
foreach ($this->methodCodes as $code) {
$this->methods[$code] = $this->paymentHelper->getMethodInstance($code);
}
public function __construct(\Magento\Framework\Module\Dir\Reader $moduleReader)
{
$etcDir = $moduleReader->getModuleDir(\Magento\Framework\Module\Dir::MODULE_ETC_DIR, 'Adyen_Payment');
$this->_schema = $etcDir . '/' . self::MERGED_CONFIG_SCHEMA;
$this->_perFileSchema = $etcDir . '/' . self::PER_FILE_VALIDATION_SCHEMA;
}
public function getConfig()
/**
* Get path to merged config schema
*
* @return string|null
*/
public function getSchema()
{
$config = [
'payment' => [
'adyenHpp' => [
]
]
];
foreach ($this->methodCodes as $code) {
if ($this->methods[$code]->isAvailable()) {
$config['payment']['adyenHpp']['redirectUrl'][$code] = $this->getMethodRedirectUrl($code);
}
}
return $config;
return $this->_schema;
}
/**
* Return redirect URL for method
* Get path to per file validation schema
*
* @param string $code
* @return mixed
* @return string|null
*/
protected function getMethodRedirectUrl($code)
public function getPerFileSchema()
{
return $this->methods[$code]->getCheckoutRedirectUrl();
return $this->_perFileSchema;
}
}
\ No newline at end of file
}
<?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\Config\Source;
/**
* Class CcType
* @codeCoverageIgnore
*/
class CcType extends \Magento\Payment\Model\Source\Cctype
{
/**
* Allowed credit card types
*
* @return string[]
*/
public function getAllowedTypes()
{
return ['VI', 'MC', 'AE', 'DI', 'JCB', 'OT'];
}
}
<?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\Config\Source;
class RecurringPaymentType implements \Magento\Framework\Option\ArrayInterface
{
const UNDEFINED_OPTION_LABEL = 'NONE';
/**
* @var \Magento\Sales\Model\Order\Config
*/
protected $_orderConfig;
/**
* @var \Adyen\Payment\Helper\Data
*/
protected $_adyenHelper;
/**
* @param \Magento\Sales\Model\Order\Config $orderConfig
* @param \Adyen\Payment\Helper\Data $adyenHelper
*/
public function __construct(
\Magento\Sales\Model\Order\Config $orderConfig,
\Adyen\Payment\Helper\Data $adyenHelper
)
{
$this->_orderConfig = $orderConfig;
$this->_adyenHelper = $adyenHelper;
}
/**
* @return array
*/
public function toOptionArray()
{
$recurringTypes = $this->_adyenHelper->getRecurringTypes();
foreach ($recurringTypes as $code => $label) {
if($code == \Adyen\Payment\Model\RecurringType::ONECLICK || $code == \Adyen\Payment\Model\RecurringType::RECURRING) {
$options[] = ['value' => $code, 'label' => $label];
}
}
return $options;
}
}
This diff is collapsed.
......@@ -23,11 +23,10 @@
namespace Adyen\Payment\Model\Method;
use Magento\Framework\Object;
use Magento\Framework\DataObject;
use Magento\Payment\Model\Method\ConfigInterface;
use Magento\Payment\Model\Method\Online\GatewayInterface;
/**
* @method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes()
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class AdyenAbstract extends \Magento\Payment\Model\Method\AbstractMethod implements GatewayInterface
......@@ -52,14 +51,13 @@ class AdyenAbstract extends \Magento\Payment\Model\Method\AbstractMethod impleme
* @param Object $request
* @param ConfigInterface $config
*
* @return Object
* @return DataObject
*
* @throws \Exception
*/
public function postRequest(Object $request, ConfigInterface $config)
public function postRequest(DataObject $request, ConfigInterface $config)
{
// Not needed only used for global configuration settings
}
}
\ No newline at end of file
......@@ -23,6 +23,12 @@
namespace Adyen\Payment\Model\Method;
/**
* Adyen CreditCard payment method
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Cc extends \Magento\Payment\Model\Method\Cc
{
......@@ -91,7 +97,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
* @param \Magento\Payment\Model\Method\Logger $logger
* @param \Magento\Framework\Module\ModuleListInterface $moduleList
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
* @param \Magento\Framework\Model\Resource\AbstractResource|null $resource
* @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
......@@ -111,7 +117,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
\Magento\Payment\Model\Method\Logger $logger,
\Magento\Framework\Module\ModuleListInterface $moduleList,
\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
) {
......@@ -144,14 +150,17 @@ class Cc extends \Magento\Payment\Model\Method\Cc
/**
* Assign data to info model instance
*
* @param \Magento\Framework\Object|mixed $data
* @param \Magento\Framework\DataObject|mixed $data
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function assignData($data)
public function assignData(\Magento\Framework\DataObject $data)
{
parent::assignData($data);
$infoInstance = $this->getInfoInstance();
$infoInstance->setCcType($data['cc_type']);
if($this->_adyenHelper->getAdyenCcConfigDataFlag('cse_enabled')) {
if(isset($data['encrypted_data'])) {
$infoInstance->setAdditionalInformation('encrypted_data', $data['encrypted_data']);
......@@ -159,6 +168,24 @@ class Cc extends \Magento\Payment\Model\Method\Cc
throw new \Magento\Framework\Exception\LocalizedException(__('Card encryption failed'));
}
}
// save value remember details checkbox
$infoInstance->setAdditionalInformation('store_cc', $data['store_cc']);
return $this;
}
/**
* Validate payment method information object
*
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.NPathComplexity)
*/
public function validate()
{
// validation only possible on front-end for CSE script
return $this;
}
......@@ -184,11 +211,11 @@ class Cc extends \Magento\Payment\Model\Method\Cc
return $this;
}
protected function _processRequest(\Magento\Framework\Object $payment, $amount, $request)
protected function _processRequest(\Magento\Sales\Model\Order\Payment $payment, $amount, $request)
{
switch ($request) {
case "authorise":
$response = $this->_paymentRequest->fullApiRequest($payment);
$response = $this->_paymentRequest->fullApiRequest($payment, $this->_code);
break;
}
......@@ -203,32 +230,32 @@ class Cc extends \Magento\Payment\Model\Method\Cc
{
$payment->setAdditionalInformation('3dActive', false);
switch ($response['paymentResult_resultCode']) {
switch ($response['resultCode']) {
case "Authorised":
//$this->_addStatusHistory($payment, $responseCode, $pspReference, $this->_getConfigData('order_status'));
$this->_addStatusHistory($payment, $response['paymentResult_resultCode'], $response['paymentResult_pspReference']);
$payment->setAdditionalInformation('pspReference', $response['paymentResult_pspReference']);
$this->_addStatusHistory($payment, $response['resultCode'], $response['pspReference']);
$payment->setAdditionalInformation('pspReference', $response['pspReference']);
break;
case "RedirectShopper":
// 3d is active so set the param to true checked in Controller/Validate3d
$payment->setAdditionalInformation('3dActive', true);
$issuerUrl = $response['paymentResult_issuerUrl'];
$PaReq = $response['paymentResult_paRequest'];
$md = $response['paymentResult_md'];
$issuerUrl = $response['issuerUrl'];
$PaReq = $response['paRequest'];
$md = $response['md'];
if(!empty($PaReq) && !empty($md) && !empty($issuerUrl)) {
$payment->setAdditionalInformation('issuerUrl', $response['paymentResult_issuerUrl']);
$payment->setAdditionalInformation('paRequest', $response['paymentResult_paRequest']);
$payment->setAdditionalInformation('md', $response['paymentResult_md']);
$payment->setAdditionalInformation('issuerUrl', $response['issuerUrl']);
$payment->setAdditionalInformation('paRequest', $response['paRequest']);
$payment->setAdditionalInformation('md', $response['md']);
} else {
throw new \Magento\Framework\Exception\LocalizedException(__('3D secure is not valid'));
}
break;
case "Refused":
// paymentResult_refusalReason
if($response['paymentResult_refusalReason']) {
// refusalReason
if($response['refusalReason']) {
$refusalReason = $response['paymentResult_refusalReason'];
$refusalReason = $response['refusalReason'];
switch($refusalReason) {
case "Transaction Not Permitted":
$errorMsg = __('The transaction is not permitted.');
......@@ -246,16 +273,16 @@ class Cc extends \Magento\Payment\Model\Method\Cc
$errorMsg = __('The expiry month is not set. Please check your expiry month!');
break;
default:
$errorMsg = __('The payment is REFUSED by Adyen.');
$errorMsg = __('The payment is REFUSED.');
break;
}
} else {
$errorMsg = __('The payment is REFUSED by Adyen.');
$errorMsg = __('The payment is REFUSED.');
}
if ($errorMsg) {
$this->_logger->critical($errorMsg);
throw new \Magento\Framework\Exception\LocalizedException($errorMsg);
throw new \Magento\Framework\Exception\LocalizedException(__($errorMsg));
}
break;
}
......@@ -278,7 +305,7 @@ class Cc extends \Magento\Payment\Model\Method\Cc
{
$response = $this->_paymentRequest->authorise3d($payment);
$responseCode = $response['paymentResult_resultCode'];
$responseCode = $response['resultCode'];
return $responseCode;
}
......@@ -294,4 +321,44 @@ class Cc extends \Magento\Payment\Model\Method\Cc
return $this->_urlBuilder->getUrl('adyen/process/validate3d/');
}
/**
* Capture on Adyen
*
* @param \Magento\Payment\Model\InfoInterface $payment
* @param float $amount
*/
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{
parent::capture($payment, $amount);
$this->_paymentRequest->capture($payment, $amount);
return $this;
}
/**
* Refund specified amount for payment
*
* @param \Magento\Framework\DataObject|InfoInterface $payment
* @param float $amount
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
* @api
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function refund(\Magento\Payment\Model\InfoInterface $payment, $amount)
{
parent::refund($payment, $amount);
$order = $payment->getOrder();
// if amount is a full refund send a refund/cancelled request so if it is not captured yet it will cancel the order
$grandTotal = $order->getGrandTotal();
if($grandTotal == $amount) {
$this->_paymentRequest->cancelOrRefund($payment);
} else {
$this->_paymentRequest->refund($payment, $amount);
}
return $this;
}
}
\ No newline at end of file
......@@ -23,12 +23,13 @@
namespace Adyen\Payment\Model\Method;
use Magento\Framework\Object;
use Magento\Framework\DataObject;
use Magento\Payment\Model\Method\ConfigInterface;
use Magento\Payment\Model\Method\Online\GatewayInterface;
/**
* @method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes()
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements GatewayInterface
......@@ -46,7 +47,6 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
*/
const GUEST_ID = 'customer_';
// protected $_formBlockType = 'Adyen\Payment\Block\Form\Hpp';
protected $_infoBlockType = 'Adyen\Payment\Block\Info\Hpp';
......@@ -58,6 +58,21 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
protected $_isGateway = true;
protected $_canAuthorize = true;
protected $_isInitializeNeeded = true;
protected $_canRefund = true;
protected $_canRefundInvoicePartial = true;
/**
* Payment Method feature
*
* @var bool
*/
protected $_canUseInternal = false;
/**
* @var \Adyen\Payment\Model\Api\PaymentRequest
*/
protected $_paymentRequest;
/**
* @var \Adyen\Payment\Helper\Data
......@@ -86,6 +101,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
protected $_adyenLogger;
/**
* @param \Adyen\Payment\Model\Api\PaymentRequest $paymentRequest
* @param \Magento\Framework\UrlInterface $urlBuilder
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
......@@ -98,12 +114,13 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
* @param \Magento\Payment\Helper\Data $paymentData
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Magento\Payment\Model\Method\Logger $logger
* @param \Magento\Framework\Model\Resource\AbstractResource|null $resource
* @param \Magento\Framework\Model\ResourceModel\AbstractResource|null $resource
* @param \Magento\Framework\Data\Collection\AbstractDb|null $resourceCollection
* @param array $data
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
\Adyen\Payment\Model\Api\PaymentRequest $paymentRequest,
\Magento\Framework\UrlInterface $urlBuilder,
\Adyen\Payment\Helper\Data $adyenHelper,
\Magento\Store\Model\StoreManagerInterface $storeManager,
......@@ -116,7 +133,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
\Magento\Payment\Helper\Data $paymentData,
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Magento\Payment\Model\Method\Logger $logger,
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
) {
......@@ -132,6 +149,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
$resourceCollection,
$data
);
$this->_paymentRequest = $paymentRequest;
$this->_urlBuilder = $urlBuilder;
$this->_adyenHelper = $adyenHelper;
$this->storeManager = $storeManager;
......@@ -159,6 +177,31 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
$stateObject->setStatus($this->_adyenHelper->getAdyenAbstractConfigData('order_status'));
}
/**
* Assign data to info model instance
*
* @param \Magento\Framework\DataObject|mixed $data
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function assignData(\Magento\Framework\DataObject $data)
{
parent::assignData($data);
$infoInstance = $this->getInfoInstance();
if(isset($data['brand_code'])) {
$infoInstance->setAdditionalInformation('brand_code', $data['brand_code']);
}
if(isset($data['issuer_id'])) {
$infoInstance->setAdditionalInformation('issuer_id', $data['issuer_id']);
}
$this->_adyenLogger->debug(print_r($data,1));
return $this;
}
/**
* Checkout redirect URL getter for onepage checkout (hardcode)
*
......@@ -182,7 +225,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
*
* @throws \Exception
*/
public function postRequest(Object $request, ConfigInterface $config)
public function postRequest(DataObject $request, ConfigInterface $config)
{
// Implement postRequest() method.
}
......@@ -190,11 +233,9 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
/**
* @desc Get url of Adyen payment
* @return string
* @todo add brandCode here
*/
public function getFormUrl()
{
// $brandCode = $this->getInfoInstance()->getCcType();
$paymentRoutine = $this->getConfigData('payment_routine');
switch ($this->_adyenHelper->isDemoMode()) {
......@@ -217,15 +258,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
}
break;
}
//IDEAL
// $idealBankUrl = false;
// $bankData = $this->getInfoInstance()->getPoNumber();
// if ($brandCode == 'ideal' && !empty($bankData)) {
// $idealBankUrl = ($isConfigDemoMode == true)
// ? 'https://test.adyen.com/hpp/redirectIdeal.shtml'
// : 'https://live.adyen.com/hpp/redirectIdeal.shtml';
// }
// return (!empty($idealBankUrl)) ? $idealBankUrl : $url;
return $url;
}
......@@ -257,7 +290,6 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
}
}
$formFields = array();
$formFields['merchantAccount'] = $merchantAccount;
......@@ -291,11 +323,16 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
$hmacKey = $this->_adyenHelper->getHmac();
$brandCode = $this->getInfoInstance()->getCcType();
$brandCode = $order->getPayment()->getAdditionalInformation("brand_code");
if($brandCode) {
$formFields['brandCode'] = $brandCode;
}
$issuerId = $order->getPayment()->getAdditionalInformation("issuer_id");
if($issuerId) {
$formFields['issuerId'] = $issuerId;
}
// Sort the array by key using SORT_STRING order
ksort($formFields, SORT_STRING);
......@@ -306,7 +343,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
$formFields['merchantSig'] = $merchantSig;
$this->_adyenLogger->info(print_r($formFields, true));
$this->_adyenLogger->debug(print_r($formFields, true));
return $formFields;
}
......@@ -325,5 +362,47 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
return $this->getConfigData('payment_selection_on_adyen');
}
/**
* Capture on Adyen
*
* @param \Magento\Payment\Model\InfoInterface $payment
* @param float $amount
*/
public function capture(\Magento\Payment\Model\InfoInterface $payment, $amount)
{
parent::capture($payment, $amount);
$this->_paymentRequest->capture($payment, $amount);
return $this;
}
/**
* Refund specified amount for payment
*
* @param \Magento\Framework\DataObject|InfoInterface $payment
* @param float $amount
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
* @api
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function refund(\Magento\Payment\Model\InfoInterface $payment, $amount)
{
parent::refund($payment, $amount);
// get pspReference
$pspReference = $payment->getAdyenPspReference();
$order = $payment->getOrder();
// if amount is a full refund send a refund/cancelled request so if it is not captured yet it will cancel the order
$grandTotal = $order->getGrandTotal();
if($grandTotal == $amount) {
$this->_paymentRequest->cancelOrRefund($payment);
} else {
$this->_paymentRequest->refund($payment, $amount);
}
return $this;
}
}
\ No newline at end of file
<?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\Method;
use Magento\Framework\Webapi\Exception;
/**
* Adyen CreditCard payment method
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
* @SuppressWarnings(PHPMD.TooManyFields)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Oneclick extends \Adyen\Payment\Model\Method\Cc
{
const METHOD_CODE = 'adyen_oneclick';
/**
* @var string
*/
protected $_code = self::METHOD_CODE;
/**
* @var string
*/
protected $_formBlockType = 'Adyen\Payment\Block\Form\Oneclick';
protected $_infoBlockType = 'Adyen\Payment\Block\Info\Oneclick';
/**
* Payment Method not ready for internal use
*
* @var bool
*/
protected $_canUseInternal = false;
/**
* Assign data to info model instance
*
* @param \Magento\Framework\DataObject|mixed $data
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function assignData(\Magento\Framework\DataObject $data)
{
parent::assignData($data);
$infoInstance = $this->getInfoInstance();
// get from variant magento code for creditcard type and set this in ccType
$variant = $data['variant'];
$ccType = $this->_adyenHelper->getMagentoCreditCartType($variant);
$infoInstance->setCcType($ccType);
// save value remember details checkbox
$infoInstance->setAdditionalInformation('recurring_detail_reference', $data['recurring_detail_reference']);
$recurringPaymentType = $this->_adyenHelper->getAdyenOneclickConfigData('recurring_payment_type');
if($recurringPaymentType == \Adyen\Payment\Model\RecurringType::ONECLICK) {
$customerInteraction = true;
} else {
$customerInteraction = false;
}
$infoInstance->setAdditionalInformation('customer_interaction', $customerInteraction);
return $this;
}
public function updateBillingAgreementStatus(\Adyen\Payment\Model\Billing\Agreement $agreement)
{
$targetStatus = $agreement->getStatus();
if($targetStatus == \Magento\Paypal\Model\Billing\Agreement::STATUS_CANCELED) {
try {
$this->_paymentRequest->disableRecurringContract(
$agreement->getReferenceId(),
$agreement->getCustomerReference()
);
} catch(Exception $e) {
throw new \Magento\Framework\Exception\LocalizedException(__('Failed to disable this contract'));
}
}
return $this;
}
}
\ No newline at end of file
......@@ -54,7 +54,7 @@ class Notification extends \Magento\Framework\Model\AbstractModel
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\Model\Resource\AbstractResource $resource = null,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
) {
......
<?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;
class RecurringType {
CONST NONE = '';
const ONECLICK = 'ONECLICK';
const ONECLICK_RECURRING = 'ONECLICK_RECURRING';
const RECURRING = 'RECURRING';
protected $_allowedRecurringTypesForListRecurringCall = [
self::ONECLICK,
self::RECURRING
];
public function getAllowedRecurringTypesForListRecurringCall()
{
return $this->_allowedRecurringTypesForListRecurringCall;
}
}
\ No newline at end of file
<?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\Resource\Billing;
/**
* Billing agreement resource model
*/
class Agreement extends \Magento\Paypal\Model\ResourceModel\Billing\Agreement
{
}
\ No newline at end of file
<?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\Resource\Billing\Agreement;
/**
* Billing agreements resource collection
*/
class Collection extends \Magento\Paypal\Model\ResourceModel\Billing\Agreement\Collection
{
/**
* Collection initialization
*
* @return void
*/
protected function _construct()
{
$this->_init('Adyen\Payment\Model\Billing\Agreement', 'Magento\Paypal\Model\ResourceModel\Billing\Agreement');
}
/**
* @return $this
*/
public function addActiveFilter()
{
$this->addFieldToFilter('status', \Magento\Paypal\Model\Billing\Agreement::STATUS_ACTIVE);
return $this;
}
}
......@@ -23,7 +23,7 @@
namespace Adyen\Payment\Model\Resource;
class Notification extends \Magento\Framework\Model\Resource\Db\AbstractDb
class Notification extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
public function _construct()
......@@ -40,13 +40,12 @@ class Notification extends \Magento\Framework\Model\Resource\Db\AbstractDb
*/
public function getNotification($pspReference, $eventCode, $success)
{
$adapter = $this->getReadConnection();
$select = $adapter->select()
$select = $this->getConnection()->select()
->from(['notification' => $this->getTable('adyen_notification')])
->where('notification.pspreference=?', $pspReference)
->where('notification.event_code=?', $eventCode)
->where('notification.success=?', $success);
return $adapter->fetchPairs($select);
return $this->getConnection()->fetchAll($select);
}
}
\ No newline at end of file
......@@ -23,7 +23,7 @@
namespace Adyen\Payment\Model\Resource\Notification;
class Collection extends \Magento\Framework\Model\Resource\Db\Collection\AbstractCollection
class Collection extends \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection
{
public function _construct()
{
......
# Adyen_Magento2
Adyen Payment plugin for Magento2
## Install with Composer ##
composer require adyen/module-payment
## Manual ##
<a href="https://docs.adyen.com/manuals/magento2-integration" target="_blank">https://docs.adyen.com/manuals/magento2-integration</a>
## Setup Cron ##
Make sure that your magento cron is running every minute. We are using a cronjob to process the notifications. The cronjob will be executed every minute. It only executes the notifications that have been received at least 2 minutes ago. We have built in this 2 minutes so we are sure Magento has created the order and all save after events are executed. A handy tool to get inside into your cronjobs is AOE scheduler. You can download this tool through Magento Connect or GitHub
## Support ##
You can create issues on our Magento Repository or if you have some specific problems for your account you can contact magento@adyen.com as well.
## API Library ##
This module is using the Adyen APIs Library for PHP for all (API) connections to Adyen.
<a href="https://github.com/Adyen/adyen-php-api-library" target="_blank">This library can be found here</a>
## Setting up cronjob ##
The notifications of Adyen (this will give you the indication of the payment status) is processed by a cronjob. You need to setup your cronjob. <a href="http://devdocs.magento.com/guides/v2.0/config-guide/cli/config-cli-subcommands-cron.html" target="_blank">This is described here</a>
We have defined this:
```
<group id="index">
<job name="adyen_payment_process_notification" instance="Adyen\Payment\Model\Cron" method="processNotification">
<schedule>*/1 * * * *</schedule>
</job>
</group>
```
<?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\Setup;
use Magento\Framework\DB\Ddl\Table;
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
/**
* Upgrade the Catalog module DB scheme
*/
class UpgradeSchema implements UpgradeSchemaInterface
{
/**
* {@inheritdoc}
*/
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
if (version_compare($context->getVersion(), '1.0.0.1', '<')) {
$this->updateSchemaVersion1001($setup);
}
if (version_compare($context->getVersion(), '1.0.0.2', '<')) {
$this->updateSchemaVersion1002($setup);
}
$setup->endSetup();
}
public function updateSchemaVersion1001($setup)
{
$connection = $setup->getConnection();
// Add column to indicate if last notification has success true or false
$adyenNotificationEventCodeSuccessColumn = [
'type' => Table::TYPE_BOOLEAN,
'length' => 1,
'nullable' => true,
'comment' => 'Adyen Notification event code success flag'
];
$connection->addColumn($setup->getTable('sales_order'), 'adyen_notification_event_code_success', $adyenNotificationEventCodeSuccessColumn);
// add column to order_payment to save Adyen PspReference
$pspReferenceColumn = [
'type' => Table::TYPE_TEXT,
'length' => 255,
'nullable' => true,
'comment' => 'Adyen PspReference of the payment'
];
$connection->addColumn($setup->getTable('sales_order_payment'), 'adyen_psp_reference', $pspReferenceColumn);
}
public function updateSchemaVersion1002($setup)
{
$connection = $setup->getConnection();
// Add column to indicate if last notification has success true or false
$adyenAgreementDataColumn = [
'type' => Table::TYPE_TEXT,
'nullable' => true,
'comment' => 'Agreement Data'
];
$connection->addColumn($setup->getTable('paypal_billing_agreement'), 'agreement_data', $adyenAgreementDataColumn);
}
}
\ No newline at end of file
<?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\Api;
class PaymentRequest extends \Magento\Framework\Object
{
/**
* @var \Magento\Framework\App\Config\ScopeConfigInterface
*/
protected $_scopeConfig;
/**
* @var \Psr\Log\LoggerInterface
*/
protected $_logger;
/**
* @var \Magento\Framework\Encryption\EncryptorInterface
*/
protected $_encryptor;
/**
* @var \Adyen\Payment\Helper\Data
*/
protected $_adyenHelper;
/**
* @var \Adyen\Payment\Logger\AdyenLogger
*/
protected $_adyenLogger;
/**
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
* @param \Psr\Log\LoggerInterface $logger
* @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
* @param \Adyen\Payment\Helper\Data $adyenHelper
* @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
* @param array $data
*/
public function __construct(
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
\Psr\Log\LoggerInterface $logger,
\Magento\Framework\Encryption\EncryptorInterface $encryptor,
\Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
array $data = []
) {
$this->_scopeConfig = $scopeConfig;
$this->_logger = $logger;
$this->_encryptor = $encryptor;
$this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;
}
public function fullApiRequest($payment)
{
$order = $payment->getOrder();
$amount = $order->getGrandTotal();
$customerEmail = $order->getCustomerEmail();
$shopperIp = $order->getRemoteIp();
$orderCurrencyCode = $order->getOrderCurrencyCode();
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account");
$request = array(
"action" => "Payment.authorise",
"paymentRequest.merchantAccount" => $merchantAccount,
"paymentRequest.amount.currency" => $orderCurrencyCode,
"paymentRequest.amount.value" => $this->_adyenHelper->formatAmount($amount, $orderCurrencyCode),
"paymentRequest.reference" => $order->getIncrementId(),
"paymentRequest.shopperIP" => $shopperIp,
"paymentRequest.shopperEmail" => $customerEmail,
"paymentRequest.shopperReference" => $order->getIncrementId(),
"paymentRequest.fraudOffset" => "0",
"paymentRequest.browserInfo.userAgent" => $_SERVER['HTTP_USER_AGENT'],
"paymentRequest.browserInfo.acceptHeader" => $_SERVER['HTTP_ACCEPT']
);
$billingAddress = $order->getBillingAddress();
if($billingAddress)
{
$addressArray = $this->_adyenHelper->getStreet($billingAddress);
$requestBilling = array("paymentRequest.card.billingAddress.street" => $addressArray['name'],
"paymentRequest.card.billingAddress.postalCode" => $billingAddress->getPostcode(),
"paymentRequest.card.billingAddress.city" => $billingAddress->getCity(),
"paymentRequest.card.billingAddress.houseNumberOrName" => $addressArray['house_number'],
"paymentRequest.card.billingAddress.stateOrProvince" => $billingAddress->getRegionCode(),
"paymentRequest.card.billingAddress.country" => $billingAddress->getCountryId()
);
$request = array_merge($request, $requestBilling);
}
$deliveryAddress = $order->getDeliveryAddress();
if($deliveryAddress)
{
$addressArray = $this->_adyenHelper->getStreet($deliveryAddress);
$requestDelivery = array("paymentRequest.card.deliveryAddress.street" => $addressArray['name'],
"paymentRequest.card.deliveryAddress.postalCode" => $deliveryAddress->getPostcode(),
"paymentRequest.card.deliveryAddress.city" => $deliveryAddress->getCity(),
"paymentRequest.card.deliveryAddress.houseNumberOrName" => $addressArray['house_number'],
"paymentRequest.card.deliveryAddress.stateOrProvince" => $deliveryAddress->getRegionCode(),
"paymentRequest.card.deliveryAddress.country" => $deliveryAddress->getCountryId()
);
$request = array_merge($request, $requestDelivery);
}
// If cse is enabled add encrypted card date into request
if($this->_adyenHelper->getAdyenCcConfigDataFlag('cse_enabled')) {
$request['paymentRequest.additionalData.card.encrypted.json'] = $payment->getAdditionalInformation("encrypted_data");
} else {
$requestCreditCardDetails = array("paymentRequest.card.expiryMonth" => $payment->getCcExpMonth(),
"paymentRequest.card.expiryYear" => $payment->getCcExpYear(),
"paymentRequest.card.holderName" => $payment->getCcOwner(),
"paymentRequest.card.number" => $payment->getCcNumber(),
"paymentRequest.card.cvc" => $payment->getCcCid(),
);
$request = array_merge($request, $requestCreditCardDetails);
}
return $this->_apiRequest($request);
}
protected function _apiRequest($request)
{
// log the request
$this->_adyenLogger->info('The request to adyen: ' . print_r($request, true));
$webserviceUsername = $this->_adyenHelper->getWsUsername();
$webservicePassword = $this->_adyenHelper->getWsPassword();
$url = $this->_adyenHelper->getWsUrl();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
curl_setopt($ch, CURLOPT_USERPWD, $webserviceUsername.":".$webservicePassword);
curl_setopt($ch, CURLOPT_POST,count($request));
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($request));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$results = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpStatus != 200) {
throw new \Magento\Framework\Exception\LocalizedException(__('HTTP Status code' . $httpStatus . " " . $webserviceUsername . ":" . $webservicePassword));
}
if ($results === false) {
throw new \Magento\Framework\Exception\LocalizedException(__('HTTP Status code' . $results));
}
parse_str($results, $resultArr);
curl_close($ch);
// log the result
$this->_adyenLogger->info('The response to adyen: ' . print_r($resultArr, true));
return $resultArr;
}
public function authorise3d($payment)
{
$order = $payment->getOrder();
$merchantAccount = $this->_adyenHelper->getAdyenAbstractConfigData("merchant_account");
$shopperIp = $order->getRemoteIp();
$md = $payment->getAdditionalInformation('md');
$paResponse = $payment->getAdditionalInformation('paResponse');
$request = array(
"action" => "Payment.authorise3d",
"paymentRequest3d.merchantAccount" => $merchantAccount,
"paymentRequest3d.browserInfo.userAgent" => $_SERVER['HTTP_USER_AGENT'],
"paymentRequest3d.browserInfo.acceptHeader" => $_SERVER['HTTP_ACCEPT'],
"paymentRequest3d.md" => $md,
"paymentRequest3d.paResponse" => $paResponse,
"paymentRequest3d.shopperIP" => $shopperIp
);
return $this->_apiRequest($request);
}
/**
* Decrypt password
*
* @param string $password
* @return string
*/
public function decryptPassword($password)
{
return $this->_encryptor->decrypt($password);
}
}
\ No newline at end of file
<?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>
*/
// @codingStandardsIgnoreFile
?>
<?php $_code = $block->getMethodCode() ?>
<fieldset class="fieldset payment items ccard <?php echo $_code ?>" id="payment_form_<?php echo $_code ?>" style="display: none;">
<div class="field type required">
<label for="<?php echo $_code ?>_cc_type" class="label"><span><?php echo __('Credit Card Type') ?></span></label>
<div class="control">
<select id="<?php echo $_code ?>_cc_type"
data-mage-init='{"creditCardType":{"creditCardTypeContainer":"#<?php echo $_code ?>_cc_type_ss_div"}}'
name="payment[cc_type]" data-validate='{required:true, "validate-cc-type-select":"#<?php echo $_code ?>_cc_number"}' class="select">
<option value=""><?php echo __('--Please Select--')?></option>
<?php $_ccType = $block->getInfoData('cc_type') ?>
<?php foreach ($block->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
<option value="<?php echo $_typeCode ?>"<?php if ($_typeCode == $_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field number required">
<label for="<?php echo $_code ?>_cc_number" class="label"><span><?php echo __('Credit Card Number') ?></span></label>
<div class="control">
<input type="number" id="<?php echo $_code ?>_cc_number" name="payment[cc_number]" title="<?php echo __('Credit Card Number') ?>" class="input-text" value="" data-validate='{"required-number":true, "validate-cc-number":"#<?php echo $_code ?>_cc_type", "validate-cc-type":"#<?php echo $_code ?>_cc_type"}'/>
</div>
</div>
<div class="field required">
<label for="<?php echo $_code ?>_cc_owner" class="label"><span><?php echo __('Credit Card Owner') ?></span></label>
<div class="control">
<input type="text" id="<?php echo $_code ?>_cc_owner" name="payment[cc_owner]" title="<?php echo __('Credit Card Owner') ?>" class="input-text" value=""/>
</div>
</div>
<div class="field date required" id="<?php echo $_code ?>_cc_type_exp_div">
<label for="<?php echo $_code ?>_expiration" class="label"><span><?php echo __('Expiration Date') ?></span></label>
<div class="control">
<div class="fields group group-2">
<div class="field no-label month">
<div class="control">
<select id="<?php echo $_code ?>_expiration" name="payment[cc_exp_month]" class="select month" data-validate='{required:true, "validate-cc-exp":"#<?php echo $_code ?>_expiration_yr"}'>
<?php $_ccExpMonth = $block->getInfoData('cc_exp_month') ?>
<?php foreach ($block->getCcMonths() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpMonth): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field no-label year">
<div class="control">
<?php $_ccExpYear = $block->getInfoData('cc_exp_year') ?>
<select id="<?php echo $_code ?>_expiration_yr" name="payment[cc_exp_year]" class="select year" data-validate='{required:true}'>
<?php foreach ($block->getCcYears() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $_ccExpYear): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
</div>
</div>
</div>
<?php if ($block->hasVerification()): ?>
<div class="field cvv required" id="<?php echo $_code ?>_cc_type_cvv_div">
<label for="<?php echo $_code ?>_cc_cid" class="label"><span><?php echo __('Card Verification Number') ?></span></label>
<div class="control">
<input type="number" title="<?php echo __('Card Verification Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_cid" name="payment[cc_cid]" value="" data-validate='{"required-number":true, "validate-cc-cvn":"#<?php echo $_code ?>_cc_type"}' />
<?php $_content = '<img src=\"' . $block->getViewFileUrl('Magento_Checkout::cvv.png') . '\" alt=\"' . __('Card Verification Number Visual Reference') . '\" title=\"' . __('Card Verification Number Visual Reference') . '\" />'; ?>
<div class="note">
<a href="#" class="action cvv" title="<?php echo __('What is this?') ?>" data-mage-init='{"tooltip": {"content": "<?php echo $_content ?>"}}'><span><?php echo __('What is this?') ?></span></a>
</div>
</div>
</div>
<?php endif; ?>
<?php if ($block->hasSsCardType()): ?>
<div class="field switch solo required" id="<?php echo $_code ?>_cc_type_ss_div">
<div class="nested">
<div class="field switch solo required">
<label for="<?php echo $_code ?>_cc_issue" class="label"><span><?php echo __('Switch/Solo/Maestro Only') ?></span></label>
</div>
<div class="field number required">
<label for="<?php echo $_code ?>_cc_issue" class="label"><span><?php echo __('Issue Number') ?></span></label>
<div class="control">
<input type="text" title="<?php echo __('Issue Number') ?>" class="input-text cvv" id="<?php echo $_code ?>_cc_issue" name="payment[cc_ss_issue]" value="" data-validate='{"validate-cc-ukss":true}'/>
</div>
</div>
<div class="field date required">
<label for="<?php echo $_code ?>_start_month" class="label"><span><?php echo __('Start Date') ?></span></label>
<div class="control">
<div class="fields group group-2">
<div class="field no-label">
<div class="control">
<select id="<?php echo $_code ?>_start_month" name="payment[cc_ss_start_month]" class="select month" data-validate='{"validate-cc-ukss":true}'>
<?php foreach ($block->getCcMonths() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $block->getInfoData('cc_ss_start_month')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
<div class="field no-label">
<div class="control">
<select id="<?php echo $_code ?>_start_year" name="payment[cc_ss_start_year]" class="select year" data-validate='{"validate-cc-ukss":true}'>
<?php foreach ($block->getSsStartYears() as $k => $v): ?>
<option value="<?php echo $k ? $k : '' ?>"<?php if ($k == $block->getInfoData('cc_ss_start_year')): ?> selected="selected"<?php endif ?>><?php echo $v ?></option>
<?php endforeach ?>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="adv container" data-validation-msg="validate-cc-ukss">&nbsp;</div>
</div>
</div>
<?php endif; ?>
<?php echo $block->getChildHtml() ?>
</fieldset>
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
/*browser:true*/
/*global define*/
define(
[
'jquery',
'Magento_Checkout/js/view/payment/default',
'Adyen_Payment/js/action/set-payment-method'
],
function ($, Component, setPaymentMethodAction) {
'use strict';
return Component.extend({
defaults: {
template: 'Adyen_Payment/payment/hpp-form'
},
/** Redirect to adyen */
continueToAdyen: function () {
//update payment method information if additional data was changed
this.selectPaymentMethod();
setPaymentMethodAction();
return false;
}
});
}
);
<!--
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
-->
<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
<div class="payment-method-title field choice">
<input type="radio"
name="payment[method]"
class="radio"
data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>
<label data-bind="attr: {'for': getCode()}" class="label"><span data-bind="text: getTitle()"></span></label>
</div>
<div class="payment-method-content">
<div class="payment-method-billing-address">
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<fieldset class="fieldset" data-bind='attr: {id: "payment_form_" + getCode()}'>
<div class="payment-method-note">
<!-- ko text: $t('You will be redirected to the Adyen website.') --><!-- /ko -->
</div>
</fieldset>
<div class="checkout-agreements-block">
<!-- ko foreach: $parent.getRegion('before-place-order') -->
<!-- ko template: getTemplate() --><!-- /ko -->
<!--/ko-->
</div>
<div class="actions-toolbar">
<div class="primary">
<button class="action primary checkout"
type="submit"
data-bind="click: continueToAdyen, enable: (getCode() == isChecked())"
disabled>
<span data-bind="text: $t('Continue to Adyen')"></span>
</button>
</div>
</div>
</div>
</div>
{
"name": "adyen/module-payment",
"description": "Official Magento2 Plugin to connect to Payment Service Provider Adyen.",
"type": "magento2-module",
"version": "1.0.0.1",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"repositories": [
{
"adyen": {
"type": "vcs",
"url": "git@github.com:Adyen/adyen-php-api-library.git"
}
}
],
"require": {
"php": "~5.5.0|~5.6.0|~7.0.0",
"magento/module-config": "100.0.*",
"magento/module-store": "100.0.*",
"magento/module-checkout": "100.0.*",
"magento/module-catalog": "100.0.*",
"magento/module-sales": "100.0.*",
"magento/module-customer": "100.0.*",
"magento/module-payment": "100.0.*",
"magento/module-quote": "100.0.*",
"magento/module-backend": "100.0.*",
"magento/module-directory": "100.0.*",
"magento/module-theme": "100.0.*",
"magento/framework": "100.0.*",
"magento/magento-composer-installer": "*",
"adyen/php-api-library": "*"
},
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Adyen\\Payment\\": ""
}
}
}
\ No newline at end of file
......@@ -22,34 +22,24 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../Magento/Config/etc/system_file.xsd">
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<section id="payment" translate="label" type="text" sortOrder="400" showInDefault="1" showInWebsite="1" showInStore="1">
<group id="adyen_group_all_in_one" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Adyen All-in-One Payment Solutions</label>
<comment><![CDATA[Adyen All-in-One Payment Solutions]]></comment>
<attribute type="expanded">1</attribute>
<fieldset_css>complex</fieldset_css>
<frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Group</frontend_model>
<include path="Adyen_Payment::system/adyen_getting_started.xml"/>
<include path="Adyen_Payment::system/adyen_required_settings.xml"/>
<include path="Adyen_Payment::system/adyen_advanced_order_processing.xml"/>
<include path="Adyen_Payment::system/adyen_advanced_notifications.xml"/>
<include path="Adyen_Payment::system/adyen_billing_agreements.xml"/>
<include path="Adyen_Payment::system/adyen_cc.xml"/>
<include path="Adyen_Payment::system/adyen_oneclick.xml"/>
<include path="Adyen_Payment::system/adyen_hpp.xml"/>
</group>
<group id="test" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Test</label>
<field id="active" translate="label" type="select" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="0">
......
......@@ -22,12 +22,10 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Magento/Config/etc/system_include.xsd">
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="adyen_advanced_notifications" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[Advanced: Adyen Payment Notifications]]></label>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
<field id="ignore_refund_notification" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Ignore refund notification</label>
<tooltip>If the refund is done on the Adyen Platform it will send a refund notification to Magento which automatically creates a credit memo. If you set this setting to 'Yes', this will not happen because it will not process any of the REFUND notification that is received.</tooltip>
......@@ -40,6 +38,5 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/adyen_abstract/multiple_merchants</config_path>
</field>
</group>
</include>
\ No newline at end of file
......@@ -22,12 +22,10 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Magento/Config/etc/system_include.xsd">
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="adyen_advanced_order_processing" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[Advanced: Magento Order Processing]]></label>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
<field id="paypal_capture_mode" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Use manual capture for PayPal</label>
<tooltip>Should be on 'No' by default. If you have requested with Adyen Support for your PayPal integration to be on manual capture, set this to 'Yes'.</tooltip>
......
......@@ -22,7 +22,7 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Magento/Config/etc/system_include.xsd">
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="adyen_billing_agreements" translate="label" type="text" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[Advanced: Billing Agreements]]></label>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
......@@ -50,7 +50,5 @@
<source_model>Adyen\Payment\Model\Config\Source\RecurringType</source_model>
<config_path>payment/adyen_abstract/recurring_type</config_path>
</field>
</group>
</include>
\ No newline at end of file
......@@ -22,17 +22,13 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Magento/Config/etc/system_include.xsd">
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="adyen_cc" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[CreditCard API integration]]></label>
<frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model>
<fieldset_css>adyen-method-adyen-cc</fieldset_css>
<comment>Process creditcard payments inside your checkout.</comment>
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/adyen_cc/active</config_path>
......@@ -46,6 +42,11 @@
<frontend_class>validate-number</frontend_class>
<config_path>payment/adyen_cc/sort_order</config_path>
</field>
<field id="cctypes" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Credit Card Types</label>
<source_model>Adyen\Payment\Model\Config\Source\CcType</source_model>
<config_path>payment/adyen_cc/cctypes</config_path>
</field>
<!--<field id="cse_enabled" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">-->
<!--<label>Enable CSE</label>-->
<!--<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>-->
......@@ -76,7 +77,5 @@
<config_path>payment/adyen_cc/specificcountry</config_path>
</field>
</group>
</group>
</include>
\ No newline at end of file
......@@ -22,7 +22,7 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Magento/Config/etc/system_include.xsd">
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="adyen_getting_started" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[Documentation & Support]]></label>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
......
......@@ -22,25 +22,17 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Magento/Config/etc/system_include.xsd">
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="adyen_hpp" translate="label" type="text" sortOrder="200" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[Hosted Payment Page (HPP) integration]]></label>
<frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model>
<fieldset_css>adyen-method-adyen-cc</fieldset_css>
<comment>Process alternative payments methods</comment>
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/adyen_hpp/active</config_path>
</field>
<field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Title</label>
<config_path>payment/adyen_hpp/title</config_path>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Sort Order</label>
<frontend_class>validate-number</frontend_class>
......@@ -63,12 +55,21 @@
<backend_model>Magento\Config\Model\Config\Backend\Encrypted</backend_model>
<config_path>payment/adyen_hpp/hmac_live</config_path>
</field>
<group id="adyen_hpp_advanced_settings" translate="label" showInDefault="1" showInWebsite="1" sortOrder="200">
<label>Advanced Settings</label>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
<field id="title" translate="label" type="text" sortOrder="65" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Title</label>
<config_path>payment/adyen_hpp/title</config_path>
</field>
<field id="delivery_days" translate="label" type="text" sortOrder="68" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Days to Delivery</label>
<tooltip>How many days to be added to the current date for delivery. ONLY whole numbers allowed.</tooltip>
<frontend_class>validate-number</frontend_class>
<config_path>payment/adyen_hpp/delivery_days</config_path>
</field>
<field id="payment_selection_on_adyen" translate="label" type="select" sortOrder="70" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Payment method selection in Adyen</label>
<label>Payment method selection on Adyen Hosted Payment Page (HPP)</label>
<tooltip>If you set this to 'Yes', payment methods in the checkout won't be displayed and you will be redirected to the Adyen HPP to make the selection.</tooltip>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/adyen_hpp/payment_selection_on_adyen</config_path>
......@@ -80,12 +81,6 @@
<depends><field id="payment_selection_on_adyen">1</field></depends>
<config_path>payment/adyen_hpp/payment_routine</config_path>
</field>
<field id="delivery_days" translate="label" type="text" sortOrder="90" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Days to Delivery</label>
<tooltip>How many days to be added to the current date for delivery. ONLY whole numbers allowed.</tooltip>
<frontend_class>validate-number</frontend_class>
<config_path>payment/adyen_hpp/delivery_days</config_path>
</field>
<field id="shopper_locale" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Language locale (optional)</label>
<tooltip>This will override the default shopper locale of the Magento store (e.g. nl_NL). Leave empty to let Magento decide.</tooltip>
......@@ -97,7 +92,6 @@
<config_path>payment/adyen_hpp/country_code</config_path>
</field>
</group>
<group id="adyen_hpp_country_specific" translate="label" showInDefault="1" showInWebsite="1" sortOrder="210">
<label>Country Specific Settings</label>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
......@@ -113,7 +107,5 @@
<config_path>payment/adyen_hpp/specificcountry</config_path>
</field>
</group>
</group>
</include>
\ No newline at end of file
<?xml version="1.0"?>
<!--
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="adyen_oneclick" translate="label" type="text" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[OneClick - Requires Adyen Credit Card]]></label>
<frontend_model>Magento\Paypal\Block\Adminhtml\System\Config\Fieldset\Payment</frontend_model>
<fieldset_css>adyen-method-adyen-cc</fieldset_css>
<comment><![CDATA[During checkout shoppers can choose to have their payment details remembered and stored for trusted websites in Adyen’s highly secure platform. Adyen takes care of this process for its customers. Shoppers can then select in the Magento checkout the saved card and checkout with ‘OneClick’.]]></comment>
<field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Enabled</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/adyen_oneclick/active</config_path>
</field>
<field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Title</label>
<config_path>payment/adyen_oneclick/title</config_path>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Sort Order</label>
<frontend_class>validate-number</frontend_class>
<config_path>payment/adyen_oneclick/sort_order</config_path>
</field>
<field id="recurring_payment_type" translate="label" type="select" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Agreement Type</label>
<tooltip>With ONECLICK the shopper needs to fill in their security code for credit cards. For RECURRING, this is not needed. If you want to use RECURRING make sure you have Agreement Type set to RECURRING or ONECLICK,RECURRING</tooltip>
<source_model>Adyen\Payment\Model\Config\Source\RecurringPaymentType</source_model>
<config_path>payment/adyen_oneclick/recurring_payment_type</config_path>
</field>
</group>
</include>
\ No newline at end of file
......@@ -22,13 +22,15 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../Magento/Config/etc/system_include.xsd">
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="adyen_required_settings" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[Required Settings]]></label>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
<field id="merchant_account" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Merchant Account</label>
<config_path>payment/adyen_abstract/merchant_account</config_path>
<tooltip><![CDATA[The merchant account identifier you want to process the (transaction) request with. Find this at the top of the screen in the Adyen Customer Area, where you will see [YourCompanyAccount] > [YourMerchantAccount] . Please note that the merchant account is different from the company account; a company account can have one or more merchant accounts.]]></tooltip>
<comment><![CDATA[<a target="_blank" href="https://docs.adyen.com/display/TD/Prepare+the+settings+in+the+Adyen+Customer+Area">Click here for explanation.</a>]]></comment>
</field>
<field id="demo_mode" translate="label" type="select" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Test/Production Mode</label>
......
......@@ -22,19 +22,36 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<type name="Adyen\Payment\Logger\Handler\AdyenDebug">
<arguments>
<argument name="filesystem" xsi:type="object">Magento\Framework\Filesystem\Driver\File</argument>
</arguments>
</type>
<type name="Adyen\Payment\Logger\AdyenLogger">
<arguments>
<argument name="name" xsi:type="string">AdyenLoggerTest</argument>
<argument name="handlers" xsi:type="array">
<item name="adyenDebug" xsi:type="object">Adyen\Payment\Logger\Handler\AdyenDebug</item>
</argument>
</arguments>
</type>
</config>
\ No newline at end of file
<payment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Adyen_Payment:etc/adyen_payment.xsd">
<adyen_credit_cards>
<type id="AE" order="0">
<label>American Express</label>
<code_alt>amex</code_alt>
</type>
<type id="VI" order="10">
<label>Visa</label>
<code_alt>visa</code_alt>
</type>
<type id="MC" order="20">
<label>MasterCard</label>
<code_alt>mc</code_alt>
</type>
<type id="DI" order="30">
<label>Discover</label>
<code_alt>discover</code_alt>
</type>
<type id="SM" order="40">
<label>Maestro/Switch</label>
<code_alt>maestro</code_alt>
</type>
<type id="JCB" order="50">
<label>JCB</label>
<code_alt>jcb</code_alt>
</type>
<type id="DN" order="60">
<label>Diners</label>
<code_alt>diners</code_alt>
</type>
</adyen_credit_cards>
</payment>
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* 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>
*/
-->
<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="payment">
<xs:annotation>
<xs:documentation>
The root node for payment configuration
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:all>
<xs:element name="adyen_credit_cards" type="adyen_credit_cardsType" minOccurs="0" />
</xs:all>
</xs:complexType>
</xs:element>
<xs:complexType name="adyen_credit_cardsType">
<xs:annotation>
<xs:documentation>
The containing node for a list of credit card types.
</xs:documentation>
</xs:annotation>
<xs:sequence maxOccurs="unbounded">
<xs:element name="type" type="AdyenTypeType" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="AdyenTypeType">
<xs:annotation>
<xs:documentation>
The definition of a credit card type.
</xs:documentation>
</xs:annotation>
<xs:all>
<xs:element name="label" type="xs:string" />
<xs:element name="code_alt" type="xs:string" />
</xs:all>
<xs:attribute name="id" type="xs:ID" use="required" />
<xs:attribute name="order" type="xs:integer" use="required" />
</xs:complexType>
</xs:schema>
This diff is collapsed.
......@@ -22,10 +22,10 @@
* Author: Adyen <magento@adyen.com>
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Magento/Cron/etc/crontab.xsd">
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="index">
<job name="adyen_payment_process_notification" instance="Adyen\Payment\Model\Cron" method="processNotification">
<schedule>* * * * *</schedule>
<schedule>*/1 * * * *</schedule>
</job>
</group>
</config>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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