Example #1
0
        public Guid Execute(Transfer transaction)
        {
            var transactionId = _accountHandler.BlockAmmount(transaction.Origin, transaction.Ammount);

            try
            {
                _accountHandler.SendMoney(transaction.Destiny, transaction.Ammount, transactionId);
                _accountHandler.ConfirmTransaction(transactionId);
            }
            catch (Exception)
            {
                _accountHandler.RevertTransaction(transactionId);
                throw;
            }

            return(transactionId);
        }