internal void GiveHandler(TransactionProtocol message, ConnectionParam connection)
        {
            if (string.IsNullOrWhiteSpace(message.Transaction) == false)
            {
                ErrorHandler(message, connection);
            }
            var task   = RequestStorage.GetInstance().GetTransaction();
            var buffer = ConvertToByteArray(task);

            connection.Socket.Send(buffer);
        }
        internal void AddHandler(TransactionProtocol message, ConnectionParam connection)
        {
            if (string.IsNullOrWhiteSpace(message.Request_id) || string.IsNullOrWhiteSpace(message.Sender_id) ||
                string.IsNullOrWhiteSpace(message.Transaction))
            {
                ErrorHandler(message, connection);
                return;
            }
            var request_storage = RequestStorage.GetInstance();

            request_storage.AddTransaction(message);
            var connection_storage = ConnectionStorage.GetInstance();

            connection_storage.AddConnection(connection, message.Request_id);
        }
Beispiel #3
0
        public void AddTransactionTest()
        {
            var transaction = new Transaction()
            {
                owner_card_id     = "gafdwaaw",
                aditional_comment = "gadwad",
                transactionType   = API_Transaction.Enums.TransactionType.Authorization,
                ccy = "MDL",
                transaction_summ = 1234
            };
            var sender = new TransactionProtocol()
            {
                Type_message = API_Transaction.Enums.TypeMessage.add,
                Transaction  = JsonConvert.SerializeObject(transaction),
                Request_id   = "51231254",
                Sender_id    = "5123124",
            };

            // var manager = new ApiManager();
            RequestStorage.GetInstance().AddTransaction(sender);

            var test_response = RequestStorage.GetInstance().GetTransaction();
        }