简体   繁体   English

支付给用户的外部账户银行账户给出“没有这样的外部账户......”

[英]Payout to User's External account bank account gives 'No such External Account...'

I have a very frustrating problem and Stripe's documentation/customer service have been giving me the run-around and my question is still not resolved.我有一个非常令人沮丧的问题,Stripe 的文档/客户服务一直在给我解决问题,但我的问题仍未解决。

I am trying to implement a payout programmatically in C# to a user's bank account.我正在尝试在 C# 中以编程方式实现对用户银行帐户的支付。

Amounts are accumulated in one stripe account (my account) but users have 'balances' that our backend keeps track of.金额累积在一个条带帐户(我的帐户)中,但用户拥有我们的后端跟踪的“余额”。 When a user decides they want to be paid out, this is where I am running into an issue.当用户决定他们想要支付时,这就是我遇到问题的地方。

So far, this is what i've implemented:到目前为止,这是我实施的:

  1. Create the User's external account and attach a bank account: https://stripe.com/docs/api/accounts/create创建用户的外部账户并附上银行账户: https : //stripe.com/docs/api/accounts/create
  2. Create a payout object: https://stripe.com/docs/api/payouts/create创建支付对象: https : //stripe.com/docs/api/payouts/create

But the problem occurs when I create a payout and add a destination to that payout.但是当我创建一个支付并向该支付添加一个目的地时会出现问题。 The reason for this is because a user might have more than one bank account linked to their external account.这样做的原因是因为用户可能有多个银行账户与其外部账户相关联。

I have something like this:我有这样的事情:

Create an external account for user为用户创建外部帐户

Account userCustomAccount = await account.CreateAsync(new AccountCreateOptions()
{
    Type = "custom",
    DefaultCurrency = "usd",
    Country = "US",
    Email = "user@fake.com",
    LegalEntity = new AccountLegalEntityOptions() {...},
    ExternalBankAccount = new AccountBankAccountOptions()
    {
        AccountHolderType = "individual",
        AccountNumber = "123456789",
        RoutingNumber = "987654321,
        Currency = "usd",
        Country = "US",
        AccountHolderName = "Test User"
    },
    TosAcceptance = new AccountTosAcceptanceOptions(){...},
    PayoutSchedule = new AccountPayoutScheduleOptions()
    {
        Interval = "manual"
    },
    PayoutStatementDescriptor = "TEST"
});

Create a payout创建付款

var sourcePayout = new PayoutCreateOptions()
{
    Amount = 100,
    Currency = "usd",
    Destination = bankAccountId,
    SourceType = "bank_account",
    StatementDescriptor = "PAYOUT"
};

where bankAccountId is the id ( like ba_xxxx ) that I retrieved from userCustomAccount.ExternalAccounts其中bankAccountId是我从userCustomAccount.ExternalAccounts检索到的 ID( like ba_xxxx

I get an error when attempting to call payout saying that "No such external account exists"尝试调用付款时出现错误,提示“不存在此类外部帐户”

Any idea how to resolve this?知道如何解决这个问题吗? I don't understand why this is so difficult to do and why this is giving me so much trouble.我不明白为什么这很难做到,为什么这给我带来了这么多麻烦。

Thanks!谢谢!

since you are creating payout to the connected account from your platform account, you will need to use the Stripe-Account header由于您是从platform帐户向关联帐户创建payout ,因此您需要使用Stripe-Account标头

What you are doing now is creating a payout for your own account with the connected account's bank id.您现在所做的是使用关联账户的银行 ID 为您自己的账户创建付款。

in C#, you would need to use the requestOptions在 C# 中,您需要使用requestOptions

var requestOptions = new RequestOptions();
requestOptions.StripeConnectAccountId = "CONNECTED ACCOUNT ID"; 

.... 
....
var payout = await PayoutService.CreateAsync(sourcePayout, requestOptions);

The key things is whenever you are operating on your connected account other than creating account itself, such as creating charge, payout, creating customer on connected account, you will need to pass the Stripe-Account header.关键是每当您在connected account上操作而不是创建帐户本身时,例如在连接帐户上创建费用、付款、创建客户,您都需要传递Stripe-Account标头。

if you are creating payout from platform to connect account's external account, directly it might not be done.如果您从平台创建付款以连接帐户的外部帐户,则可能无法直接完成。 first send the fund from platform balance to connect account using transfer api.首先使用转账api将平台余额中的资金发送到连接帐户。 transfer api .传输接口

and then create a payout on the connect account.然后在连接帐户上创建付款。 generally the payouts are automatic, and after the preset minimum number of days(for US 2 days), the payout is created with all the available balance in the connect account balance.通常付款是自动的,在预设的最少天数(美国 2 天)后,使用连接帐户余额中的所有可用余额创建付款。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM