示例#1
0
        public async Task UpdatePayment(int id, Guid bankPaymentId, bool success)
        {
            var payment = await _repository.GetPayment(id);

            if (payment == null)
            {
                throw new NotFoundException(nameof(Payment), id);
            }

            payment.BankPaymentId = bankPaymentId;
            payment.Status        = success ? PaymentStatus.Success : PaymentStatus.Failure;
            payment.Processed     = DateTime.Now;

            await _repository.UpdatePayment(payment);

            await _unitOfWork.Commit();
        }