public async Task <IActionResult> Continue(Guid id, PaymentOptionsStateVm paymentOptionsStateVm) { // Restore VM from state field, so that form is as it was before moving on to next step var paymentOptionsVm = DeserialiseModel <PaymentOptionsVm>(paymentOptionsStateVm.FilledInState); Debug.Assert(paymentOptionsVm.InitialState == null, "Serialisation Loop Detected - InitialState should be marked as JsonIgnore"); // Process as if user posted it return(await ProcessPaymentOptionsPost(id, paymentOptionsVm)); }
public IActionResult OneOffCancel(Guid id, PaymentOptionsStateVm paymentOptionsStateVm) { // Construct model for Cancel view var cancelVm = new ReturnToFormVm { State = paymentOptionsStateVm.FilledInState, StateFieldName = nameof(PaymentOptionsStateVm.FilledInState), StateType = nameof(PaymentOptionsVm), ReturnControllerName = ControllerName, ReturnActionName = nameof(Continue) }; return(View("PaymentCancel", cancelVm)); }
public IActionResult Change(Guid id, PaymentOptionsStateVm paymentOptionsStateVm) { // Restore VM from state field, so that form is as it was before moving on to next step var paymentOptionsVm = DeserialiseModel <PaymentOptionsVm>(paymentOptionsStateVm.FilledInState); Debug.Assert(paymentOptionsVm.InitialState == null, "Serialisation Loop Detected - InitialState should be marked as JsonIgnore"); // Save state for round-trip (to re-populate lists, messages etc) paymentOptionsVm.InitialState = paymentOptionsStateVm.FilledInState; paymentOptionsVm.SelectedPlanSetupOption = PlanSetupOptions.None; paymentOptionsVm.DirectDebitAmount = null; return(View("Index", paymentOptionsVm)); }