Пример #1
0
        public static UserPersonalData GetUserPersonalData()
        {
            Random rand = new Random((int)DateTime.Now.Ticks);

            var accountPersonalInformation = new UserPersonalData()
            {
                DayPhone     = "4464464464",
                EveningPhone = "4464464464",
                ExternalID   = rand.Next(1000000, 999999999).ToString(),
                FirstName    = "John",
                LastName     = "Doe",
                PhonePIN     = "1234",
                SourceEmail  = string.Format($"user{rand.Next(1, 10000)}@user.com"), // [email protected] through [email protected]
                SSN          = "123456789",
                DateOfBirth  = "01-01-1981",
                Tier         = "TestEIN",
                UserAddress  = new Address()
                {
                    StreetAddress1 = "123 Main St.",
                    City           = "Downtown",
                    State          = "NJ",
                    PostalCode     = "12345",
                    Country        = "USA"
                }
            };

            return(accountPersonalInformation);
        }
Пример #2
0
        public void EditAccountTimeZone()
        {
            // In ProPay, the TimeZone is edited as part of the User Personal Data. This value is not part of the UserPersonalData object in the SDK, though.

            // First, populate the UserPersonalData object
            // All items originally sent during account creation must be provided or they will be overwritten with blank spaces.
            var userPersonalData = new UserPersonalData()
            {
                DayPhone      = "4464464464",
                EveningPhone  = "4464464464",
                FirstName     = "John",
                LastName      = "Doe",
                MiddleInitial = "A",
                SourceEmail   = "*****@*****.**"
            };

            // Now call EditAccount, and in addition to sending the UserPersonalData, also send the TimeZone with one of the approved values.
            // See comment on WithTimeZone for values, or the ProPay documentation for further elaboration.
            var response = _service.EditAccount()
                           .WithAccountNumber("718216467")
                           .WithUserPersonalData(userPersonalData)
                           .WithTimeZone("ET")
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Пример #3
0
        public void EditAccountAddress()
        {
            var personalInfo = new UserPersonalData()
            {
                UserAddress = new Address()
                {
                    StreetAddress1 = "124 Main St.",
                    City           = "Downtown",
                    State          = "NJ",
                    PostalCode     = "12345",
                    Country        = "USA"
                },
                MailingAddress = new Address()
                {
                    StreetAddress1 = "125 Main St.",
                    City           = "Downtown",
                    State          = "NJ",
                    PostalCode     = "12345",
                    Country        = "USA"
                }
            };

            var response = _service.EditAccount()
                           .WithAccountNumber("718135662")
                           .WithUserPersonalData(personalInfo)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Пример #4
0
 private void HydrateUserPersonalData(ElementTree xml, Element xmlTrans, UserPersonalData userPersonalData)
 {
     xml.SubElement(xmlTrans, "FirstName", userPersonalData.FirstName);
     xml.SubElement(xmlTrans, "mInitial", userPersonalData.MiddleInitial);
     xml.SubElement(xmlTrans, "LastName", userPersonalData.LastName);
     xml.SubElement(xmlTrans, "dob", userPersonalData.DateOfBirth);
     xml.SubElement(xmlTrans, "ssn", userPersonalData.SSN);
     xml.SubElement(xmlTrans, "sourceEmail", userPersonalData.SourceEmail);
     xml.SubElement(xmlTrans, "dayPhone", userPersonalData.DayPhone);
     xml.SubElement(xmlTrans, "evenPhone", userPersonalData.EveningPhone);
     xml.SubElement(xmlTrans, "NotificationEmail", userPersonalData.NotificationEmail);
     xml.SubElement(xmlTrans, "currencyCode", userPersonalData.CurrencyCode);
     xml.SubElement(xmlTrans, "tier", userPersonalData.Tier);
     xml.SubElement(xmlTrans, "externalId", userPersonalData.ExternalID);
     xml.SubElement(xmlTrans, "addr", userPersonalData.UserAddress.StreetAddress1);
     xml.SubElement(xmlTrans, "aptNum", userPersonalData.UserAddress.StreetAddress2);
     xml.SubElement(xmlTrans, "addr3", userPersonalData.UserAddress.StreetAddress3);
     xml.SubElement(xmlTrans, "city", userPersonalData.UserAddress.City);
     xml.SubElement(xmlTrans, "state", userPersonalData.UserAddress.State);
     xml.SubElement(xmlTrans, "zip", userPersonalData.UserAddress.PostalCode);
     xml.SubElement(xmlTrans, "country", userPersonalData.UserAddress.Country);
 }
Пример #5
0
        public void EditAccountInformation()
        {
            Random rand = new Random((int)DateTime.Now.Ticks);

            var accountPersonalInfo = new UserPersonalData()
            {
                DayPhone      = "4464464464",
                EveningPhone  = "4464464464",
                ExternalID    = rand.Next(1000000, 999999999).ToString(),
                FirstName     = "John",
                LastName      = "Doe",
                MiddleInitial = "A",
                SourceEmail   = string.Format($"user{rand.Next(1, 10000)}@user.com")
            };

            var response = _service.EditAccount()
                           .WithAccountNumber("718135662")
                           .WithUserPersonalData(accountPersonalInfo)
                           .Execute();

            Assert.IsNotNull(response);
            Assert.AreEqual("00", response.ResponseCode);
        }
Пример #6
0
        public async Task <HttpResponseMessage> UpdateUserPersonalData([FromBody] UserPersonalData model)
        {
            try
            {
                LogRequest(model);
                if (!ModelState.IsValid)
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
                }
                NeeoUser currentUser        = new NeeoUser(model.username);
                bool     operationCompleted = await System.Threading.Tasks.Task.Run(() => currentUser.UpdateUserPersonalData(model));

                return(Request.CreateResponse(HttpStatusCode.OK));
            }
            catch (ApplicationException applicationException)
            {
                return(Request.CreateErrorResponse((HttpStatusCode)Convert.ToInt16(applicationException.Message), NeeoDictionaries.HttpStatusCodeDescriptionMapper[Convert.ToInt16(applicationException.Message)]));
            }
            catch (Exception exception)
            {
                Logger.LogManager.CurrentInstance.ErrorLogger.LogError(System.Reflection.MethodBase.GetCurrentMethod().GetType(), exception.Message, exception);
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
        }
Пример #7
0
 public PayFacBuilder WithUserPersonalData(UserPersonalData userPersonalData)
 {
     UserPersonalData = userPersonalData;
     return(this);
 }