public Task <string> ProcessCommand(CreateOrderFlowContext context, IFlowCommand command)
        {
            return(command switch
            {
                SubmitPaymentDetailsCommand submitCommand => DoProcessing(context, submitCommand),
                GoToContactDetailsCommand goToContactCommand => DoProcessing(context, goToContactCommand),

                _ => throw new UnsupportedCommandException(),
            });
Esempio n. 2
0
 public Task <IActionResult> SubmitPaymentDetails(string flowState, SubmitPaymentDetailsCommand command)
 {
     return(ProcessCommand(flowState, command));
 }
Esempio n. 3
0
        public Task <SummaryPageViewModel> GetSummaryPage(CreateOrderFlowContext context, SubmitPaymentDetailsCommand command)
        {
            var reservationCode = new Random().Next(1111, 9999).ToString();

            var viewModel = new SummaryPageViewModel
            {
                FlowContext = context,
                OrderCode   = reservationCode,
            };

            return(Task.FromResult(viewModel));
        }
Esempio n. 4
0
        public Task <PaymentDetailsViewModel> GetPaymentPage(CreateOrderFlowContext context, SubmitPaymentDetailsCommand command)
        {
            var viewModel = new PaymentDetailsViewModel
            {
                FlowContext   = context,
                PaymentMethod = command?.PaymentMethod ?? context.PaymentMethod,
            };

            return(Task.FromResult(viewModel));
        }