public void ProcessFee_Action_Should_Redirect_To_ProcessCreditCard_If_InsufficientFee_Saved() { var orderId = 1; var viewModel = new DeclinedOrderFeeConfirmationViewModel() { OrderId = orderId, }; var actionResult = _target.ProcessFee(viewModel); actionResult.Should().NotBeNull().And.BeOfType<RedirectToRouteResult>(); ((RedirectToRouteResult)actionResult).RouteValues.Should().HaveCount(2); ((RedirectToRouteResult)actionResult).RouteValues["action"].Should().Be(NameHelper.OrderCreationWizard.ProcessCreditCard); ((RedirectToRouteResult)actionResult).RouteValues["orderId"].Should().Be(orderId); }
public DeclinedOrderFeeConfirmationViewModel GetInsufficientFeeConfirmation(int orderId, OrderFeesCalculationResults calculationResults = null) { var order = _orderManager.GetOrderById(orderId); CheckOrderAccessForClients(order); var viewModel = new DeclinedOrderFeeConfirmationViewModel(); viewModel.FeeConfirmation = calculationResults == null ? new OrderFeeConfirmationViewModel(order.FeeInfo) : new OrderFeeConfirmationViewModel(calculationResults); viewModel.InsufficientFeeConfirmation = calculationResults == null ? new OrderFeeConfirmationViewModel(order.FeeInfo) : new OrderFeeConfirmationViewModel(calculationResults); var insufficientFee = _orderManager.CalculateInsufficientFee(order); viewModel.InsufficientFeeConfirmation.AppraisalFee = insufficientFee != default(decimal) ? insufficientFee : viewModel.FeeConfirmation.AppraisalFee; viewModel.Difference = (double)(viewModel.InsufficientFeeConfirmation.AppraisalFee - viewModel.FeeConfirmation.AppraisalFee); viewModel.OrderNumber = GetOrderNumber(order); return viewModel; }
public ActionResult CancelOrderRefund(DeclinedOrderFeeConfirmationViewModel viewModel) { _orderService.UpdateOrderStatus(viewModel.OrderId, OrderStatus.Cancelled); CommitProviderInstance.Commit(); return RedirectToClientPipeline(); }
public ActionResult FeeConfirmation(DeclinedOrderFeeConfirmationViewModel viewModel, int nextStep) { var nextTab = SafeConvert.ToEnum<OrderCreationWizardTabOrder>(nextStep).Value; bool isSavePressed = IsSavePressed(nextTab, OrderCreationWizardTabOrder.FeeConfirmation); return isSavePressed ? RedirectToClientPipeline() : RedirectToStep(nextTab, viewModel.OrderId); }
public ActionResult ProcessFee(DeclinedOrderFeeConfirmationViewModel viewModel) { var nextTab = OrderCreationWizardTabOrder.ProcessCreditCard; return RedirectToStep(nextTab, viewModel.OrderId); }