使用银行帐户创建新的连接帐户时引发条带异常

时间:2018-12-04 09:04:55

标签: c# stripe-payments

升级到Stripe.Net的最新版本后。 我正在尝试使用.Net API创建一个新的自定义连接帐户,其中包括一个银行帐户,而Stripe会抛出此异常。

  

此帐户只能使用帐户令牌进行更新,因为它最初是使用帐户令牌创建的。 (尝试直接更新参数“ account_token”。)

我正在分配从Stripe.js生成的AccountToken,这似乎可以生成。此外,将外部银行添加到已创建的连接帐户中也没有问题。我似乎无法创建新的自定义帐户

这是我的C#代码

                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);

0 个答案:

没有答案