diff --git a/Block/Adminhtml/System/Config/CardFormCustomization/SecureFormBannerMessage.php b/Block/Adminhtml/System/Config/CardFormCustomization/SecureFormBannerMessage.php
deleted file mode 100644
index 5da32523..00000000
--- a/Block/Adminhtml/System/Config/CardFormCustomization/SecureFormBannerMessage.php
+++ /dev/null
@@ -1,86 +0,0 @@
-omiseCcConfig = $omiseCcConfig;
- }
-
- /**
- * Retrieve unique system message identity
- *
- * @return string
- */
- public function getIdentity()
- {
- return 'opn_payments_secure_form_message';
- }
-
- /**
- * Whether the system message should be shown
- *
- * @return bool
- */
- public function isDisplayed()
- {
- $secureForm = $this->omiseCcConfig->getSecureForm();
- return $secureForm == 'yes' ? false : true;
- }
-
- /**
- * Retrieve system message text
- *
- * @return \Magento\Framework\Phrase
- */
- public function getText()
- {
- $defaultMessage = "Opn Payments : Update your plugin to the latest version to enable
- Secure Form and maximize the security of your customers’ information.
- You will need to re-customize the credit card checkout form after the upgrade.
-
- Learn how to enable Secure Form.";
-
- return $this->localize('secure_form_banner_message', $defaultMessage);
- }
-
- /**
- * Retrieve system message severity
- *
- * @return int
- */
- public function getSeverity()
- {
- return self::SEVERITY_CRITICAL;
- }
-
- /**
- * localize using translation key
- *
- * @param string $key
- * @param string $default
- * @return string
- */
- public function localize($key, $default)
- {
- $result = __($key);
- return $result == $key ? $default : $result;
- }
-}
diff --git a/Gateway/Request/PaymentDataBuilder.php b/Gateway/Request/PaymentDataBuilder.php
index 8512aa18..5e145126 100644
--- a/Gateway/Request/PaymentDataBuilder.php
+++ b/Gateway/Request/PaymentDataBuilder.php
@@ -111,10 +111,6 @@ public function build(array $buildSubject)
$requestBody[self::ZERO_INTEREST_INSTALLMENTS] = true;
}
- if (Cc::CODE === $method->getMethod()) {
- $requestBody[self::METADATA]['secure_form_enabled'] = $this->ccConfig->getSecureForm();
- }
-
if (Installment::CODE === $method->getMethod()) {
$card = $method->getAdditionalInformation(InstallmentDataAssignObserver::CARD);
if ($card !== null) {
diff --git a/Model/Config/Cc.php b/Model/Config/Cc.php
index 334b1a44..b0f2f84d 100644
--- a/Model/Config/Cc.php
+++ b/Model/Config/Cc.php
@@ -26,9 +26,4 @@ public function getCardTheme()
{
return $this->getValue('card_form_theme', self::CODE);
}
-
- public function getSecureForm()
- {
- return $this->getValue('secure_form', self::CODE);
- }
}
diff --git a/Model/Source/SecureForm.php b/Model/Source/SecureForm.php
deleted file mode 100644
index 7d9e238c..00000000
--- a/Model/Source/SecureForm.php
+++ /dev/null
@@ -1,22 +0,0 @@
- 'yes',
- 'label' => __('Yes'),
- ],
- [
- 'value' => 'no',
- 'label' => __('No')
- ]
- ];
- }
-}
diff --git a/Model/Ui/CcConfigProvider.php b/Model/Ui/CcConfigProvider.php
index 98a00a54..1883e216 100644
--- a/Model/Ui/CcConfigProvider.php
+++ b/Model/Ui/CcConfigProvider.php
@@ -56,7 +56,6 @@ public function getConfig()
'isCustomerLoggedIn' => $this->customer->isLoggedIn(),
'cards' => $this->getCards(),
'locale' => $this->omiseCcConfig->getStoreLocale(),
- 'secureForm' => $this->omiseCcConfig->getSecureForm(),
'formDesign' => $theme->getFormDesign($selectedTheme, $customDesign),
'theme' => $selectedTheme
],
diff --git a/Test/Unit/PaymentDataBuilderTest.php b/Test/Unit/PaymentDataBuilderTest.php
index 383bc7b5..59217b4a 100644
--- a/Test/Unit/PaymentDataBuilderTest.php
+++ b/Test/Unit/PaymentDataBuilderTest.php
@@ -131,7 +131,6 @@ public function buildDataProvider()
'order_id' => 123,
'store_id' => 1,
'store_name' => 'opn-store',
- 'secure_form_enabled' => true
],
],
[
diff --git a/Test/Unit/SecureFormBannerMessageTest.php b/Test/Unit/SecureFormBannerMessageTest.php
deleted file mode 100644
index 21800a4d..00000000
--- a/Test/Unit/SecureFormBannerMessageTest.php
+++ /dev/null
@@ -1,80 +0,0 @@
-_omiseCcConfigMock = $this->createStub(Cc::class);
- $this->_messageModel = new SecureFormBannerMessage($this->_omiseCcConfigMock);
- }
-
- /**
- * test get identity
- *
- * @covers Omise\Payment\Block\Adminhtml\System\Config\CardFormCustomization\SecureFormBannerMessage
- */
- public function testGetIdentity()
- {
- $this->assertEquals('opn_payments_secure_form_message', $this->_messageModel->getIdentity());
- }
-
- /**
- * test text is display when secure form is off
- *
- * @covers Omise\Payment\Block\Adminhtml\System\Config\CardFormCustomization\SecureFormBannerMessage
- */
- public function testIsDisplayed()
- {
- $this->_omiseCcConfigMock->method('getSecureForm')->willReturn(false);
- $this->assertEquals(true, $this->_messageModel->isDisplayed());
- }
-
- /**
- * test text is not display when secure form is on
- *
- * @covers Omise\Payment\Block\Adminhtml\System\Config\CardFormCustomization\SecureFormBannerMessage
- */
- public function testIsNotDisplayed()
- {
- $this->_omiseCcConfigMock->method('getSecureForm')->willReturn(true);
- $this->assertEquals(false, $this->_messageModel->isDisplayed());
- }
-
- /**
- * test that get severity should return MessageInterface:SEVERITY_CRITICAL
- *
- * @covers Omise\Payment\Block\Adminhtml\System\Config\CardFormCustomization\SecureFormBannerMessage
- */
- public function testGetSeverity()
- {
- $this->assertEquals(MessageInterface::SEVERITY_CRITICAL, $this->_messageModel->getSeverity());
- }
-
- /**
- * test getText return valid html
- *
- * @covers Omise\Payment\Block\Adminhtml\System\Config\CardFormCustomization\SecureFormBannerMessage
- */
- public function testGetText()
- {
- $text = 'Update your plugin to the latest version to enable';
- $this->assertStringContainsString($text, $this->_messageModel->getText());
- }
-}
diff --git a/etc/adminhtml/di.xml b/etc/adminhtml/di.xml
index 55609597..f06fce9f 100644
--- a/etc/adminhtml/di.xml
+++ b/etc/adminhtml/di.xml
@@ -8,12 +8,4 @@
-
-
-
-
- - Omise\Payment\Block\Adminhtml\System\Config\CardFormCustomization\SecureFormBannerMessage
-
-
-
diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml
index 94bcc458..6cbafcbe 100644
--- a/etc/adminhtml/system.xml
+++ b/etc/adminhtml/system.xml
@@ -85,21 +85,10 @@
This controls the title which the user sees during checkout.
payment/omise_cc/title
-
-
- payment/omise_cc/secure_form
- Omise\Payment\Model\Source\SecureForm
-
- mandatory in a future release.]]>
-
-
payment/omise_cc/card_form_theme
Omise\Payment\Model\Source\CardFormTheme
-
- yes
-
Click here for more secure card form customization.]]>
diff --git a/etc/config.xml b/etc/config.xml
index 6ab5366a..bdf2fe67 100644
--- a/etc/config.xml
+++ b/etc/config.xml
@@ -28,7 +28,6 @@
1
1
authorize
- no
light
diff --git a/view/frontend/web/js/view/payment/method-renderer/omise-cc-method.js b/view/frontend/web/js/view/payment/method-renderer/omise-cc-method.js
index 3be8be39..32804e6d 100644
--- a/view/frontend/web/js/view/payment/method-renderer/omise-cc-method.js
+++ b/view/frontend/web/js/view/payment/method-renderer/omise-cc-method.js
@@ -83,9 +83,7 @@ define(
'omiseSaveCard',
'omiseCardError'
])
- if (this.isSecureForm()) {
- this.openOmiseJs()
- }
+ this.openOmiseJs()
return this
},
@@ -95,21 +93,15 @@ define(
checkoutData.setSelectedPaymentMethod(this.item.method);
OmiseCard.destroy();
setTimeout(() => {
- if (this.isSecureForm()) {
- const element = document.querySelector('.omise-card-form')
- if(element) {
- this.applyOmiseJsToElement(this, element)
- }
+ const element = document.querySelector('.omise-card-form')
+ if(element) {
+ this.applyOmiseJsToElement(this, element)
}
}, 300);
return true
},
- isSecureForm: function () {
- return window.checkoutConfig.payment.omise_cc.secureForm === 'yes'
- },
-
openOmiseJs: function () {
ko.bindingHandlers.omiseCardForm = {
init: (element) => this.applyOmiseJsToElement(this, element)
@@ -287,43 +279,6 @@ define(
OmiseCard.requestCardToken(billingAddress)
},
- /**
- * Generate Omise token with omise.js before proceed the placeOrder process.
- *
- * @return {void}
- */
- generateTokenWithOmiseJsAndPerformPlaceOrderAction: function () {
- if (! this.validate()) {
- return false;
- }
-
- const self = this
- this.startPerformingPlaceOrderAction()
-
- let card = {
- number: this.omiseCardNumber(),
- name: this.omiseCardHolderName(),
- expiration_month: this.omiseCardExpirationMonth(),
- expiration_year: this.omiseCardExpirationYear(),
- security_code: this.omiseCardSecurityCode()
- }
- let selectedBillingAddress = quote.billingAddress()
-
- if (self.billingAddressCountries.indexOf(selectedBillingAddress.countryId) > -1) {
- Object.assign(card, this.getSelectedTokenBillingAddress(selectedBillingAddress))
- }
-
- Omise.setPublicKey(this.getPublicKey())
- Omise.createToken('card', card, function (statusCode, response) {
- if (statusCode === 200) {
- self.createOrder(self, {token : response.id})
- } else {
- self.omiseCardError(response.message)
- self.stopPerformingPlaceOrderAction()
- }
- })
- },
-
/**
* Hook the placeOrder function.
* Original source: placeOrder(data, event); @ module-checkout/view/frontend/web/js/view/payment/default.js
@@ -346,36 +301,10 @@ define(
return true
}
- if (this.isSecureForm()) {
- this.generateTokenWithEmbeddedFormAndPerformPlaceOrderAction()
- } else {
- this.generateTokenWithOmiseJsAndPerformPlaceOrderAction()
- }
-
+ this.generateTokenWithEmbeddedFormAndPerformPlaceOrderAction()
return true
},
- /**
- * Hook the validate function.
- * Original source: validate(); @ module-checkout/view/frontend/web/js/view/payment/default.js
- *
- * @return {boolean}
- */
- validate: function () {
- let prefix = '#' + this.getCode(),
- fields = [
- 'CardNumber',
- 'CardHolderName',
- 'CardExpirationMonth',
- 'CardExpirationYear',
- 'CardSecurityCode'
- ]
-
-
- $(prefix + 'Form').validation()
- return fields.map(f => $(prefix + f).valid()).every(valid => valid)
- },
-
processOrderWithCard: function () {
const self = this
const failHandler = this.buildFailHandler(self, 300)
diff --git a/view/frontend/web/template/payment/omise-cc-form.html b/view/frontend/web/template/payment/omise-cc-form.html
index 06dc199c..a534fdb5 100644
--- a/view/frontend/web/template/payment/omise-cc-form.html
+++ b/view/frontend/web/template/payment/omise-cc-form.html
@@ -71,119 +71,9 @@
-
-
-
-
-
-
-
+