private async Task ProcessHotWalletCashout(ProcessHotWalletErc20EventCommand queueMessage) { string transactionId = queueMessage.OperationId; CashOutContextData context = await _transactionService.GetTransactionContext <CashOutContextData>(transactionId); if (context == null) { _log.Error(new NullReferenceException("Context is null for hotwallet cashout"), context: queueMessage.ToJson()); return; } string clientId = context.ClientId; string hash = queueMessage.TransactionHash; string cashOperationId = context.CashOperationId; var clientAcc = await _clientAccountClient.GetByIdAsync(clientId); var clientEmail = await _personalDataService.GetEmailAsync(clientId); await _cashOperationsRepositoryClient.UpdateBlockchainHashAsync(clientId, cashOperationId, hash); await _srvEmailsFacade.SendNoRefundOCashOutMail(clientAcc.PartnerId, clientEmail, context.Amount, context.AssetId, hash); }
public async Task Process(HashEvent ev) { var tx = await _bitcoinTransactionRepository.FindByTransactionIdAsync(ev.Id); if (tx == null) { return; } string hash = ev.Hash; switch (tx.CommandType) { case BitCoinCommands.CashOut: var cashOutContext = await _transactionService.GetTransactionContext <CashOutContextData>(tx.TransactionId); var clientAcc = await _сlientAccountClient.GetByIdAsync(cashOutContext.ClientId); var clientEmail = await _personalDataService.GetEmailAsync(cashOutContext.ClientId); await _cashOperationsRepositoryClient.UpdateBlockchainHashAsync(cashOutContext.ClientId, cashOutContext.CashOperationId, hash); await _srvEmailsFacade.SendNoRefundOCashOutMail(clientAcc.PartnerId, clientEmail, cashOutContext.Amount, cashOutContext.AssetId, hash); break; } }