public void postSale(SalePostRequest postRequest, SalePostResponse postResponse) { SalePostContext context; context = new SalePostContextImpl(postRequest, postResponse); _postSalePipelineStart.execute(context); }
public override void stageExecute(SalePostContext context) { SalePostResponse response = context.Response; SaleRepo.SaleBuilder saleBuilder = context.saleBuild(); PANRange binRange = null; Card card = saleBuilder.Card; ResponseCode?failureResponseCode = null;; if (card != null) { binRange = card.PANRange; } if (binRange != null) { Terminal terminal = saleBuilder.Terminal; if (terminal != null) { failureResponseCode = checkSchemeFundsRecipient(binRange, terminal, saleBuilder.FundsRecipient, binRange.Scheme, saleBuilder.DebtRepayFlag); } else { //Logger.warn("Sale doesn't have associated terminal = " + "Cannot perform Funds recipient check"); } } else { //Logger.info("Not performing FundsRecipient check - Not a VISA/Mastercard card"); } //nextStage(context); if (failureResponseCode.HasValue) { response.ResponseCode = (ResponseCode)failureResponseCode; } else { nextStage(context); } }
public SalePostContextImpl(SalePostRequest request, SalePostResponse response) { this.request = request; this.response = response; }