Skip to content

Commit ad56730

Browse files
committed
MC-17337: Braintree Error Code Mapping Not Working for CVV 200
- fix tests
1 parent 32baf19 commit ad56730

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

app/code/Magento/Braintree/Test/Unit/Gateway/Validator/GeneralResponseValidatorTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
1515
use PHPUnit_Framework_MockObject_MockObject as MockObject;
1616

17+
/**
18+
* Class GeneralResponseValidatorTest
19+
*/
1720
class GeneralResponseValidatorTest extends \PHPUnit\Framework\TestCase
1821
{
1922
/**
@@ -82,9 +85,11 @@ public function dataProviderTestValidate()
8285
{
8386
$successTransaction = new \stdClass();
8487
$successTransaction->success = true;
88+
$successTransaction->status = 'authorized';
8589

8690
$failureTransaction = new \stdClass();
8791
$failureTransaction->success = false;
92+
$failureTransaction->status = 'declined';
8893
$failureTransaction->message = 'Transaction was failed.';
8994

9095
$errors = [
@@ -93,10 +98,10 @@ public function dataProviderTestValidate()
9398
'code' => 81804,
9499
'attribute' => 'base',
95100
'message' => 'Cannot process transaction.'
96-
]
101+
],
97102
]
98103
];
99-
$errorTransaction = new Error(['errors' => $errors]);
104+
$errorTransaction = new Error(['errors' => $errors, 'transaction' => ['status' => 'declined']]);
100105

101106
return [
102107
[

dev/tests/integration/testsuite/Magento/Checkout/Api/PaymentInformationManagementTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function testSavePaymentInformationAndPlaceOrderWithErrors(
9696
array_push($errors['errors'], ['code' => $testErrorCode]);
9797
}
9898

99-
$response = new Error(['errors' => $errors]);
99+
$response = new Error(['errors' => $errors, 'transaction' => ['status' => 'declined']]);
100100

101101
$this->client->method('placeRequest')
102102
->willReturn(['object' => $response]);

0 commit comments

Comments
 (0)