public RequestResultModel(Response response,string url,  string rawRequest , string rawResponse)
 {
     Response = response;
     Url = url;
     RawRequest = rawRequest;
     RawResponse = rawResponse;
 }
        public Response ConvertToResponse(Dictionary<string, string> dictionary)
        {
            if (dictionary == null)
                throw new ArgumentNullException("dictionary");

            Status? status = null;
            string statusStr;
            if (dictionary.TryGetValue("status", out statusStr))
                status = (Status) Enum.Parse(typeof (Status), statusStr, true);

            ResponseStatus? responseStatus = null;
            string responseStatusStr;
            if (dictionary.TryGetValue("pxyResponse.responseStatus", out responseStatusStr))
                responseStatus = (ResponseStatus) Enum.Parse(typeof (ResponseStatus), responseStatusStr, true);

            string processorRefId;
            dictionary.TryGetValue("pxyResponse.processorRefId", out processorRefId);

            string processorType;
            dictionary.TryGetValue("pxyResponse.processorType", out processorType);

            string responseStatusName;
            dictionary.TryGetValue("pxyResponse.responseStatus.name", out responseStatusName);

            string responseStatusCode;
            dictionary.TryGetValue("pxyResponse.responseStatus.code", out responseStatusCode);

            string responseStatusDescription;
            dictionary.TryGetValue("pxyResponse.responseStatus.description", out responseStatusDescription);

            string responseStatusReasonCode;
            dictionary.TryGetValue("pxyResponse.responseStatus.reasonCode", out responseStatusReasonCode);

            string fullNativeResp;
            dictionary.TryGetValue("pxyResponse.fullNativeResp", out fullNativeResp);

            string threeDSAcsUrl;
            dictionary.TryGetValue("pxyResponse.threeDSAcsUrl", out threeDSAcsUrl);

            string threeDSTransactionId;
            dictionary.TryGetValue("pxyResponse.threeDSTransactionId", out threeDSTransactionId);

            string threeDSPARequest;
            dictionary.TryGetValue("pxyResponse.threeDSPARequest", out threeDSPARequest);

            string fraudServiceFullNativeResp;
            dictionary.TryGetValue("frdChkResp.fullNativeResp", out fraudServiceFullNativeResp);

            string errorId;
            dictionary.TryGetValue("errId", out errorId);

            var resp = new Response(status, responseStatus, processorRefId, processorType,
                responseStatusName, responseStatusCode, responseStatusDescription,
                responseStatusReasonCode, fullNativeResp, threeDSAcsUrl, threeDSTransactionId,
                threeDSPARequest, fraudServiceFullNativeResp, errorId);

            return resp;
        }