public void WriteHeader(Prism820Context context, Type820Header header) { var line = string.Format("SH|{0}|{1}|O|", context.TradingPartnerId, header.TraceReferenceNbr); context.AppendLine(line); logger.TraceFormat("Wrote 820 \"SH\" PRISM line for Header {0}", header.HeaderKey); }
public void WriteDetail(Prism820Context context, Type820Header header) { if (!header.HeaderKey.HasValue) { return; } var headerKey = header.HeaderKey.Value; var details = marketDataAccess.ListDetails(headerKey); if (details == null || details.Length == 0) { return; } foreach (var detail in details) { if (!detail.DetailKey.HasValue) { continue; } var premiseNumber = IdentifyEsiId(context, detail); var membershipId = IdentifyLdcAccountNumber(context, detail); var line = string.Format("20|{0}|{5}||{1}|||||{2}||||{3}|||{4}|", context.TradingPartnerId, detail.PaymentAmount, detail.CrossReferenceNbr, detail.ReferenceNbr, premiseNumber, membershipId); context.AppendLine(line); logger.TraceFormat("Wrote 820 \"20\" PRISM line for Header {0}", header.HeaderKey); } }
public void WritePayment(Prism820Context context, Type820Header header) { var partnerId = context.TradingPartnerId; var stateId = partnerId.Substring(3, 2); var line = string.Format("01|{0}|{1}|{2}|{3}|{4}||||||||{5}|{6}|{7}|{8}|{9}|{10}|{11}||||", partnerId, stateId, header.TransactionTypeCode, header.TotalAmount, header.PaymentMethodCode, header.TransactionDate, header.TraceReferenceNbr, header.CrName, header.CrDuns, header.TdspName, header.TdspDuns, header.CreditDebitFlag); context.AppendLine(line); logger.TraceFormat("Wrote 820 \"01\" PRISM line for Header {0}", header.HeaderKey); }