Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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));
        }