示例#1
0
        public ArmOneRegisterResponse ArmOneRegister(ArmOneRegisterRequest payload)
        {
            ClientPortalUtilities generate = new ClientPortalUtilities(_configSettingManager);
            var token   = generate.ARMOneToken();
            var _client = new RestActions(_contentRootPath);

            string url = _configSettingManager.ArmOne + "/ARMONE/Register";

            return(_client.CallArmOneRestAction <ArmOneRegisterResponse, ArmOneRegisterRequest>(payload, url, token));
        }
        public ArmOneRegisterResponse OnboardNewUsers(Person model, string password)
        {
            var response   = new ArmOneRegisterResponse();
            var snResponse = new SalesNewCustomerResponse();

            //onboard on datahub API
            //first, on sales/prospect
            var spRequest = new SalesProspectRequest
            {
                Surname      = model.LastName,
                FirstName    = model.FirstName,
                EmailAddress = model.Email,
                MobileNumber = model.Tel,
                Sex          = model.Gender,
                Address      = model.Address,
                BvnNumber    = model.BioetricVerificationNumber
            };
            var spResponse = _clientService.AddNewCustomerStageOne(spRequest);

            //then, on sales/newcustomer
            if (spResponse != null)
            {
                var snRequest = new SalesNewCustomerRequest {
                    ProspectCode = spResponse.ProspectCode
                };
                snResponse = _clientService.AddNewCustomerStageTwo(snRequest);
            }

            //onboard on ArmOne
            if (snResponse != null)
            {
                var armRequest = new ArmOneRegisterRequest
                {
                    Membershipkey     = snResponse.MembershipNumber,
                    Password          = password,
                    EmailAddress      = model.Email,
                    MobileNumber      = model.Tel,
                    SecurityQuestion  = "",
                    SecurityAnswer    = "",
                    SecurtiyQuestion2 = String.Empty,
                    SecurityAnswer2   = String.Empty,
                    FirstName         = model.FirstName,
                    LastName          = model.LastName,
                    Channel           = "CLient_Portal"
                };
                response = _clientService.ArmOneRegister(armRequest);
            }

            return(response);
        }
        public ArmOneRegisterResponse OnboardOldUsers(string username, string password)
        {
            var customer = new CustomerDetail();
            var response = new ArmOneRegisterResponse();

            //make call to datahub API
            var dataHubAuthRequest = new AuthenticateRequest {
                Password = password, UserName = username
            };
            var dataHubAuthResponse = _clientService.Authenticate(dataHubAuthRequest);

            if (dataHubAuthResponse != null && dataHubAuthResponse.IsActive == true)
            {
                //get customer details
                customer = GetUserProfile(dataHubAuthResponse.MembershipKey);

                //register user on ArmOne
                var request = new ArmOneRegisterRequest
                {
                    Membershipkey     = customer.MembershipNumber,
                    Password          = password,
                    EmailAddress      = customer.EmailAddress,
                    MobileNumber      = customer.MobileNumber,
                    SecurityQuestion  = dataHubAuthResponse.SecurityQuestion,
                    SecurityAnswer    = dataHubAuthResponse.SecurityAnswer,
                    SecurtiyQuestion2 = String.Empty,
                    SecurityAnswer2   = String.Empty,
                    FirstName         = customer.FirstName,
                    LastName          = customer.LastName,
                    Channel           = "CLient_Portal"
                };
                response = _clientService.ArmOneRegister(request);
            }

            return(response);
        }