diff --git a/Block/Adminhtml/ColorPicker.php b/Block/Adminhtml/ColorPicker.php new file mode 100644 index 0000000..7ed7a7c --- /dev/null +++ b/Block/Adminhtml/ColorPicker.php @@ -0,0 +1,59 @@ +getElementHtml(); + $value = $element->getData('value'); + $elementId = $element->getHtmlId(); + $html .= ''; + + return $html; + } +} diff --git a/CHANGELOG.md b/CHANGELOG.md index a63385b..edfd242 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Changelog All notable changes to this project will be documented in this file. +## [3.2.0] - 2022-03-11 +### Changed +- Installation instructions in the README.md file were updated +- Color selector for Pay Button on the module Configuration page + + ## [3.1.1] - 2022-01-04 ### Fixed - Installation instructions in the README.md file were updated diff --git a/Ui/ConfigProvider.php b/Ui/ConfigProvider.php index e788ca5..ad27950 100644 --- a/Ui/ConfigProvider.php +++ b/Ui/ConfigProvider.php @@ -1,6 +1,6 @@ config = $config; - $this->urlBuilder = $urlBuilder; + $this->config = $config; + $this->urlBuilder = $urlBuilder; $this->embeddedConfig = $embeddedConfig; } @@ -73,7 +75,7 @@ public function __construct( protected function getPlaceOrderUrl() { return $this->urlBuilder->getUrl('mastercard/simplify/placeOrder', [ - '_secure' => 1 + '_secure' => 1, ]); } @@ -86,21 +88,22 @@ public function getConfig() { return [ 'payment' => [ - self::CODE => [ + self::CODE => [ self::JS_COMPONENT => $this->config->getValue(self::JS_COMPONENT), - self::PUBLIC_KEY => $this->config->getValue(self::PUBLIC_KEY), - self::IS_MODAL => $this->config->getValue(self::PAYMENT_FORM_TYPE) == FormType::MODAL, + self::PUBLIC_KEY => $this->config->getValue(self::PUBLIC_KEY), + self::IS_MODAL => $this->config->getValue(self::PAYMENT_FORM_TYPE) == FormType::MODAL, self::REDIRECT_URL => $this->getPlaceOrderUrl(), - self::VAULT_CODE => self::VAULT_PAYMENT_CODE, + self::VAULT_CODE => self::VAULT_PAYMENT_CODE, ], self::EMBEDDED_CODE => [ self::JS_COMPONENT => $this->embeddedConfig->getValue(self::JS_COMPONENT), - self::PUBLIC_KEY => $this->embeddedConfig->getValue(self::PUBLIC_KEY), - self::IS_MODAL => $this->embeddedConfig->getValue(self::PAYMENT_FORM_TYPE) == FormType::MODAL, + self::PUBLIC_KEY => $this->embeddedConfig->getValue(self::PUBLIC_KEY), + self::IS_MODAL => $this->embeddedConfig->getValue(self::PAYMENT_FORM_TYPE) == FormType::MODAL, self::REDIRECT_URL => $this->getPlaceOrderUrl(), - self::VAULT_CODE => self::VAULT_EMBEDDED_PAYMENT_CODE, - ] - ] + self::VAULT_CODE => self::VAULT_EMBEDDED_PAYMENT_CODE, + self::BUTTON_COLOR => $this->embeddedConfig->getValue(self::BUTTON_COLOR), + ], + ], ]; } } diff --git a/composer.json b/composer.json index dd20260..cfa5f09 100755 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { "name": "mastercard/module-simplifycommerce", - "version": "3.1.1", - "description": "Mastercard Simplify Commerce", - "license": "proprietary", + "version": "3.2.0", + "description": "Mastercard Payment Gateway Services - Simplify", + "license": "Apache-2.0", "authors": [ { "name": "Tomasz Waraksa", @@ -14,7 +14,7 @@ } ], "require": { - "magento/framework": "^101.0.0|^102.0.0|^103.0.0|^104.0.0" + "magento/framework": "^101.0.0|^102.0.0|^103.0.0" }, "type": "magento2-module", "autoload": { diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 62bd312..f1ccab7 100755 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -146,6 +146,11 @@ Magento\Config\Model\Config\Source\Yesno payment/simplifycommerce_embedded_vault/active + + + payment/simplifycommerce_embedded/button_color + MasterCard\SimplifyCommerce\Block\Adminhtml\ColorPicker + diff --git a/etc/config.xml b/etc/config.xml index 62ac0dc..558f02c 100755 --- a/etc/config.xml +++ b/etc/config.xml @@ -73,6 +73,7 @@ 0 last4,type,expMonth,expYear,source,paymentStatus + #1979c3 SimplifyVaultFacade diff --git a/lib/SimplifyAdapter.php b/lib/SimplifyAdapter.php index 194bd7e..34098a2 100644 --- a/lib/SimplifyAdapter.php +++ b/lib/SimplifyAdapter.php @@ -41,7 +41,7 @@ public function __construct($publicKey, $privateKey) Simplify::$publicKey = $publicKey; Simplify::$privateKey = $privateKey; - Simplify::$userAgent = 'Magento-3.1.1'; + Simplify::$userAgent = 'Magento-3.2.0'; } /** diff --git a/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-embedded-method.js b/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-embedded-method.js index 5536294..a957981 100644 --- a/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-embedded-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-embedded-method.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2020 Mastercard + * Copyright (c) 2013-2022 Mastercard * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-method.js b/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-method.js index 5895f3e..8975fa7 100644 --- a/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-method.js +++ b/view/frontend/web/js/view/payment/method-renderer/simplifycommerce-method.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2021 Mastercard + * Copyright (c) 2013-2022 Mastercard * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -194,5 +194,17 @@ define([ isVaultEnabled: function () { return this.vaultEnabler.isVaultEnabled(); }, + + /** + * @returns {String} + */ + getButtonColor: function () { + var config, buttonColor; + + config = window.checkoutConfig["payment"][this.getCode()] || {}; + buttonColor = config["button_color"] || null; + + return buttonColor; + } }); }); diff --git a/view/frontend/web/template/payment/simplifycommerce.html b/view/frontend/web/template/payment/simplifycommerce.html index 11d6017..6f6704f 100755 --- a/view/frontend/web/template/payment/simplifycommerce.html +++ b/view/frontend/web/template/payment/simplifycommerce.html @@ -1,89 +1,89 @@ - - -
-
- - -
-
- - - -
-
- - - -
- -
- - -
- - - -
-
-
- - -
- -
- -
-
- - - -
- -
-
- - -
-
- -
-
+ + +
+
+ + +
+
+ + + +
+
+ + + +
+ +
+ + +
+ + + +
+
+
+ + +
+ +
+ +
+
+ + + +
+ +
+
+ + +
+
+ +
+