Exemple #1
0
        public async Task InitializeAsync()
        {
            var policy = new SmartRetryExecutionPolicy();

            DiscountCodeService.SetExecutionPolicy(policy);
            PriceRuleService.SetExecutionPolicy(policy);

            // Create one for count, list, get, etc. orders.
            await Create(Code);
        }
Exemple #2
0
        private async Task <PriceRule> CreatePriceRule(PriceRule rule, bool skipAddToCreatedList)
        {
            var obj = await PriceRuleService.CreateAsync(rule);

            if (!skipAddToCreatedList)
            {
                CreatedPriceRules.Add(obj);
            }

            return(obj);
        }
Exemple #3
0
 private async Task DeletePriceRules()
 {
     foreach (var obj in CreatedPriceRules)
     {
         try
         {
             await PriceRuleService.DeleteAsync(obj.Id.Value);
         }
         catch (ShopifyException ex)
         {
             if (ex.HttpStatusCode != HttpStatusCode.NotFound)
             {
                 Console.WriteLine($"Failed to delete created PriceRule with id {obj.Id.Value}. {ex.Message}");
             }
         }
     }
 }
Exemple #4
0
        public AppTest()
        {
            var priceRuleSvc = new PriceRuleService();

            co = new Checkout(priceRuleSvc.GetPricingRules());
        }