Ejemplo n.º 1
0
        public async Task SimulateReceivePayment(ReceivePaymentRequest request)
        {
            var payment = await _queryProcessor.ProcessAsync(new GetPaymentByInvoiceIdQuery(request.InvoiceId), CancellationToken.None);

            if (payment == null)
            {
                throw new ArgumentException($"No payment found for invoice {request.InvoiceId}");
            }
            await _commandBus.PublishAsync(new ReceivePaymentCommand(PaymentId.With(payment.PaymentId), payment.InvoiceId, request.Amount), CancellationToken.None);
        }
Ejemplo n.º 2
0
 public async Task SimulateReceivePayment([FromBody] ReceivePaymentRequest request)
 {
     await _paymentService.SimulateReceivePayment(request);
 }