public GetUserAlertsJob() { this.Logger = LogManager.GetLogger(); ItGoesChaChing.Ebay.ILogger clientAlertsLogger = this.Logger as ItGoesChaChing.Ebay.ILogger; this.ApiCall = new GetUserAlertsCall(clientAlertsLogger); }
public void DebugAlerts() { if (this.Context.Accounts.Count == 0) { return; } Account account = this.Context.Accounts[0]; string sessionData = account.SessionData; IJsonWebRequest jsonService = new JsonServiceStub( Test.StartJson + Test.FeedbackReceivedJson + "," + Test.AskSellerQuestion + "," + Test.AskSellerQuestion2 + "," + Test.FixedPriceTransactionJson + Test.EndJson); ItGoesChaChing.Ebay.ILogger logger = this.Logger as ItGoesChaChing.Ebay.ILogger; GetUserAlertsCall alertsCall = new GetUserAlertsCall(logger, jsonService); GetUserAlertsJob job = new GetUserAlertsJob(this.Logger, alertsCall); List <AlertBase> alerts = job.GetUserAlerts(account); alerts[0].Timestamp = System.DateTime.Now.AddSeconds(1); alerts[1].Timestamp = System.DateTime.Now.AddSeconds(4); alerts[2].Timestamp = System.DateTime.Now.AddSeconds(8); alerts[3].Timestamp = System.DateTime.Now.AddSeconds(12); QueueAlerts(alerts); account.SessionData = sessionData; }
public void Login(Account account) { EbayContext context = new EbayContext(account.EbayToken); // Get the Token // TODO: Initial failure point is on login here.... string userAlertsToken = null; { GetUserAlertsToken command = new GetUserAlertsToken(context); command.Execute(); userAlertsToken = command.ClientAlertsAuthToken; } // Login ... ItGoesChaChing.Ebay.ILogger clientAlertsLogger = this.Logger as ItGoesChaChing.Ebay.ILogger; LoginCall apiCall = new LoginCall(clientAlertsLogger); apiCall.ApiRequest.ClientAlertsAuthToken = userAlertsToken; apiCall.Execute(); account.SessionID = apiCall.ApiResponse.SessionID; account.SessionData = apiCall.ApiResponse.SessionData; }
public void Logout(Account account) { if (account.SessionData == null) { return; // There is no need to logout as the Account isn't logged in. } ItGoesChaChing.Ebay.ILogger clientAlertsLogger = this.Logger as ItGoesChaChing.Ebay.ILogger; LogoutCall apiCall = new LogoutCall(clientAlertsLogger); apiCall.ApiRequest.SessionID = account.SessionID; apiCall.ApiRequest.SessionData = account.SessionData; apiCall.Execute(); }