Skip to content

Commit 737cc14

Browse files
committed
Merge branch 'ACP2E-1964' of https://github.com/magento-l3/magento2ce into PR-05242023
2 parents d9d3d9b + c177106 commit 737cc14

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

app/code/Magento/Paypal/Model/Payflow/Service/Response/Validator/CVV2Match.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,38 @@
99
use Magento\Paypal\Model\Payflow\Service\Response\ValidatorInterface;
1010
use Magento\Paypal\Model\Payflow\Transparent;
1111

12-
/**
13-
* Class CVV2Match
14-
*/
1512
class CVV2Match implements ValidatorInterface
1613
{
1714
/**
1815
* Result of the card security code (CVV2) check
1916
*/
20-
const CVV2MATCH = 'cvv2match';
17+
public const CVV2MATCH = 'cvv2match';
2118

2219
/**
2320
* This field returns the transaction amount, or if performing a partial authorization,
2421
* the amount approved for the partial authorization.
2522
*/
26-
const AMT = 'amt';
23+
public const AMT = 'amt';
2724

2825
/**
2926
* Message if validation fail
3027
*/
31-
const ERROR_MESSAGE = 'Card security code does not match.';
28+
public const ERROR_MESSAGE = 'Card security code does not match.';
3229

3330
/**#@+ Values of the response */
34-
const RESPONSE_YES = 'y';
31+
public const RESPONSE_YES = 'y';
3532

36-
const RESPONSE_NO = 'n';
33+
public const RESPONSE_NO = 'n';
3734

38-
const RESPONSE_NOT_SUPPORTED = 'x';
35+
public const RESPONSE_NOT_SUPPORTED = 'x';
3936
/**#@-*/
4037

4138
/**#@+ Validation settings payments */
42-
const CONFIG_ON = 1;
39+
public const CONFIG_ON = 1;
4340

44-
const CONFIG_OFF = 0;
41+
public const CONFIG_OFF = 0;
4542

46-
const CONFIG_NAME = 'avs_security_code';
43+
public const CONFIG_NAME = 'avs_security_code';
4744
/**#@-*/
4845

4946
/**
@@ -55,7 +52,7 @@ class CVV2Match implements ValidatorInterface
5552
*/
5653
public function validate(DataObject $response, Transparent $transparentModel)
5754
{
58-
if ($transparentModel->getConfig()->getValue(static::CONFIG_NAME) === static::CONFIG_OFF) {
55+
if ((int)$transparentModel->getConfig()->getValue(static::CONFIG_NAME) === static::CONFIG_OFF) {
5956
return true;
6057
}
6158

app/code/Magento/Paypal/Test/Unit/Model/Payflow/Service/Response/Validator/CVV2MatchTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,15 @@ public function validationDataProvider()
137137
'response' => new DataObject(),
138138
'configValue' => '1',
139139
],
140+
[
141+
'expectedResult' => true,
142+
'response' => new DataObject(
143+
[
144+
'cvv2match' => 'N',
145+
]
146+
),
147+
'configValue' => '0',
148+
],
140149
];
141150
}
142151
}

0 commit comments

Comments
 (0)