Beispiel #1
0
        public async Task <bool> ValidateStoreInstalled(Models.EDM.tblSeller storeData)
        {
            bool isExist = false;

            try
            {
                var shopService = new ShopifySharp.ShopService(storeData.ShopDomain, storeData.ShopifyAccessToken);
                var shopDetails = await shopService.GetAsync();

                isExist = true;
            }
            catch (ShopifySharp.ShopifyException ex)
            {
                if (ex.HttpStatusCode == System.Net.HttpStatusCode.Unauthorized && ex.Message == "Error: [API] Invalid API key or access token (unrecognized login or wrong password)")
                {
                    isExist = false;
                    Log.Error("Error in ValidateStoreInstalled method in class Sellerservice.cs", ex);
                }
                else
                {
                    isExist = true;
                }
            }

            return(isExist);
        }
Beispiel #2
0
 public async Task UpdateSellerDetails(Models.EDM.tblSeller seller)
 {
     try
     {
         db.Entry(seller).State = EntityState.Modified;
         await db.SaveChangesAsync();
     }
     catch (Exception ex)
     {
         Log.Error("Error in UpdateSellerDetails in SellerService.cs", ex);
     }
 }