This repository has been archived by the owner on Aug 6, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from innoppl-developers/master
M2 plugin converted to support magento marketplace
- Loading branch information
Showing
52 changed files
with
107 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0
app/code/Bitpay/Core/Block/Form/Bitpay.php → Block/Form/Bitpay.php
100755 → 100644
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,9 +82,4 @@ public function isTestMode() { | |
return false; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0
app/code/Bitpay/Core/Logger/Handler.php → Logger/Handler.php
100755 → 100644
File renamed without changes.
0
app/code/Bitpay/Core/Logger/Logger.php → Logger/Logger.php
100755 → 100644
File renamed without changes.
0
app/code/Bitpay/Core/Model/Config.php → Model/Config.php
100755 → 100644
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
namespace Bitpay\Core\Model; | ||
|
||
class MagentoStorage implements \Bitpay\Storage\StorageInterface { | ||
/** | ||
* @var array | ||
*/ | ||
protected $_keys; | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function persist(\Bitpay\KeyInterface $key) { | ||
$this -> _keys[$key -> getId()] = $key; | ||
|
||
$data = serialize($key); | ||
|
||
$encryptedData = \Magento\Framework\App\ObjectManager::getInstance() -> get('\Magento\Framework\Encryption\EncryptorInterface') -> encrypt($data); | ||
$config = \Magento\Framework\App\ObjectManager::getInstance() -> get('\Magento\Config\Model\ResourceModel\Config'); | ||
$store = \Magento\Framework\App\ObjectManager::getInstance() -> get('\Magento\Store\Model\StoreManagerInterface'); | ||
$helper = \Magento\Framework\App\ObjectManager::getInstance() -> get('\Bitpay\Core\Helper\Data'); | ||
|
||
if (true === isset($config) && false === empty($config)) { | ||
$config -> saveConfig($key -> getId(), $encryptedData, $store -> getStore() -> getCode(), 0); | ||
} else { | ||
$helper -> 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.'); | ||
} | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function load($id) { | ||
if (true === isset($id) && true === isset($this -> _keys[$id])) { | ||
return $this -> _keys[$id]; | ||
} | ||
$helper = \Magento\Framework\App\ObjectManager::getInstance() -> get('\Bitpay\Core\Helper\Data'); | ||
$storeconfig = \Magento\Framework\App\ObjectManager::getInstance() -> get('\Magento\Framework\App\Config\ScopeConfigInterface'); | ||
$entity = $storeconfig -> getValue($id); | ||
|
||
/** | ||
* Not in database | ||
*/ | ||
if (false === isset($entity) || true === empty($entity)) { | ||
$helper -> debugData('[INFO] Call to MagentoStorage::load($id) with the id of ' . $id . ' did not return the store config parameter because it was not found in the database.'); | ||
throw new \Exception('[INFO] Call to MagentoStorage::load($id) with the id of ' . $id . ' did not return the store config parameter because it was not found in the database.'); | ||
} | ||
|
||
$decodedEntity = unserialize(\Magento\Framework\App\ObjectManager::getInstance() -> get('\Magento\Framework\Encryption\EncryptorInterface') -> decrypt($entity)); | ||
|
||
if (false === isset($decodedEntity) || true === empty($decodedEntity)) { | ||
$helper -> debugData('[INFO] Call to MagentoStorage::load($id) with the id of ' . $id . ' could not decrypt & unserialize the entity ' . $entity . '.'); | ||
throw new \Exception('[INFO] Call to MagentoStorage::load($id) with the id of ' . $id . ' could not decrypt & unserialize the entity ' . $entity . '.'); | ||
} | ||
|
||
$helper -> debugData('[INFO] Call to MagentoStorage::load($id) with the id of ' . $id . ' successfully decrypted & unserialized the entity ' . $entity . '.'); | ||
|
||
return $decodedEntity; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
0
app/code/Bitpay/Core/etc/config.xml → etc/config.xml
100755 → 100644
File renamed without changes.
0
app/code/Bitpay/Core/etc/di.xml → etc/di.xml
100755 → 100644
File renamed without changes.
0
app/code/Bitpay/Core/etc/frontend/di.xml → etc/frontend/di.xml
100755 → 100644
File renamed without changes.
File renamed without changes.
File renamed without changes.
0
app/code/Bitpay/Core/etc/module.xml → etc/module.xml
100755 → 100644
File renamed without changes.
0
app/code/Bitpay/Core/etc/payment.xml → etc/payment.xml
100755 → 100644
File renamed without changes.
Oops, something went wrong.