Exemple #1
0
        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);
            }
        }
Exemple #2
0
        public ReversalHostNodeRequestDto ReversalRequest(ReversalTritonNodeRequestDto req)
        {
            ICryptographyService svr = new CryptographyService(req.TerminalId);
            //string nameLocation = "800 LANGDON ST,          MADISON      AU";
            string nameLocation = svr.GetTerminalLocation();

            _log.Debug("Constructing Core Request Object");
            var requestDto = new ReversalHostNodeRequestDto
            {
                P3ProcessingCode    = req.TransactionCode, // from triton
                P4AmountTran        = req.Amount1,         // from triton /* Authorization transaction amount */
                P7TransmitDt        = DateTime.Now,
                P12TimeLocalTran    = DateTime.Now,
                P13DateLocalTran    = DateTime.Now,
                P15DateSettlement   = DateTime.Now.AddDays(+1),
                P25PosConditionCode = req.PosCondCode,    // from triton
                P28AmtTranFee       = req.Amount2,        // from triton /* Surcharge amount */
                P35Track2           = req.Track2,         // from triton
                P41TerminalId       = req.TerminalId,     // from triton
                P43NameLocation     = nameLocation,
                P57AmountCash       = req.Amount3,        // from triton /* Dispensed amount */
                TranSeqNo           = req.TranSeqNo,      // from triton
                MiscellaneousX      = req.MiscellaneousX, // from triton
                AuthorizationNum    = req.AuthorizationNum
            };

            return(requestDto);
        }
Exemple #3
0
        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);
            }
        }