Exemple #1
0
        protected override void RunCallback()
        {
            var dbFactory = new DbFactory();
            var time      = new TimeService(dbFactory);

            var settings = new SettingsService(dbFactory);

            var lastSyncDate = settings.GetReturnsDataReadDate(_api.Market, _api.MarketplaceId);

            LogWrite("Last sync date=" + lastSyncDate);

            var walmartReader = new WalmartReturnInfoReader(GetLogger(),
                                                            time,
                                                            (WalmartApi)_api,
                                                            dbFactory,
                                                            AppSettings.WalmartReportBaseDirectory,
                                                            AppSettings.WalmartFeedBaseDirectory);

            if (!lastSyncDate.HasValue ||
                (time.GetUtcTime() - lastSyncDate) > _betweenProcessingInverval)
            {
                walmartReader.UpdateReturnInfo();

                settings.SetReturnsDataReadDate(time.GetUtcTime(), _api.Market, _api.MarketplaceId);
            }
        }
Exemple #2
0
        public void ReadRefunds(WalmartApi api)
        {
            var walmartReader = new WalmartReturnInfoReader(_log,
                                                            _time,
                                                            (WalmartApi)api,
                                                            _dbFactory,
                                                            AppSettings.WalmartReportBaseDirectory,
                                                            AppSettings.WalmartFeedBaseDirectory);

            walmartReader.UpdateReturnInfo();
        }