Beispiel #1
0
        public async Task <Account> AddBankToAccount(Member Member,
                                                     string BusinessName,
                                                     string BankAccount,
                                                     string RoutingNumber)
        {
            if (Member is null || Member.StripeAccountId is null)
            {
                throw new Exception($"SmStipeService.TestAddBankToAccount : Bad input parameters on member : {Member.Id}");
            }

            // retrieve account
            var     service = new AccountService();
            Account account = service.Get(Member.StripeAccountId);
            //  add external_account

            // update account and then Member
            var options = new AccountUpdateOptions
            {
                ExternalAccount = new AccountBankAccountOptions()
                {
                    AccountHolderName = BusinessName,
                    AccountHolderType = "individual",
                    AccountNumber     = BankAccount,
                    RoutingNumber     = RoutingNumber,
                    Country           = "US",
                    Currency          = "usd"
                }
            };

            account = await service.UpdateAsync(Member.StripeAccountId, options);

            return(account);
        }
        public virtual async Task <Account> Update(string id, AccountUpdateOptions updateOptions)
        {
            var postData = this.ApplyAllParameters(updateOptions, string.Empty, false);

            //remove the ?
            postData = RemoveQuestionMark(postData);

            var response = await Requestor.Post(string.Format(Urls.SpecificAccount, id), data : postData);

            return(Mapper <Account> .MapFromJson(response));
        }
Beispiel #3
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,
            };
        }
        public string UpdateConnectedCustomAccount()
        {
            StripeConfiguration.ApiKey = "sk_test_xx"; //Stripe secret key

            var options = new AccountUpdateOptions
            {
                BusinessProfile = new AccountBusinessProfileOptions
                {
                    Url          = "https://tourtech.com",
                    Name         = "example business",
                    SupportEmail = "*****@*****.**",
                    Mcc          = "5732"
                },
                Capabilities = new AccountCapabilitiesOptions
                {
                    CardPayments = new AccountCapabilitiesCardPaymentsOptions
                    {
                        Requested = true,
                    },
                    Transfers = new AccountCapabilitiesTransfersOptions
                    {
                        Requested = true,
                    },
                },
                ExternalAccount = new AccountBankAccountOptions()
                {
                    AccountHolderName = "abcd",
                    AccountHolderType = "individual",
                    AccountNumber     = "000123456789",
                    Country           = "US",
                    Currency          = "usd",
                    RoutingNumber     = "110000000",
                },
                BusinessType = "individual",
                Email        = "*****@*****.**",
                Individual   = new AccountIndividualOptions()
                {
                    FirstName = "Maaz",
                    LastName  = "qureshi",
                    Dob       = new DobOptions() //test dub 1901-01-01
                    {
                        Day   = 01,
                        Month = 01,
                        Year  = 1901
                    },
                    SsnLast4 = "0000",
                    IdNumber = "000000000",
                    Phone    = "000 000 0000",

                    Address = new AddressOptions {
                        State      = "Alabama",
                        Country    = "us",
                        City       = "address_full_match",
                        Line1      = "address_full_match",
                        PostalCode = "35004 "
                    },
                    Email = "*****@*****.**"
                },
                TosAcceptance = new AccountTosAcceptanceOptions
                {
                    Date = DateTime.UtcNow,
                    Ip   = "127.0.0.1", // provide request's IP address
                },
            };

            var service = new AccountService();
            var account = service.Update("acct_1HqwrqQ7aXzmziE6", options);



            return(account.Id);//this is connectedStripeAccountId
        }
Beispiel #5
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,
            };
        }
        public static string UpdateConnectedAccount(string stripeId, BillingInfoModel model, Models.User.UserInfoModel userDetail)
        {
            //var stripeKey = StripeApiKey();
            //StripeConfiguration.ApiKey = "sk_test_51HqZBDLnFgPc5G9BeuyG5lXc32mkG8Hijz01tGKSD6c5ChKpWHSARtJ49yNv75GXY3AbAINw08N8kA1VkvwZtONW00o0QdHxLp";
            var stripeKey = StripeApiKey();
            var options   = new AccountUpdateOptions
            {
                BusinessProfile = new AccountBusinessProfileOptions
                {
                    Url  = "http://viralad.tourtech.co.il/",
                    Name = "affiliate",
                    Mcc  = "7311"
                },
                Capabilities = new AccountCapabilitiesOptions
                {
                    CardPayments = new AccountCapabilitiesCardPaymentsOptions
                    {
                        Requested = true,
                    },
                    Transfers = new AccountCapabilitiesTransfersOptions
                    {
                        Requested = true,
                    },
                },
                ExternalAccount = new AccountBankAccountOptions()
                {
                    AccountHolderName = model.AccountHolderName,
                    AccountHolderType = "individual",
                    AccountNumber     = model.AccountNumber,
                    Country           = "US",
                    Currency          = "usd",
                    RoutingNumber     = model.RoutingNumber,
                },
                BusinessType = "individual",
                Email        = userDetail.Email,
                Individual   = new AccountIndividualOptions()
                {
                    FirstName = userDetail.FirstName,
                    LastName  = userDetail.LastName,
                    Dob       = new DobOptions() //test dub 1901-01-01
                    {
                        Day   = 1,               //long.Parse(userDetail.DateOfBirth.Day.ToString()),
                        Month = 1,               //long.Parse(userDetail.DateOfBirth.Month.ToString()),
                        Year  = 1901             //long.Parse(userDetail.DateOfBirth.Year.ToString())
                    },
                    SsnLast4 = model.SsnLast4,
                    IdNumber = model.IdNumber,
                    Phone    = model.Phone,

                    Address = new AddressOptions
                    {
                        State      = "Alabama",
                        Country    = "us",
                        City       = "Moody",
                        Line1      = "address_full_match",
                        PostalCode = "35004"
                    },
                    Email = model.Email
                },
                TosAcceptance = new AccountTosAcceptanceOptions
                {
                    Date = DateTime.UtcNow,
                    Ip   = "127.0.0.1", // provide request's IP address
                },
            };

            var service = new AccountService();
            var account = service.Update(stripeId, options);


            return(account.Id);//this is connectedStripeAccountId
        }