public async Task <IActionResult> Expired([FromBody] TransactionExpiredRequest request)
        {
            IEnumerable <IPaymentRequestTransaction> txs =
                await _transactionsService.GetByBcnIdentityAsync(request.Blockchain, request.IdentityType, request.Identity);

            foreach (IPaymentRequestTransaction tx in txs)
            {
                await _paymentRequestService.UpdateStatusAsync(tx.WalletAddress);
            }

            return(Ok());
        }
Beispiel #2
0
        public async Task UpdateTransactionAsync(IUpdateTransactionCommand command)
        {
            await _transactionsService.UpdateAsync(command);

            if (string.IsNullOrEmpty(command.WalletAddress))
            {
                IEnumerable <IPaymentRequestTransaction> txs =
                    await _transactionsService.GetByBcnIdentityAsync(command.Blockchain, command.IdentityType, command.Identity);

                foreach (IPaymentRequestTransaction tx in txs)
                {
                    await _paymentRequestService.UpdateStatusAsync(tx.WalletAddress);
                }
            }
            else
            {
                await _paymentRequestService.UpdateStatusAsync(command.WalletAddress);
            }
        }
Beispiel #3
0
        public async Task <IActionResult> Expired([FromBody] TransactionExpiredRequest request)
        {
            try
            {
                IEnumerable <IPaymentRequestTransaction> txs =
                    await _transactionsService.GetByBcnIdentityAsync(request.Blockchain, request.IdentityType, request.Identity);

                foreach (IPaymentRequestTransaction tx in txs)
                {
                    await _paymentRequestService.UpdateStatusAsync(tx.WalletAddress);
                }

                return(Ok());
            }
            catch (Exception ex)
            {
                await _log.WriteErrorAsync(nameof(TransactionsController), nameof(Expired), ex);

                throw;
            }
        }