public ReversalModel ReversalRequest(ReversalModel atm) { using (var proxy = _proxyClient) { proxy.Connect(); ReversalTritonNodeRequestDto req = new ReversalTritonNodeRequestDto ( atm.TerminalId, atm.TransactionCode, atm.AuthorizationTranAmount, atm.AuthorizationSurAmount, atm.AuthorizationDispensedAmount, atm.Track2, atm.TranSeqNo, atm.MiscellaneousX, atm.PosCondCode, atm.AuthorizationNum ); ReversalCoreNodeResponseDto responseDto = proxy.ServiceProxy.RequestReversal(req); atm.AuthorizationCode = responseDto.ResponseCode; atm.AuthorizationDesc = responseDto.ResponseDescription; atm.AuthorizationAction = responseDto.ResponseAction; atm.AuthorizationNum = responseDto.Stan; atm.TranSeqNo = responseDto.TranSeqNo; return(atm); } }
public ReversalCoreNodeResponseDto RequestReversal(ReversalTritonNodeRequestDto req) { using (var client = ScsServiceClientBuilder.CreateClient <IHostNodeRequestService>(new ScsTcpEndPoint(Config.HostIpAddress, Config.HostPort))) { client.Connect(); ReversalCoreNodeResponseDto autResponseDto; IReversalService svr = new ReversalService(); var reversalReq = svr.ReversalRequest(req); if (reversalReq != null) { _log.Debug("Sending Core Request Object"); ReversalHostNodeResponseDto res = client.ServiceProxy.RequestReversal(reversalReq); // Send to HostNode _log.Debug("Getting Host Response Object"); autResponseDto = new ReversalCoreNodeResponseDto { Stan = res.Stan, ResponseCode = res.ResponseCode, ResponseDescription = res.ResponseDescription, ResponseAction = res.ResponseAction, AmountTran = res.AmountTran, AmtTranFee = res.AmtTranFee, AmountCash = res.AmountCash, TranSeqNo = res.TranSeqNo }; } else { _log.Debug("Pin Translation failed, sending response."); //send response back to terminal for decline autResponseDto = new ReversalCoreNodeResponseDto { ResponseCode = "99", ResponseDescription = "Pin Translation Error", ResponseAction = "Decline transaction", TranSeqNo = req.TranSeqNo, AmountTran = req.Amount1, AmtTranFee = req.Amount2 }; } return(autResponseDto); } }