public static function verifyResponse($response, $messageName)
    {
        $data = array();
        $httpStatus = $response['code'];

        $message = OpenPayU_Util::convertJsonToArray($response['response'], true);

        $data['status'] = isset($message['status']['statusCode']) ? $message['status']['statusCode'] : null;

        if (json_last_error() == JSON_ERROR_SYNTAX) {
            $data['response'] = $response['response'];
        } elseif (isset($message[$messageName])) {
            unset($message[$messageName]['Status']);
            $data['response'] = $message[$messageName];
        } elseif (isset($message)) {
            $data['response'] = $message;
            unset($message['status']);
        }

        $result = self::build($data);

        if ($httpStatus == 200 || $httpStatus == 201 || $httpStatus == 422 || $httpStatus == 301 || $httpStatus == 302) {
            return $result;
        }

        OpenPayU_Http::throwHttpStatusException($httpStatus, $result);
    }
public static function verifyResponse($response, $messageName)
    {
        $data = array();
        $httpStatus = $response['code'];

        $message = OpenPayU_Util::convertJsonToArray($response['response'], true);

        $data['status'] = isset($message['status']['statusCode']) ? $message['status']['statusCode'] : null;

        if (json_last_error() == JSON_ERROR_SYNTAX) {
            $data['response'] = $response['response'];
        } elseif (isset($message[$messageName])) {
            unset($message[$messageName]['Status']);
            $data['response'] = $message[$messageName];
        } elseif (isset($message)) {
            $data['response'] = $message;
            unset($message['status']);
        }

        $result = self::build($data);

        if ($httpStatus == 200 || $httpStatus == 201 || $httpStatus == 422 || $httpStatus == 301 || $httpStatus == 302) {
            return $result;
        }

        OpenPayU_Http::throwHttpStatusException($httpStatus, $result);
    }
public static function verifyResponse ( $ response , $ messageName ) { $ data = array ( ) ; $ httpStatus = $ response [ 'code' ] ; $ message = OpenPayU_Util :: convertJsonToArray ( $ response [ 'response' ] , true ) ; $ data [ 'status' ] = isset ( $ message [ 'status' ] [ 'statusCode' ] ) ? $ message [ 'status' ] [ 'statusCode' ] : null ; if ( json_last_error ( ) == JSON_ERROR_SYNTAX ) { $ data [ 'response' ] = $ response [ 'response' ] ; } elseif ( isset ( $ message [ $ messageName ] ) ) { unset ( $ message [ $ messageName ] [ 'Status' ] ) ; $ data [ 'response' ] = $ message [ $ messageName ] ; } elseif ( isset ( $ message ) ) { $ data [ 'response' ] = $ message ; unset ( $ message [ 'status' ] ) ; } $ result = self :: build ( $ data ) ; if ( $ httpStatus == 200 || $ httpStatus == 201 || $ httpStatus == 422 || $ httpStatus == 301 || $ httpStatus == 302 ) { return $ result ; } OpenPayU_Http :: throwHttpStatusException ( $ httpStatus , $ result ) ; }
Verify response from PayU

@param string $response
@param string $messageName
@return null|OpenPayU_Result
@throws OpenPayU_Exception
@throws OpenPayU_Exception_Authorization
@throws OpenPayU_Exception_Network
@throws OpenPayU_Exception_ServerError
@throws OpenPayU_Exception_ServerMaintenance
Verify response from PayU