public async Task <ActionResult> Search(SearchPersonModel model)
        {
            List <Person> persons = new List <Person>();

            if (!String.IsNullOrWhiteSpace(model.Email))
            {
                //search by email
                PersonListOptions options = new PersonListOptions()
                {
                    Email = model.Email
                };
                persons = await ArenaAPIHelper.GetPersons(options);
            }
            else if (!String.IsNullOrWhiteSpace(model.PhoneNumber))
            {
                //search by phone
                PersonListOptions options = new PersonListOptions()
                {
                    PhoneNumber = ValidationHelper.CleanPhoneNumber(model.PhoneNumber)
                };
                persons = await ArenaAPIHelper.GetPersons(options);
            }

            return(PartialView("_persons", persons));
        }
예제 #2
0
        public PersonServiceTest()
        {
            this.service = new PersonService();

            this.createOptions = new PersonCreateOptions
            {
                FirstName    = "John",
                Relationship = new PersonRelationshipOptions
                {
                    AccountOpener    = true,
                    Owner            = true,
                    PercentOwnership = 30.5m,
                }
            };

            this.updateOptions = new PersonUpdateOptions
            {
                FirstName    = "John",
                Relationship = new PersonRelationshipOptions
                {
                    AccountOpener    = true,
                    Owner            = true,
                    PercentOwnership = 30.5m,
                }
            };

            this.listOptions = new PersonListOptions
            {
                Limit        = 1,
                Relationship = new PersonRelationshipListOptions
                {
                    Director = true,
                }
            };
        }
예제 #3
0
        public static async Task <List <Person> > GetPersons(PersonListOptions options)
        {
            if (!IsReady())
            {
                await StartSession();
            }

            PersonRepository repository = new PersonRepository(_arenaAPI);

            return(await repository.Get(options));
        }
예제 #4
0
        public PersonServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new PersonService(this.StripeClient);

            this.createOptions = new PersonCreateOptions
            {
                FirstName    = "John",
                Relationship = new PersonRelationshipOptions
                {
                    AccountOpener    = true,
                    Owner            = true,
                    PercentOwnership = 30.5m,
                },
                Verification = new PersonVerificationOptions
                {
                    AdditionalDocument = new PersonVerificationDocumentOptions
                    {
                        BackFileId  = "file_abc",
                        FrontFileId = "file_def",
                    },
                    Document = new PersonVerificationDocumentOptions
                    {
                        BackFileId  = "file_123",
                        FrontFileId = "file_345",
                    },
                },
            };

            this.updateOptions = new PersonUpdateOptions
            {
                FirstName    = "John",
                Relationship = new PersonRelationshipOptions
                {
                    AccountOpener    = true,
                    Owner            = true,
                    PercentOwnership = 30.5m,
                }
            };

            this.listOptions = new PersonListOptions
            {
                Limit        = 1,
                Relationship = new PersonRelationshipListOptions
                {
                    Director = true,
                }
            };
        }