簡體   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