Braintree\Result\Error::__construct PHP Метод

__construct() публичный Метод

overrides default constructor
public __construct ( array $response )
$response array gateway response array
    public function __construct($response)
    {
        $this->_attributes = $response;
        $this->_set('errors', new ErrorCollection($response['errors']));
        if (isset($response['verification'])) {
            $this->_set('creditCardVerification', new CreditCardVerification($response['verification']));
        } else {
            $this->_set('creditCardVerification', null);
        }
        if (isset($response['transaction'])) {
            $this->_set('transaction', Transaction::factory($response['transaction']));
        } else {
            $this->_set('transaction', null);
        }
        if (isset($response['subscription'])) {
            $this->_set('subscription', Subscription::factory($response['subscription']));
        } else {
            $this->_set('subscription', null);
        }
        if (isset($response['merchantAccount'])) {
            $this->_set('merchantAccount', MerchantAccount::factory($response['merchantAccount']));
        } else {
            $this->_set('merchantAccount', null);
        }
        if (isset($response['verification'])) {
            $this->_set('verification', new CreditCardVerification($response['verification']));
        } else {
            $this->_set('verification', null);
        }
    }