繁体   English   中英

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

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

我有一个非常令人沮丧的问题,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

尝试调用付款时出现错误,提示“不存在此类外部帐户”

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

谢谢!

由于您是从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标头。

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

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

暂无
暂无

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

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