public ActionResult GetOrder(string orderId)
        {
            var orderService = new OrderServiceProvider();

            var visitorOrderRequest = new GetVisitorOrderRequest(orderId,
                                                                 "Entity-Customer-34d758ae2d2d472d89014954d0cc4440", "CommerceEngineDefaultStorefront");
            var result = orderService.GetVisitorOrder(visitorOrderRequest);

            return(View(result));
        }
コード例 #2
0
        public ManagerResponse <GetVisitorOrderResult, CommerceOrder> GetOrderDetails(string userId, string orderId)
        {
            Assert.ArgumentNotNullOrEmpty(userId, nameof(userId));
            Assert.ArgumentNotNullOrEmpty(orderId, nameof(orderId));

            if (StorefrontContext.Current == null)
            {
                throw new InvalidOperationException("Cannot be called without a valid storefront context.");
            }

            var request = new GetVisitorOrderRequest(orderId, userId, StorefrontContext.Current.ShopName);
            var result  = OrderServiceProvider.GetVisitorOrder(request);

            result.WriteToSitecoreLog();
            return(new ManagerResponse <GetVisitorOrderResult, CommerceOrder>(result, result.Order as CommerceOrder));
        }