Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ResponseValidator.php
Go to the documentation of this file.
1 <?php
7 
8 use Braintree\Result\Error;
9 use Braintree\Result\Successful;
10 use Braintree\Transaction;
11 use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
12 
17 {
21  protected function getResponseValidators()
22  {
23  return array_merge(
24  parent::getResponseValidators(),
25  [
26  function ($response) {
27  return [
28  $response instanceof Successful
29  && isset($response->transaction)
30  && in_array(
31  $response->transaction->status,
32  [Transaction::AUTHORIZED, Transaction::SUBMITTED_FOR_SETTLEMENT, Transaction::SETTLING]
33  ),
34  [__('Wrong transaction status')]
35  ];
36  }
37  ]
38  );
39  }
40 }
$response
Definition: 404.php:11
__()
Definition: __.php:13