12345678910111213141516171819202122232425262728293031323334353637383940 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Braintree\Gateway\Validator;
- use Braintree\Result\Error;
- use Braintree\Result\Successful;
- use Braintree\Transaction;
- use Magento\Payment\Gateway\Validator\ResultInterfaceFactory;
- /**
- * Class ResponseValidator
- */
- class ResponseValidator extends GeneralResponseValidator
- {
- /**
- * @return array
- */
- protected function getResponseValidators()
- {
- return array_merge(
- parent::getResponseValidators(),
- [
- function ($response) {
- return [
- $response instanceof Successful
- && isset($response->transaction)
- && in_array(
- $response->transaction->status,
- [Transaction::AUTHORIZED, Transaction::SUBMITTED_FOR_SETTLEMENT, Transaction::SETTLING]
- ),
- [__('Wrong transaction status')]
- ];
- }
- ]
- );
- }
- }
|