Esempio n. 1
0
        public AccountServiceTest(
            StripeMockFixture stripeMockFixture,
            MockHttpClientFixture mockHttpClientFixture)
            : base(stripeMockFixture, mockHttpClientFixture)
        {
            this.service = new AccountService(this.StripeClient);

            this.createOptions = new AccountCreateOptions
            {
                Type            = AccountType.Custom,
                BusinessProfile = new AccountBusinessProfileOptions
                {
                    Name = "business name",
                },
                BusinessType = "company",
                Capabilities = new AccountCapabilitiesOptions
                {
                    CardPayments = new AccountCapabilitiesCardPaymentsOptions
                    {
                        Requested = true,
                    },
                    Transfers = new AccountCapabilitiesTransfersOptions
                    {
                        Requested = true,
                    },
                },
                Company = new AccountCompanyOptions
                {
                    Address = new AddressOptions
                    {
                        State      = "CA",
                        City       = "City",
                        Line1      = "Line1",
                        Line2      = "Line2",
                        PostalCode = "90210",
                        Country    = "US",
                    },
                    Name         = "Company name",
                    Verification = new AccountCompanyVerificationOptions
                    {
                        Document = new AccountCompanyVerificationDocumentOptions
                        {
                            Back  = "file_back",
                            Front = "file_front",
                        },
                    },
                },
                ExternalAccount = "tok_visa_debit",
                Settings        = new AccountSettingsOptions
                {
                    Branding = new AccountSettingsBrandingOptions
                    {
                        Logo = "file_123",
                    },
                    CardPayments = new AccountSettingsCardPaymentsOptions
                    {
                        DeclineOn = new AccountSettingsCardPaymentsDeclineOnOptions
                        {
                            AvsFailure = true,
                            CvcFailure = true,
                        },
                        StatementDescriptorPrefix = "STR",
                    },
                    Payments = new AccountSettingsPaymentsOptions
                    {
                        StatementDescriptor = "STRIPE 123",
                    },
                    Payouts = new AccountSettingsPayoutsOptions
                    {
                        DebitNegativeBalances = true,
                        Schedule = new AccountSettingsPayoutsScheduleOptions
                        {
                            Interval      = "monthly",
                            MonthlyAnchor = "10",
                        },
                    },
                },
                TosAcceptance = new AccountTosAcceptanceOptions
                {
                    Date      = DateTime.Parse("Mon, 01 Jan 2001 00:00:00Z"),
                    Ip        = "127.0.0.1",
                    UserAgent = "User-Agent",
                },
            };

            this.updateOptions = new AccountUpdateOptions
            {
                Metadata = new Dictionary <string, string>
                {
                    { "key", "value" },
                },
            };

            this.rejectOptions = new AccountRejectOptions
            {
                Reason = "terms_of_service",
            };

            this.listOptions = new AccountListOptions
            {
                Limit = 1,
            };
        }
Esempio n. 2
0
        public AccountServiceTest()
        {
            this.service = new AccountService();

            this.createOptions = new AccountCreateOptions
            {
                Type = AccountType.Custom,
                ExternalAccountId = "tok_visa_debit",
                LegalEntity       = new AccountLegalEntityOptions
                {
                    AdditionalOwners = new List <AccountAdditionalOwner>
                    {
                        new AccountAdditionalOwner
                        {
                            // Verified this is encoded properly but stripe-mock does not
                            // support dob at the moment for additional owners.
                            // Dob = new AccountDobOptions
                            // {
                            //     Day = 1,
                            //     Month = 1,
                            //     Year = 1980,
                            // },
                            FirstName    = "John",
                            LastName     = "Doe",
                            Verification = new AccountVerificationOptions
                            {
                                DocumentBackId = "file_123",
                                DocumentId     = "file_234",
                            },
                        },
                        new AccountAdditionalOwner
                        {
                            Address = new AddressOptions
                            {
                                State      = "CA",
                                City       = "City",
                                Line1      = "Line1",
                                Line2      = "Line2",
                                PostalCode = "90210",
                                Country    = "US",
                            },
                            FirstName = "Jenny",
                            LastName  = "Rosen",
                        }
                    },
                    Verification = new AccountVerificationOptions
                    {
                        DocumentBackId = "file_abc",
                        DocumentId     = "file_bcd",
                    },
                }
            };

            this.updateOptions = new AccountUpdateOptions
            {
                Metadata = new Dictionary <string, string>
                {
                    { "key", "value" },
                },
            };

            this.rejectOptions = new AccountRejectOptions
            {
                Reason = "terms_of_service"
            };

            this.listOptions = new AccountListOptions
            {
                Limit = 1,
            };
        }