Пример #1
0
        public void LogTritonHostTotalRequest(HostTotalModel atm, DateTime atmConnected, DateTime takenByCore, string atmId, string atmIp)
        {
            TritonNode_Transaction logModel = new TritonNode_Transaction
            {
                req_type  = "HostTotal",
                tran_type = "Request",
                communications_identifier = atm.CommunicationIdentifier,
                terminal_identifier       = atm.TerminalIdentifier,
                software_version_number   = atm.SoftwareVerionNo,
                encryption_mode_flag      = atm.EncryptionModeFlag,
                information_header        = atm.InformationHeader,
                terminal_id        = atm.TerminalId,
                transaction_code   = atm.TransactionCode,
                transaction_seq_no = atm.TranSeqNo,
                status_monitoring  = atm.StatusMonitoringField,
                miscellaneous_X    = atm.MiscellaneousX,
                dtTakenByCore      = takenByCore.ToString("yyyy-MM-dd HH:mm:ss"),
                dtconnected        = atmConnected.ToString("yyyy-MM-dd HH:mm:ss"),
                tran_gid           = atmId,
                tran_date          = takenByCore.ToString("yyyy-MM-dd"),
                tran_time          = takenByCore.ToString("HH:mm:ss"),
                switch_no          = 1,
                tran_ip            = atmIp,
                text = atm.Text
            };

            Log(logModel);
        }
Пример #2
0
        public byte[] HostTotalResponse(HostTotalModel model)
        {
            //    // Example Host Totals Response Message

            string InformationHeader = "            ";                  // 12 ASCII Char. Not used as of this release, must be space filled
            string businessDate      = DateTime.Now.ToString("MMddyy"); // Business date of the transaction in MMDDYY format. Set by processor.

            string builder = "";


            builder += InformationHeader.PadRight(12, ' ');
            builder += "\x1C" + "0";                   // Multi-Block Indicator 1 Numeric
            builder += "\x1C" + model.TerminalId;      // 15 Alphanumeric Terminal ID. Assigned by processor. Left justified, space filled to the right.
            builder += "\x1C" + model.TransactionCode; // 2 Alphanumeric Code indicating type of transaction being done. See Transaction Codes table.
            //builder += "\x1C" + businessDate; // 6 Numeric
            builder += "\x1C";
            builder += model.NoOfWithdrawals.ToString("D4"); // No. of Withdrawals  4 Numeric Total number of withdrawals since the last request for totals. Zero or space filled to the left.
            builder += model.NoOfInquiries.ToString("D4");   // No. of Inquiries  4 Numeric Total number of inquiries since the last request for totals. Zero or space filled to the left.
            builder += model.NoOfTransfers.ToString("D4");   // No. of Transfers  4 Numeric Total number of transfers since the last request for totals. Zero or space filled to the left.
            builder += model.Settlement.ToString("D8");      /* Settlement  8 Numeric  F  X  Total amount of all withdrawals. Zero or space filled to left, right justified. Represents the amount in the smallest
                                                              * possible unit of currency.*/
            builder += "\x1C" + model.MiscellaneousX;
            builder += "\x1C";
            builder += "\x03";
            builder  = "\x02" + builder + CalcLRC(builder);

            byte[] result = Build(builder);
            string encode = _helper.AsciiOctets2String(result);

            _log.Debug("Message sent to ATM: " + encode);
            model.Text = encode;
            return(result);
        }
Пример #3
0
        public void LogTritonDayTotal(HostTotalModel atm, string atmId)
        {
            Terminals_Day_Totals dayTotals = new Terminals_Day_Totals
            {
                tran_gid        = atmId,
                terminal_id     = atm.TerminalId,
                business_date   = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                settlement_code = atm.TransactionCode,
                processed_date  = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                num_of_cw       = atm.NoOfWithdrawals,
                num_of_tf       = atm.NoOfTransfers,
                num_of_bi       = atm.NoOfInquiries,
                total_dispensed = atm.Settlement / 100m
            };

            Log(dayTotals);
        }
Пример #4
0
 public HostTotalModel HostTotalRequest(HostTotalModel atm)
 {
     // wait for get information form database
     return(atm);
 }