Esempio n. 1
0
        static void Main()
        {
            teleBot = new TelegramBotClient(AppInfo.TelegramToken);
            nl      = new NLModel();

            //telegram
            try
            {
                var telegram = teleBot.GetMeAsync().Result;
                Console.WriteLine(
                    $"{telegram.FirstName} работает."
                    );
                teleBot.OnMessage += Bot_OnMessage;
                teleBot.StartReceiving();
            }
            catch (Exception e) { Console.WriteLine("Ошибка при запуске Telegram бота: " + e.Message); }

            Thread.Sleep(int.MaxValue);
        }
Esempio n. 2
0
        public object CreateOrdByNL(decimal money)
        {
            var data = new NLModel()
            {
                return_url       = "http://*****:*****@gmail.com",
                transaction_info = "Thanh toan bang NL",
                order_code       = Convert.ToString((new Random()).Next(100000)),
                price            = money.ToString(),
                currency         = "vnd",
                quantity         = "1",
                tax               = "1000",
                discount          = "0",
                fee_cal           = "0",
                fee_shipping      = "1000",
                order_description = "Demo Payment",
                buyer_info        = "",
                affiliate_code    = "",
                cancel_url        = "http://localhost:55070/NLPayment/Index",
                time_limit        = DateTime.Now.AddMinutes(5).ToString("dd/MM/yyyy,hh:mm")
            };

            return(new PaymentRequest().buildCheckoutUrlNew(data));
        }