Braintree\OAuthGateway::_verifyGatewayResponse PHP Метод

_verifyGatewayResponse() приватный Метод

private _verifyGatewayResponse ( $response )
    private function _verifyGatewayResponse($response)
    {
        if (isset($response['credentials'])) {
            $result = new Result\Successful(OAuthCredentials::factory($response['credentials']));
            return $this->_mapSuccess($result);
        } else {
            if (isset($response['result'])) {
                $result = new Result\Successful(OAuthResult::factory($response['result']));
                return $this->_mapAccessTokenRevokeSuccess($result);
            } else {
                if (isset($response['apiErrorResponse'])) {
                    $result = new Result\Error($response['apiErrorResponse']);
                    return $this->_mapError($result);
                } else {
                    throw new Exception\Unexpected("Expected credentials or apiErrorResponse");
                }
            }
        }
    }