private void Log(Transaction_Completed model) { using (TransactionData context = new TransactionData()) { context.InsertTransactionCompletedRecord(model); } }
public void LogTritonReversalResponse(ReversalModel atm, DateTime responseSent, DateTime responseFromCoreNode, DateTime atmConnected, DateTime takenByCore, string atmId, string atmIp) { TritonNode_Transaction logModel = new TritonNode_Transaction { req_type = "Reversal", tran_type = "Response", 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, transaction_amount = _transactionAmount, //dispense_amount = _actualDispenseAmount, //surcharge_amount = _surchargeAmount, miscellaneous_1 = atm.Miscellaneous1, miscellaneous_2 = atm.Miscellaneous2, status_monitoring = atm.StatusMonitoringField, miscellaneous_X = atm.MiscellaneousX, response_code = atm.AuthorizationCode, dtResponseSent = responseSent.ToString("yyyy-MM-dd HH:mm:ss"), dtTakenByCore = takenByCore.ToString("yyyy-MM-dd HH:mm:ss"), dtconnected = atmConnected.ToString("yyyy-MM-dd HH:mm:ss"), dtResponseFromCore = responseFromCoreNode.ToString("yyyy-MM-dd HH:mm:ss"), tran_gid = atmId, track2 = ReplaceTrack2(atm.Track2), tran_date = takenByCore.ToString("yyyy-MM-dd"), tran_time = takenByCore.ToString("HH:mm:ss"), switch_no = 1, tran_ip = atmIp, auth_no = atm.AuthorizationNum, text = atm.Text, terminal_tran_seq = atm.AtmSeqNo }; Log(logModel); //if (atm.AuthorizationCode == "00") { Transaction_Completed logCompleted = new Transaction_Completed { tran_gid = atmId, tran_ip = atmIp, switch_no = 1, request_timestamp = takenByCore.ToString("yyyy-MM-dd HH:mm:ss"), request_type = "Reversal", terminal_id = atm.TerminalId, transaction_seq_no = atm.TranSeqNo, card_no = ReplaceCardNo(atm.Track2), transaction_amount = _transactionAmount, //surcharge_amount = _surchargeAmount, //dispense_amount = _actualDispenseAmount, response_code = atm.AuthorizationCode, tran_date = takenByCore.ToString("yyyy-MM-dd"), tran_time = takenByCore.ToString("HH:mm:ss"), transaction_code = atm.TransactionCode, transaction_speed = (responseFromCoreNode - takenByCore).ToString("g"), auth_no = atm.AuthorizationNum, response_desc = atm.AuthorizationDesc, response_action = atm.AuthorizationAction, status_monitoring = atm.StatusMonitoringField, terminal_tran_seq = atm.AtmSeqNo }; Log(logCompleted); } }
public void InsertTransactionCompletedRecord(Transaction_Completed transaction) { Connection.Execute(transaction.ToString()); }