示例#1
0
        public static void RunShopifyFulfillmentEmail()
        {
            var orderId       = CommandLineHelpers.SolicitOrderShopifyId();
            var fulfillmentId = CommandLineHelpers.SolicitShopifyFulfillmentId(1767491698732);

            Autofac.RunInScope(scope =>
            {
                var instanceContext = scope.Resolve <InstanceContext>();
                var fulfillmentApi  = scope.Resolve <FulfillmentApi>();

                var json = new
                {
                    fulfillment = new
                    {
                        id = fulfillmentId,
                        notify_customer = true,
                    },
                    tracking_numbers = new []
                    {
                        "1ZY1234567890"
                    }
                }.SerializeToJson();

                var TestInstanceId = CommandLineHelpers.SolicitInstanceId();
                instanceContext.Initialize(TestInstanceId);
                fulfillmentApi.Update(orderId, fulfillmentId, json);
            });
        }
示例#2
0
        public static void RunAcumaticaOrderSync()
        {
            var shopifyOrderId = CommandLineHelpers.SolicitOrderShopifyId();

            Autofac.RunInScope(scope =>
            {
                var instanceContext  = scope.Resolve <InstanceContext>();
                var acumaticaContext = scope.Resolve <AcumaticaHttpContext>();
                var orderSync        = scope.Resolve <AcumaticaOrderPut>();

                var TestInstanceId = CommandLineHelpers.SolicitInstanceId();
                instanceContext.Initialize(TestInstanceId);
                acumaticaContext.SessionRun(() => orderSync.RunOrder(shopifyOrderId));
            });
        }
示例#3
0
        public static void RunShopifyOrderRetrieve()
        {
            Autofac.RunInScope(scope =>
            {
                var id = CommandLineHelpers.SolicitOrderShopifyId();

                var instanceContext = scope.Resolve <InstanceContext>();
                var shopifyOrderApi = scope.Resolve <OrderApi>();
                var logger          = scope.Resolve <IPushLogger>();

                var TestInstanceId = CommandLineHelpers.SolicitInstanceId();
                instanceContext.Initialize(TestInstanceId);
                var json       = shopifyOrderApi.Retrieve(id);
                var compressed = json.SerializeToJson(Formatting.None).ToBase64Zip();

                logger.Info($"Shopify Order size: {json.Length} bytes - (compressed {compressed.Length} bytes)");
            });
        }