public async Task <IActionResult> DeclinePay(Guid studyRoomSessionId, CancellationToken token) { var command = new DeclinePaymentCommand(studyRoomSessionId); await _commandBus.DispatchAsync(command, token); return(Ok()); }
public ActionResult DeclinePayment(Payment payment, DeclinePaymentCommand declinePaymentCommand, User currentUser) { Require.NotNull(payment, "payment"); Require.NotNull(declinePaymentCommand, "declinePaymentCommand"); if (!ModelState.IsValid) { return(View("DeclinePayment", new DeclinePaymentViewModel(payment, declinePaymentCommand))); } PaymentService.DeclinePayment(payment, declinePaymentCommand.DeclineReason, currentUser); return(RedirectToAction("Index")); }