forked from magento/magento2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '2.3-develop' into feature/271-Customer-Attributes-Valid…
…ation Conflicts: app/code/Magento/CustomerGraphQl/Model/Customer/CreateCustomerAccount.php app/code/Magento/CustomerGraphQl/Model/Customer/UpdateCustomerAccount.php
- Loading branch information
Showing
670 changed files
with
14,824 additions
and
6,313 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...Magento/Authorizenet/Test/Mftf/Test/StorefrontVerifySecureURLRedirectAuthorizenetTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="StorefrontVerifySecureURLRedirectAuthorizenet"> | ||
<annotations> | ||
<features value="Authorizenet"/> | ||
<stories value="Storefront Secure URLs"/> | ||
<title value="Verify Secure URLs For Storefront Authorizenet Pages"/> | ||
<description value="Verify that the Secure URL configuration applies to the Authorizenet pages on the Storefront"/> | ||
<severity value="MAJOR"/> | ||
<testCaseId value="MC-15610"/> | ||
<group value="authorizenet"/> | ||
<group value="configuration"/> | ||
<group value="secure_storefront_url"/> | ||
</annotations> | ||
<before> | ||
<createData entity="Simple_US_Customer" stepKey="customer"/> | ||
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefront"> | ||
<argument name="Customer" value="$$customer$$"/> | ||
</actionGroup> | ||
<executeJS function="return window.location.host" stepKey="hostname"/> | ||
<magentoCLI command="config:set web/secure/base_url https://{$hostname}/" stepKey="setSecureBaseURL"/> | ||
<magentoCLI command="config:set web/secure/use_in_frontend 1" stepKey="useSecureURLsOnStorefront"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCache"/> | ||
</before> | ||
<after> | ||
<magentoCLI command="config:set web/secure/use_in_frontend 0" stepKey="dontUseSecureURLsOnStorefront"/> | ||
<magentoCLI command="cache:flush" stepKey="flushCache"/> | ||
<deleteData createDataKey="customer" stepKey="deleteCustomer"/> | ||
</after> | ||
<executeJS function="return window.location.host" stepKey="hostname"/> | ||
<amOnUrl url="http://{$hostname}/authorizenet" stepKey="goToUnsecureAuthorizenetURL"/> | ||
<seeCurrentUrlEquals url="https://{$hostname}/authorizenet" stepKey="seeSecureAuthorizenetURL"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
app/code/Magento/AuthorizenetCardinal/Gateway/Validator/CavvResponseValidator.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Magento\AuthorizenetCardinal\Gateway\Validator; | ||
|
||
use Magento\AuthorizenetAcceptjs\Gateway\SubjectReader; | ||
use Magento\AuthorizenetCardinal\Model\Config; | ||
use Magento\Payment\Gateway\Validator\AbstractValidator; | ||
use Magento\Payment\Gateway\Validator\ResultInterface; | ||
use Magento\Payment\Gateway\Validator\ResultInterfaceFactory; | ||
|
||
/** | ||
* Validates cardholder authentication verification response code. | ||
*/ | ||
class CavvResponseValidator extends AbstractValidator | ||
{ | ||
/** | ||
* The result code that authorize.net returns if CAVV passed validation. | ||
*/ | ||
private const RESULT_CODE_SUCCESS = '2'; | ||
|
||
/** | ||
* @var SubjectReader | ||
*/ | ||
private $subjectReader; | ||
|
||
/** | ||
* @var ResultInterfaceFactory | ||
*/ | ||
private $resultFactory; | ||
|
||
/** | ||
* @var Config | ||
*/ | ||
private $config; | ||
|
||
/** | ||
* @param ResultInterfaceFactory $resultFactory | ||
* @param SubjectReader $subjectReader | ||
* @param Config $config | ||
*/ | ||
public function __construct( | ||
ResultInterfaceFactory $resultFactory, | ||
SubjectReader $subjectReader, | ||
Config $config | ||
) { | ||
parent::__construct($resultFactory); | ||
|
||
$this->resultFactory = $resultFactory; | ||
$this->subjectReader = $subjectReader; | ||
$this->config = $config; | ||
} | ||
|
||
/** | ||
* @inheritdoc | ||
*/ | ||
public function validate(array $validationSubject): ResultInterface | ||
{ | ||
if ($this->config->isActive() === false) { | ||
return $this->createResult(true); | ||
} | ||
|
||
$response = $this->subjectReader->readResponse($validationSubject); | ||
$transactionResponse = $response['transactionResponse']; | ||
|
||
$cavvResultCode = $transactionResponse['cavvResultCode'] ?? ''; | ||
$isValid = $cavvResultCode === self::RESULT_CODE_SUCCESS; | ||
$errorCodes = []; | ||
$errorMessages = []; | ||
|
||
if (!$isValid) { | ||
$errorCodes[] = $transactionResponse['cavvResultCode']; | ||
$errorMessages[] = 'CAVV failed validation'; | ||
} | ||
|
||
return $this->createResult($isValid, $errorMessages, $errorCodes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.