Esempio n. 1
0
        public async Task <ActionResult> Complete(CompletePaymentRequest completePaymentRequest)
        {
            try
            {
                //todo: send cart data with order
                ViewBag.PaymentConfirmation = await _checkoutService.Complete(completePaymentRequest, _isSandbox);

                var cart = await _cartService.GetCartViewModel(_session.SessionId());

                var orderId = await _orderService.Create(await GetOrderModel(), cart);

                await _cartService.EmptyCart(_session.SessionId());

                return(RedirectToAction("OrderConfirmation", "Checkout", new { id = orderId }));
            }
            catch (PaymentsException ex)
            {
                return(Content(ex.Response));
            }
        }