/// <summary> /// Queues a login command with a set of credentials /// </summary> /// <param name="creds">The credentials to login with</param> /// <param name="bankId">The bank id to use</param> /// <returns>A step in progress</returns> public IStepDefinition Login(ICredentials creds, Guid bankId) { var queue = "bank_login_queue"; //todo: Make this an app setting Infrastrucure.CreateQueue(queue); creds.BankId = bankId; var step = new StepDefinition() { Id = Guid.NewGuid(), Successful = false, Field = "", Data = "", NextStep = null }; creds.StepId = step.Id; Infrastrucure.SendBackedMessage(queue, new BrokeredMessage(creds), "steps", step); return step; }
private BankInformation getUSAA() { var bank = new BankInformation() { Canonical = "USAA", Homepage = new Uri("http://usaa.com"), Id = Guid.Parse("3dd8f83d-d338-4157-a1b0-9d39a443796f"), Logo = new Uri("http://hahah.com"), Steps = new List<StepDefinition>() }; var user = new StepDefinition() { Data = "User Name", Field = "UserName" }; var pass = new StepDefinition() { Data = "Password", Field = "Password" }; var pin = new StepDefinition() { Data = "Pin", Field = "Pin" }; var q = new StepDefinition() { Data = "What is your mother's maiden name?", Field = "Question" }; bank.Steps.Add(user); bank.Steps.Add(pass); bank.Steps.Add(pin); bank.Steps.Add(q); return bank; }
/// <summary> /// Attempts to login with a set of credentials /// </summary> /// <param name="credentials">The credentials to login with</param> /// <param name="bankId">The bank id to login to</param> /// <returns>A step</returns> public IStepDefinition Login(ICredentials credentials, Guid bankId) { var creds = credentials as Credentials; var step = new StepDefinition(); this._currentStep = Guid.NewGuid(); step.Id = _currentStep; Steps.Add(this._currentStep, step); _bank.Login(creds); return step; }