internal static AmendmentResponse Parse(string xml, ILogger logger)
        {
            try
            {
                var dirRes = AcquirerTrxRes.Deserialize(xml);
                return(new AmendmentResponse(dirRes, xml));
            }
            catch (Exception e1)
            {
                logger.LogError(e1, "error");
                try
                {
                    var errRes = AcquirerErrorRes.Deserialize(xml);
                    return(new AmendmentResponse(errRes, xml));
                }
                catch (Exception e2)
                {
                    logger.LogError(e2, "error");

                    return(new AmendmentResponse(e1)
                    {
                        RawMessage = xml
                    });
                }
            }
        }
Ejemplo n.º 2
0
        internal static CancellationResponse Parse(string xml, ILogger logger)
        {
            try
            {
                var dirRes = AcquirerTrxRes.Deserialize(xml);
                return(new CancellationResponse(dirRes, xml));
            }
            catch (Exception e1)
            {
                logger.Log("error : {0}", e1);

                try
                {
                    var errRes = AcquirerErrorRes.Deserialize(xml);
                    return(new CancellationResponse(errRes, xml));
                }
                catch (Exception e2)
                {
                    logger.Log("error : {0}", e2);

                    return(new CancellationResponse(e1)
                    {
                        RawMessage = xml
                    });
                }
            }
        }
        internal static NewMandateResponse Parse(string xml, ILogger logger)
        {
            try
            {
                var dirRes = AcquirerTrxRes.Deserialize(xml);
                return(new NewMandateResponse(dirRes, xml));
            }
            catch (Exception e1)
            {
                logger.LogError(e1, e1.Message);
                try
                {
                    var errRes = AcquirerErrorRes.Deserialize(xml);
                    return(new NewMandateResponse(errRes, xml));
                }
                catch (Exception e2)
                {
                    logger.LogError(e2, e2.Message);

                    return(new NewMandateResponse(e1)
                    {
                        RawMessage = xml
                    });
                }
            }
        }
Ejemplo n.º 4
0
        internal static AuthenticationResponse Parse(string xml)
        {
            try
            {
                if (xml.Contains("AcquirerTrxRes"))
                {
                    var dirRes = AcquirerTrxRes.Deserialize(xml);
                    return(new AuthenticationResponse(dirRes, xml));
                }

                var errRes = AcquirerErrorRes.Deserialize(xml);
                return(new AuthenticationResponse(errRes, xml));
            }
            catch (Exception e)
            {
                return(new AuthenticationResponse(e, xml));
            }
        }