diff --git a/.php_cs b/.php_cs index 743cab6ee0d17..8381e44cf08ff 100644 --- a/.php_cs +++ b/.php_cs @@ -15,7 +15,6 @@ $finder = Symfony\CS\Finder\DefaultFinder::create() ->exclude('dev/tests/functional/vendor') ->exclude('dev/tests/integration/tmp') ->exclude('dev/tests/integration/var') - ->exclude('lib/internal/CardinalCommerce') ->exclude('lib/internal/Cm') ->exclude('lib/internal/Credis') ->exclude('lib/internal/JSMin') diff --git a/app/code/Magento/Centinel/Block/Adminhtml/Validation.php b/app/code/Magento/Centinel/Block/Adminhtml/Validation.php deleted file mode 100644 index cd3ee0a70796a..0000000000000 --- a/app/code/Magento/Centinel/Block/Adminhtml/Validation.php +++ /dev/null @@ -1,61 +0,0 @@ -setId('sales_order_create_validation_card'); - } - - /** - * Return text for block`s header - * - * @return \Magento\Framework\Phrase - */ - public function getHeaderText() - { - return __('3D Secure Card Validation'); - } - - /** - * Return css class name for header block - * - * @return string - */ - public function getHeaderCssClass() - { - return 'head-payment-method'; - } - - /** - * Prepare html output - * - * @return string - */ - protected function _toHtml() - { - $payment = $this->getQuote()->getPayment(); - if (!$payment->getMethod() || - $payment->getMethodInstance()->getIsDummy() || - !$payment->getMethodInstance()->getIsCentinelValidationEnabled() - ) { - return ''; - } - return parent::_toHtml(); - } -} diff --git a/app/code/Magento/Centinel/Block/Adminhtml/Validation/Form.php b/app/code/Magento/Centinel/Block/Adminhtml/Validation/Form.php deleted file mode 100644 index 1bb63f2cee86d..0000000000000 --- a/app/code/Magento/Centinel/Block/Adminhtml/Validation/Form.php +++ /dev/null @@ -1,39 +0,0 @@ - - */ -namespace Magento\Centinel\Block\Adminhtml\Validation; - -class Form extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate -{ - /** - * Prepare validation and template parameters - * - * @return string - */ - protected function _toHtml() - { - $payment = $this->getQuote()->getPayment(); - if ($payment) { - $method = $payment->getMethodInstance(); - if ($method->getIsCentinelValidationEnabled() && ($centinel = $method->getCentinelValidator())) { - $this->setFrameUrl( - $centinel->getValidatePaymentDataUrl() - )->setContainerId( - 'centinel_authenticate_iframe' - )->setMethodCode( - $method->getCode() - ); - return parent::_toHtml(); - } - } - return ''; - } -} diff --git a/app/code/Magento/Centinel/Block/Authentication.php b/app/code/Magento/Centinel/Block/Authentication.php deleted file mode 100644 index 149548fec10bb..0000000000000 --- a/app/code/Magento/Centinel/Block/Authentication.php +++ /dev/null @@ -1,91 +0,0 @@ -_checkoutSession = $checkoutSession; - parent::__construct($context, $data); - $this->_isScopePrivate = true; - } - - /** - * Add identifier of related block - * - * @param string $blockId - * @return $this - */ - public function addRelatedBlock($blockId) - { - $this->_relatedBlocks[] = $blockId; - return $this; - } - - /** - * Return identifiers of related blocks - * - * @return string[] - */ - public function getRelatedBlocks() - { - return $this->_relatedBlocks; - } - - /** - * Check whether authentication is required and prepare some template data - * - * @return string - */ - protected function _toHtml() - { - $method = $this->_checkoutSession->getQuote()->getPayment()->getMethodInstance(); - if ($method->getIsCentinelValidationEnabled()) { - $centinel = $method->getCentinelValidator(); - if ($centinel && $centinel->shouldAuthenticate()) { - $this->setAuthenticationStart(true); - $this->setFrameUrl($centinel->getAuthenticationStartUrl()); - return parent::_toHtml(); - } - } - return parent::_toHtml(); - } -} diff --git a/app/code/Magento/Centinel/Block/Authentication/Complete.php b/app/code/Magento/Centinel/Block/Authentication/Complete.php deleted file mode 100644 index 6fb32e49efa70..0000000000000 --- a/app/code/Magento/Centinel/Block/Authentication/Complete.php +++ /dev/null @@ -1,49 +0,0 @@ -_coreRegistry = $registry; - parent::__construct($context, $data); - } - - /** - * Prepare authentication result params and render - * - * @return string - */ - protected function _toHtml() - { - $validator = $this->_coreRegistry->registry('current_centinel_validator'); - if ($validator) { - $this->setIsProcessed(true); - $this->setIsSuccess($validator->isAuthenticateSuccessful()); - } - return parent::_toHtml(); - } -} diff --git a/app/code/Magento/Centinel/Block/Authentication/Start.php b/app/code/Magento/Centinel/Block/Authentication/Start.php deleted file mode 100644 index 10fd701433be3..0000000000000 --- a/app/code/Magento/Centinel/Block/Authentication/Start.php +++ /dev/null @@ -1,49 +0,0 @@ -_coreRegistry = $registry; - parent::__construct($context, $data); - } - - /** - * Prepare form parameters and render - * - * @return string - */ - protected function _toHtml() - { - $validator = $this->_coreRegistry->registry('current_centinel_validator'); - if ($validator && $validator->shouldAuthenticate()) { - $this->addData($validator->getAuthenticateStartData()); - return parent::_toHtml(); - } - return ''; - } -} diff --git a/app/code/Magento/Centinel/Block/Logo.php b/app/code/Magento/Centinel/Block/Logo.php deleted file mode 100644 index bcefadeeacbbc..0000000000000 --- a/app/code/Magento/Centinel/Block/Logo.php +++ /dev/null @@ -1,28 +0,0 @@ -getMethod()->getCode(); - } -} diff --git a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php deleted file mode 100644 index cb8ffb4afa3bd..0000000000000 --- a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index.php +++ /dev/null @@ -1,55 +0,0 @@ - - */ -namespace Magento\Centinel\Controller\Adminhtml\Centinel; - -class Index extends \Magento\Backend\App\Action -{ - /** - * Core registry - * - * @var \Magento\Framework\Registry - */ - protected $_coreRegistry = null; - - /** - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\Registry $coreRegistry - */ - public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $coreRegistry) - { - $this->_coreRegistry = $coreRegistry; - parent::__construct($context); - } - - /** - * Return payment model - * - * @return \Magento\Quote\Model\Quote\Payment - */ - protected function _getPayment() - { - return $this->_objectManager->get('Magento\Sales\Model\AdminOrder\Create')->getQuote()->getPayment(); - } - - /** - * Return Centinel validation model - * - * @return \Magento\Centinel\Model\Service - */ - protected function _getValidator() - { - if ($this->_getPayment()->getMethodInstance()->getIsCentinelValidationEnabled()) { - return $this->_getPayment()->getMethodInstance()->getCentinelValidator(); - } - return false; - } -} diff --git a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/AuthenticationComplete.php b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/AuthenticationComplete.php deleted file mode 100644 index fa7ee1ffd32fb..0000000000000 --- a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/AuthenticationComplete.php +++ /dev/null @@ -1,35 +0,0 @@ -_getValidator(); - if ($validator) { - $request = $this->getRequest(); - - $data = new \Magento\Framework\Object(); - $data->setTransactionId($request->getParam('MD')); - $data->setPaResPayload($request->getParam('PaRes')); - - $validator->authenticate($data); - $this->_coreRegistry->register('current_centinel_validator', $validator); - } - } catch (\Exception $e) { - $this->_coreRegistry->register('current_centinel_validator', false); - } - $this->_view->loadLayout()->renderLayout(); - } -} diff --git a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/AuthenticationStart.php b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/AuthenticationStart.php deleted file mode 100644 index 33bdc10cc336f..0000000000000 --- a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/AuthenticationStart.php +++ /dev/null @@ -1,24 +0,0 @@ -_getValidator(); - if ($validator) { - $this->_coreRegistry->register('current_centinel_validator', $validator); - } - $this->_view->loadLayout()->renderLayout(); - } -} diff --git a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php b/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php deleted file mode 100644 index 13d3154b90053..0000000000000 --- a/app/code/Magento/Centinel/Controller/Adminhtml/Centinel/Index/ValidatePaymentData.php +++ /dev/null @@ -1,38 +0,0 @@ -getRequest()->getParam('payment'); - $validator = $this->_getValidator(); - if (!$validator) { - throw new \Exception('This payment method does not have centinel validation.'); - } - $validator->reset(); - $this->_getPayment()->importData($paymentData); - $result['authenticationUrl'] = $validator->getAuthenticationStartUrl(); - } catch (\Magento\Framework\Exception\LocalizedException $e) { - $result['message'] = $e->getMessage(); - } catch (\Exception $e) { - $this->_objectManager->get('Psr\Log\LoggerInterface')->critical($e); - $result['message'] = __('Validation failed.'); - } - $this->getResponse()->representJson( - $this->_objectManager->get('Magento\Framework\Json\Helper\Data')->jsonEncode($result) - ); - } -} diff --git a/app/code/Magento/Centinel/Controller/Index.php b/app/code/Magento/Centinel/Controller/Index.php deleted file mode 100644 index 1cbca3d3e6442..0000000000000 --- a/app/code/Magento/Centinel/Controller/Index.php +++ /dev/null @@ -1,56 +0,0 @@ -_coreRegistry = $coreRegistry; - parent::__construct($context); - } - - /** - * Return payment model - * - * @return \Magento\Quote\Model\Quote\Payment - */ - protected function _getPayment() - { - return $this->_objectManager->get('Magento\Checkout\Model\Session')->getQuote()->getPayment(); - } - - /** - * Return Centinel validation model - * - * @return \Magento\Centinel\Model\Service - */ - protected function _getValidator() - { - if ($this->_getPayment()->getMethodInstance()->getIsCentinelValidationEnabled()) { - return $this->_getPayment()->getMethodInstance()->getCentinelValidator(); - } - return false; - } -} diff --git a/app/code/Magento/Centinel/Controller/Index/AuthenticationComplete.php b/app/code/Magento/Centinel/Controller/Index/AuthenticationComplete.php deleted file mode 100644 index 2c726b855a8df..0000000000000 --- a/app/code/Magento/Centinel/Controller/Index/AuthenticationComplete.php +++ /dev/null @@ -1,35 +0,0 @@ -_getValidator(); - if ($validator) { - $request = $this->getRequest(); - - $data = new \Magento\Framework\Object(); - $data->setTransactionId($request->getParam('MD')); - $data->setPaResPayload($request->getParam('PaRes')); - - $validator->authenticate($data); - $this->_coreRegistry->register('current_centinel_validator', $validator); - } - } catch (\Exception $e) { - $this->_coreRegistry->register('current_centinel_validator', false); - } - $this->_view->loadLayout()->renderLayout(); - } -} diff --git a/app/code/Magento/Centinel/Controller/Index/AuthenticationStart.php b/app/code/Magento/Centinel/Controller/Index/AuthenticationStart.php deleted file mode 100644 index ecddad03418c1..0000000000000 --- a/app/code/Magento/Centinel/Controller/Index/AuthenticationStart.php +++ /dev/null @@ -1,24 +0,0 @@ -_getValidator(); - if ($validator) { - $this->_coreRegistry->register('current_centinel_validator', $validator); - } - $this->_view->loadLayout()->renderLayout(); - } -} diff --git a/app/code/Magento/Centinel/Helper/Data.php b/app/code/Magento/Centinel/Helper/Data.php deleted file mode 100644 index 393505eef9eb0..0000000000000 --- a/app/code/Magento/Centinel/Helper/Data.php +++ /dev/null @@ -1,145 +0,0 @@ - - */ -namespace Magento\Centinel\Helper; - -class Data extends \Magento\Framework\App\Helper\AbstractHelper -{ - /** - * Return label for cmpi field - * - * @param string $fieldName - * @return \Magento\Framework\Phrase|string - */ - public function getCmpiLabel($fieldName) - { - switch ($fieldName) { - case \Magento\Centinel\Model\Service::CMPI_PARES: - return __('3D Secure Verification Result'); - case \Magento\Centinel\Model\Service::CMPI_ENROLLED: - return __('3D Secure Cardholder Validation'); - case \Magento\Centinel\Model\Service::CMPI_ECI: - return __('3D Secure Electronic Commerce Indicator'); - case \Magento\Centinel\Model\Service::CMPI_CAVV: - return __('3D Secure CAVV'); - case \Magento\Centinel\Model\Service::CMPI_XID: - return __('3D Secure XID'); - } - return ''; - } - - /** - * Return value for cmpi field - * - * @param string $fieldName - * @param string $value - * @return string - */ - public function getCmpiValue($fieldName, $value) - { - switch ($fieldName) { - case \Magento\Centinel\Model\Service::CMPI_PARES: - return $this->_getCmpiParesValue($value); - case \Magento\Centinel\Model\Service::CMPI_ENROLLED: - return $this->_getCmpiEnrolledValue($value); - case \Magento\Centinel\Model\Service::CMPI_ECI: - return $this->_getCmpiEciValue($value); - case \Magento\Centinel\Model\Service::CMPI_CAVV: - // break intentionally omitted - case \Magento\Centinel\Model\Service::CMPI_XID: - return $value; - } - return ''; - } - - /** - * Return text value for cmpi eci flag field - * - * @param string $value - * @return \Magento\Framework\Phrase|string - */ - private function _getCmpiEciValue($value) - { - switch ($value) { - case '01': - case '07': - return __('Merchant Liability'); - case '02': - case '05': - case '06': - return __('Card Issuer Liability'); - default: - return $value; - } - } - - /** - * Return text value for cmpi enrolled field - * - * @param string $value - * @return \Magento\Framework\Phrase - */ - private function _getCmpiEnrolledValue($value) - { - switch ($value) { - case 'Y': - return __('Enrolled'); - case 'U': - return __('Enrolled but Authentication Unavailable'); - case 'N': - // break intentionally omitted - default: - return __('Not Enrolled'); - } - } - - /** - * Return text value for cmpi pares field - * - * @param string $value - * @return \Magento\Framework\Phrase|string - */ - private function _getCmpiParesValue($value) - { - switch ($value) { - case 'Y': - return __('Successful'); - case 'N': - return __('Failed'); - case 'U': - return __('Unable to complete'); - case 'A': - return __('Successful attempt'); - default: - return $value; - } - } - - /** - * Return url of page about visa verification - * - * @return string - */ - public function getVisaLearnMorePageUrl() - { - return 'https://usa.visa.com/personal/security/vbv/index.html?ep=v_sym_verifiedbyvisa'; - } - - /** - * Return url of page about mastercard verification - * - * @return string - */ - public function getMastercardLearnMorePageUrl() - { - return 'http://www.mastercardbusiness.com/mcbiz/index.jsp?template=/orphans&content=securecodepopup'; - } -} diff --git a/app/code/Magento/Centinel/LICENSE.txt b/app/code/Magento/Centinel/LICENSE.txt deleted file mode 100644 index 49525fd99da9c..0000000000000 --- a/app/code/Magento/Centinel/LICENSE.txt +++ /dev/null @@ -1,48 +0,0 @@ - -Open Software License ("OSL") v. 3.0 - -This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: - -Licensed under the Open Software License version 3.0 - - 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: - - 1. to reproduce the Original Work in copies, either alone or as part of a collective work; - - 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; - - 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; - - 4. to perform the Original Work publicly; and - - 5. to display the Original Work publicly. - - 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. - - 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. - - 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. - - 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). - - 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. - - 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. - - 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. - - 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). - - 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. - - 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. - - 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. - - 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. - - 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. - - 16. Modification of This License. This License is Copyright (C) 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/Centinel/LICENSE_AFL.txt b/app/code/Magento/Centinel/LICENSE_AFL.txt deleted file mode 100644 index 87943b95d43a5..0000000000000 --- a/app/code/Magento/Centinel/LICENSE_AFL.txt +++ /dev/null @@ -1,48 +0,0 @@ - -Academic Free License ("AFL") v. 3.0 - -This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: - -Licensed under the Academic Free License version 3.0 - - 1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: - - 1. to reproduce the Original Work in copies, either alone or as part of a collective work; - - 2. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; - - 3. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License; - - 4. to perform the Original Work publicly; and - - 5. to display the Original Work publicly. - - 2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. - - 3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. - - 4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. - - 5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). - - 6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. - - 7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. - - 8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. - - 9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). - - 10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. - - 11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. - - 12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. - - 13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. - - 14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - - 15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. - - 16. Modification of This License. This License is Copyright 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file diff --git a/app/code/Magento/Centinel/Model/AbstractState.php b/app/code/Magento/Centinel/Model/AbstractState.php deleted file mode 100644 index 58f3b6dee34d1..0000000000000 --- a/app/code/Magento/Centinel/Model/AbstractState.php +++ /dev/null @@ -1,151 +0,0 @@ -_dataStorage = $dataStorageModel; - return $this; - } - - /** - * Getter for storage data model - * - * @return \Magento\Framework\Object - */ - public function getDataStorage() - { - return $this->_dataStorage; - } - - /** - * Retrieves data from the object - * - * If $key is empty will return all the data as an array - * Otherwise it will return value of the attribute specified by $key - * - * $index parameter is ignored - * - * @param string $key - * @param string|int $index - * @return mixed - * @see \Magento\Framework\Session\SessionManager::getData() - */ - public function getData($key = '', $index = null) - { - return $this->getDataStorage()->getData($key); - } - - /** - * Overwrite data in the object. - * - * Parameter $key can be string or array. - * If $key is string, the attribute value will be overwritten by $value - * - * If $key is an array, it will overwrite all the data in the object. - * - * @param string|array $key - * @param mixed $value - * @return $this - */ - public function setData($key, $value = null) - { - $this->getDataStorage()->setData($key, $value); - return $this; - } - - /** - * Save lookup result in state model - * - * @param \Magento\Framework\Object $result - * @return $this - */ - public function setLookupResult($result) - { - foreach ($result->getData() as $key => $value) { - $this->setData('lookup_' . $key, $value); - } - return $this; - } - - /** - * Save authenticate result in state model - * - * @param \Magento\Framework\Object $result - * @return $this - */ - public function setAuthenticateResult($result) - { - foreach ($result->getData() as $key => $value) { - $this->setData('authenticate_' . $key, $value); - } - return $this; - } - - /** - * Analyse lookup`s results. If lookup is successful return true and false if it failure - * Result depends from flag self::getIsModeStrict() - * - * @return bool - */ - final public function isLookupSuccessful() - { - if ($this->_isLookupStrictSuccessful()) { - return true; - } elseif (!$this->getIsModeStrict() && $this->_isLookupSoftSuccessful()) { - return true; - } - return false; - } - - /** - * Analyse lookup`s results. If lookup is strict successful return true - * - * @return bool - */ - abstract protected function _isLookupStrictSuccessful(); - - /** - * Analyse lookup`s results. If lookup is soft successful return true - * - * @return bool - */ - abstract protected function _isLookupSoftSuccessful(); - - /** - * Analyse lookup`s results. If it has require params for authenticate, return true - * - * @return bool - */ - abstract public function isAuthenticateAllowed(); - - /** - * Analyse authenticate`s results. If authenticate is successful return true and false if it failure - * Result depends from flag self::getIsModeStrict() - * - * @return bool - */ - abstract public function isAuthenticateSuccessful(); -} diff --git a/app/code/Magento/Centinel/Model/Api.php b/app/code/Magento/Centinel/Model/Api.php deleted file mode 100644 index 29babcc6a118e..0000000000000 --- a/app/code/Magento/Centinel/Model/Api.php +++ /dev/null @@ -1,424 +0,0 @@ - '784', - 'AFN' => '971', - 'ALL' => '008', - 'AMD' => '051', - 'ANG' => '532', - 'AOA' => '973', - 'ARS' => '032', - 'AUD' => '036', - 'AWG' => '533', - 'AZN' => '944', - 'BAM' => '977', - 'BBD' => '052', - 'BDT' => '050', - 'BGN' => '975', - 'BHD' => '048', - 'BIF' => '108', - 'BMD' => '060', - 'BND' => '096', - 'BOB' => '068', - 'BOV' => '984', - 'BRL' => '986', - 'BSD' => '044', - 'BTN' => '064', - 'BWP' => '072', - 'BYR' => '974', - 'BZD' => '084', - 'CAD' => '124', - 'CDF' => '976', - 'CHE' => '947', - 'CHF' => '756', - 'CHW' => '948', - 'CLF' => '990', - 'CLP' => '152', - 'CNY' => '156', - 'COP' => '170', - 'COU' => '970', - 'CRC' => '188', - 'CUC' => '931', - 'CUP' => '192', - 'CVE' => '132', - 'CZK' => '203', - 'DJF' => '262', - 'DKK' => '208', - 'DOP' => '214', - 'DZD' => '012', - 'EEK' => '233', - 'EGP' => '818', - 'ERN' => '232', - 'ETB' => '230', - 'EUR' => '978', - 'FJD' => '242', - 'FKP' => '238', - 'GBP' => '826', - 'GEL' => '981', - 'GHS' => '936', - 'GIP' => '292', - 'GMD' => '270', - 'GNF' => '324', - 'GTQ' => '320', - 'GYD' => '328', - 'HKD' => '344', - 'HNL' => '340', - 'HRK' => '191', - 'HTG' => '332', - 'HUF' => '348', - 'IDR' => '360', - 'ILS' => '376', - 'INR' => '356', - 'IQD' => '368', - 'IRR' => '364', - 'ISK' => '352', - 'JMD' => '388', - 'JOD' => '400', - 'JPY' => '392', - 'KES' => '404', - 'KGS' => '417', - 'KHR' => '116', - 'KMF' => '174', - 'KPW' => '408', - 'KRW' => '410', - 'KWD' => '414', - 'KYD' => '136', - 'KZT' => '398', - 'LAK' => '418', - 'LBP' => '422', - 'LKR' => '144', - 'LRD' => '430', - 'LSL' => '426', - 'LTL' => '440', - 'LVL' => '428', - 'LYD' => '434', - 'MAD' => '504', - 'MDL' => '498', - 'MGA' => '969', - 'MKD' => '807', - 'MMK' => '104', - 'MNT' => '496', - 'MOP' => '446', - 'MRO' => '478', - 'MUR' => '480', - 'MVR' => '462', - 'MWK' => '454', - 'MXN' => '484', - 'MXV' => '979', - 'MYR' => '458', - 'MZN' => '943', - 'NAD' => '516', - 'NGN' => '566', - 'NIO' => '558', - 'NOK' => '578', - 'NPR' => '524', - 'NZD' => '554', - 'OMR' => '512', - 'PAB' => '590', - 'PEN' => '604', - 'PGK' => '598', - 'PHP' => '608', - 'PKR' => '586', - 'PLN' => '985', - 'PYG' => '600', - 'QAR' => '634', - 'RON' => '946', - 'RSD' => '941', - 'RUB' => '643', - 'RWF' => '646', - 'SAR' => '682', - 'SBD' => '090', - 'SCR' => '690', - 'SDG' => '938', - 'SEK' => '752', - 'SGD' => '702', - 'SHP' => '654', - 'SLL' => '694', - 'SOS' => '706', - 'SRD' => '968', - 'STD' => '678', - 'SYP' => '760', - 'SZL' => '748', - 'THB' => '764', - 'TJS' => '972', - 'TMT' => '934', - 'TND' => '788', - 'TOP' => '776', - 'TRY' => '949', - 'TTD' => '780', - 'TWD' => '901', - 'TZS' => '834', - 'UAH' => '980', - 'UGX' => '800', - 'USD' => '840', - 'USN' => '997', - 'USS' => '998', - 'UYU' => '858', - 'UZS' => '860', - 'VEF' => '937', - 'VND' => '704', - 'VUV' => '548', - 'WST' => '882', - 'XAF' => '950', - 'XAG' => '961', - 'XAU' => '959', - 'XBA' => '955', - 'XBB' => '956', - 'XBC' => '957', - 'XBD' => '958', - 'XCD' => '951', - 'XDR' => '960', - 'XOF' => '952', - 'XPD' => '964', - 'XPF' => '953', - 'XPT' => '962', - 'XTS' => '963', - 'XXX' => '999', - 'YER' => '886', - 'ZAR' => '710', - 'ZMK' => '894', - 'ZWL' => '932', - ]; - - /** - * Centinel validation client - * - * @var \CentinelClient - */ - protected $_clientInstance = null; - - /** - * @var \Psr\Log\LoggerInterface - */ - protected $logger; - - /** - * @param \Psr\Log\LoggerInterface $logger - * @param array $data - */ - public function __construct(\Psr\Log\LoggerInterface $logger, array $data = []) - { - $this->logger = $logger; - parent::__construct($data); - } - - /** - * Return Centinel thin client object - * - * @return \CentinelClient - */ - protected function _getClientInstance() - { - if (empty($this->_clientInstance)) { - $this->_clientInstance = new \CentinelClient(); - } - return $this->_clientInstance; - } - - /** - * Return Centinel Api version - * - * @return string - */ - protected function _getVersion() - { - return '1.7'; - } - - /** - * Return transaction type. according centinel documetation it should be "C" - * - * @return string - */ - protected function _getTransactionType() - { - return 'C'; - } - - /** - * Return Timeout Connect - * - * @return int - */ - protected function _getTimeoutConnect() - { - return 100; - } - - /** - * Return Timeout Read - * - * @return int - */ - protected function _getTimeoutRead() - { - return 100; - } - - /** - * Call centinel api methods by given method name and data - * - * @param string $method - * @param array $data - * @return \CentinelClient - * @throws \Exception - */ - protected function _call($method, $data) - { - $client = $this->_getClientInstance(); - $request = array_merge( - [ - 'MsgType' => $method, - 'Version' => $this->_getVersion(), - 'ProcessorId' => $this->getProcessorId(), - 'MerchantId' => $this->getMerchantId(), - 'TransactionPwd' => $this->getTransactionPwd(), - 'TransactionType' => $this->_getTransactionType(), - ], - $data - ); - - $debugData = ['request' => $request]; - - try { - foreach ($request as $key => $val) { - $client->add($key, $val); - } - $client->sendHttp($this->_getApiEndpointUrl(), $this->_getTimeoutConnect(), $this->_getTimeoutRead()); - } catch (\Exception $e) { - $debugData['response'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; - $this->_debug($debugData); - throw $e; - } - - $debugData['response'] = $client->response; - $this->_debug($debugData); - - return $client; - } - - /** - * Getter for API call URL - * - * @return string - * @throws \Exception - */ - protected function _getApiEndpointUrl() - { - if ($this->getIsTestMode()) { - return 'https://centineltest.cardinalcommerce.com/maps/txns.asp'; - } - $url = $this->getApiEndpointUrl(); - if (!$url) { - throw new \Exception('Centinel API endpoint URL is not configured properly.'); - } - return $url; - } - - /** - * Call centinel api lookup method - * - * @param \Magento\Framework\Object $data - * @return \Magento\Framework\Object - */ - public function callLookup($data) - { - $result = new \Magento\Framework\Object(); - - $month = strlen($data->getCardExpMonth()) == 1 ? '0' . $data->getCardExpMonth() : $data->getCardExpMonth(); - $currencyCode = $data->getCurrencyCode(); - $currencyNumber = isset( - self::$_iso4217Currencies[$currencyCode] - ) ? self::$_iso4217Currencies[$currencyCode] : ''; - if (!$currencyNumber) { - return $result->setErrorNo(1)->setErrorDesc(__('Unsupported currency code: %1.', $currencyCode)); - } - - $clientResponse = $this->_call( - 'cmpi_lookup', - [ - 'Amount' => round($data->getAmount() * 100), - 'CurrencyCode' => $currencyNumber, - 'CardNumber' => $data->getCardNumber(), - 'CardExpMonth' => $month, - 'CardExpYear' => $data->getCardExpYear(), - 'OrderNumber' => $data->getOrderNumber() - ] - ); - - $result->setErrorNo($clientResponse->getValue('ErrorNo')); - $result->setErrorDesc($clientResponse->getValue('ErrorDesc')); - $result->setTransactionId($clientResponse->getValue('TransactionId')); - $result->setEnrolled($clientResponse->getValue('Enrolled')); - $result->setAcsUrl($clientResponse->getValue('ACSUrl')); - $result->setPayload($clientResponse->getValue('Payload')); - $result->setEciFlag($clientResponse->getValue('EciFlag')); - - return $result; - } - - /** - * Call centinel api authentication method - * - * @param \Magento\Framework\Object $data - * @return \Magento\Framework\Object - */ - public function callAuthentication($data) - { - $result = new \Magento\Framework\Object(); - - $clientResponse = $this->_call( - 'cmpi_authenticate', - ['TransactionId' => $data->getTransactionId(), 'PAResPayload' => $data->getPaResPayload()] - ); - - $result->setErrorNo($clientResponse->getValue('ErrorNo')); - $result->setErrorDesc($clientResponse->getValue('ErrorDesc')); - $result->setPaResStatus($clientResponse->getValue('PAResStatus')); - $result->setSignatureVerification($clientResponse->getValue('SignatureVerification')); - $result->setCavv($clientResponse->getValue('Cavv')); - $result->setEciFlag($clientResponse->getValue('EciFlag')); - $result->setXid($clientResponse->getValue('Xid')); - - return $result; - } - - /** - * Log debug data to file - * - * @param array $debugData - * @return void - */ - protected function _debug($debugData) - { - if ($this->getDebugFlag()) { - $this->logger->debug(var_export($debugData, true)); - } - } -} diff --git a/app/code/Magento/Centinel/Model/Config.php b/app/code/Magento/Centinel/Model/Config.php deleted file mode 100644 index 81d187f3ed2ed..0000000000000 --- a/app/code/Magento/Centinel/Model/Config.php +++ /dev/null @@ -1,150 +0,0 @@ -_scopeConfig = $scopeConfig; - $this->_coreConfig = $coreConfig; - $this->_encryptor = $encryptor; - } - - /** - * Set store to congif model - * - * @param int|\Magento\Store\Model\Store $store - * @return $this - */ - public function setStore($store) - { - $this->_store = $store; - return $this; - } - - /** - * Return store - * - * @return int|\Magento\Store\Model\Store - */ - public function getStore() - { - return $this->_store; - } - - /** - * Return centinel processorId - * - * @return string - */ - public function getProcessorId() - { - return $this->_getServiceConfigValue('processor_id'); - } - - /** - * Return centinel merchantId - * - * @return string - */ - public function getMerchantId() - { - return $this->_getServiceConfigValue('merchant_id'); - } - - /** - * Return centinel transactionPwd - * - * @return string - */ - public function getTransactionPwd() - { - return $this->_encryptor->decrypt($this->_getServiceConfigValue('password')); - } - - /** - * Return flag - is centinel mode test - * - * @return bool - * @SuppressWarnings(PHPMD.BooleanGetMethodName) - */ - public function getIsTestMode() - { - return (bool)(int)$this->_getServiceConfigValue('test_mode'); - } - - /** - * Return value of node of centinel config section - * - * @param string $key - * @return string - */ - private function _getServiceConfigValue($key) - { - return $this->_scopeConfig->getValue($this->_serviceConfigPath . '/' . $key, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $this->getStore()); - } - - /** - * Define if debugging is enabled - * - * @return bool - * @SuppressWarnings(PHPMD.BooleanGetMethodName) - */ - public function getDebugFlag() - { - return $this->_getServiceConfigValue('debug'); - } -} diff --git a/app/code/Magento/Centinel/Model/Observer.php b/app/code/Magento/Centinel/Model/Observer.php deleted file mode 100644 index 7f3c95ef9ce96..0000000000000 --- a/app/code/Magento/Centinel/Model/Observer.php +++ /dev/null @@ -1,133 +0,0 @@ - - */ -namespace Magento\Centinel\Model; - -class Observer extends \Magento\Framework\Object -{ - /** - * Centinel data - * - * @var \Magento\Centinel\Helper\Data - */ - protected $_centinelData = null; - - /** - * Constructor - * - * By default is looking for first argument as array and assigns it as object - * attributes This behavior may change in child classes - * - * @param \Magento\Centinel\Helper\Data $centinelData - * @param array $data - */ - public function __construct(\Magento\Centinel\Helper\Data $centinelData, array $data = []) - { - $this->_centinelData = $centinelData; - parent::__construct($data); - } - - /** - * Set cmpi data to payment - * - * @param \Magento\Framework\Object $observer - * @return $this - */ - public function salesEventConvertQuoteToOrder($observer) - { - $payment = $observer->getEvent()->getQuote()->getPayment(); - - if ($payment->getMethodInstance()->getIsCentinelValidationEnabled()) { - $to = [$payment, 'setAdditionalInformation']; - $payment->getMethodInstance()->getCentinelValidator()->exportCmpiData($to); - } - return $this; - } - - /** - * Add cmpi data to info block - * - * @param \Magento\Framework\Object $observer - * @return void|$this - */ - public function paymentInfoBlockPrepareSpecificInformation($observer) - { - if ($observer->getEvent()->getBlock()->getIsSecureMode()) { - return; - } - - $payment = $observer->getEvent()->getPayment(); - $transport = $observer->getEvent()->getTransport(); - $helper = $this->_centinelData; - - $info = [ - \Magento\Centinel\Model\Service::CMPI_PARES, - \Magento\Centinel\Model\Service::CMPI_ENROLLED, - \Magento\Centinel\Model\Service::CMPI_ECI, - \Magento\Centinel\Model\Service::CMPI_CAVV, - \Magento\Centinel\Model\Service::CMPI_XID, - ]; - foreach ($info as $key) { - if ($value = $payment->getAdditionalInformation($key)) { - $transport->setData($helper->getCmpiLabel($key), $helper->getCmpiValue($key, $value)); - } - } - return $this; - } - - /** - * Add centinel logo block into payment form - * - * @param \Magento\Framework\Object $observer - * @return $this - */ - public function paymentFormBlockToHtmlBefore($observer) - { - $paymentFormBlock = $observer->getEvent()->getBlock(); - $method = $paymentFormBlock->getMethod(); - - if ($method && $method->getIsCentinelValidationEnabled()) { - $layout = $paymentFormBlock->getLayout(); - $block = $layout->createBlock('Magento\Centinel\Block\Logo'); - $block->setMethod($method); - - $paymentFormBlock->setChild( - 'payment.method.' . $method->getCode() . 'centinel.logo', - $block - ); - } - return $this; - } - - /** - * Reset validation data - * - * @param \Magento\Framework\Object $observer - * @return $this - */ - public function checkoutSubmitAllAfter($observer) - { - $method = false; - - if ($order = $observer->getEvent()->getOrder()) { - $method = $order->getPayment()->getMethodInstance(); - } elseif ($orders = $observer->getEvent()->getOrders()) { - if ($order = array_shift($orders)) { - $method = $order->getPayment()->getMethodInstance(); - } - } - - if ($method && $method->getIsCentinelValidationEnabled()) { - $method->getCentinelValidator()->reset(); - } - return $this; - } -} diff --git a/app/code/Magento/Centinel/Model/Service.php b/app/code/Magento/Centinel/Model/Service.php deleted file mode 100644 index b21fc2db73797..0000000000000 --- a/app/code/Magento/Centinel/Model/Service.php +++ /dev/null @@ -1,448 +0,0 @@ - self::CMPI_ENROLLED, - 'lookup_eci_flag' => self::CMPI_ECI, - 'authenticate_pa_res_status' => self::CMPI_PARES, - 'authenticate_cavv' => self::CMPI_CAVV, - 'authenticate_eci_flag' => self::CMPI_ECI, - 'authenticate_xid' => self::CMPI_XID, - ]; - - /** - * Validation api model factory - * - * @var \Magento\Centinel\Model\Api - */ - protected $_apiFactory; - - /** - * Config - * - * @var \Magento\Centinel\Model\Config - */ - protected $_config; - - /** - * Backend url - * - * @var \Magento\Framework\UrlInterface - */ - protected $_url; - - /** - * Centinel session - * - * @var \Magento\Framework\Session\SessionManagerInterface - */ - protected $_centinelSession; - - /** - * State factory - * - * @var \Magento\Centinel\Model\StateFactory - */ - protected $_stateFactory; - - /** - * Validation state model - * - * @var \Magento\Centinel\Model\AbstractState - */ - protected $_validationState; - - /** - * Url prefix - * - * @var string - */ - protected $_urlPrefix; - - /** - * @var \Magento\Framework\Data\Form\FormKey - */ - protected $formKey; - - /** - * @param \Magento\Centinel\Model\Config $config - * @param \Magento\Centinel\Model\ApiFactory $apiFactory - * @param \Magento\Framework\UrlInterface $url - * @param \Magento\Framework\Session\SessionManagerInterface $centinelSession - * @param \Magento\Centinel\Model\StateFactory $stateFactory - * @param \Magento\Framework\Data\Form\FormKey $formKey - * @param string $urlPrefix - * @param array $data - */ - public function __construct( - \Magento\Centinel\Model\Config $config, - \Magento\Centinel\Model\ApiFactory $apiFactory, - \Magento\Framework\UrlInterface $url, - \Magento\Framework\Session\SessionManagerInterface $centinelSession, - \Magento\Centinel\Model\StateFactory $stateFactory, - \Magento\Framework\Data\Form\FormKey $formKey, - $urlPrefix = 'centinel/index/', - array $data = [] - ) { - $this->_config = $config; - $this->_apiFactory = $apiFactory; - $this->_url = $url; - $this->_centinelSession = $centinelSession; - $this->_stateFactory = $stateFactory; - $this->formKey = $formKey; - $this->_urlPrefix = $urlPrefix; - parent::__construct($data); - } - - /** - * Return value from section of centinel config - * - * @return \Magento\Centinel\Model\Config - */ - protected function _getConfig() - { - return $this->_config->setStore($this->getStore()); - } - - /** - * Generate checksum from all passed parameters - * - * @param string $paymentMethodCode - * @param string $cardType - * @param string $cardNumber - * @param string $cardExpMonth - * @param string $cardExpYear - * @param float $amount - * @param string $currencyCode - * @return string - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - protected function _generateChecksum( - $paymentMethodCode, - $cardType, - $cardNumber, - $cardExpMonth, - $cardExpYear, - $amount, - $currencyCode - ) { - return md5(implode(func_get_args(), '_')); - } - - /** - * Unified validation/authentication URL getter - * - * @param string $suffix - * @param bool $current - * @return string - */ - protected function _getUrl($suffix, $current = false) - { - $params = [ - '_secure' => true, - '_current' => $current, - 'form_key' => $this->formKey->getFormKey(), - 'isIframe' => true, - ]; - return $this->_url->getUrl($this->_urlPrefix . $suffix, $params); - } - - /** - * Return validation api model - * - * @return \Magento\Centinel\Model\Api - */ - protected function _getApi() - { - $config = $this->_getConfig(); - $api = $this->_apiFactory->create(); - $api->setProcessorId( - $config->getProcessorId() - )->setMerchantId( - $config->getMerchantId() - )->setTransactionPwd( - $config->getTransactionPwd() - )->setIsTestMode( - $config->getIsTestMode() - )->setDebugFlag( - $config->getDebugFlag() - )->setApiEndpointUrl( - $this->getCustomApiEndpointUrl() - ); - return $api; - } - - /** - * Return validation state model - * - * @param string $cardType - * @return \Magento\Centinel\Model\AbstractState - */ - protected function _getValidationState($cardType = null) - { - $type = $cardType ? $cardType : $this->_centinelSession->getData('card_type'); - if (!$this->_validationState && $type) { - $model = $this->_stateFactory->createState($type); - if (!$model) { - return false; - } - $model->setDataStorage($this->_centinelSession); - $this->_validationState = $model; - } - return $this->_validationState; - } - - /** - * Drop validation state model - * - * @return void - */ - protected function _resetValidationState() - { - $this->_centinelSession->setData([]); - $this->_validationState = false; - } - - /** - * Drop old and init new validation state model - * - * @param string $cardType - * @param string $dataChecksum - * @return \Magento\Centinel\Model\AbstractState - */ - protected function _initValidationState($cardType, $dataChecksum) - { - $this->_resetValidationState(); - $state = $this->_stateFactory->createState($cardType); - $state->setDataStorage( - $this->_centinelSession - )->setCardType( - $cardType - )->setChecksum( - $dataChecksum - )->setIsModeStrict( - $this->getIsModeStrict() - ); - return $this->_getValidationState(); - } - - /** - * Process lookup validation and init new validation state model - * - * @param \Magento\Framework\Object $data - * @return void - */ - public function lookup($data) - { - $newChecksum = $this->_generateChecksum( - $data->getPaymentMethodCode(), - $data->getCardType(), - $data->getCardNumber(), - $data->getCardExpMonth(), - $data->getCardExpYear(), - $data->getAmount(), - $data->getCurrencyCode() - ); - - $validationState = $this->_initValidationState($data->getCardType(), $newChecksum); - - $api = $this->_getApi(); - $result = $api->callLookup($data); - $validationState->setLookupResult($result); - } - - /** - * Process authenticate validation - * - * @param \Magento\Framework\Object $data - * @return void - * @throws \Exception - */ - public function authenticate($data) - { - $validationState = $this->_getValidationState(); - if (!$validationState || $data->getTransactionId() != $validationState->getLookupTransactionId()) { - throw new \Exception('Authentication impossible: transaction id or validation state is wrong.'); - } - - $api = $this->_getApi(); - $result = $api->callAuthentication($data); - $validationState->setAuthenticateResult($result); - if (!$validationState->isAuthenticateSuccessful()) { - $this->reset(); - } - } - - /** - * Validate payment data - * - * This check is performed on payment information submission, as well as on placing order. - * Workflow state is stored validation state model - * - * @param \Magento\Framework\Object $data - * @return void - * @throws \Magento\Framework\Exception\LocalizedException - */ - public function validate($data) - { - $newChecksum = $this->_generateChecksum( - $data->getPaymentMethodCode(), - $data->getCardType(), - $data->getCardNumber(), - $data->getCardExpMonth(), - $data->getCardExpYear(), - $data->getAmount(), - $data->getCurrencyCode() - ); - - $validationState = $this->_getValidationState($data->getCardType()); - if (!$validationState) { - $this->_resetValidationState(); - return; - } - - // check whether is authenticated before placing order - if ($this->getIsPlaceOrder()) { - if ($validationState->getChecksum() != $newChecksum) { - throw new \Magento\Framework\Exception\LocalizedException( - __('Payment information error. Please start over.') - ); - } - if ($validationState->isAuthenticateSuccessful()) { - return; - } - throw new \Magento\Framework\Exception\LocalizedException( - __('Please verify the card with the issuer bank before placing the order.') - ); - } else { - if ($validationState->getChecksum() != $newChecksum || !$validationState->isLookupSuccessful()) { - $this->lookup($data); - $validationState = $this->_getValidationState(); - } - if ($validationState->isLookupSuccessful()) { - return; - } - throw new \Magento\Framework\Exception\LocalizedException( - __('This card has failed validation and cannot be used.') - ); - } - } - - /** - * Reset validation state and drop api object - * - * @return $this - */ - public function reset() - { - $this->_resetValidationState(); - return $this; - } - - /** - * Return URL for authentication - * - * @return string - */ - public function getAuthenticationStartUrl() - { - return $this->_getUrl('authenticationstart'); - } - - /** - * Return URL for validation - * - * @return string - */ - public function getValidatePaymentDataUrl() - { - return $this->_getUrl('validatepaymentdata'); - } - - /** - * If authenticate is should return true - * - * @return bool - */ - public function shouldAuthenticate() - { - $validationState = $this->_getValidationState(); - return $validationState && $validationState->isAuthenticateAllowed(); - } - - /** - * Return data for start authentication (redirect customer to bank page) - * - * @return array - */ - public function getAuthenticateStartData() - { - $validationState = $this->_getValidationState(); - if (!$validationState && $this->shouldAuthenticate()) { - throw new \Exception('Authentication impossible: validation state is wrong.'); - } - $data = [ - 'acs_url' => $validationState->getLookupAcsUrl(), - 'pa_req' => $validationState->getLookupPayload(), - 'term_url' => $this->_getUrl('authenticationcomplete', true), - 'md' => $validationState->getLookupTransactionId(), - ]; - return $data; - } - - /** - * If authenticate is successful return true - * - * @return bool - */ - public function isAuthenticateSuccessful() - { - $validationState = $this->_getValidationState(); - return $validationState && $validationState->isAuthenticateSuccessful(); - } - - /** - * Export cmpi lookups and authentication information stored in session into array - * - * @param array|object $to - * @param array|bool $map - * @return array|object - */ - public function exportCmpiData($to, $map = false) - { - if (!$map) { - $map = $this->_cmpiMap; - } - if ($validationState = $this->_getValidationState()) { - $to = \Magento\Framework\Object\Mapper::accumulateByMap($validationState, $to, $map); - } - return $to; - } -} diff --git a/app/code/Magento/Centinel/Model/State/Jcb.php b/app/code/Magento/Centinel/Model/State/Jcb.php deleted file mode 100644 index 82ab2944c32d2..0000000000000 --- a/app/code/Magento/Centinel/Model/State/Jcb.php +++ /dev/null @@ -1,135 +0,0 @@ -_isLookupStrictSuccessful() && $this->getAuthenticateEciFlag() === null; - } - - /** - * Analyse authenticate`s results. If authenticate is successful return true and false if it failure - * Result depends from flag self::getIsModeStrict() - * - * @return bool - */ - public function isAuthenticateSuccessful() - { - if (!$this->getIsModeStrict() && $this->_isLookupSoftSuccessful()) { - return true; - } - - if ($this->_isLookupStrictSuccessful()) { - if ($this->_isAuthenticationSuccessful()) { - return true; - } - if ($this->_isAuthenticationUnavailable() && !$this->getIsModeStrict()) { - return true; - } - if ($this->_isAuthenticationAttemptsPerformed()) { - return true; - } - } - - return false; - } - - /** - * Returns true if authentication successful (Test case 1) - * - * @return bool - */ - protected function _isAuthenticationSuccessful() - { - return $this->getAuthenticatePaResStatus() === 'Y' && - $this->getAuthenticateEciFlag() === '05' && - $this->getAuthenticateXid() != '' && - $this->getAuthenticateCavv() != '' && - $this->getAuthenticateErrorNo() === '0' && - $this->getAuthenticateSignatureVerification() === 'Y'; - } - - /** - * Returns true if authentication unavailable (Test case 4) or timeout encountered (Test case 5) - * - * @return bool - */ - protected function _isAuthenticationUnavailable() - { - return $this->getAuthenticatePaResStatus() === 'U' && - $this->getAuthenticateSignatureVerification() === 'Y' && - $this->getAuthenticateEciFlag() === '07' && - $this->getAuthenticateXid() != '' && - $this->getAuthenticateCavv() === '' && - $this->getAuthenticateErrorNo() === '0'; - } - - /** - * Returns true if processing attempts performed (Test case 11) - * - * @return bool - */ - protected function _isAuthenticationAttemptsPerformed() - { - return $this->getAuthenticatePaResStatus() === 'A' && - $this->getAuthenticateSignatureVerification() === 'Y' && - $this->getAuthenticateEciFlag() === '06' && - $this->getAuthenticateXid() != '' && - $this->getAuthenticateCavv() != '' && - $this->getAuthenticateErrorNo() === '0'; - } - - /** - * Analyse lookup`s results. If lookup is strict successful return true (Test cases 1-4, 6, 10-11) - * - * @return bool - */ - protected function _isLookupStrictSuccessful() - { - return $this->getLookupEnrolled() === 'Y' && - $this->getLookupAcsUrl() != '' && - $this->getLookupPayload() != '' && - $this->getLookupErrorNo() === '0'; - } - - /** - * Analyse lookup`s results. If lookup is soft successful return true (Test cases 5,7,8,9) - * - * @return bool - */ - protected function _isLookupSoftSuccessful() - { - $acsUrl = $this->getLookupAcsUrl(); - $payload = $this->getLookupPayload(); - $errorNo = $this->getLookupErrorNo(); - $enrolled = $this->getLookupEnrolled(); - - if ($acsUrl !== '' || $payload !== '') { - return false; - } - - if ($enrolled === '' && $errorNo === '0') { - return true; - } - - if ($enrolled === 'U' && ($errorNo === '0' || $errorNo !== '')) { - return true; - } - - return false; - } -} diff --git a/app/code/Magento/Centinel/Model/State/Mastercard.php b/app/code/Magento/Centinel/Model/State/Mastercard.php deleted file mode 100644 index 803dc7d12e631..0000000000000 --- a/app/code/Magento/Centinel/Model/State/Mastercard.php +++ /dev/null @@ -1,164 +0,0 @@ -_isLookupStrictSuccessful() && $this->getAuthenticateEciFlag() === null; - } - - /** - * Analyse authenticate`s results. If authenticate is successful return true and false if it failure - * Result depends from flag self::getIsModeStrict() - * - * @return bool - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - */ - public function isAuthenticateSuccessful() - { - $paResStatus = $this->getAuthenticatePaResStatus(); - $eciFlag = $this->getAuthenticateEciFlag(); - $xid = $this->getAuthenticateXid(); - $cavv = $this->getAuthenticateCavv(); - $errorNo = $this->getAuthenticateErrorNo(); - $signatureVerification = $this->getAuthenticateSignatureVerification(); - - //Test cases 1-4, 10 - if ($this->_isLookupStrictSuccessful()) { - if ($paResStatus == 'Y' && $eciFlag == '02' && $xid != '' && $cavv != '' && $errorNo == '0') { - //Test case 1 - if ($signatureVerification == 'Y') { - return true; - } - //Test case 2 - if ($signatureVerification == 'N') { - return false; - } - } - - //Test case 3 - if ($paResStatus == 'N' && - $signatureVerification == 'Y' && - $eciFlag == '01' && - $xid != '' && - $cavv == '' && - $errorNo == '0' - ) { - return false; - } - - //Test case 4 - if ($paResStatus == 'U' && - $signatureVerification == 'Y' && - $eciFlag == '01' && - $xid != '' && - $cavv == '' && - $errorNo == '0' - ) { - if ($this->getIsModeStrict()) { - return false; - } else { - return true; - } - } - - //Test case 10 - if ($paResStatus == '' && - $signatureVerification == '' && - $eciFlag == '01' && - $xid == '' && - $cavv == '' && - $errorNo == '1050' - ) { - return false; - } - } - - //Test cases 5-9 - if (!$this->getIsModeStrict() && $this->_isLookupSoftSuccessful()) { - if ($paResStatus == '' && - $signatureVerification == '' && - $eciFlag == '' && - $xid == '' && - $cavv == '' && - $errorNo == '0' - ) { - return true; - } elseif ($paResStatus == false && - $signatureVerification == false && - $eciFlag == false && - $xid == false && - $cavv == false && - $errorNo == false - ) { - return true; - } - } - - return false; - } - - /** - * Analyse lookup`s results. If lookup is strict successful return true - * - * @return bool - */ - protected function _isLookupStrictSuccessful() - { - //Test cases 1-4, 10 - if ($this->getLookupEnrolled() == 'Y' && - $this->getLookupAcsUrl() != '' && - $this->getLookupPayload() != '' && - $this->getLookupErrorNo() == '0' - ) { - return true; - } - return false; - } - - /** - * Analyse lookup`s results. If lookup is soft successful return true - * - * @return bool - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - */ - protected function _isLookupSoftSuccessful() - { - $acsUrl = $this->getLookupAcsUrl(); - $payload = $this->getLookupPayload(); - $errorNo = $this->getLookupErrorNo(); - $enrolled = $this->getLookupEnrolled(); - - //Test cases 6,7 - if ($acsUrl == '' && $payload == '' && $errorNo == '0' && ($enrolled == 'N' || $enrolled == 'U')) { - return true; - } - - //Test case 5 - if ($enrolled == '' && $acsUrl == '' && $payload == '' && $errorNo == 'Timeout number') { - return true; - } - - //Test cases 8,9 - if ($enrolled == 'U' && $acsUrl == '' && $payload == '' && $errorNo == '1001') { - return true; - } - - return false; - } -} diff --git a/app/code/Magento/Centinel/Model/State/Visa.php b/app/code/Magento/Centinel/Model/State/Visa.php deleted file mode 100644 index d667cc51daa15..0000000000000 --- a/app/code/Magento/Centinel/Model/State/Visa.php +++ /dev/null @@ -1,184 +0,0 @@ -_isLookupStrictSuccessful() && $this->getAuthenticateEciFlag() === null; - } - - /** - * Analyse authenticate`s results. If authenticate is successful return true and false if it failure - * Result depends from flag self::getIsModeStrict() - * - * @return bool - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - * @SuppressWarnings(PHPMD.NPathComplexity) - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - public function isAuthenticateSuccessful() - { - $paResStatus = $this->getAuthenticatePaResStatus(); - $eciFlag = $this->getAuthenticateEciFlag(); - $xid = $this->getAuthenticateXid(); - $cavv = $this->getAuthenticateCavv(); - $errorNo = $this->getAuthenticateErrorNo(); - $signatureVerification = $this->getAuthenticateSignatureVerification(); - - //Test cases 1-5, 11 - if ($this->_isLookupStrictSuccessful()) { - if ($paResStatus == 'Y' && $eciFlag == '05' && $xid != '' && $cavv != '' && $errorNo == '0') { - //Test case 1 - if ($signatureVerification == 'Y') { - return true; - } - //Test case 2 - if ($signatureVerification == 'N') { - return false; - } - } - - //Test case 3 - if ($paResStatus == 'N' && - $signatureVerification == 'Y' && - $eciFlag == '07' && - $xid != '' && - $cavv == '' && - $errorNo == '0' - ) { - return false; - } - - //Test case 4 - if ($paResStatus == 'A' && - $signatureVerification == 'Y' && - $eciFlag == '06' && - $xid != '' && - $cavv != '' && - $errorNo == '0' - ) { - if ($this->getIsModeStrict()) { - return false; - } else { - return true; - } - } - - //Test case 5 - if ($paResStatus == 'U' && - $signatureVerification == 'Y' && - $eciFlag == '07' && - $xid != '' && - $cavv == '' && - $errorNo == '0' - ) { - if ($this->getIsModeStrict()) { - return false; - } else { - return true; - } - } - - //Test case 11 - if ($paResStatus == 'U' && - $signatureVerification == '' && - $eciFlag == '07' && - $xid == '' && - $cavv == '' && - $errorNo == '1050' - ) { - if ($this->getIsModeStrict()) { - return false; - } else { - return true; - } - } - } - - //Test cases 6-10 - if (!$this->getIsModeStrict() && $this->_isLookupSoftSuccessful()) { - if ($paResStatus == '' && - $signatureVerification == '' && - $eciFlag == '' && - $xid == '' && - $cavv == '' && - $errorNo == '0' - ) { - return true; - } elseif ($paResStatus == false && - $signatureVerification == false && - $eciFlag == false && - $xid == false && - $cavv == false && - $errorNo == false - ) { - return true; - } - } - - return false; - } - - /** - * Analyse lookup`s results. If lookup is strict successful return true - * - * @return bool - */ - protected function _isLookupStrictSuccessful() - { - //Test cases 1-5, 11 - if ($this->getLookupEnrolled() == 'Y' && - $this->getLookupAcsUrl() != '' && - $this->getLookupPayload() != '' && - $this->getLookupErrorNo() == '0' - ) { - return true; - } - return false; - } - - /** - * Analyse lookup`s results. If lookup is soft successful return true - * - * @return bool - * @SuppressWarnings(PHPMD.CyclomaticComplexity) - */ - protected function _isLookupSoftSuccessful() - { - $acsUrl = $this->getLookupAcsUrl(); - $payload = $this->getLookupPayload(); - $errorNo = $this->getLookupErrorNo(); - $enrolled = $this->getLookupEnrolled(); - - //Test cases 7,8 - if ($acsUrl == '' && $payload == '' && $errorNo == '0' && ($enrolled == 'N' || $enrolled == 'U')) { - return true; - } - - //Test case 6 - if ($enrolled == '' && $acsUrl == '' && $payload == '' && $errorNo == 'Timeout number') { - return true; - } - - //Test cases 9,10 - if ($enrolled == 'U' && $acsUrl == '' && $payload == '' && $errorNo == '1001') { - return true; - } - - return false; - } -} diff --git a/app/code/Magento/Centinel/Model/StateFactory.php b/app/code/Magento/Centinel/Model/StateFactory.php deleted file mode 100644 index 71e949e5e6056..0000000000000 --- a/app/code/Magento/Centinel/Model/StateFactory.php +++ /dev/null @@ -1,51 +0,0 @@ -_objectManager = $objectManager; - $this->_stateClassMap = $stateClassMap; - } - - /** - * Create state object - * - * @param string $cardType - * @return \Magento\Centinel\Model\AbstractState|false - */ - public function createState($cardType) - { - if (!isset($this->_stateClassMap[$cardType])) { - return false; - } - return $this->_objectManager->create($this->_stateClassMap[$cardType]); - } -} diff --git a/app/code/Magento/Centinel/README.md b/app/code/Magento/Centinel/README.md deleted file mode 100644 index f0b3f3f7bd253..0000000000000 --- a/app/code/Magento/Centinel/README.md +++ /dev/null @@ -1 +0,0 @@ -The Magento_Centinel module implements the integration with Centinel (Cardinal Centinel Thin Client), a payment gateway from Cardinal Commerce, and enables 3-D Secure credit card validation (that is, Verified by Visa, MasterCard SecureCode and JCB J/Secure Payer Authentication programs). diff --git a/app/code/Magento/Centinel/Test/Unit/Model/ObserverTest.php b/app/code/Magento/Centinel/Test/Unit/Model/ObserverTest.php deleted file mode 100644 index a37c377bc7600..0000000000000 --- a/app/code/Magento/Centinel/Test/Unit/Model/ObserverTest.php +++ /dev/null @@ -1,91 +0,0 @@ -getMockBuilder('Magento\Framework\Model\AbstractExtensibleModel') - ->disableOriginalConstructor() - ->setMethods(['getIsCentinelValidationEnabled', 'getCode']) - ->getMockForAbstractClass(); - $method->expects($this->once()) - ->method('getIsCentinelValidationEnabled') - ->will($this->returnValue(true)); - - $method->expects($this->once()) - ->method('getCode') - ->willReturn('payflowpro'); - - $blockLogo = $this->getMock( - 'Magento\Centinel\Block\Logo', - ['setMethod'], - [], - '', - false - ); - $blockLogo->expects($this->once()) - ->method('setMethod') - ->with($method); - - $layout = $this->getMock( - 'Magento\Framework\View\Layout', - ['createBlock'], - [], - '', - false - ); - $layout->expects($this->once()) - ->method('createBlock') - ->will($this->returnValue($blockLogo)); - - $block = $this->getMock( - 'Magento\Framework\View\Element\Template', - ['getMethod', 'getLayout', 'setChild'], - [], - '', - false - ); - $block->expects($this->once()) - ->method('getMethod') - ->will($this->returnValue($method)); - $block->expects($this->once()) - ->method('getLayout') - ->will($this->returnValue($layout)); - $block->expects($this->once()) - ->method('setChild') - ->with('payment.method.payflowprocentinel.logo', $blockLogo); - - $event = $this->getMock( - 'Magento\Framework\Event', - ['getBlock'], - [], - '', - false - ); - $event->expects($this->once()) - ->method('getBlock') - ->will($this->returnValue($block)); - - $observer = $this->getMock( - 'Magento\Framework\Event\Observer', - [], - [], - '', - false - ); - $observer->expects($this->once()) - ->method('getEvent') - ->will($this->returnValue($event)); - - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - /** @var \Magento\Centinel\Model\Observer $model */ - $model = $this->objectManager->getObject('Magento\Centinel\Model\Observer'); - - $this->assertEquals($model->paymentFormBlockToHtmlBefore($observer), $model); - } -} diff --git a/app/code/Magento/Centinel/Test/Unit/Model/ServiceTest.php b/app/code/Magento/Centinel/Test/Unit/Model/ServiceTest.php deleted file mode 100644 index e9b5237e16ead..0000000000000 --- a/app/code/Magento/Centinel/Test/Unit/Model/ServiceTest.php +++ /dev/null @@ -1,137 +0,0 @@ -getMock('Magento\Framework\Url', ['getUrl'], [], '', false); - $url->expects( - $this->once() - )->method( - 'getUrl' - )->with( - $this->equalTo('url_prefix/authenticationstart'), - $this->equalTo(['_secure' => true, '_current' => false, 'form_key' => false, 'isIframe' => true]) - )->will( - $this->returnValue('some value') - ); - - $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - /** @var \Magento\Centinel\Model\Service $model */ - $model = $helper->getObject( - 'Magento\Centinel\Model\Service', - ['url' => $url, 'urlPrefix' => 'url_prefix/'] - ); - $this->assertEquals('some value', $model->getAuthenticationStartUrl()); - } - - public function testLookup() - { - $centinelSession = $this->getMock( - 'Magento\Framework\Session\SessionManager', - ['setData', 'getData'], - [], - '', - false - ); - $centinelSession->expects($this->once())->method('setData')->with([]); - $centinelSession->expects($this->once())->method('getData')->will($this->returnValue('cardType')); - - $api = $this->getMock( - 'Magento\Centinel\Model\Api', - [ - 'setProcessorId', - 'setMerchantId', - 'setTransactionPwd', - 'setIsTestMode', - 'setDebugFlag', - 'callLookup' - ], - [], - '', - false - ); - $api->expects($this->once())->method('setProcessorId')->will($this->returnValue($api)); - $api->expects($this->once())->method('setMerchantId')->will($this->returnValue($api)); - $api->expects($this->once())->method('setTransactionPwd')->will($this->returnValue($api)); - $api->expects($this->once())->method('setIsTestMode')->will($this->returnValue($api)); - $api->expects($this->once())->method('setDebugFlag')->will($this->returnValue($api)); - $api->expects($this->once())->method('callLookup')->will($this->returnValue('result')); - $apiFactory = $this->getMock('Magento\Centinel\Model\ApiFactory', ['create'], [], '', false); - $apiFactory->expects($this->once())->method('create')->will($this->returnValue($api)); - - $state = $this->getMock( - '\Magento\Centinel\Model\State', - ['setDataStorage', 'setCardType', 'setChecksum', 'setIsModeStrict', 'setLookupResult'], - [], - '', - false - ); - $state->expects( - $this->any() - )->method( - 'setDataStorage' - )->with( - $centinelSession - )->will( - $this->returnValue($state) - ); - $state->expects($this->once())->method('setCardType')->with('cardType')->will($this->returnValue($state)); - $state->expects($this->once())->method('setChecksum')->will($this->returnValue($state)); - $state->expects($this->once())->method('setLookupResult')->with('result'); - $stateFactory = $this->getMock( - '\Magento\Centinel\Model\StateFactory', - ['createState'], - [], - '', - false - ); - $stateFactory->expects( - $this->any() - )->method( - 'createState' - )->with( - 'cardType' - )->will( - $this->returnValue($state) - ); - - $config = $this->getMock( - '\Magento\Centinel\Model\Config', - ['setStore', 'getProcessorId', 'getMerchantId', 'getTransactionPwd', 'getIsTestMode', 'getDebugFlag'], - [], - '', - false - ); - $config->expects($this->once())->method('setStore')->will($this->returnValue($config)); - - $helper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - /** @var \Magento\Centinel\Model\Service $model */ - $model = $helper->getObject( - 'Magento\Centinel\Model\Service', - [ - 'apiFactory' => $apiFactory, - 'centinelSession' => $centinelSession, - 'stateFactory' => $stateFactory, - 'config' => $config - ] - ); - - $data = new \Magento\Framework\Object(['card_type' => 'cardType']); - - $model->lookup($data); - } -} diff --git a/app/code/Magento/Centinel/Test/Unit/Model/State/JcbTest.php b/app/code/Magento/Centinel/Test/Unit/Model/State/JcbTest.php deleted file mode 100644 index bf72a0b64e878..0000000000000 --- a/app/code/Magento/Centinel/Test/Unit/Model/State/JcbTest.php +++ /dev/null @@ -1,848 +0,0 @@ -_model = new \Magento\Centinel\Model\State\Jcb(); - $this->_model->setDataStorage(new \Magento\Framework\Object()); - } - - /** - * @param bool $result - * @param array $lookupResults - * @param array $params - * @dataProvider testIsAuthenticateAllowedDataProvider - */ - public function testIsAuthenticateAllowed($result, $lookupResults, $params) - { - $this->_model->setLookupResult(new \Magento\Framework\Object($lookupResults)); - $this->_model->setAuthenticateResult(new \Magento\Framework\Object($params)); - $this->assertEquals($result, $this->_model->isAuthenticateAllowed()); - } - - public function testIsAuthenticateAllowedDataProvider() - { - return [ - 'successful lookup and empty authentication' => [ - true, - [ - 'enrolled' => 'Y', - 'acs_url' => 'no empty value', - 'payload' => 'no empty value', - 'error_no' => '0' - ], - [], - ], - 'wrong lookup and empty authentication' => [false, [], []], - 'successful lookup and not empty authentication' => [ - false, - [ - 'enrolled' => 'Y', - 'acs_url' => 'no empty value', - 'payload' => 'no empty value', - 'error_no' => '0' - ], - ['eci_flag' => 'value'], - ], - 'wrong lookup and not empty authentication' => [false, [], ['eci_flag' => 'value']] - ]; - } - - public function testIsAuthenticateSuccessfulWithSoftLookup() - { - $lookupResults = ['enrolled' => '', 'acs_url' => '', 'payload' => '', 'error_no' => '0']; - $this->_model->setLookupResult(new \Magento\Framework\Object($lookupResults)); - - $this->_model->setIsModeStrict(true); - $this->assertEquals(false, $this->_model->isAuthenticateSuccessful()); - - $this->_model->setIsModeStrict(false); - $this->assertEquals(true, $this->_model->isAuthenticateSuccessful()); - } - - /** - * @param bool $result - * @param bool $strictMode - * @param array $params - * @dataProvider isAuthenticateSuccessfulDataProvider - */ - public function testIsAuthenticateSuccessful($result, $strictMode, $params) - { - $strictMode = $strictMode; - // PHPMD bug: unused local variable warning - $this->_model->setIsModeStrict($strictMode); - $lookupResult = [ - 'enrolled' => 'Y', - 'acs_url' => 'no empty value', - 'payload' => 'no empty value', - 'error_no' => '0', - ]; - $this->_model->setLookupResult(new \Magento\Framework\Object($lookupResult)); - $this->_model->setAuthenticateResult(new \Magento\Framework\Object($params)); - - $this->assertEquals($result, $this->_model->isAuthenticateSuccessful()); - } - - public function isAuthenticateSuccessfulDataProvider() - { - return array_merge( - $this->_getAuthenticationSuccessfulData(), - $this->_getAuthenticationUnavailableData(), - $this->_getProcessingAttemptsPerformedData(), - [ - 'Centinel case 2' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'N' - ], - ], - 'Centinel case 3' => [ - false, - true, - [ - 'pa_res_status' => 'N', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 10' => [ - false, - true, - [ - 'pa_res_status' => '', - 'signature_verification' => '', - 'eci_flag' => '07', - 'xid' => '', - 'cavv' => '', - 'error_no' => 'not zero' - ], - ] - ] - ); - } - - /** - * Data for successful authentication - * - * @return array - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function _getAuthenticationSuccessfulData() - { - return [ - 'Centinel case 1' => [ - true, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 pa_res_status is absent' => [ - false, - true, - [ - 'eci_flag' => '05', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 eci_flag is absent' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 xid is absent' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'cavv' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 cavv is absent' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'xid' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 error_no is absent' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'xid' => 'some string', - 'cavv' => 'some string', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 signature_verification is absent' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 1 wrong pa_res_status' => [ - false, - true, - [ - 'pa_res_status' => 'wrong value', - 'eci_flag' => '05', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 wrong eci_flag' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => 'wrong value', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 empty xid' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'xid' => '', - 'cavv' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 empty cavv' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 no zero error_no' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => 'no zero', - 'signature_verification' => 'Y' - ], - ], - 'Centinel case 1 wrong signature_verification' => [ - false, - true, - [ - 'pa_res_status' => 'Y', - 'eci_flag' => '05', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0', - 'signature_verification' => 'wrong value' - ], - ], - 'Centinel case 1 no params' => [false, true, []] - ]; - } - - /** - * Data for unavailable authentication - * - * @return array - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function _getAuthenticationUnavailableData() - { - return [ - 'Centinel case 4,5 in strict mode' => [ - false, - true, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5' => [ - true, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 pa_res_status is absent' => [ - false, - false, - [ - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 signature_verification is absent' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 eci_flag is absent' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 xid is absent' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 cavv is absent' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 error_no is absent' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => '' - ], - ], - 'Centinel case 4,5 wrong pa_res_status' => [ - false, - false, - [ - 'pa_res_status' => 'wrong value', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 wrong signature_verification' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'wrong value', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 wrong eci_flag' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'eci_flag' => 'wrong value', - 'xid' => '', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 empty xid' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => '', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 not empty cavv' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => 'not empty', - 'error_no' => '0' - ], - ], - 'Centinel case 4,5 no zero error_no' => [ - false, - false, - [ - 'pa_res_status' => 'U', - 'signature_verification' => 'Y', - 'eci_flag' => '07', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => 'no zero' - ], - ], - 'Centinel case 4,5 no params' => [false, false, []] - ]; - } - - /** - * Data for attempts performed processing - * - * @return array - * @SuppressWarnings(PHPMD.ExcessiveMethodLength) - */ - protected function _getProcessingAttemptsPerformedData() - { - return [ - 'Centinel case 11' => [ - true, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'Y', - 'eci_flag' => '06', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 pa_res_status is absent' => [ - false, - true, - [ - 'signature_verification' => 'Y', - 'eci_flag' => '06', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 signature_verification is absent' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'eci_flag' => '06', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 eci_flag is absent' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'Y', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 xid is absent' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'Y', - 'eci_flag' => '06', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 cavv is absent' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'Y', - 'eci_flag' => '06', - 'xid' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 error_no is absent' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'Y', - 'eci_flag' => '06', - 'xid' => 'some string', - 'cavv' => 'some string' - ], - ], - 'Centinel case no params' => [false, true, []], - 'Centinel case 11 wrong pa_res_status' => [ - false, - true, - [ - 'pa_res_status' => 'wrong value', - 'signature_verification' => 'Y', - 'eci_flag' => '06', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 wrong signature_verification' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'wrong value', - 'eci_flag' => '06', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 wrong eci_flag' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'Y', - 'eci_flag' => 'wrong value', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 empty xid' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'Y', - 'eci_flag' => '06', - 'xid' => '', - 'cavv' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel case 11 empty cavv' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'Y', - 'eci_flag' => '06', - 'xid' => 'some string', - 'cavv' => '', - 'error_no' => '0' - ], - ], - 'Centinel case 11 no zero' => [ - false, - true, - [ - 'pa_res_status' => 'A', - 'signature_verification' => 'Y', - 'eci_flag' => '06', - 'xid' => 'some string', - 'cavv' => 'some string', - 'error_no' => 'no zero' - ], - ] - ]; - } - - /** - * @param bool $result - * @param bool $strictMode - * @param array $params - * @dataProvider isLookupSuccessfulDataProvider - */ - public function testIsLookupSuccessful($result, $strictMode, $params) - { - $this->_model->setLookupResult(new \Magento\Framework\Object($params)); - $this->_model->setIsModeStrict($strictMode); - $this->assertEquals($result, $this->_model->isLookupSuccessful()); - } - - public function isLookupSuccessfulDataProvider() - { - return array_merge($this->_getSoftSuccessfulLookupData(), $this->_getStrictSuccessfulLookupData()); - } - - /** - * Data for soft successful lookup - * - * @return array - */ - protected function _getSoftSuccessfulLookupData() - { - return [ - 'Centinel case 5' => [ - true, - false, - ['enrolled' => '', 'acs_url' => '', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 5 enrolled is absent' => [ - false, - false, - ['acs_url' => '', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 5 acs_url is absent' => [ - false, - false, - ['enrolled' => '', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 5 payload is absent' => [ - false, - false, - ['enrolled' => '', 'acs_url' => '', 'error_no' => '0'], - ], - 'Centinel case 5 error_no is absent' => [ - false, - false, - ['enrolled' => '', 'acs_url' => '', 'payload' => ''], - ], - 'Centinel case 5 no params' => [false, false, []], - 'Centinel case 5 not empty enrolled' => [ - false, - false, - ['enrolled' => 'not empty', 'acs_url' => '', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 5 not empty acs_url' => [ - false, - false, - ['enrolled' => '', 'acs_url' => 'not empty', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 5 not empty payload' => [ - false, - false, - ['enrolled' => '', 'acs_url' => '', 'payload' => 'not empty', 'error_no' => '0'], - ], - 'Centinel case 5 no zero error_no' => [ - false, - false, - ['enrolled' => '', 'acs_url' => '', 'payload' => '', 'error_no' => 'not zero'], - ], - 'Centinel case 5 empty error_no' => [ - false, - false, - ['enrolled' => '', 'acs_url' => '', 'payload' => '', 'error_no' => ''], - ], - 'Centinel case 7' => [ - true, - false, - ['enrolled' => 'U', 'acs_url' => '', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 8,9' => [ - true, - false, - ['enrolled' => 'U', 'acs_url' => '', 'payload' => '', 'error_no' => 'some string'], - ], - 'Centinel case 7,8,9 enrolled is absent' => [ - false, - false, - ['acs_url' => '', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 7,8,9 acs_url is absent' => [ - false, - false, - ['enrolled' => 'U', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 7,8,9 payload is absent' => [ - false, - false, - ['enrolled' => 'U', 'acs_url' => '', 'error_no' => '0'], - ], - 'Centinel case 7,8,9 error_no no params' => [false, false, []], - 'Centinel case 7,8,9 wrong enrolled' => [ - false, - false, - ['enrolled' => 'wrong value', 'acs_url' => '', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 7,8,9 not empty acs_url' => [ - false, - false, - ['enrolled' => 'U', 'acs_url' => 'not empty', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel case 7,8,9 not empty payload' => [ - false, - false, - ['enrolled' => 'U', 'acs_url' => '', 'payload' => 'not empty', 'error_no' => '0'], - ] - ]; - } - - /** - * Data for strict successful lookup - * - * @return array - */ - protected function _getStrictSuccessfulLookupData() - { - return [ - 'Centinel cases 1-4, 6, 10-11' => [ - true, - true, - ['enrolled' => 'Y', 'acs_url' => 'some string', 'payload' => 'some string', 'error_no' => '0'], - ], - 'Centinel cases 1-4, 6, 10-11 enrolled is absent' => [ - false, - true, - ['acs_url' => 'some string', 'payload' => 'some string', 'error_no' => '0'], - ], - 'Centinel cases 1-4, 6, 10-11 acs_url is absent' => [ - false, - true, - ['enrolled' => 'Y', 'payload' => 'some string', 'error_no' => '0'], - ], - 'Centinel cases 1-4, 6, 10-11 payload is absent' => [ - false, - true, - ['enrolled' => 'Y', 'acs_url' => 'some string', 'error_no' => '0'], - ], - 'Centinel cases 1-4, 6, 10-11 error_no is absent' => [ - false, - true, - ['enrolled' => 'Y', 'acs_url' => 'some string', 'payload' => 'some string'], - ], - 'Centinel cases 1-4, 6, 10-11 no params' => [false, true, []], - 'Centinel cases 1-4, 6, 10-11 wrong enrolled' => [ - false, - true, - [ - 'enrolled' => 'wrong value', - 'acs_url' => 'some string', - 'payload' => 'some string', - 'error_no' => '0' - ], - ], - 'Centinel cases 1-4, 6, 10-11 empty enrolled' => [ - false, - true, - ['enrolled' => '', 'acs_url' => 'some string', 'payload' => 'some string', 'error_no' => '0'], - ], - 'Centinel cases 1-4, 6, 10-11 empty acs_url' => [ - false, - true, - ['enrolled' => 'Y', 'acs_url' => '', 'payload' => 'some string', 'error_no' => '0'], - ], - 'Centinel cases 1-4, 6, 10-11 empty payload' => [ - false, - true, - ['enrolled' => 'Y', 'acs_url' => 'some string', 'payload' => '', 'error_no' => '0'], - ], - 'Centinel cases 1-4, 6, 10-11 wrong error_no' => [ - false, - true, - [ - 'enrolled' => 'Y', - 'acs_url' => 'some string', - 'payload' => 'some string', - 'error_no' => 'wrong value' - ], - ], - 'Centinel cases 1-4, 6, 10-11 empty error_no' => [ - false, - true, - ['enrolled' => 'Y', 'acs_url' => 'some string', 'payload' => 'some string', 'error_no' => ''], - ] - ]; - } -} diff --git a/app/code/Magento/Centinel/Test/Unit/Model/StateFactoryTest.php b/app/code/Magento/Centinel/Test/Unit/Model/StateFactoryTest.php deleted file mode 100644 index 4614ed11af44e..0000000000000 --- a/app/code/Magento/Centinel/Test/Unit/Model/StateFactoryTest.php +++ /dev/null @@ -1,78 +0,0 @@ -getMock('Magento\Framework\ObjectManagerInterface'); - $objectManager->expects( - $this->at(0) - )->method( - 'create' - )->with( - 'Magento\Centinel\Model\State\Visa' - )->will( - $this->returnValue($this->getMock('Magento\Centinel\Model\State\Visa')) - ); - $objectManager->expects( - $this->at(1) - )->method( - 'create' - )->with( - 'Magento\Centinel\Model\State\Mastercard' - )->will( - $this->returnValue($this->getMock('Magento\Centinel\Model\State\Mastercard')) - ); - $objectManager->expects( - $this->at(2) - )->method( - 'create' - )->with( - 'Magento\Centinel\Model\State\Jcb' - )->will( - $this->returnValue($this->getMock('Magento\Centinel\Model\State\Jcb')) - ); - $objectManager->expects( - $this->at(3) - )->method( - 'create' - )->with( - 'Magento\Centinel\Model\State\Mastercard' - )->will( - $this->returnValue($this->getMock('Magento\Centinel\Model\State\Mastercard')) - ); - - $factory = new \Magento\Centinel\Model\StateFactory( - $objectManager, - [ - 'VI' => 'Magento\Centinel\Model\State\Visa', - 'MC' => 'Magento\Centinel\Model\State\Mastercard', - 'JCB' => 'Magento\Centinel\Model\State\Jcb', - 'SM' => 'Magento\Centinel\Model\State\Mastercard' - ] - ); - $this->assertInstanceOf('Magento\Centinel\Model\State\Visa', $factory->createState('VI')); - $this->assertInstanceOf('Magento\Centinel\Model\State\Mastercard', $factory->createState('MC')); - $this->assertInstanceOf('Magento\Centinel\Model\State\Jcb', $factory->createState('JCB')); - $this->assertInstanceOf('Magento\Centinel\Model\State\Mastercard', $factory->createState('SM')); - $this->assertFalse($factory->createState('LOL')); - } - - public function testCreateStateMapIsEmpty() - { - $objectManager = $this->getMock('Magento\Framework\ObjectManagerInterface'); - $factory = new \Magento\Centinel\Model\StateFactory($objectManager); - $this->assertFalse($factory->createState('VI')); - $this->assertFalse($factory->createState('MC')); - $this->assertFalse($factory->createState('JCB')); - $this->assertFalse($factory->createState('SM')); - $this->assertFalse($factory->createState('LOL')); - } -} diff --git a/app/code/Magento/Centinel/composer.json b/app/code/Magento/Centinel/composer.json deleted file mode 100644 index 49def296d8d93..0000000000000 --- a/app/code/Magento/Centinel/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "magento/module-centinel", - "description": "N/A", - "require": { - "php": "~5.5.0|~5.6.0", - "magento/module-store": "0.74.0-beta10", - "magento/module-checkout": "0.74.0-beta10", - "magento/module-backend": "0.74.0-beta10", - "magento/module-sales": "0.74.0-beta10", - "magento/framework": "0.74.0-beta10", - "magento/magento-composer-installer": "*" - }, - "type": "magento2-module", - "version": "0.74.0-beta10", - "license": [ - "OSL-3.0", - "AFL-3.0" - ], - "extra": { - "map": [ - [ - "*", - "Magento/Centinel" - ] - ] - } -} diff --git a/app/code/Magento/Centinel/etc/adminhtml/di.xml b/app/code/Magento/Centinel/etc/adminhtml/di.xml deleted file mode 100644 index 87e976b536e30..0000000000000 --- a/app/code/Magento/Centinel/etc/adminhtml/di.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - centinel_validator - - - - - Magento\Centinel\Model\Session\Storage - - - - - Magento\Backend\Model\UrlInterface - Magento\Centinel\Model\Session - adminhtml/centinel_index/ - - - diff --git a/app/code/Magento/Centinel/etc/adminhtml/events.xml b/app/code/Magento/Centinel/etc/adminhtml/events.xml deleted file mode 100644 index 3a6750b2da85c..0000000000000 --- a/app/code/Magento/Centinel/etc/adminhtml/events.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Centinel/etc/adminhtml/routes.xml b/app/code/Magento/Centinel/etc/adminhtml/routes.xml deleted file mode 100644 index 2ff9c2bc4715a..0000000000000 --- a/app/code/Magento/Centinel/etc/adminhtml/routes.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Centinel/etc/adminhtml/system.xml b/app/code/Magento/Centinel/etc/adminhtml/system.xml deleted file mode 100644 index 643f1878b6282..0000000000000 --- a/app/code/Magento/Centinel/etc/adminhtml/system.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - -
- - sales - Magento_Payment::payment_services - - - - - - - - - - - Magento\Config\Model\Config\Backend\Encrypted - - - - This overrides any API URL that may be specified by a payment method. - Magento\Config\Model\Config\Source\Yesno - - - - Magento\Config\Model\Config\Source\Yesno - - -
-
-
diff --git a/app/code/Magento/Centinel/etc/di.xml b/app/code/Magento/Centinel/etc/di.xml deleted file mode 100644 index b970db56e8625..0000000000000 --- a/app/code/Magento/Centinel/etc/di.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - Magento\Centinel\Model\State\Visa - Magento\Centinel\Model\State\Mastercard - Magento\Centinel\Model\State\Jcb - Magento\Centinel\Model\State\Mastercard - - - - diff --git a/app/code/Magento/Centinel/etc/events.xml b/app/code/Magento/Centinel/etc/events.xml deleted file mode 100644 index 3a09cd0c0da1b..0000000000000 --- a/app/code/Magento/Centinel/etc/events.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/Centinel/etc/frontend/di.xml b/app/code/Magento/Centinel/etc/frontend/di.xml deleted file mode 100644 index 4ec66c4094e59..0000000000000 --- a/app/code/Magento/Centinel/etc/frontend/di.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - centinel_validator - - - - - Magento\Centinel\Model\Session\Storage - - - - - - /centinel/ - - - - - - Magento\Centinel\Model\Session - - - diff --git a/app/code/Magento/Centinel/etc/frontend/events.xml b/app/code/Magento/Centinel/etc/frontend/events.xml deleted file mode 100644 index 24dcacbedddf5..0000000000000 --- a/app/code/Magento/Centinel/etc/frontend/events.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Centinel/etc/frontend/routes.xml b/app/code/Magento/Centinel/etc/frontend/routes.xml deleted file mode 100644 index 136230f5ce152..0000000000000 --- a/app/code/Magento/Centinel/etc/frontend/routes.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - diff --git a/app/code/Magento/Centinel/etc/module.xml b/app/code/Magento/Centinel/etc/module.xml deleted file mode 100644 index 1b9fa14e9f40d..0000000000000 --- a/app/code/Magento/Centinel/etc/module.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - diff --git a/app/code/Magento/Centinel/i18n/de_DE.csv b/app/code/Magento/Centinel/i18n/de_DE.csv deleted file mode 100644 index 01df77c497be5..0000000000000 --- a/app/code/Magento/Centinel/i18n/de_DE.csv +++ /dev/null @@ -1,42 +0,0 @@ -"3D Secure Card Validation","3D Secure Kartenvalidierung" -"Validation failed.","Validierung ist fehlgeschlagen." -"3D Secure Verification Result","3D Secure Verifizierungsergebnis" -"3D Secure Cardholder Validation","3D Secure Karteninhabervalidierung" -"3D Secure Electronic Commerce Indicator","3D Secure Electronic Commerce Indicator" -"3D Secure CAVV","3D Secure CAVV" -"3D Secure XID","3D Secure XD" -"Merchant Liability","Haftung für Händler" -"Card Issuer Liability","Haftung für Kartenausteller" -Enrolled,Eingeschrieben -"Enrolled but Authentication Unavailable","Eingeschrieben, aber Authentifizierung nicht verfügbar" -"Not Enrolled","Nicht eingeschrieben" -Successful,Erfolgreich -Failed,Fehlgeschlagen -"Unable to complete","Fertigstellung nicht möglich" -"Successful attempt","Erfolgreicher Versuch" -"Unsupported currency code: %1.","Unsupported currency code: %1." -"Payment information error. Please start over.","Fehler bei Zahlungsinformation. Bitte versuchen Sie es erneut." -"Please verify the card with the issuer bank before placing the order.","Bitte verifizieren Sie die Karte mit der Ausstellerbank bevor Sie die Bestellung durchführen." -"This card has failed validation and cannot be used.","Diese Karte konnte nicht validiert werden und kann nicht benützt werden." -"Verification Successful","Verifizierung erfolgreich" -"Please continue with placing order.","Bitte fahren Sie mit der Bestellung fort." -"Verification Failed","Verifizierung fehlgeschlagen" -"The card has failed verification with the issuer bank.","Die Karte konnte nicht mit der Ausstellerbank verifiziert werden." -"Order cannot be placed.","Bestellung kann nicht durchgeführt werden." -"Verification cannot be processed","Verifizierung kann nicht verarbeitet werden" -"There has been wrong payment information submitted or time limit has expired. Please, try again.","Es wurden falsche Zahlungsinformationen abgeschickt, oder Zeitlimit ist abgelaufen. Bitte versuchen Sie es erneut." -"Card Verification",Kartenverifizierung -"Start/Reset Validation...","Validierung starten/zurücksetzen..." -"Please verify the card with the issuer bank:","Bitte verifizieren Sie die Karte mit der Ausstellerbank:" -"There has been wrong payment information submitted or the time limit has expired. Please, try again.","Es wurden falsche Zahlungsinformationen abgeschickt, oder das Zeitlimit ist abgelaufen. Bitte versuchen Sie es erneut." -"To ensure the security of your transactions","Um die Sicherheit ihrer Transaktionen zu gewährleisten" -"Verified by Visa","Verified by Visa" -"MasterCard SecureCode","MasterCard SecureCode" -Password,Password -"Test Mode","Test Mode" -"Payment Services","Payment Services" -"3D Secure Credit Card Validation","3D Secure Credit Card Validation" -"Processor ID","Processor ID" -"Merchant ID","Merchant ID" -"This overrides any API URL that may be specified by a payment method.","This overrides any API URL that may be specified by a payment method." -"Debug Mode","Debug Mode" diff --git a/app/code/Magento/Centinel/i18n/en_US.csv b/app/code/Magento/Centinel/i18n/en_US.csv deleted file mode 100644 index 98e02de675243..0000000000000 --- a/app/code/Magento/Centinel/i18n/en_US.csv +++ /dev/null @@ -1,42 +0,0 @@ -"3D Secure Card Validation","3D Secure Card Validation" -"Validation failed.","Validation failed." -"3D Secure Verification Result","3D Secure Verification Result" -"3D Secure Cardholder Validation","3D Secure Cardholder Validation" -"3D Secure Electronic Commerce Indicator","3D Secure Electronic Commerce Indicator" -"3D Secure CAVV","3D Secure CAVV" -"3D Secure XID","3D Secure XID" -"Merchant Liability","Merchant Liability" -"Card Issuer Liability","Card Issuer Liability" -Enrolled,Enrolled -"Enrolled but Authentication Unavailable","Enrolled but Authentication Unavailable" -"Not Enrolled","Not Enrolled" -Successful,Successful -Failed,Failed -"Unable to complete","Unable to complete" -"Successful attempt","Successful attempt" -"Unsupported currency code: %1.","Unsupported currency code: %1." -"Payment information error. Please start over.","Payment information error. Please start over." -"Please verify the card with the issuer bank before placing the order.","Please verify the card with the issuer bank before placing the order." -"This card has failed validation and cannot be used.","This card has failed validation and cannot be used." -"Verification Successful","Verification Successful" -"Please continue with placing order.","Please continue with placing order." -"Verification Failed","Verification Failed" -"The card has failed verification with the issuer bank.","The card has failed verification with the issuer bank." -"Order cannot be placed.","Order cannot be placed." -"Verification cannot be processed","Verification cannot be processed" -"There has been wrong payment information submitted or time limit has expired. Please, try again.","There has been wrong payment information submitted or time limit has expired. Please, try again." -"Card Verification","Card Verification" -"Start/Reset Validation...","Start/Reset Validation..." -"Please verify the card with the issuer bank:","Please verify the card with the issuer bank:" -"There has been wrong payment information submitted or the time limit has expired. Please, try again.","There has been wrong payment information submitted or the time limit has expired. Please, try again." -"To ensure the security of your transactions","To ensure the security of your transactions" -"Verified by Visa","Verified by Visa" -"MasterCard SecureCode","MasterCard SecureCode" -Password,Password -"Test Mode","Test Mode" -"Payment Services","Payment Services" -"3D Secure Credit Card Validation","3D Secure Credit Card Validation" -"Processor ID","Processor ID" -"Merchant ID","Merchant ID" -"This overrides any API URL that may be specified by a payment method.","This overrides any API URL that may be specified by a payment method." -"Debug Mode","Debug Mode" diff --git a/app/code/Magento/Centinel/i18n/es_ES.csv b/app/code/Magento/Centinel/i18n/es_ES.csv deleted file mode 100644 index d4b4792979a6c..0000000000000 --- a/app/code/Magento/Centinel/i18n/es_ES.csv +++ /dev/null @@ -1,42 +0,0 @@ -"3D Secure Card Validation","Validación segura 3D de tarjeta" -"Validation failed.","Validación errónea." -"3D Secure Verification Result","Resultados de la verificación segura 3D" -"3D Secure Cardholder Validation","Validación segura 3D del títular de la tarjeta" -"3D Secure Electronic Commerce Indicator","Indicador comercio electrónico seguro 3D" -"3D Secure CAVV","CAVV Seguro 3D" -"3D Secure XID","XID Seguro 3D" -"Merchant Liability","Responsabilidad del comerciante" -"Card Issuer Liability","Responsabilidad del emisor de la tarjeta" -Enrolled,Inscrito -"Enrolled but Authentication Unavailable","Inscrito pero autentificación no disponible" -"Not Enrolled","No inscrito" -Successful,Exitoso -Failed,"Ha fallado" -"Unable to complete","No se ha podido completar" -"Successful attempt","Intento exitoso" -"Unsupported currency code: %1.","Unsupported currency code: %1." -"Payment information error. Please start over.","Error de información de pago. Por favor, comience de nuevo." -"Please verify the card with the issuer bank before placing the order.","Por favor verifique la tarjeta con el banco emisor antes de realizar el pedido." -"This card has failed validation and cannot be used.","Esta tarjeta ha fallado su validación y no puede ser usada." -"Verification Successful","Verificación exitosa" -"Please continue with placing order.","Por favor continue con su pedido." -"Verification Failed","Verificación errónea" -"The card has failed verification with the issuer bank.","La tarjeta ha fallado la verificación con el banco emisor." -"Order cannot be placed.","El pedido no puede ser realizado." -"Verification cannot be processed","La verificación no puede ser procesada" -"There has been wrong payment information submitted or time limit has expired. Please, try again.","Se ha enviado información errónea o el límite de tiempo ha expirado. Por favor, inténtelo de nuevo." -"Card Verification","Verificación de tarjeta" -"Start/Reset Validation...","Comenzar/Resetear validación..." -"Please verify the card with the issuer bank:","Por favor verifique la tarjeta con el banco emisor:" -"There has been wrong payment information submitted or the time limit has expired. Please, try again.","Se ha enviado información errónea o el límite de tiempo ha expirado. Por favor, inténtelo de nuevo." -"To ensure the security of your transactions","Para asegurar la seguridad de sus transacciones" -"Verified by Visa","Verificado por Visa" -"MasterCard SecureCode","MasterCard Código Seguro" -Password,Password -"Test Mode","Test Mode" -"Payment Services","Payment Services" -"3D Secure Credit Card Validation","3D Secure Credit Card Validation" -"Processor ID","Processor ID" -"Merchant ID","Merchant ID" -"This overrides any API URL that may be specified by a payment method.","This overrides any API URL that may be specified by a payment method." -"Debug Mode","Debug Mode" diff --git a/app/code/Magento/Centinel/i18n/fr_FR.csv b/app/code/Magento/Centinel/i18n/fr_FR.csv deleted file mode 100644 index c4679155db4df..0000000000000 --- a/app/code/Magento/Centinel/i18n/fr_FR.csv +++ /dev/null @@ -1,42 +0,0 @@ -"3D Secure Card Validation","Validation carte 3D sécurisée" -"Validation failed.","Validation a échouée." -"3D Secure Verification Result","Résultat vérification 3D sécurisé" -"3D Secure Cardholder Validation","Validation porteur de carte 3D sécurisée" -"3D Secure Electronic Commerce Indicator","Indicateur commerce électronique 3D sécurisé" -"3D Secure CAVV","CAVV 3D sécurisé" -"3D Secure XID","XID 3D sécurisé" -"Merchant Liability","Responsabilité du commerçant" -"Card Issuer Liability","Responsabilité de l'émetteur de la carte" -Enrolled,Enrôlé -"Enrolled but Authentication Unavailable","Enrôlé mais authentification non disponible" -"Not Enrolled","Non enrôlé" -Successful,Réussi -Failed,Échec -"Unable to complete","Ne peut compléter" -"Successful attempt","Tentative réussie" -"Unsupported currency code: %1.","Unsupported currency code: %1." -"Payment information error. Please start over.","Erreur d'infos de paiement. Veuillez recommencer." -"Please verify the card with the issuer bank before placing the order.","Veuillez vérifier la carte avec la banque émettrice avant de passer la commande." -"This card has failed validation and cannot be used.","La carte n'a pu être validée et ne peut être utilisée." -"Verification Successful","Vérification réussie" -"Please continue with placing order.","Veuillez continuer à faire la commande." -"Verification Failed","Vérification a échouée" -"The card has failed verification with the issuer bank.","La carte n'a pas réussie sa vérification avec la banque émettrice." -"Order cannot be placed.","Commande ne peut être placée." -"Verification cannot be processed","Vérification ne peut être traitée" -"There has been wrong payment information submitted or time limit has expired. Please, try again.","Une mauvaise information de paiement a été soumise ou temps imparti est achevé. Veuillez réessayer." -"Card Verification","Vérification carte" -"Start/Reset Validation...","Démarrer/réinitialiser validation..." -"Please verify the card with the issuer bank:","Veuillez vérifier la carte avec la banque émettrice" -"There has been wrong payment information submitted or the time limit has expired. Please, try again.","Une mauvaise information de paiement a été soumise ou le temps imparti s'est achevé. Veuillez réessayer." -"To ensure the security of your transactions","Pour assurer la sécurité de vos transactions" -"Verified by Visa","Vérifié par Visa" -"MasterCard SecureCode","Code sûr MasterCard" -Password,Password -"Test Mode","Test Mode" -"Payment Services","Payment Services" -"3D Secure Credit Card Validation","3D Secure Credit Card Validation" -"Processor ID","Processor ID" -"Merchant ID","Merchant ID" -"This overrides any API URL that may be specified by a payment method.","This overrides any API URL that may be specified by a payment method." -"Debug Mode","Debug Mode" diff --git a/app/code/Magento/Centinel/i18n/nl_NL.csv b/app/code/Magento/Centinel/i18n/nl_NL.csv deleted file mode 100644 index 9cc11c4a1041b..0000000000000 --- a/app/code/Magento/Centinel/i18n/nl_NL.csv +++ /dev/null @@ -1,42 +0,0 @@ -"3D Secure Card Validation","3D Secure Card Validation" -"Validation failed.","Validatie mislukt." -"3D Secure Verification Result","3D Veilig Verificatie Resultaat" -"3D Secure Cardholder Validation","3D Veilige Kaarthouder Verificatie" -"3D Secure Electronic Commerce Indicator","3D Veilige Electronische Commerce Indicator" -"3D Secure CAVV","3D Veilige CAVV" -"3D Secure XID","3D Veilige XID" -"Merchant Liability","Winkelier Aansprakelijkheid" -"Card Issuer Liability","Kaart Uitgever Verplichting" -Enrolled,Ingeschreven -"Enrolled but Authentication Unavailable","Ingeschreven maar Authenticatie niet Beschikbaar" -"Not Enrolled","Niet Ingeschreven" -Successful,Succesvol -Failed,Mislukt -"Unable to complete","Niet afgemaakt" -"Successful attempt","Succesvolle poging" -"Unsupported currency code: %1.","Unsupported currency code: %1." -"Payment information error. Please start over.","Betalingsinformatie fout. Start a.u.b. overnieuw." -"Please verify the card with the issuer bank before placing the order.","Verifieer de kaart a.u.b. met de uitgevende bank, voordat u de order plaatst." -"This card has failed validation and cannot be used.","Deze kaart kon niet worden gevalideerd en is onbruikbaar." -"Verification Successful","Verificatie geslaagd" -"Please continue with placing order.","Ga aub verder met plaatsen order." -"Verification Failed","Verificatie mislukt" -"The card has failed verification with the issuer bank.","De kaart verificatie met de uitgevende bank is mislukt." -"Order cannot be placed.","Order kan niet geplaatst worden." -"Verification cannot be processed","Verificatie kan niet worden verwerkt" -"There has been wrong payment information submitted or time limit has expired. Please, try again.","Er is verkeerde betalingsinformatie verzonden of tijdslimiet is verlopen. Probeer a.u.b. opnieuw." -"Card Verification","Kaart Verificatie" -"Start/Reset Validation...","Begin/Herstel Validatie..." -"Please verify the card with the issuer bank:","Verifieer de kaart a.u.b. met de uitgevende bank:" -"There has been wrong payment information submitted or the time limit has expired. Please, try again.","Er is verkeerde betalingsinformatie verzonden of de tijdslimiet is verlopen. Probeer het a.u.b. opnieuw." -"To ensure the security of your transactions","Om de veiligheid van uw transacties te verzekeren" -"Verified by Visa","Geverifieerd door Visa" -"MasterCard SecureCode","MasterCard SecureCode" -Password,Password -"Test Mode","Test Mode" -"Payment Services","Payment Services" -"3D Secure Credit Card Validation","3D Secure Credit Card Validation" -"Processor ID","Processor ID" -"Merchant ID","Merchant ID" -"This overrides any API URL that may be specified by a payment method.","This overrides any API URL that may be specified by a payment method." -"Debug Mode","Debug Mode" diff --git a/app/code/Magento/Centinel/i18n/pt_BR.csv b/app/code/Magento/Centinel/i18n/pt_BR.csv deleted file mode 100644 index c72f80d7a9436..0000000000000 --- a/app/code/Magento/Centinel/i18n/pt_BR.csv +++ /dev/null @@ -1,42 +0,0 @@ -"3D Secure Card Validation","Validação de Cartão 3D Secure" -"Validation failed.","Falha de validação." -"3D Secure Verification Result","Resultado de Verificação 3D Secure" -"3D Secure Cardholder Validation","Validação de Portador de Cartão 3D Secure" -"3D Secure Electronic Commerce Indicator","Indicador de Comércio Eletrônico 3D Secure" -"3D Secure CAVV","3D Secure CAVV" -"3D Secure XID","3D Secure XID" -"Merchant Liability","Responsabilidade do Comerciante" -"Card Issuer Liability","Responsabilidade do Emissor do Cartão" -Enrolled,Inscritos -"Enrolled but Authentication Unavailable","Inscritos mas Autenticação Não Disponível" -"Not Enrolled","Não Inscrito" -Successful,"Bem sucedido" -Failed,Falha -"Unable to complete","Incapaz de completar" -"Successful attempt","Tentativa bem sucedida" -"Unsupported currency code: %1.","Unsupported currency code: %1." -"Payment information error. Please start over.","Erro de informações de pagamento. Por favor comece de novo." -"Please verify the card with the issuer bank before placing the order.","Por favor verifique o cartão com o banco emissor antes de colocar a ordem." -"This card has failed validation and cannot be used.","A validação do cartão falhou e ele não pode ser utilizado." -"Verification Successful","Sucesso na Verificação" -"Please continue with placing order.","Por favor continuem com a colocação da ordem." -"Verification Failed","Falha de Verificação" -"The card has failed verification with the issuer bank.","O cartão falhou a verificação com o banco emissor." -"Order cannot be placed.","Pedido não pode ser realizado." -"Verification cannot be processed","A verificação não pode ser processada" -"There has been wrong payment information submitted or time limit has expired. Please, try again.","Houve apresentação de informações erradas de pagamento ou prazo expirou. Por favor, tente novamente." -"Card Verification","Verificação de Cartão" -"Start/Reset Validation...","Iniciar/Reiniciar Validação..." -"Please verify the card with the issuer bank:","Por favor verifique o cartão com o banco emissor:" -"There has been wrong payment information submitted or the time limit has expired. Please, try again.","Houve informações de pagamento erradas apresentadas ou o prazo expirou. Por favor tente novamente." -"To ensure the security of your transactions","Para garantir a segurança da sua transação" -"Verified by Visa","Verificado pela Visa" -"MasterCard SecureCode","MasterCard SecureCode" -Password,Password -"Test Mode","Test Mode" -"Payment Services","Payment Services" -"3D Secure Credit Card Validation","3D Secure Credit Card Validation" -"Processor ID","Processor ID" -"Merchant ID","Merchant ID" -"This overrides any API URL that may be specified by a payment method.","This overrides any API URL that may be specified by a payment method." -"Debug Mode","Debug Mode" diff --git a/app/code/Magento/Centinel/i18n/zh_CN.csv b/app/code/Magento/Centinel/i18n/zh_CN.csv deleted file mode 100644 index 225cea16dee0c..0000000000000 --- a/app/code/Magento/Centinel/i18n/zh_CN.csv +++ /dev/null @@ -1,42 +0,0 @@ -"3D Secure Card Validation","3D 安全信用卡验证" -"Validation failed.",验证失败。 -"3D Secure Verification Result","3D 安全验证结果" -"3D Secure Cardholder Validation","3D 安全持卡人验证" -"3D Secure Electronic Commerce Indicator","3D 安全电子商务指标" -"3D Secure CAVV","3D 安全 CAVV" -"3D Secure XID","3D 安全 XID" -"Merchant Liability",商家责任 -"Card Issuer Liability",发卡机构法律责任 -Enrolled,登记 -"Enrolled but Authentication Unavailable",已登记但验证不可用 -"Not Enrolled",未登记 -Successful,成功 -Failed,已失败 -"Unable to complete",无法完成 -"Successful attempt",成功尝试 -"Unsupported currency code: %1.","Unsupported currency code: %1." -"Payment information error. Please start over.",支付信息错误。请重新开始。 -"Please verify the card with the issuer bank before placing the order.",在下订单前,请与发卡行验证信用卡。 -"This card has failed validation and cannot be used.",信用卡验证失败,无法使用。 -"Verification Successful",验证成功 -"Please continue with placing order.",请继续下订单。 -"Verification Failed",验证失败 -"The card has failed verification with the issuer bank.",卡片与发卡行的验证失败。 -"Order cannot be placed.",无法下订单。 -"Verification cannot be processed",验证工作无法处理 -"There has been wrong payment information submitted or time limit has expired. Please, try again.",提交的支付信息错误,或时间限制已到。请重试。 -"Card Verification",信用卡验证 -"Start/Reset Validation...",开始/重设验证... -"Please verify the card with the issuer bank:",请与发卡行验证信用卡: -"There has been wrong payment information submitted or the time limit has expired. Please, try again.",已提交错误的支付信息,或时间限制已过。请重试。 -"To ensure the security of your transactions",要确保您的交易安全 -"Verified by Visa","Visa 已验证" -"MasterCard SecureCode","MasterCard 安全代码" -Password,Password -"Test Mode","Test Mode" -"Payment Services","Payment Services" -"3D Secure Credit Card Validation","3D Secure Credit Card Validation" -"Processor ID","Processor ID" -"Merchant ID","Merchant ID" -"This overrides any API URL that may be specified by a payment method.","This overrides any API URL that may be specified by a payment method." -"Debug Mode","Debug Mode" diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationcomplete.xml b/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationcomplete.xml deleted file mode 100644 index 24bd3da34274c..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationcomplete.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationstart.xml b/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationstart.xml deleted file mode 100644 index c7710e5391f00..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/layout/adminhtml_centinel_index_authenticationstart.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml deleted file mode 100644 index 2289c87584180..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_card_validation.xml b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_card_validation.xml deleted file mode 100644 index 6da07e72baf68..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_card_validation.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_data.xml b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_data.xml deleted file mode 100644 index 0a7d6cead32ae..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_load_block_data.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_start.xml b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_start.xml deleted file mode 100644 index 5966970282ad3..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_start.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/app/code/Magento/Centinel/view/adminhtml/templates/authentication/complete.phtml b/app/code/Magento/Centinel/view/adminhtml/templates/authentication/complete.phtml deleted file mode 100644 index 6d7a00e1d9fd0..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/templates/authentication/complete.phtml +++ /dev/null @@ -1,21 +0,0 @@ - -getIsProcessed()):?> - getIsSuccess()):?> -

-

- -

-

- - -

-

- diff --git a/app/code/Magento/Centinel/view/adminhtml/templates/authentication/start.phtml b/app/code/Magento/Centinel/view/adminhtml/templates/authentication/start.phtml deleted file mode 100644 index fc8b8705c57a3..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/templates/authentication/start.phtml +++ /dev/null @@ -1,18 +0,0 @@ - -
- - - -
- diff --git a/app/code/Magento/Centinel/view/adminhtml/templates/order/create/abstract.phtml b/app/code/Magento/Centinel/view/adminhtml/templates/order/create/abstract.phtml deleted file mode 100644 index 802e8c8759f97..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/templates/order/create/abstract.phtml +++ /dev/null @@ -1,14 +0,0 @@ - - -
- getHeaderText() ?> -
getButtonsHtml() ?>
-
-
- getChildHtml('', true) ?> -
diff --git a/app/code/Magento/Centinel/view/adminhtml/templates/validation/form.phtml b/app/code/Magento/Centinel/view/adminhtml/templates/validation/form.phtml deleted file mode 100644 index 0f6bc0416f160..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/templates/validation/form.phtml +++ /dev/null @@ -1,33 +0,0 @@ - - -
-
- -
-
- -
- -
- - diff --git a/app/code/Magento/Centinel/view/adminhtml/web/order_create.js b/app/code/Magento/Centinel/view/adminhtml/web/order_create.js deleted file mode 100644 index 184bfd307a3f0..0000000000000 --- a/app/code/Magento/Centinel/view/adminhtml/web/order_create.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -define(["prototype"], function(){ - -window.centinelValidator = new Class.create(); - -centinelValidator.prototype = { - - initialize : function(method, validationUrl, containerId){ - this.method = method; - this.validationUrl = validationUrl; - this.containerId = containerId; - }, - - validate : function(){ - if (order.paymentMethod != this.method) { - return false; - } - var params = order.getPaymentData(); - params = order.prepareParams(params); - params.json = true; - - new Ajax.Request(this.validationUrl, { - parameters:params, - method:'post', - onSuccess: function(transport) { - var response = transport.responseText.evalJSON(); - if (response.authenticationUrl) { - this.autenticationStart(response.authenticationUrl); - } - if (response.message) { - this.autenticationFinish(response.message); - } - }.bind(this) - }); - }, - - autenticationStart : function(url) { - this.getContainer().src = url; - this.getContainer().style.display = 'block'; - }, - - autenticationFinish : function(message) { - alert(message); - this.getContainer().style.display = 'none'; - }, - - getContainer : function() { - return $(this.containerId); - } - -}; - -}); \ No newline at end of file diff --git a/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationcomplete.xml b/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationcomplete.xml deleted file mode 100644 index c8d40e57f459b..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationcomplete.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationstart.xml b/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationstart.xml deleted file mode 100644 index 5305d4fdb46b7..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/layout/centinel_index_authenticationstart.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - diff --git a/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_review.xml deleted file mode 100644 index 6bdbb4f91bf78..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_review.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - instant - - - - - diff --git a/app/code/Magento/Centinel/view/frontend/layout/multishipping_checkout_overview.xml b/app/code/Magento/Centinel/view/frontend/layout/multishipping_checkout_overview.xml deleted file mode 100644 index d94c2799038d7..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/layout/multishipping_checkout_overview.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - window - - - - - diff --git a/app/code/Magento/Centinel/view/frontend/requirejs-config.js b/app/code/Magento/Centinel/view/frontend/requirejs-config.js deleted file mode 100644 index ffffa3738afb2..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/requirejs-config.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ - -var config = { - map: { - '*': { - centinelAuthenticate: 'Magento_Centinel/centinel-authenticate' - } - } -}; \ No newline at end of file diff --git a/app/code/Magento/Centinel/view/frontend/templates/authentication.phtml b/app/code/Magento/Centinel/view/frontend/templates/authentication.phtml deleted file mode 100644 index eadafd6baadf0..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/templates/authentication.phtml +++ /dev/null @@ -1,26 +0,0 @@ - -getAuthenticationStart()):?> -
-

-

-
- -
-
- - - diff --git a/app/code/Magento/Centinel/view/frontend/templates/authentication/complete.phtml b/app/code/Magento/Centinel/view/frontend/templates/authentication/complete.phtml deleted file mode 100644 index 7e0f67b8c22f5..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/templates/authentication/complete.phtml +++ /dev/null @@ -1,24 +0,0 @@ - -getIsProcessed()):?> - getIsSuccess()):?> - - -

-

- - -

-

- diff --git a/app/code/Magento/Centinel/view/frontend/templates/authentication/start.phtml b/app/code/Magento/Centinel/view/frontend/templates/authentication/start.phtml deleted file mode 100644 index 22763408138fb..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/templates/authentication/start.phtml +++ /dev/null @@ -1,21 +0,0 @@ - -
-
- - - -
-
- diff --git a/app/code/Magento/Centinel/view/frontend/templates/logo.phtml b/app/code/Magento/Centinel/view/frontend/templates/logo.phtml deleted file mode 100644 index f67f720dc7f34..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/templates/logo.phtml +++ /dev/null @@ -1,18 +0,0 @@ - - diff --git a/app/code/Magento/Centinel/view/frontend/web/centinel-authenticate.js b/app/code/Magento/Centinel/view/frontend/web/centinel-authenticate.js deleted file mode 100644 index 701d373ebee08..0000000000000 --- a/app/code/Magento/Centinel/view/frontend/web/centinel-authenticate.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright © 2015 Magento. All rights reserved. - * See COPYING.txt for license details. - */ -/*jshint jquery:true*/ -define([ - "jquery", - "jquery/ui" -], function($){ - "use strict"; - - $.widget('mage.centinelAuthenticate', { - options : { - frameUrl: '', - iframeSelector: '[data-container="iframe"]', - bodySelector: '[data-container="body"]' - }, - - _create : function() { - // listen for the custom event for changing state - this.element.closest(this.options.bodySelector).on("paymentAuthentication", $.proxy(this._paymentmentAthenticationTrigger, this)); - }, - - _init: function() { - this._isAuthenticationStarted = false; - - // show the frame with the appropriate URL - this.element.find(this.options.iframeSelector).prop('src', this.options.frameUrl); - this.element.show(); - }, - - /** - * This method is used to cancel the call to Centinel from a display perspective as it shows the related blocks and hides the frame. - * @public - */ - cancel : function() { - this.element.hide(); - this.element.find(this.options.iframeSelector).prop('src', ''); - this._isAuthenticationStarted = false; - }, - - /** - * This method is used to complete the interaction from Centinel and resets the display so the order can be placed. - * @public - */ - success : function() { - this.element.hide(); - this._isAuthenticationStarted = false; - }, - - /** - * This method processes the paymentAuthentication actions. - */ - _paymentmentAthenticationTrigger : function(event, data) { - if (data.state === 'start') { - this._start(); - } else if (data.state === 'success') { - this.success(); - } else if (data.state === 'cancel') { - this.cancel(); - } - }, - - /** - * This method is used to initiate the call to Centinel from a display perspective as it hides the related blocks and shows the frame. It also sets the URL in the frame, which initiates the interaction with Centinel. - * @private - */ - _start : function() { - this._isAuthenticationStarted = true; - } - }); - - return $.mage.centinelAuthenticate; -}); \ No newline at end of file diff --git a/app/code/Magento/Centinel/view/frontend/web/images/sc_learn_62x34.png b/app/code/Magento/Centinel/view/frontend/web/images/sc_learn_62x34.png deleted file mode 100644 index 54991ada1dd7b..0000000000000 Binary files a/app/code/Magento/Centinel/view/frontend/web/images/sc_learn_62x34.png and /dev/null differ diff --git a/app/code/Magento/Centinel/view/frontend/web/images/vbv_ltbg_71x57.png b/app/code/Magento/Centinel/view/frontend/web/images/vbv_ltbg_71x57.png deleted file mode 100644 index 691741056a416..0000000000000 Binary files a/app/code/Magento/Centinel/view/frontend/web/images/vbv_ltbg_71x57.png and /dev/null differ diff --git a/app/code/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecure.php b/app/code/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecure.php deleted file mode 100644 index 5d2045ed68e95..0000000000000 --- a/app/code/Magento/Multishipping/Model/Payment/Method/Specification/Is3DSecure.php +++ /dev/null @@ -1,75 +0,0 @@ -scopeConfig = $scopeConfig; - } - - /** - * {@inheritdoc} - */ - public function isSatisfiedBy($paymentMethod) - { - $is3DSecureSupported = isset( - $this->methodsInfo[$paymentMethod][self::FLAG_ALLOW_MULTIPLE_WITH_3DSECURE] - ) && $this->methodsInfo[$paymentMethod][self::FLAG_ALLOW_MULTIPLE_WITH_3DSECURE]; - return $is3DSecureSupported || !$this->is3DSecureEnabled($paymentMethod); - } - - /** - * Is 3DSecure enabled for payment method - * - * @param string $paymentMethod - * @return bool - */ - protected function is3DSecureEnabled($paymentMethod) - { - return $this->scopeConfig->isSetFlag( - sprintf(self::PATH_PAYMENT_3DSECURE, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $paymentMethod) - ) || $this->scopeConfig->isSetFlag( - sprintf(self::PATH_PAYMENT_CENTINEL, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $paymentMethod) - ); - } -} diff --git a/app/code/Magento/Multishipping/Test/Unit/Model/Payment/Method/Specification/Is3DSecureTest.php b/app/code/Magento/Multishipping/Test/Unit/Model/Payment/Method/Specification/Is3DSecureTest.php deleted file mode 100644 index e5829d3c775fd..0000000000000 --- a/app/code/Magento/Multishipping/Test/Unit/Model/Payment/Method/Specification/Is3DSecureTest.php +++ /dev/null @@ -1,96 +0,0 @@ -paymentConfigMock = $this->getMock('\Magento\Payment\Model\Config', [], [], '', false); - $this->scopeConfigMock = $this->getMock('\Magento\Framework\App\Config\ScopeConfigInterface'); - $this->objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); - } - - /** - * Test isSatisfiedBy method - * - * @param array $methodsInfo - * @param bool $is3DSecureEnabled - * @param bool $result - * @dataProvider methodsDataProvider - */ - public function testIsSatisfiedBy($methodsInfo, $is3DSecureEnabled, $result) - { - $method = 'method-name'; - $methodsInfo = [$method => $methodsInfo]; - - $this->paymentConfigMock->expects( - $this->once() - )->method( - 'getMethodsInfo' - )->will( - $this->returnValue($methodsInfo) - ); - $this->scopeConfigMock->expects( - $this->any() - )->method( - 'isSetFlag' - )->will( - $this->returnValue($is3DSecureEnabled) - ); - - $configSpecification = $this->objectManager->getObject( - 'Magento\Multishipping\Model\Payment\Method\Specification\Is3DSecure', - ['paymentConfig' => $this->paymentConfigMock, 'scopeConfig' => $this->scopeConfigMock] - ); - - $this->assertEquals( - $result, - $configSpecification->isSatisfiedBy($method), - sprintf('Failed payment method test: "%s"', $method) - ); - } - - /** - * Data provider - * - * @return array - */ - public function methodsDataProvider() - { - return [ - [['allow_multiple_with_3dsecure' => 1], true, true], - [['allow_multiple_with_3dsecure' => 1], false, true], - [['allow_multiple_with_3dsecure' => 0], true, false], - [['allow_multiple_with_3dsecure' => 0], false, true], - [['no-flag' => 0], true, false] - ]; - } -} diff --git a/app/code/Magento/Multishipping/etc/frontend/di.xml b/app/code/Magento/Multishipping/etc/frontend/di.xml index adac7cf03e70d..0320b5cc341c4 100644 --- a/app/code/Magento/Multishipping/etc/frontend/di.xml +++ b/app/code/Magento/Multishipping/etc/frontend/di.xml @@ -17,7 +17,6 @@ Magento\Multishipping\Model\Payment\Method\Specification\Enabled - Magento\Multishipping\Model\Payment\Method\Specification\Is3DSecure diff --git a/app/code/Magento/OfflinePayments/etc/payment.xml b/app/code/Magento/OfflinePayments/etc/payment.xml index 23f8679100fc6..d0f09bdb19feb 100644 --- a/app/code/Magento/OfflinePayments/etc/payment.xml +++ b/app/code/Magento/OfflinePayments/etc/payment.xml @@ -15,23 +15,18 @@ 1 - 1 1 - 1 1 - 1 1 - 1 1 - 1 diff --git a/app/code/Magento/Payment/Model/Method/Cc.php b/app/code/Magento/Payment/Model/Method/Cc.php index 978e75c5840aa..7e9e8c0181169 100644 --- a/app/code/Magento/Payment/Model/Method/Cc.php +++ b/app/code/Magento/Payment/Model/Method/Cc.php @@ -36,13 +36,6 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod */ protected $_localeDate; - /** - * Centinel service model - * - * @var \Magento\Centinel\Model\Service - */ - protected $_centinelService; - /** * @param \Magento\Framework\Model\Context $context * @param \Magento\Framework\Registry $registry @@ -52,7 +45,6 @@ class Cc extends \Magento\Payment\Model\Method\AbstractMethod * @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig * @param \Magento\Framework\Module\ModuleListInterface $moduleList * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate - * @param \Magento\Centinel\Model\Service $centinelService * @param \Magento\Framework\Model\Resource\AbstractResource $resource * @param \Magento\Framework\Data\Collection\Db $resourceCollection * @param array $data @@ -67,7 +59,6 @@ public function __construct( \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Framework\Module\ModuleListInterface $moduleList, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, - \Magento\Centinel\Model\Service $centinelService, \Magento\Framework\Model\Resource\AbstractResource $resource = null, \Magento\Framework\Data\Collection\Db $resourceCollection = null, array $data = [] @@ -85,7 +76,6 @@ public function __construct( ); $this->_moduleList = $moduleList; $this->_localeDate = $localeDate; - $this->_centinelService = $centinelService; } /** @@ -240,11 +230,6 @@ public function validate() throw new \Magento\Framework\Exception\LocalizedException($errorMsg); } - //This must be after all validation conditions - if ($this->getIsCentinelValidationEnabled()) { - $this->getCentinelValidator()->validate($this->getCentinelValidationData()); - } - return $this; } @@ -369,128 +354,4 @@ public function isAvailable($quote = null) { return $this->getConfigData('cctypes', $quote ? $quote->getStoreId() : null) && parent::isAvailable($quote); } - - /** - * Whether centinel service is enabled - * - * @return bool - * @SuppressWarnings(PHPMD.BooleanGetMethodName) - */ - public function getIsCentinelValidationEnabled() - { - return $this->_moduleList->has('Magento_Centinel') && 1 == $this->getConfigData('centinel'); - } - - /** - * Instantiate centinel validator model - * - * @return \Magento\Centinel\Model\Service - */ - public function getCentinelValidator() - { - $this->_centinelService->setIsModeStrict( - $this->getConfigData('centinel_is_mode_strict') - )->setCustomApiEndpointUrl( - $this->getConfigData('centinel_api_url') - )->setStore( - $this->getStore() - )->setIsPlaceOrder( - $this->_isPlaceOrder() - ); - return $this->_centinelService; - } - - /** - * Return data for Centinel validation - * - * @return \Magento\Framework\Object - */ - public function getCentinelValidationData() - { - $info = $this->getInfoInstance(); - $params = new \Magento\Framework\Object(); - $params->setPaymentMethodCode( - $this->getCode() - )->setCardType( - $info->getCcType() - )->setCardNumber( - $info->getCcNumber() - )->setCardExpMonth( - $info->getCcExpMonth() - )->setCardExpYear( - $info->getCcExpYear() - )->setAmount( - $this->_getAmount() - )->setCurrencyCode( - $this->_getCurrencyCode() - )->setOrderNumber( - $this->_getOrderId() - ); - return $params; - } - - /** - * Order increment ID getter (either real from order or a reserved from quote) - * - * @return string - */ - private function _getOrderId() - { - $info = $this->getInfoInstance(); - - if ($this->_isPlaceOrder()) { - return $info->getOrder()->getIncrementId(); - } else { - if (!$info->getQuote()->getReservedOrderId()) { - $info->getQuote()->reserveOrderId(); - } - return $info->getQuote()->getReservedOrderId(); - } - } - - /** - * Grand total getter - * - * @return string - */ - private function _getAmount() - { - $info = $this->getInfoInstance(); - if ($this->_isPlaceOrder()) { - return (double)$info->getOrder()->getQuoteBaseGrandTotal(); - } else { - return (double)$info->getQuote()->getBaseGrandTotal(); - } - } - - /** - * Currency code getter - * - * @return string - */ - private function _getCurrencyCode() - { - $info = $this->getInfoInstance(); - - if ($this->_isPlaceOrder()) { - return $info->getOrder()->getBaseCurrencyCode(); - } else { - return $info->getQuote()->getBaseCurrencyCode(); - } - } - - /** - * Whether current operation is order placement - * - * @return bool - */ - private function _isPlaceOrder() - { - $info = $this->getInfoInstance(); - if ($info instanceof \Magento\Quote\Model\Quote\Payment) { - return false; - } elseif ($info instanceof \Magento\Sales\Model\Order\Payment) { - return true; - } - } } diff --git a/app/code/Magento/Payment/Test/Unit/Model/Config/ConverterTest.php b/app/code/Magento/Payment/Test/Unit/Model/Config/ConverterTest.php index a41d440e77e47..ea2ebbe345917 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Config/ConverterTest.php +++ b/app/code/Magento/Payment/Test/Unit/Model/Config/ConverterTest.php @@ -31,7 +31,7 @@ public function testConvert() $expectedResult = [ 'credit_cards' => ['SO' => 'Solo', 'SM' => 'Switch/Maestro'], 'groups' => ['any_payment' => 'Any Payment'], - 'methods' => ['checkmo' => ['allow_multiple_address' => 1, 'allow_multiple_with_3dsecure' => 1]], + 'methods' => ['checkmo' => ['allow_multiple_address' => 1]], ]; $this->assertEquals($expectedResult, $this->_model->convert($dom), '', 0, 20); } diff --git a/app/code/Magento/Payment/Test/Unit/Model/Config/_files/payment.xml b/app/code/Magento/Payment/Test/Unit/Model/Config/_files/payment.xml index 26151a6116dd9..5c01da582585b 100644 --- a/app/code/Magento/Payment/Test/Unit/Model/Config/_files/payment.xml +++ b/app/code/Magento/Payment/Test/Unit/Model/Config/_files/payment.xml @@ -23,7 +23,6 @@ 1 - 1 diff --git a/app/code/Magento/Payment/composer.json b/app/code/Magento/Payment/composer.json index 88fb0103d0f0b..e935e442304bd 100644 --- a/app/code/Magento/Payment/composer.json +++ b/app/code/Magento/Payment/composer.json @@ -6,7 +6,6 @@ "magento/module-config": "0.74.0-beta10", "magento/module-store": "0.74.0-beta10", "magento/module-sales": "0.74.0-beta10", - "magento/module-centinel": "0.74.0-beta10", "magento/module-checkout": "0.74.0-beta10", "magento/module-quote": "0.74.0-beta10", "magento/framework": "0.74.0-beta10", diff --git a/app/code/Magento/Payment/etc/payment.xsd b/app/code/Magento/Payment/etc/payment.xsd index 0acc76bc9acbf..c25bd31d96002 100644 --- a/app/code/Magento/Payment/etc/payment.xsd +++ b/app/code/Magento/Payment/etc/payment.xsd @@ -89,7 +89,6 @@ - diff --git a/app/code/Magento/Payment/etc/payment_file.xsd b/app/code/Magento/Payment/etc/payment_file.xsd index def5383c713b8..c0ecf517a7b3c 100644 --- a/app/code/Magento/Payment/etc/payment_file.xsd +++ b/app/code/Magento/Payment/etc/payment_file.xsd @@ -89,7 +89,6 @@ - diff --git a/composer.json b/composer.json index fea3155240c36..eed43c95b4cca 100644 --- a/composer.json +++ b/composer.json @@ -73,7 +73,6 @@ "magento/module-catalog-search": "self.version", "magento/module-catalog-url-rewrite": "self.version", "magento/module-catalog-widget": "self.version", - "magento/module-centinel": "self.version", "magento/module-checkout": "self.version", "magento/module-checkout-agreements": "self.version", "magento/module-cms": "self.version", diff --git a/composer.lock b/composer.lock index 858057377ec62..dcf8c4b429aac 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "4fdda89beb346c9abc4ecb4d78b0572c", + "hash": "83f0bf6faf27d24da65818858b1c9a67", "packages": [ { "name": "composer/composer", diff --git a/dev/tests/integration/testsuite/Magento/Centinel/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/Centinel/Helper/DataTest.php deleted file mode 100644 index 4198c84681aa2..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Centinel/Helper/DataTest.php +++ /dev/null @@ -1,26 +0,0 @@ -get('Magento\Payment\Helper\Data'); - /** @var $paymentInfo \Magento\Payment\Model\Info */ - $paymentInfo = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create( - 'Magento\Payment\Model\Info' - ); - $paymentInfo->setMethod('checkmo'); - $result = $block->getInfoBlock($paymentInfo); - $this->assertInstanceOf('Magento\OfflinePayments\Block\Info\Checkmo', $result); - } -} diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php index 71dc720b07192..cf332c55e852f 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/Config/ReaderTest.php @@ -40,7 +40,7 @@ public function testRead() $expected = [ 'credit_cards' => ['SO' => 'Solo', 'SM' => 'Switch/Maestro'], 'groups' => ['any_payment' => 'Any Payment'], - 'methods' => ['checkmo' => ['allow_multiple_address' => 1, 'allow_multiple_with_3dsecure' => 1]], + 'methods' => ['checkmo' => ['allow_multiple_address' => 1]], ]; $this->assertEquals($expected, $result); } @@ -58,7 +58,7 @@ public function testMergeCompleteAndPartial() 'credit_cards' => ['AE' => 'American Express', 'SM' => 'Switch/Maestro', 'SO' => 'Solo'], 'groups' => ['any_payment' => 'Any Payment Methods', 'offline' => 'Offline Payment Methods'], 'methods' => [ - 'checkmo' => ['allow_multiple_address' => 1, 'allow_multiple_with_3dsecure' => 1], + 'checkmo' => ['allow_multiple_address' => 1], 'deny-method' => ['allow_multiple_address' => 0], ], ]; diff --git a/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment.xml b/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment.xml index 82113715ec1c1..0b6abf4ceaf28 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment.xml +++ b/dev/tests/integration/testsuite/Magento/Payment/Model/_files/payment.xml @@ -23,7 +23,6 @@ 1 - 1 diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Centinel/StateFactoryTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Centinel/StateFactoryTest.php deleted file mode 100644 index 60b907404a94c..0000000000000 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Centinel/StateFactoryTest.php +++ /dev/null @@ -1,62 +0,0 @@ -_getFactoryTypes(); - $ccTypes = $this->_getCcTypes(); - - $definedTypes = array_intersect($factoryTypes, $ccTypes); - - $this->assertEquals( - $factoryTypes, - $definedTypes, - 'Some factory types are missing from payments config.' . "\nMissing types: " . implode( - ',', - array_diff($factoryTypes, $definedTypes) - ) - ); - } - - /** - * Get factory, find list of types it has - * - * @return array string[] factoryTypes - */ - private function _getFactoryTypes() - { - /** @var \Magento\Centinel\Model\StateFactory $stateFactory */ - $stateFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Centinel\Model\StateFactory' - ); - $reflectionObj = new \ReflectionClass($stateFactory); - $stateMapProp = $reflectionObj->getProperty('_stateClassMap'); - $stateMapProp->setAccessible(true); - $stateClassMap = $stateMapProp->getValue($stateFactory); - $factoryTypes = array_keys($stateClassMap); - return $factoryTypes; - } - - /** - * Get config, find list of types it has - * - * @return array string[] ccTypes - */ - private function _getCcTypes() - { - /** @var \Magento\Payment\Model\Config $paymentConfig */ - $paymentConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get( - 'Magento\Payment\Model\Config' - ); - $ccTypes = array_keys($paymentConfig->getCcTypes()); - return $ccTypes; - } -} diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index 029920b879fee..cfa0609a65846 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -3603,4 +3603,44 @@ ['Magento\Checkout\Controller\Onepage\SaveShippingMethod'], ['Magento\Checkout\Controller\Onepage\ShippingMethod'], ['Magento\Catalog\Model\Product\Gallery\ContentValidator', 'Magento\Framework\Api\ImageContentValidator'], + ['Magento\Centinel\Block\Adminhtml\Validation\Form'], + ['Magento\Centinel\Block\Adminhtml\Validation'], + ['Magento\Centinel\Block\Authentication\Complete'], + ['Magento\Centinel\Block\Authentication\Start'], + ['Magento\Centinel\Block\Authentication'], + ['Magento\Centinel\Block\Logo'], + ['Magento\Centinel\Controller\Adminhtml\Centinel\Index\AuthenticationComplete'], + ['Magento\Centinel\Controller\Adminhtml\Centinel\Index\AuthenticationStart'], + ['Magento\Centinel\Controller\Adminhtml\Centinel\Index\ValidatePaymentData'], + ['Magento\Centinel\Controller\Adminhtml\Centinel\Index'], + ['Magento\Centinel\Controller\Index\AuthenticationComplete'], + ['Magento\Centinel\Controller\Index\AuthenticationStart'], + ['Magento\Centinel\Controller\Index'], + ['Magento\Centinel\Helper\Data'], + ['Magento\Centinel\Model\State\Jcb'], + ['Magento\Centinel\Model\State\Mastercard'], + ['Magento\Centinel\Model\State\Visa'], + ['Magento\Centinel\Model\AbstractState'], + ['Magento\Centinel\Model\Api'], + ['Magento\Centinel\Model\Config'], + ['Magento\Centinel\Model\Observer'], + ['Magento\Centinel\Model\Service'], + ['Magento\Centinel\Model\StateFactory'], + ['Magento\Multishipping\Model\Payment\Method\Specification\Is3DSecure'], + ['CentinelClient'], + ['XMLParser'], + ['Magento\Centinel\Test\Block\Adminhtml\Order\View\Tab\Info'], + ['Magento\Centinel\Test\Block\Onepage\Review'], + ['Magento\Centinel\Test\Block\Authentication'], + ['Magento\Centinel\Test\Fixture\AbstractCreditCard'], + ['Magento\Centinel\Test\Fixture\GuestAuthorizenetInvalidCc'], + ['Magento\Centinel\Test\Fixture\GuestPayPalPayflowProInvalidCc'], + ['Magento\Centinel\Test\Fixture\GuestPayPalPayflowProValidCc'], + ['Magento\Centinel\Test\Fixture\GuestPayPalPaymentsProInvalidCc'], + ['Magento\Centinel\Test\Fixture\GuestPayPalPaymentsProValidCc'], + ['Magento\Centinel\Test\Fixture\RegisteredAuthorizenetValidCc'], + ['Magento\Centinel\Test\TestCase\AbstractCentinelPaymentsTest'], + ['Magento\Centinel\Test\TestCase\CentinelPaymentsInvalidCcTest'], + ['Magento\Centinel\Test\TestCase\CentinelPaymentsValidCcTest'], + ['Magento\Centinel\CreateOrderTest'], ]; diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt index 7e57c255f7d1b..47b334a5237a5 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt @@ -27,8 +27,6 @@ Magento/CatalogInventory/Model/Source Magento/CatalogSearch/Model/Resource/Helper Magento/CatalogSearch/Model/Resource/Advanced Magento/CatalogSearch/Model/Resource/Search -Magento/Centinel/Controller -Magento/Centinel/Model/State Magento/Checkout/Block/Multishipping Magento/Checkout/Model/Type Magento/Catalog/Model/Template diff --git a/lib/internal/CardinalCommerce/CentinelClient.php b/lib/internal/CardinalCommerce/CentinelClient.php deleted file mode 100644 index c2f19380cbe2e..0000000000000 --- a/lib/internal/CardinalCommerce/CentinelClient.php +++ /dev/null @@ -1,161 +0,0 @@ -request[$name] = $this->escapeXML($value); - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - // Function getValue(name) - // - // Retrieve a specific value for the give name within the Centinel response collection. - ///////////////////////////////////////////////////////////////////////////////////////////// - - - function getValue($name) { - if (isset($this->response[$name])) { - return $this->response[$name]; - }else{ - return ""; - } - } - - - ///////////////////////////////////////////////////////////////////////////////////////////// - // Function getRequestXml(name) - // - // Serialize all elements of the request collection into a XML message, and format the required - // form payload according to the Centinel XML Message APIs. The form payload is returned from - // the function. - ///////////////////////////////////////////////////////////////////////////////////////////// - - - function getRequestXml(){ - $queryString = ""; - foreach ($this->request as $name => $value) { - $queryString = $queryString."<".($name).">".($value)."" ; - } - $queryString = $queryString.""; - return "cmpi_msg=".urlencode($queryString); - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - // Function sendHttp(url, "", $timeout) - // - // HTTP POST the form payload to the url using cURL. - // form payload according to the Centinel XML Message APIs. The form payload is returned from - // the function. - ///////////////////////////////////////////////////////////////////////////////////////////// - - function sendHttp($url, $connectTimeout="", $timeout) { - - // verify that the URL uses a supported protocol. - - if( (strpos($url, "http://")=== 0) || (strpos($url, "https://")=== 0) ) { - - //Construct the payload to POST to the url. - - $data = $this->getRequestXml(); - // create a new cURL resource - - $ch = curl_init($url); - - // set URL and other appropriate options - curl_setopt($ch, CURLOPT_POST,1); - curl_setopt($ch, CURLOPT_POSTFIELDS, $data); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); - - // Execute the request. - - $result = curl_exec($ch); - $succeeded = curl_errno($ch) == 0 ? true : false; - - // close cURL resource, and free up system resources - - curl_close($ch); - - // If Communication was not successful set error result, otherwise - - if(!$succeeded) { - - $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8030, CENTINEL_ERROR_CODE_8030_DESC); - - } - - // Assert that we received an expected Centinel Message in reponse. - - if (strpos($result, "") === false) { - $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8010, CENTINEL_ERROR_CODE_8010_DESC); - } - - - } else { - $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8000, CENTINEL_ERROR_CODE_8000_DESC); - } - $parser = new XMLParser; - $parser->deserializeXml($result); - $this->response = $parser->deserializedResponse; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - // Function setErrorResponse(errorNo, errorDesc) - // - // Initialize an Error response to ensure that parsing will be handled properly. - ///////////////////////////////////////////////////////////////////////////////////////////// - - function setErrorResponse($errorNo, $errorDesc) { - - $resultText = ""; - $resultText = $resultText."".($errorNo)."" ; - $resultText = $resultText."".($errorDesc)."" ; - $resultText = $resultText.""; - - return $resultText; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - // Function escapeXML(value) - // - // Escaped string converting all '&' to '&' and all '<' to '<'. Return the escaped value. - ///////////////////////////////////////////////////////////////////////////////////////////// - - function escapeXML($elementValue){ - - $escapedValue = str_replace("&", "&", $elementValue); - $escapedValue = str_replace("<", "<", $escapedValue); - - return $escapedValue; - - } - - } diff --git a/lib/internal/CardinalCommerce/CentinelErrors.php b/lib/internal/CardinalCommerce/CentinelErrors.php deleted file mode 100644 index 2ac2eb1996262..0000000000000 --- a/lib/internal/CardinalCommerce/CentinelErrors.php +++ /dev/null @@ -1,24 +0,0 @@ -xml_parser = xml_parser_create(); - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - // Function startElement(parser, name, attribute) - // - // Start Tag Element Handler - ///////////////////////////////////////////////////////////////////////////////////////////// - - function startElement($parser, $name, $attrs='') { - $this->elementName= $name; - - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - // Function elementData(parser, data) - // - // Element Data Handler - ///////////////////////////////////////////////////////////////////////////////////////////// - - function elementData($parser, $data) { - $this->elementValue .= $data; - - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - // Function endElement(name, value) - // - // End Tag Element Handler - ///////////////////////////////////////////////////////////////////////////////////////////// - - function endElement($parser, $name) { - - $this->deserializedResponse[$this->elementName]= $this->elementValue; - $this->elementName = ""; - $this->elementValue = ""; - } - - ///////////////////////////////////////////////////////////////////////////////////////////// - // Function deserialize(xmlString) - // - // Deserilize the XML reponse message and add each element to the deserializedResponse collection. - // Once complete, then each element reference will be available using the getValue function. - ///////////////////////////////////////////////////////////////////////////////////////////// - - function deserializeXml($responseString) { - - xml_set_object($this->xml_parser, $this); - xml_parser_set_option($this->xml_parser,XML_OPTION_CASE_FOLDING,FALSE); - xml_set_element_handler($this->xml_parser, "startElement", "endElement"); - xml_set_character_data_handler($this->xml_parser, "elementData"); - - if (!xml_parse($this->xml_parser, $responseString)) { - - $this->deserializedResponse["ErrorNo"]= CENTINEL_ERROR_CODE_8020; - $this->deserializedResponse["ErrorDesc"]= CENTINEL_ERROR_CODE_8020_DESC; - } - - xml_parser_free($this->xml_parser); - } - }