public HttpResponseMessage PaymentByCard([FromBody] PaymentModel paymentModel) { var dateStart = DateTime.Now; _performancelog.Debug($"Start,PaymentController,PaymentByCard,{string.Empty},{dateStart:hh.mm.ss.ffffff}"); ErrorMessage errorMessage; string userCode; HttpResponseMessage httpResponseMessage; if (GetUserCode(out userCode, out httpResponseMessage)) { return(httpResponseMessage); } Report merchantStream = null; Report customerStream = null; var updatedTenders = _paymentManager.ByCard(paymentModel.SaleNumber, paymentModel.TillNumber, paymentModel.CardNumber, userCode, paymentModel.TransactionType, paymentModel.PONumber, paymentModel.AmountUsed, ref merchantStream, ref customerStream, out errorMessage); if (!string.IsNullOrEmpty(errorMessage.MessageStyle.Message)) { return(Request.CreateResponse(HttpStatusCode.BadRequest, new ErrorResponse { Error = errorMessage.MessageStyle })); } TenderSummaryModel tenderSummary = GetTenderSummary(updatedTenders); if (merchantStream != null || customerStream != null) { tenderSummary.Receipts = new List <ReportModel>(); if (merchantStream != null) { tenderSummary.Receipts.Add(new ReportModel { ReportName = merchantStream.ReportName, ReportContent = merchantStream.ReportContent, Copies = 1 }); } if (customerStream != null) { tenderSummary.Receipts.Add(new ReportModel { ReportName = customerStream.ReportName, ReportContent = customerStream.ReportContent, Copies = 1 }); } } _performancelog.Debug($"End,PaymentController,PaymentByCard,{DateTime.Now.Subtract(dateStart).TotalMilliseconds},{DateTime.Now:hh.mm.ss.ffffff}"); return(Request.CreateResponse(HttpStatusCode.OK, tenderSummary)); }