Ejemplo n.º 1
0
        public ChangePINResponse DoBalanceEnquiry(CardDetails theCard, Account acct, string seq_nr)
        {
            ChangePINResponse response = null;

            lock (this)
            {
                if (_clientPeer.IsConnected)
                {
                    BalanceEnquiryISO cpMsg = new BalanceEnquiryISO(acct, theCard, _transactionID, seq_nr);

                    Trx.Messaging.Message responseMessage = ProcessRequest(cpMsg);
                    response = new ChangePINResponse(responseMessage);
                    response.TransactionID = _transactionID;
                }
            }
            return(response);
        }
Ejemplo n.º 2
0
        public ChangePINResponse DoChangePIN(CardDetails theCard, Account acct, string seq_nr)
        {
            ChangePINResponse response = null;

            lock (this)
            {
                if (_clientPeer.IsConnected)
                {
                    ChangePIN cpMsg = new ChangePIN(_terminal, acct, theCard, _transactionID, seq_nr);
                    new PANE.ERRORLOG.Error().LogInfo("Pin Change Request: " + cpMsg.ToString());

                    Trx.Messaging.Message responseMessage = ProcessRequest(cpMsg);
                    new PANE.ERRORLOG.Error().LogInfo("Pin Change Response: " + responseMessage.ToString());
                    response = new ChangePINResponse(responseMessage);
                    response.TransactionID = _transactionID;
                }
            }
            return(response);
        }
Ejemplo n.º 3
0
        private Trx.Messaging.Message ProcessRequest(Iso8583Message msg)
        {
            LastMessageSent = msg;
            PeerRequest request = new PeerRequest(_clientPeer, msg);

            // new PANE.ERRORLOG.Error().LogInfo(string.Format("Before sending {0}", _clientPeer.Channel.Name.ToString()));

            Console.WriteLine("The request: " + request.RequestMessage);

            new PANE.ERRORLOG.Error().LogInfo(string.Format("The request: " + request.RequestMessage));
            request.Send();
            request.WaitResponse(serverTimeout);

            if (request.Expired)
            {
                Console.WriteLine("Timed out");
                new PANE.ERRORLOG.Error().LogInfo("ProcessRequest Timed Out!");
                throw new ConnectionTimedOutException(msg);
            }
            else
            {
                Trx.Messaging.Message clo = request.ResponseMessage.Clone() as Trx.Messaging.Message;
                if (clo.Fields.Contains(127))
                {
                    (clo.Fields[127].Value as Trx.Messaging.Message).Parent = null;
                }
                if (clo.Fields.Contains(125))
                {
                    Console.WriteLine("ZPK: " + clo.Fields[125].Value);
                    new PANE.ERRORLOG.Error().LogInfo(string.Format("ZPK: " + clo.Fields[125].Value));
                }

                Console.WriteLine("The response: " + request.RequestMessage);
                new PANE.ERRORLOG.Error().LogInfo(string.Format("The response: " + request.ResponseMessage));
            }

            return(request.ResponseMessage);
        }
Ejemplo n.º 4
0
        public KeyExchangeResponse DoKeyExchange()
        {
            KeyExchangeResponse response = null;

            lock (this)
            {
                if (Connect())
                {
                    Console.WriteLine("connect");
                    KeyExchange keMsg = new KeyExchange(_transactionID);
                    new PANE.ERRORLOG.Error().LogInfo("About to send key Exchange Message: " + keMsg.ToString());
                    Trx.Messaging.Message responseMessage = ProcessRequest(keMsg);
                    response = new KeyExchangeResponse(responseMessage);

                    new PANE.ERRORLOG.Error().LogInfo("Recieved Exchange Message: " + responseMessage.ToString());
                    response.TransactionID = _transactionID;
                }
                else
                {
                    Console.WriteLine("not connected");
                }
            }
            return(response);
        }