public IActionResult Create()
        {
            var user = _appUserParser.Parse(HttpContext.User);
            var vm   = _orderSvc.MapUserInfoIntoOrder(user, new Order());

            vm.CardExpirationShortFormat();

            return(View(vm));
        }
Example #2
0
        public async Task <IActionResult> Create()
        {
            var user  = _appUserParser.Parse(HttpContext.User);
            var order = await _basketSvc.GetOrderDraft(user.Id);

            var vm = _orderSvc.MapUserInfoIntoOrder(user, order);

            vm.CardExpirationShortFormat();

            return(View(vm));
        }
Example #3
0
        public async Task <IActionResult> Create()
        {
            var user  = _appUserParser.Parse(HttpContext.User);
            var order = await _basketSvc.GetOrderDraft(user.Id);

            order.OrderItems.ForEach(i => i.ConvertedPrice = i.UnitPrice * order.CurrencyRate);

            var vm = _orderSvc.MapUserInfoIntoOrder(user, order);

            vm.CardExpirationShortFormat();

            return(View(vm));
        }
Example #4
0
        private async Task GetOrder(IDialogContext context)
        {
            var botUserData = await identityService.GetBotDataAsync(context);

            var authUser = botUserData.GetUserAuthData();
            var userData = botUserData.GetUserData();

            var basket = await basketService.GetBasket(authUser.UserId, authUser.AccessToken);

            var orderFromBasket = basketService.MapBasketToOrder(basket);

            order = orderingService.MapUserInfoIntoOrder(userData, orderFromBasket);
            order.CardExpirationShortFormat();
            order.RequestId = Guid.NewGuid();
        }