public ContactInfoViewData UserContactCreate() { string accountMasterExternalId = "9509"; string loginEmail = "*****@*****.**"; ContactInfoModel contactInfo = new ContactInfoModel { FirstName = "QA", LastName = "Automation", Company = "Softtek", Email = "*****@*****.**", PhoneNumber = "0987654" }; //Create an Account Master and an Account asociated with it CreateAccountMasterRequest request = new CreateAccountMasterRequest { CreatedBy = System.Security.Principal.WindowsIdentity.GetCurrent().Name, CreatedUtc = DateTime.UtcNow, ExternalIdentifier = accountMasterExternalId, IsWebEnabled = true, Name = contactInfo.Company, PlatformIdentifier = new Guid(PlatformIdentifier), TermsConfiguration = new TermsConfiguration { HasPaymentTerms = true, TermsDescription = "40 Net Days, cool Stuff" } }; var accountMasterResponse = IntegrationsClient.AccountMaster.Create(request).Result; //Get the Account created by the Above Method GetAccountAccountMasterRequest getAccountAccountMasterRequest = new GetAccountAccountMasterRequest { externalId = accountMasterExternalId }; var getAccountAccountMasterResponse = CustomerServiceClient.Logins.GetAccountByAccountMasterExternalId(getAccountAccountMasterRequest).Result; //Create a Login/User/Contact providing the AccountMaster and the Account Identifier CreateLoginUserContactRequest createLoginUserContactRequest = new CreateLoginUserContactRequest { AccountIdentifier = getAccountAccountMasterResponse.Result.AccountIdentifier, AccountMasterIdentifier = getAccountAccountMasterResponse.Result.AccountMasterIdentifier, ConfirmPassword = "******", Password = "******", ContactEmail = contactInfo.Email, Email = loginEmail, FirstName = contactInfo.FirstName, LastName = contactInfo.LastName, PlatformIdentifier = new Guid(PlatformIdentifier), PhoneNumber = contactInfo.PhoneNumber }; var createLoginUserContactResponse = CustomerServiceClient.Logins.CreateContactUserLogin(createLoginUserContactRequest).Result; return(new ContactInfoViewData { Email = loginEmail, Password = "******", Contact = contactInfo }); }
public LoginModel UserWithNoTermsAsPaymentOption() { string email = "*****@*****.**"; string accountMasterExternalId = "5372225"; Processor.ClearUserLoginByEmail(email).Wait(); //Create an Account Master and an Account asociated with it CreateAccountMasterRequest request = new CreateAccountMasterRequest { CreatedBy = System.Security.Principal.WindowsIdentity.GetCurrent().Name, CreatedUtc = DateTime.UtcNow, ExternalIdentifier = accountMasterExternalId, IsWebEnabled = true, Name = "Softtek", PlatformIdentifier = new Guid(PlatformIdentifier), TermsConfiguration = new TermsConfiguration { HasPaymentTerms = false, TermsDescription = "40 Net Days, cool Stuff" } }; var accountMasterResponse = IntegrationsClient.AccountMaster.Create(request).Result; //Get the Account created by the Above Method GetAccountAccountMasterRequest getAccountAccountMasterRequest = new GetAccountAccountMasterRequest { externalId = accountMasterExternalId }; var getAccountAccountMasterResponse = CustomerServiceClient.Logins.GetAccountByAccountMasterExternalId(getAccountAccountMasterRequest).Result; //Create a Login/User/Contact providing the AccountMaster and the Account Identifier CreateLoginUserContactRequest createLoginUserContactRequest = new CreateLoginUserContactRequest { AccountIdentifier = getAccountAccountMasterResponse.Result.AccountIdentifier, AccountMasterIdentifier = getAccountAccountMasterResponse.Result.AccountMasterIdentifier, ConfirmPassword = "******", Password = "******", ContactEmail = "*****@*****.**", Email = email, FirstName = "Softtek", LastName = "Test User", PlatformIdentifier = new Guid(PlatformIdentifier), PhoneNumber = "123456789" }; var createLoginUserContactResponse = CustomerServiceClient.Logins.CreateContactUserLogin(createLoginUserContactRequest).Result; return(new LoginModel { Email = email, Password = "******" }); }
public AddressViewData UserWithAccountAddress() { string accountMasterExternalId = "9509"; string loginEmail = "*****@*****.**"; AddressModel accountAddress = new AddressModel { street = "Elm street", country = "US", CompanyName = "KDA", postal = "22780", city = "Boulder", state = "CO", apartment = "apt B" }; Processor.ClearUserLoginByEmail(loginEmail).Wait(); try { //Create an Account Master and an Account asociated with it CreateAccountMasterRequest request = new CreateAccountMasterRequest { CreatedBy = System.Security.Principal.WindowsIdentity.GetCurrent().Name, CreatedUtc = DateTime.UtcNow, ExternalIdentifier = accountMasterExternalId, IsWebEnabled = true, Name = "Softtek", PlatformIdentifier = new Guid(PlatformIdentifier), TermsConfiguration = new TermsConfiguration { HasPaymentTerms = true, TermsDescription = "40 Net Days, cool Stuff" } }; var accountMasterResponse = IntegrationsClient.AccountMaster.Create(request).Result; //Get the Account created by the Above Method GetAccountAccountMasterRequest getAccountAccountMasterRequest = new GetAccountAccountMasterRequest { externalId = accountMasterExternalId }; var getAccountAccountMasterResponse = CustomerServiceClient.Logins.GetAccountByAccountMasterExternalId(getAccountAccountMasterRequest).Result; //Create a Login/User/Contact providing the AccountMaster and the Account Identifier CreateLoginUserContactRequest createLoginUserContactRequest = new CreateLoginUserContactRequest { AccountIdentifier = getAccountAccountMasterResponse.Result.AccountIdentifier, AccountMasterIdentifier = getAccountAccountMasterResponse.Result.AccountMasterIdentifier, ConfirmPassword = "******", Password = "******", ContactEmail = "*****@*****.**", Email = loginEmail, FirstName = "test1", LastName = "automation", PlatformIdentifier = new Guid(PlatformIdentifier), PhoneNumber = "1234567" }; var createLoginUserContactResponse = CustomerServiceClient.Logins.CreateContactUserLogin(createLoginUserContactRequest).Result; //Add an account level address to the current user CreateAddressRequest createAddressRequest = new CreateAddressRequest { AddressLine = accountAddress.street, AddressLine2 = string.IsNullOrEmpty(accountAddress.apartment) ? "" : accountAddress.apartment, City = accountAddress.city, Country = accountAddress.country, Identifier = Guid.NewGuid().ToString(), Name = accountAddress.CompanyName, Postal = accountAddress.postal, State = accountAddress.state, OwnerExternalId = accountMasterExternalId }; AddressResponse createResponse = IntegrationsClient.Address.Add(createAddressRequest).Result; return(new AddressViewData { Email = loginEmail, Password = "******", Address = accountAddress }); } catch (Exception) { throw; } }