/**
  * @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;
 }
 /**
  * @param \Magento\Framework\Model\Context $context
  * @param \Magento\Checkout\Model\Session $session
  * @param \Magento\Store\Model\StoreManagerInterface $storeManager
  * @param PaymentHelper $paymentHelper
  * @param \Adyen\Payment\Helper\Data $adyenHelper
  */
 public function __construct(\Magento\Framework\Model\Context $context, \Magento\Checkout\Model\Session $session, \Magento\Store\Model\StoreManagerInterface $storeManager, PaymentHelper $paymentHelper, \Magento\Framework\Locale\ResolverInterface $localeResolver, \Magento\Framework\App\Config\ScopeConfigInterface $config, \Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Logger\AdyenLogger $adyenLogger)
 {
     $this->_appState = $context->getAppState();
     $this->_session = $session;
     $this->_storeManager = $storeManager;
     $this->_paymentHelper = $paymentHelper;
     $this->_localeResolver = $localeResolver;
     $this->_config = $config;
     $this->_adyenHelper = $adyenHelper;
     $this->_adyenLogger = $adyenLogger;
     foreach ($this->methodCodes as $code) {
         $this->methods[$code] = $this->_paymentHelper->getMethodInstance($code);
     }
 }
 /**
  * PaymentRequest constructor.
  *
  * @param \Magento\Framework\Model\Context $context
  * @param \Magento\Framework\Encryption\EncryptorInterface $encryptor
  * @param \Adyen\Payment\Helper\Data $adyenHelper
  * @param \Adyen\Payment\Logger\AdyenLogger $adyenLogger
  * @param \Adyen\Payment\Model\RecurringType $recurringType
  * @param array $data
  */
 public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Encryption\EncryptorInterface $encryptor, \Adyen\Payment\Helper\Data $adyenHelper, \Adyen\Payment\Logger\AdyenLogger $adyenLogger, \Adyen\Payment\Model\RecurringType $recurringType, array $data = [])
 {
     $this->_encryptor = $encryptor;
     $this->_adyenHelper = $adyenHelper;
     $this->_adyenLogger = $adyenLogger;
     $this->_recurringType = $recurringType;
     $this->_appState = $context->getAppState();
     // initialize client
     $webserviceUsername = $this->_adyenHelper->getWsUsername();
     $webservicePassword = $this->_adyenHelper->getWsPassword();
     $client = new \Adyen\Client();
     $client->setApplicationName("Magento 2 plugin");
     $client->setUsername($webserviceUsername);
     $client->setPassword($webservicePassword);
     if ($this->_adyenHelper->isDemoMode()) {
         $client->setEnvironment(\Adyen\Environment::TEST);
     } else {
         $client->setEnvironment(\Adyen\Environment::LIVE);
     }
     // assign magento log
     $client->setLogger($adyenLogger);
     $this->_client = $client;
 }
Esempio n. 4
0
 /**
  * @param \Magento\Framework\Model\Context $context
  * @param \Magento\Framework\Registry $registry
  * @param \Magento\Framework\Model\Resource\AbstractResource $resource
  * @param \Magento\Framework\Data\Collection\Db $resourceCollection
  * @param array $data
  */
 public function __construct(\Magento\Framework\Model\Context $context, \Magento\Framework\Registry $registry, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = [])
 {
     $this->_registry = $registry;
     $this->_appState = $context->getAppState();
     $this->_eventManager = $context->getEventDispatcher();
     $this->_cacheManager = $context->getCacheManager();
     $this->_resource = $resource;
     $this->_resourceCollection = $resourceCollection;
     $this->_logger = $context->getLogger();
     $this->_actionValidator = $context->getActionValidator();
     if (method_exists($this->_resource, 'getIdFieldName') || $this->_resource instanceof \Magento\Framework\Object) {
         $this->_idFieldName = $this->_getResource()->getIdFieldName();
     }
     parent::__construct($data);
     $this->_construct();
 }
 /**
  * RecurringDataBuilder constructor.
  *
  * @param \Adyen\Payment\Helper\Data $adyenHelper
  * @param \Magento\Framework\Model\Context $context
  */
 public function __construct(\Adyen\Payment\Helper\Data $adyenHelper, \Magento\Framework\Model\Context $context)
 {
     $this->adyenHelper = $adyenHelper;
     $this->appState = $context->getAppState();
 }
 public function __construct(Context $context)
 {
     $this->isDeveloper = $context->getAppState()->getMode() == State::MODE_DEVELOPER;
 }