public Event CancelTranferAmountBetweenAccounts(string transactionId, string fromAccountId, string toAccountId, decimal amount)
        {
            Validate(transactionId, fromAccountId, toAccountId, amount);

            var creditFrom = new CheckingAccountLine(transactionId, fromAccountId, +amount, GetRevertingMessage());

            operations.Add(creditFrom);

            var debitTo = new CheckingAccountLine(transactionId, toAccountId, -amount, GetRevertingMessage());

            operations.Add(debitTo);

            return(TransferServiceEventFactory.BuildTransferCanceledEvent(transactionId));
        }
        public Event TranferAmountBetweenAccounts(string transactionId, string fromAccountId, string toAccountId, decimal amount)
        {
            Validate(transactionId, fromAccountId, toAccountId, amount);

            var debitFrom = new CheckingAccountLine(transactionId, fromAccountId, -amount, GetTransferingDescription(toAccountId));

            operations.Add(debitFrom);

            var creditTo = new CheckingAccountLine(transactionId, toAccountId, +amount, GetTransferingDescription(fromAccountId));

            operations.Add(creditTo);

            return(TransferServiceEventFactory.BuildTransferSucceededEvent(transactionId));
        }
 private async Task ProcessCancellationFailureAsync(MessageHeader header, Exception exception)
 {
     var transferFailed = TransferServiceEventFactory.BuildOtherReasonTransferFailedEvent(header.TransactionId, exception);
     await eventProducer.ProduceAsync(transferFailed);
 }