コード例 #1
0
ファイル: PaymentService.cs プロジェクト: cykelbud/lrms
        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);
        }
コード例 #2
0
ファイル: PaymentController.cs プロジェクト: cykelbud/lrms
 public async Task SimulateReceivePayment([FromBody] ReceivePaymentRequest request)
 {
     await _paymentService.SimulateReceivePayment(request);
 }