/// <summary>
        /// Sends event for ethereum poayment to azure queue
        /// </summary>
        /// <param name="userContract"></param>
        /// <param name="amount"></param>
        /// <returns></returns>
        public async Task FirePaymentEvent(string userContract, decimal amount)
        {
            try
            {
                var model = new EthereumCashInModel
                {
                    Amount   = amount,
                    Contract = userContract
                };

                var json = JsonConvert.SerializeObject(model);

                await _queue.PutRawMessage(json);
            }
            catch (Exception e)
            {
                await _logger.WriteError("ApiCallService", "FirePaymentEvent", $"Contract : {userContract}, amount: {amount}", e);
            }
        }
Exemplo n.º 2
0
        public void Warning(string title, string message)
        {
            var obj = new
            {
                Data = new
                {
                    BroadcastGroup = 100,
                    MessageData    = new
                    {
                        Subject = title,
                        Text    = message
                    }
                }
            };

            var str = "PlainTextBroadcast:" + JsonConvert.SerializeObject(obj);

            _queue.PutRawMessage(str);
        }
 public async Task PushContract(string contract)
 {
     await _queue.PutRawMessage(contract);
 }