/**
  * @inheritdoc
  */
 public function persist(\Bitpay\KeyInterface $key)
 {
     $path = $key->getId();
     $data = serialize($key);
     $encoded = bin2hex(openssl_encrypt($data, self::METHOD, $this->password, 1, self::IV));
     file_put_contents($path, $encoded);
 }
 /**
  * @inheritdoc
  */
 public function persist(\Bitpay\KeyInterface $key)
 {
     $path = $key->getId();
     $data = serialize($key);
     $encrypted = $this->dataEncrypt($data);
     $encoded = $this->dataEncode($encrypted);
     $this->saveToFile($encoded, $path);
 }
 /**
  * @inheritdoc
  */
 public function persist(\Bitpay\KeyInterface $key)
 {
     try {
         $path = $key->getId();
         file_put_contents($path, serialize($key));
     } catch (\Exception $e) {
         throw new \Exception('[ERROR] In FilesystemStorage::persist(): ' . $e->getMessage());
     }
 }
Пример #4
0
 /**
  * @inheritdoc
  */
 public function persist(\Bitpay\KeyInterface $key)
 {
     $this->_keys[$key->getId()] = $key;
     $data = serialize($key);
     $encryptedData = \Mage::helper('core')->encrypt($data);
     $config = new \Mage_Core_Model_Config();
     if (true === isset($config) && false === empty($config)) {
         $config->saveConfig($key->getId(), $encryptedData);
     } else {
         \Mage::helper('bitpay')->debugData('[ERROR] In file lib/Bitpay/Storage/MagentoStorage.php, class MagentoStorage::persist - Could not instantiate a \\Mage_Core_Model_Config object.');
         throw new \Exception('[ERROR] In file lib/Bitpay/Storage/MagentoStorage.php, class MagentoStorage::persist - Could not instantiate a \\Mage_Core_Model_Config object.');
     }
 }
Пример #5
0
 /**
  * @inheritdoc
  */
 public function persist(\Bitpay\KeyInterface $key)
 {
     $path = $key->getId();
     file_put_contents($path, serialize($key));
 }