コード例 #1
0
        public void EditUserAssignAddressAsDefault()
        {
            CustomerServiceWebAppClient customerServiceClient = new CustomerServiceWebAppClient(ServiceConstants.CustomerServiceUrl, ServiceConstants.Username, ServiceConstants.Password);
            IntegrationsWebAppClient    integrationsClient    = new IntegrationsWebAppClient(ServiceConstants.IntegrationsAPIUrl, ServiceConstants.AllPointsPlatformId);
            UpdateUserRequest           updateRequest         = new UpdateUserRequest
            {
                AccountIdentifier                  = Guid.NewGuid(),
                ContactIdentifier                  = Guid.NewGuid(),
                CookieString                       = string.Empty,
                DefaultAddressIdentifier           = Guid.NewGuid(),
                DefaultCreditCardPaymentIdentifier = Guid.NewGuid(),
                Identifier         = Guid.NewGuid(),
                IsAnonymous        = false,
                IsEnabled          = true,
                LoginIdentifier    = Guid.NewGuid(),
                PlatformIdentifier = Guid.NewGuid(),
                RoleGuids          = new List <string>
                {
                    Guid.NewGuid().ToString()
                },
                UseAccountTermsAsDefaultPayment = true
            };
            HttpResponse <UserResponse> updateResponse = customerServiceClient.Users.Update(updateRequest).Result;

            Assert.IsNotNull(updateResponse, "Response is null");
            Assert.IsNotNull(updateResponse.Result, $"{nameof(updateResponse.Result)} is null");
        }
コード例 #2
0
        public void DeleteUser()
        {
            CustomerServiceWebAppClient customerServiceClient = new CustomerServiceWebAppClient(ServiceConstants.CustomerServiceUrl, ServiceConstants.Username, ServiceConstants.Password);
            DeleteUserRequest           deleteRequest         = new DeleteUserRequest
            {
                Id = "f47de712-abf3-4ab3-8ea9-f0ef663d6491"
            };
            HttpResponse <UserResponse> deleteResponse = customerServiceClient.Users.Remove(deleteRequest).Result;

            Assert.IsNotNull(deleteResponse, "Response is null");
            Assert.IsNotNull(deleteResponse.Result, $"{nameof(deleteResponse.Result)} is null");
        }
コード例 #3
0
        public BaseDataFactory()
        {
            string mongoConnectionString   = EnvironmentConstants.MongoConnectionString;
            string integrationsApiV1Url    = FormatUrl(EnvironmentConstants.IntegrationsApiV1Url);
            string customerServiceApiUrl   = FormatUrl(EnvironmentConstants.CustomerServiceUrl);
            bool   integrationsHasHttps    = EnvironmentConstants.IntegrationsApiV1Url.Contains("https");
            bool   customerServiceHasHttps = EnvironmentConstants.CustomerServiceUrl.Contains("https");

            Processor             = new ECommerceProcessor(mongoConnectionString);
            IntegrationsClientV1  = new IntegrationsWebAppClient(integrationsApiV1Url, PlatformIdentifier, integrationsHasHttps);
            CustomerServiceClient = new CustomerServiceWebAppClient(customerServiceApiUrl, @EnvironmentConstants.Username, EnvironmentConstants.UserPassword, customerServiceHasHttps);
            EcommerceClient       = new ECommerceWebAppClient(AppUrl);
        }
コード例 #4
0
        public void GetAccountAccountMaster()
        {
            CustomerServiceWebAppClient client = new CustomerServiceWebAppClient(ServiceConstants.CustomerServiceUrl, ServiceConstants.Username, ServiceConstants.Password);

            GetAccountAccountMasterRequest getAccountAccountMasterRequest = new GetAccountAccountMasterRequest
            {
                externalId = "JhonsEXTid"
            };
            var getAccountAccountMasterResponse = client.Logins.GetAccountByAccountMasterExternalId(getAccountAccountMasterRequest).Result;

            Assert.IsNotNull(getAccountAccountMasterResponse.Result);
            Assert.IsNotNull(getAccountAccountMasterResponse.Result.AccountIdentifier);
        }
コード例 #5
0
        public void GetUserByInternalId()
        {
            CustomerServiceWebAppClient customerServiceClient = new CustomerServiceWebAppClient(ServiceConstants.CustomerServiceUrl, ServiceConstants.Username, ServiceConstants.Password);

            GetUserRequest getUserRequest = new GetUserRequest
            {
                Id = new Guid(GenericGuid)
            };

            var getUserResponse = customerServiceClient.Users.GetByInternalIdentifier(getUserRequest).Result;

            Assert.IsNotNull(getUserResponse, $"{nameof(getUserResponse)} should not be null");
            Assert.IsNotNull(getUserResponse.Result, $"{nameof(getUserResponse.Result)} should not be null");
            Assert.IsNotNull(getUserResponse.Result.Identifier, $"{nameof(getUserResponse.Result.Identifier)} cannot be null");
        }
コード例 #6
0
        public void CreateUserLoginContact()
        {
            CustomerServiceWebAppClient client = new CustomerServiceWebAppClient(ServiceConstants.CustomerServiceUrl, ServiceConstants.Username, ServiceConstants.Password);

            CreateLoginUserContactRequest createLoginUserContactRequest = new CreateLoginUserContactRequest
            {
                AccountIdentifier       = new Guid("92de5f84-bb48-456b-b319-8e5b5dba3369"),
                AccountMasterIdentifier = new Guid("4c8577a9-b401-4dae-9570-1b47db6be529"),
                ConfirmPassword         = "******",
                Password           = "******",
                ContactEmail       = "*****@*****.**",
                Email              = "*****@*****.**",
                FirstName          = "Softtek",
                LastName           = "Test User",
                PlatformIdentifier = new Guid("55c4524c-5e8f-4b81-adf1-a2f1d38677ff"),
                PhoneNumber        = "123456789"
            };
            var createLoginUserContactResponse = client.Logins.CreateContactUserLogin(createLoginUserContactRequest).Result;

            Assert.IsNotNull(createLoginUserContactResponse.Result);
            Assert.IsNotNull(createLoginUserContactResponse.Result.Contact);
            Assert.IsNotNull(createLoginUserContactResponse.Result.Login);
            Assert.IsNotNull(createLoginUserContactResponse.Result.User);
        }