public ActionResult Substantiate(string id) { var command = new VerifyCardUse { ClaimRequestId = id, Comments = "", }; try { var response = _commandSender.Send(command); if (response.CommandStatus == CommandStatusEnum.Failed) { ModelState.AddModelError("ResponseError", response.Message); } return RedirectToAction("Index"); } catch (TimeoutException toe) { ModelState.AddModelError("TimeOutError", toe.Message); return RedirectToAction("Index"); } catch (Exception ex) { ModelState.AddModelError("Error", ex.Message); return RedirectToAction("Index"); } }
public void VerifyClaimRequest(VerifyCardUse command) { if (_state.CurrentClaimState == ClaimRequestStateEnum.PendingSubstantiation) { RaiseCardUseVerifiedEvent(command.ClaimRequestId); } else { throw new DomainException( string.Format( "Received a command to verify card use, but this claim request is not in a state [{0}] to process that command.", _state.CurrentClaimState)); } }