コード例 #1
0
ファイル: Program.cs プロジェクト: tdonkor/RunPCDCall
        static void Main(string[] args)
        {
            //object initiations
            InitPCDCall       initPCDCall       = new InitPCDCall();
            TerminalIPAddress terminalIPAddress = new TerminalIPAddress();
            StatusClass       terminalStatus    = new StatusClass();

            StringBuilder logDetails = new StringBuilder();

            logDetails.Append($"Date/Time: {DateTime.Now}.\n");

            //Set terminalIp Address
            terminalIPAddress.IPAddressIn = ConfigurationManager.AppSettings.Get("IPAddress");
            terminalIPAddress.SetIPAddress();

            if (terminalIPAddress.DiagRequestOut == "0")
            {
                logDetails.Append("PED IP Address set Correctly\n");
            }
            else
            {
                logDetails.Append("PED IP Address NOT set Correctly\n");
            }

            //check status at Idle
            terminalStatus.GetTerminalState();


            if (terminalStatus.StateOut == 1)
            {
                logDetails.Append("PED at Idle for PCD initialisation\n");
            }
            else
            {
                logDetails.Append("PED NOT at Idle for PCD initialisation\n");
            }

            //Launch the PCD call
            initPCDCall.Launch();

            if (initPCDCall.DiagRequestOut == "0")
            {
                logDetails.Append("The PED PCD initiation request is sent to the PED\n");
            }
            else
            {
                logDetails.Append("The PED PCD initiation request was NOT sent to the PED\n");
            }

            File.WriteAllText(ConfigurationManager.AppSettings.Get("LogPath"), logDetails.ToString());
        }
コード例 #2
0
ファイル: MakoPrintIngenico.cs プロジェクト: MakoLab/fractus
        public static void PrintValue(string amount, string label)
        {
            TerminalIPAddress PedIP    = new TerminalIPAddress();
            SSLCertificate    PedSSL   = new SSLCertificate();
            Status            PedState = new Status();

            PedIP.IPAddressIn = "192.168.1.58";

            PedIP.SetIPAddress();
            PedSSL.PathIn = "E:\\TerminalRoot.pem";
            PedSSL.SetPath();
            PedState.GetTerminalState();

            Transaction PedTRN = new Transaction();

            PedTRN.MessageNumberIn   = "11";
            PedTRN.Amount1In         = amount;
            PedTRN.Amount1LabelIn    = label;
            PedTRN.TransactionTypeIn = "00";
            PedTRN.DoTransaction();
        }