public TransactionModel AuthorizationRequest(TransactionModel atm) { using (var proxy = _proxyClient) { proxy.Connect(); TranTritonNodeRequestDto req = new TranTritonNodeRequestDto ( atm.TerminalId, atm.TransactionCode, atm.Amount1, atm.Amount2, atm.Track2, atm.PinBlock, atm.TranSeqNo, atm.MiscellaneousX, atm.PosCondCode ); _log.Debug("Sending Request to Core Node: " + req); TranCoreNodeResponseDto responseDto = proxy.ServiceProxy.RequestTransaction(req); // Send to CoreNode _log.Debug("Recieved Response from Core Node: " + responseDto); atm.AuthorizationCode = responseDto.ResponseCode; atm.AuthorizationDesc = responseDto.ResponseDescription; atm.AuthorizationAction = responseDto.ResponseAction; atm.TranSeqNo = responseDto.TranSeqNo; atm.Balance = responseDto.AmountCash; atm.AuthorizationNum = responseDto.Stan; return(atm); } }
public TranCoreNodeResponseDto RequestTransaction(TranTritonNodeRequestDto req) { using (var client = ScsServiceClientBuilder.CreateClient <IHostNodeRequestService>(new ScsTcpEndPoint(Config.HostIpAddress, Config.HostPort))) { client.Connect(); TranCoreNodeResponseDto autResponseDto; IAuthorizationService svr = new AuthorizationService(); TranHostNodeRequestDto autReq = svr.AuthorizationRequest(req); if (autReq != null) { _log.Debug("Sending Core Request Object"); TranHostNodeResponseDto res = client.ServiceProxy.RequestTransaction(autReq); // Send to HostNode _log.Debug("Getting Host Response Object"); autResponseDto = new TranCoreNodeResponseDto { 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 TranCoreNodeResponseDto { ResponseCode = "99", ResponseDescription = "Pin Translation Error", ResponseAction = "Decline transaction", TranSeqNo = req.TranSeqNo, AmountTran = req.Amount1, AmtTranFee = req.Amount2 }; } return(autResponseDto); } }
public TranHostNodeRequestDto AuthorizationRequest(TranTritonNodeRequestDto req) { TranHostNodeRequestDto requestDto; ICryptographyService svr = new CryptographyService(req.TerminalId); var translateResult = svr.TranslatePin(req.PinBlock, req.Track2); //string nameLocation = "800 LANGDON ST, MADISON AU"; string nameLocation = svr.GetTerminalLocation(); string merchantType = "5811"; if (translateResult != null && translateResult.ErrorCode == "00") //if (translateResult != null) { _log.Debug("Constructing Core Request Object"); requestDto = new TranHostNodeRequestDto { P3ProcessingCode = req.TransactionCode, // from triton P4AmountTran = req.Amount1, // from triton P7TransmitDt = DateTime.Now, P12TimeLocalTran = DateTime.Now, P13DateLocalTran = DateTime.Now, P15DateSettlement = DateTime.Now.AddDays(+1), P18MerchantType = merchantType, P25PosConditionCode = req.PosCondCode, // from triton P28AmtTranFee = req.Amount2, // from triton P35Track2 = req.Track2, // from triton P41TerminalId = req.TerminalId, // from triton P43NameLocation = nameLocation, P52PinBlock = translateResult.PinBlock, // translated pin P57AmountCash = req.TransactionCode == "11" || req.TransactionCode == "12" || req.TransactionCode == "15" ? req.Amount1 : 0, // from triton TranSeqNo = req.TranSeqNo, // from triton MiscellaneousX = req.MiscellaneousX, // 55 }; } else { requestDto = null; } return(requestDto); }