public function __construct(ClientInterface $client, OpenpayExceptionMapper $exceptionMapper, OpenpayFeeValidator $validator, OpenpayTransactionMapper $transactionMapper, EncryptorInterface $encryptor, ScopeConfigInterface $config)
 {
     $paymentOpenpayConfig = $config->getValue('payment/openpay');
     $paymentOpenpayConfig['merchantId'] = $encryptor->decrypt($paymentOpenpayConfig['merchantId']);
     $paymentOpenpayConfig['apiKey'] = $encryptor->decrypt($paymentOpenpayConfig['apiKey']);
     $paymentOpenpayConfig['publicKey'] = $encryptor->decrypt($paymentOpenpayConfig['publicKey']);
     parent::__construct($client, $exceptionMapper, $validator, $transactionMapper, $paymentOpenpayConfig);
 }
 /**
  * {@inheritdoc}
  */
 public function get($storeId = null)
 {
     /** @var CredentialsInterface $credentials */
     $credentials = $this->credentialsFactory->create();
     $configValues = $this->scopeConfig->getValue(self::PAYMENT_OPENPAY_PATH, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);
     $merchantId = $this->encryptor->decrypt($configValues['merchantId']);
     $publicKey = $this->encryptor->decrypt($configValues['publicKey']);
     $credentials->setMerchantId($merchantId)->setPublicKey($publicKey)->setIsSandboxMode($configValues['sandbox']);
     return $credentials;
 }
Exemple #3
0
 /**
  * Create physical certificate file based on DB data
  *
  * @param string $file
  * @return void
  */
 protected function _createCertFile($file)
 {
     if ($this->varDirectory->isDirectory(self::BASEPATH_PAYPAL_CERT)) {
         $this->_removeOutdatedCertFile();
     }
     $this->varDirectory->writeFile($file, $this->encryptor->decrypt($this->getContent()));
 }
Exemple #4
0
 /**
  * @desc Retrieve the webserver password
  * @return string
  */
 public function getWsPassword()
 {
     if ($this->isDemoMode()) {
         $wsPassword = $this->_encryptor->decrypt(trim($this->getAdyenAbstractConfigData('ws_password_test')));
     } else {
         $wsPassword = $this->_encryptor->decrypt(trim($this->getAdyenAbstractConfigData('ws_password_live')));
     }
     return $wsPassword;
 }
Exemple #5
0
 /**
  * Gather saved credit card numbers from sales order payments and re-encrypt them
  *
  * @return void
  */
 protected function _reEncryptCreditCardNumbers()
 {
     $table = $this->getTable('sales_order_payment');
     $select = $this->getConnection()->select()->from($table, ['entity_id', 'cc_number_enc']);
     $attributeValues = $this->getConnection()->fetchPairs($select);
     // save new values
     foreach ($attributeValues as $valueId => $value) {
         $this->getConnection()->update($table, ['cc_number_enc' => $this->encryptor->encrypt($this->encryptor->decrypt($value))], ['entity_id = ?' => (int) $valueId]);
     }
 }
Exemple #6
0
 public function getBackendCfg()
 {
     $cfg = [];
     $cfg['key'] = $this->_encryptor->decrypt($this->_escaper->escapeHtml($this->scopeConfig->getValue('cc_uk/main_options/backend_accesstoken', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)));
     $cfg['enabled'] = $this->scopeConfig->isSetFlag('cc_uk/main_options/backend_enabled', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
     $cfg['auto_search'] = $this->scopeConfig->isSetFlag('cc_uk/gfx_options/searchbar_auto_search', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
     $cfg['clean_postsearch'] = $this->scopeConfig->isSetFlag('cc_uk/gfx_options/searchbar_clean_postsearch', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
     $cfg['searchbar_type'] = $this->_escaper->escapeHtml($this->scopeConfig->getValue('cc_uk/gfx_options/searchbar_type', \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     $cfg['error_msg'] = [];
     $cfg['error_msg']["0001"] = $this->_escaper->escapeHtml($this->scopeConfig->getValue('cc_uk/txt_options/error_msg_1', \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     $cfg['error_msg']["0002"] = $this->_escaper->escapeHtml($this->scopeConfig->getValue('cc_uk/txt_options/error_msg_2', \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     $cfg['error_msg']["0003"] = $this->_escaper->escapeHtml($this->scopeConfig->getValue('cc_uk/txt_options/error_msg_3', \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     $cfg['error_msg']["0004"] = $this->_escaper->escapeHtml($this->scopeConfig->getValue('cc_uk/txt_options/error_msg_4', \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     $cfg['txt'] = [];
     $cfg['txt']["search_label"] = $this->_escaper->escapeHtml($this->scopeConfig->getValue('cc_uk/txt_options/search_label', \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     $cfg['txt']["search_placeholder"] = $this->_escaper->escapeHtml($this->scopeConfig->getValue('cc_uk/txt_options/search_placeholder', \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     $cfg['txt']["search_buttontext"] = $this->_escaper->escapeHtml($this->scopeConfig->getValue('cc_uk/txt_options/search_buttontext', \Magento\Store\Model\ScopeInterface::SCOPE_STORE));
     return json_encode($cfg);
 }
Exemple #7
0
 /**
  * Decrypt data
  *
  * @param string $data
  * @return string
  */
 public function decrypt($data)
 {
     return $this->_encryptor->decrypt($data);
 }
Exemple #8
0
 /**
  * Return centinel transactionPwd
  *
  * @return string
  */
 public function getTransactionPwd()
 {
     return $this->_encryptor->decrypt($this->_getServiceConfigValue('password'));
 }
Exemple #9
0
 /**
  * Process config value
  *
  * @param string $value
  * @return string
  */
 public function processValue($value)
 {
     return $this->_encryptor->decrypt($value);
 }
Exemple #10
0
 /**
  * Decrypt password
  *
  * @param   string $password
  * @return  string
  */
 public function decryptPassword($password)
 {
     return $this->_encryptor->decrypt($password);
 }
Exemple #11
0
 /**
  * Google Account password
  *
  * @param int $storeId
  * @return string
  */
 public function getAccountPassword($storeId = null)
 {
     return $this->_encryptor->decrypt($this->getConfigData('password', $storeId));
 }
Exemple #12
0
 /**
  * Returns configured Insights insert key for New Relic events related to cron jobs
  *
  * @return string
  */
 public function getInsightsInsertKey()
 {
     return $this->encryptor->decrypt($this->scopeConfig->getValue('newrelicreporting/general/insights_insert_key'));
 }