public Task <Unit> Handle(TimeOutPayment command, CancellationToken cancellationToken)
 {
     return(paymentRepository.GetAndUpdate(
                command.PaymentId,
                payment => payment.TimeOut(),
                cancellationToken));
 }
示例#2
0
    public async Task <IActionResult> TimeoutPayment(Guid id, [FromBody] TimeOutPaymentRequest?request)
    {
        var command = TimeOutPayment.Create(
            id,
            request?.TimedOutAt
            );

        await commandBus.Send(command);

        return(Ok());
    }