Skip to content

Commit bd801b0

Browse files
Merge pull request #85 from checkout/dev
Readme update and configuration improvement
2 parents 200e01c + 3f7ef22 commit bd801b0

File tree

4 files changed

+24
-11
lines changed

4 files changed

+24
-11
lines changed

Gateway/Config/Config.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Checkout\Model\Session as CheckoutSession;
1717
use Magento\Framework\App\Config\ScopeConfigInterface;
1818
use Magento\Framework\Locale\Resolver as LocaleResolver;
19+
use Magento\Framework\Encryption\EncryptorInterface;
1920
use CheckoutCom\Magento2\Model\Adminhtml\Source\Environment;
2021
use CheckoutCom\Magento2\Model\Adminhtml\Source\Integration;
2122

@@ -119,6 +120,7 @@ public function __construct(
119120
StoreManagerInterface $storeManager,
120121
CheckoutSession $checkoutSession,
121122
LocaleResolver $localeResolver,
123+
EncryptorInterface $encryptor,
122124
$methodCode = null,
123125
$pathPattern = self::DEFAULT_PATH_PATTERN
124126
) {
@@ -128,9 +130,9 @@ public function __construct(
128130
$this->storeManager = $storeManager;
129131
$this->checkoutSession = $checkoutSession;
130132
$this->localeResolver = $localeResolver;
133+
$this->encryptor = $encryptor;
131134
}
132135

133-
134136
public static function getSupportedLanguages() {
135137
return [
136138
[
@@ -739,10 +741,10 @@ public function isDebugMode() {
739741
* @return string
740742
*/
741743
public function getPublicKey() {
742-
return (string) $this->getValue(
744+
return (string) $this->encryptor->decrypt($this->getValue(
743745
self::KEY_PUBLIC_KEY,
744746
$this->storeManager->getStore()
745-
);
747+
));
746748
}
747749

748750
/**
@@ -751,10 +753,10 @@ public function getPublicKey() {
751753
* @return string
752754
*/
753755
public function getSecretKey() {
754-
return (string) $this->getValue(
756+
return (string) $this->encryptor->decrypt($this->getValue(
755757
self::KEY_SECRET_KEY,
756758
$this->storeManager->getStore()
757-
);
759+
));
758760
}
759761

760762
/**
@@ -792,10 +794,10 @@ public function getMadaBinsPath() {
792794
* @return string
793795
*/
794796
public function getPrivateSharedKey() {
795-
return (string) $this->getValue(
797+
return (string) $this->encryptor->decrypt($this->getValue(
796798
self::KEY_PRIVATE_SHARED_KEY,
797799
$this->storeManager->getStore()
798-
);
800+
));
799801
}
800802

801803
/**

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ bin/magento setup:upgrade
4848
rm -rf var/cache var/generation/ var/di
4949
bin/magento setup:di:compile && php bin/magento cache:clean
5050
```
51+
52+
## Update
53+
In order to update the Checkout.com Magento 2 extension please run the following commands in a terminal, from your Magento 2 root directory:
54+
55+
```bash
56+
composer update checkoutcom/magento2:*
57+
bin/magento setup:upgrade
58+
rm -rf var/cache var/generation/ var/di
59+
bin/magento setup:di:compile && php bin/magento cache:clean
60+
```
61+
5162
For more information on the Magento 2 module installation process, please have a look at the [Magento 2 official documentation](http://devdocs.magento.com/guides/v2.0/install-gde/install/cli/install-cli-subcommands-enable.html "Magento 2 official documentation")
5263

5364
## Configuration

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"magento/module-vault": "*"
1212
},
1313
"type": "magento2-module",
14-
"version": "1.0.38",
14+
"version": "1.0.39",
1515
"autoload": {
1616
"files": [
1717
"registration.php"

etc/config.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
<auto_capture>0</auto_capture>
4848
<auto_capture_time>0.02</auto_capture_time>
4949
<language_fallback>EN-EN</language_fallback>
50-
<public_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
51-
<secret_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
52-
<private_shared_key backend_model="Magento\Config\Model\Config\Backend\Encrypted" />
50+
<public_key></public_key>
51+
<secret_key></secret_key>
52+
<private_shared_key></private_shared_key>
5353
<sandbox_api_url><![CDATA[https://sandbox.checkout.com/api2/v2/]]></sandbox_api_url>
5454
<live_api_url><![CDATA[https://api2.checkout.com/v2/]]></live_api_url>
5555
<sandbox_embedded_url><![CDATA[https://cdn.checkout.com/js/frames.js]]></sandbox_embedded_url>

0 commit comments

Comments
 (0)