Stripe exception thrown when creating new connect account with bank account

。_饼干妹妹 提交于 2020-01-15 05:39:06

问题


After upgrading to the latest version of Stripe.Net. I'm trying to create a new custom connect account, which includes a bank account, with the .Net API and Stripe is throwing this exception.

This account can only be updated with an account token, because it was originally created with an account token. (Attempted to update param 'account_token' directly.)

I'm assigning the AccountToken I'm generating from Stripe.js and that seems to be generating ok. Additionally I have no issue adding an external bank to a already created connect account. I just can't seem to create a new custom account

Here is my c# code

                AccountDobOptions dobOptions = new AccountDobOptions()
                {
                    Day = yogaProfile.Birthdate.Day,
                    Month = yogaProfile.Birthdate.Month,
                    Year = yogaProfile.Birthdate.Year
                };

                AddressOptions addressOptions = new AddressOptions()
                {
                    City = bankDetails.City,
                    Country = bankDetails.CountryCode,
                    State = bankDetails.CountryCode == "US" ? bankDetails.USStateCode : bankDetails.NonUSStateCode,
                    PostalCode = bankDetails.PostalCode,
                    Line1 = bankDetails.AddressLine1,
                    Line2 = bankDetails.AddressLine2
                };

                AccountLegalEntityOptions legal = new AccountLegalEntityOptions();
                legal.Dob = dobOptions;
                legal.Type = "individual";
                legal.Address = addressOptions;
                legal.FirstName = accountFullName.Split(' ')[0];
                legal.LastName = accountFullName.Split(' ')[1];

                //legal.SSNLast4 = bankDetails.LastFourSSN;


                AccountTosAcceptanceOptions tosOptions = new AccountTosAcceptanceOptions()
                {
                    Date = DateTime.UtcNow,
                    Ip = clientIpAddress != null ? clientIpAddress : GetUserIpAddress()
                };

                var accountOptions = new AccountCreateOptions()
                {
                    Email = yogaProfile.ApplicationUser.Email,
                    Type = AccountType.Custom,
                    Country = bankDetails.CountryCode,
                    LegalEntity = legal,
                    TosAcceptance = tosOptions,
                    AccountToken = stripeToken,
                    //TransferScheduleInterval = "weekly",
                    ExternalBankAccount = new AccountBankAccountOptions()
                };

                var accountService = new AccountService();
                Account account = accountService.Create(accountOptions);

来源:https://stackoverflow.com/questions/53609170/stripe-exception-thrown-when-creating-new-connect-account-with-bank-account

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!