Skip to content

Commit ea20244

Browse files
committed
ACP2E-1964: fix CVV config validation; unit test
1 parent 98fb0dc commit ea20244

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class CVV2Match implements ValidatorInterface
5555
*/
5656
public function validate(DataObject $response, Transparent $transparentModel)
5757
{
58-
if ($transparentModel->getConfig()->getValue(static::CONFIG_NAME) === static::CONFIG_OFF) {
58+
if ((int)$transparentModel->getConfig()->getValue(static::CONFIG_NAME) === static::CONFIG_OFF) {
5959
return true;
6060
}
6161

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)