【问题标题】:Payout to User's External account bank account gives 'No such External Account...'支付给用户的外部账户银行账户给出“没有这样的外部账户...”
【发布时间】:2019-06-17 20:44:43
【问题描述】:

我有一个非常令人沮丧的问题,Stripe 的文档/客户服务一直在给我解决问题,但我的问题仍未解决。

我正在尝试使用 C# 以编程方式向用户的银行帐户付款。

金额累积在一个条带帐户(我的帐户)中,但用户有我们的后端跟踪的“余额”。当用户决定他们想要获得报酬时,这就是我遇到问题的地方。

到目前为止,这是我已经实现的:

  1. 创建用户的外部账户并附加银行账户: https://stripe.com/docs/api/accounts/create
  2. 创建一个支付对象: https://stripe.com/docs/api/payouts/create

但是,当我创建付款并将目的地添加到该付款时,就会出现问题。原因是用户可能有多个银行账户与其外部账户相关联。

我有这样的事情:

为用户创建一个外部帐户

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

创建付款

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

其中bankAccountId 是我从userCustomAccount.ExternalAccounts 检索到的id (like ba_xxxx)

我在尝试调用支付时收到错误消息,提示“不存在此类外部帐户”

知道如何解决这个问题吗?我不明白为什么这很难做到,为什么会给我带来这么多麻烦。

谢谢!

【问题讨论】:

    标签: c# api stripe-payments


    【解决方案1】:

    由于您是从您的platform 帐户创建payout 到已连接的帐户,因此您需要使用Stripe-Account 标头

    您现在所做的是使用关联账户的银行 ID 为您自己的账户创建付款。

    在 C# 中,您需要使用 requestOptions

    var requestOptions = new RequestOptions();
    requestOptions.StripeConnectAccountId = "CONNECTED ACCOUNT ID"; 
    
    .... 
    ....
    var payout = await PayoutService.CreateAsync(sourcePayout, requestOptions);
    
    

    关键是当您在connected account 上进行操作时,除了创建帐户本身之外,例如创建费用、付款、在关联帐户上创建客户,您都需要传递Stripe-Account 标头。

    【讨论】:

    • 谢谢@wsw 我试过这个,但我得到一个错误:Insufficient funds in Stripe account. In test mode, you can add funds to your available balance (bypassing your pending balance) by creating a charge with 4000 0000 0000 0077 as the card number. You can use the the /v1/balance endpoint to view your Stripe balance (for more details, see stripe.com/docs/api#balance). 我的主账户有可用资金,但连接的账户有 0。我不确定这里发生了什么。有什么建议吗?
    • 是的,Stripe 中的payout 意味着将资金从Account Balance 转移到物理Bank Account。由于您正在为关联账户创建Manual 支付,这意味着您正在将Available Balance 从关联账户余额转移到其注册的银行账户。连接的帐户需要有Available Balance 才能payout 也就是兑现。您可以做的是使用提到的卡并创建一个Direct Charge,并在帐户标题后面(stripe.com/docs/connect/direct-charges),这将为连接的帐户提供资金
    • 谢谢@wsw 的回答,我知道这个问题已经很久了,但是我有一个关于这个解决方案的问题,当我们设置Stripe-Account 并且外部连接的帐户将自行支付意思是它会使用平台账户余额来支付自己对吗?
    【解决方案2】:

    如果您从平台创建付款以连接帐户的外部帐户,则可能无法直接完成。首先使用转账API将资金从平台余额发送到连接账户。 transfer api.

    然后在连接帐户上创建付款。通常支付是自动的,并且在预设的最少天数(美国 2 天)之后,使用连接帐户余额中的所有可用余额创建支付。

    【讨论】:

      猜你喜欢
      • 2021-05-03
      • 1970-01-01
      • 2014-08-27
      • 2018-08-06
      • 2021-02-03
      • 2019-01-30
      • 2015-03-25
      • 2017-12-14
      • 1970-01-01
      相关资源
      最近更新 更多