internal static AcceptanceReport Parse(string xml)
        {
            var doc = p12.Document.Deserialize(xml);
            var acc = new AcceptanceReport(doc);

            acc.RawMessage = xml;
            return(acc);
        }
示例#2
0
        private StatusResponse(AcquirerStatusRes statusRes, string xml)
        {
            Error               = null;
            IsError             = false;
            TransactionId       = statusRes.Transaction.transactionID;
            StatusDateTimestamp =
                statusRes.Transaction.statusDateTimestampSpecified? statusRes.Transaction.statusDateTimestamp : (DateTime?)null;
            Status     = statusRes.Transaction.status;
            RawMessage = xml;

            if (Status == StatusResponse.Success)
            {
                if (statusRes.Transaction.container == null)
                {
                    throw new ApplicationException("No mandate present for the transaction with status 'Success'.");
                }

                var mandateXml = statusRes.Transaction.container.Any[0].OuterXml;
                if (!string.IsNullOrWhiteSpace(mandateXml))
                {
                    AcceptanceReport = AcceptanceReport.Parse(mandateXml);
                }
            }
        }