如何使用laravel在条带中添加客户外部银行帐户
如何使用laravel在条带中添加客户外部银行帐户
{
"id": "ba_1MI3bbF23J5kz1XAe7HfLvuN",
"object": "bank_account",
"account": "acct_1MHoBlF23J5kz1XA",
"account_holder_name": "Jane Austen",
"account_holder_type": "individual",
"account_type": null,
"available_payout_methods": [
"standard"
],
"bank_name": "STRIPE TEST BANK",
"country": "US",
"currency": "usd",
"fingerprint": "1JWtPxqbdX5Gamtz",
"last4": "6789",
"metadata": {},
"routing_number": "110000000",
"status": "new"
}
我使用以下代码生成此响应
$account = \Stripe\Account::create(array(
"type" => "custom",
"country" => "US",
"email" => auth()->user()->email,
'capabilities' => [
'card_payments' => ['requested' => true],
'transfers' => ['requested' => true],
],
));
$account_id = $account->id;
$external_account = $stripe->accounts->createExternalAccount(
$account_id,
$user->stripe_customer_id,
[
'external_account' => $token->id,
]
);
如何生成此响应{“id”:“ba_1MI35QF23J5kz1XAwIvJPWa0”,“对象”:“银行账户”、“账户保持器姓名”:“女孩”,“帐户保持器类型”:“个人”、“账户类型”:空,“银行名称”:“试纸条测试库”,“国家”:“美国”、“货币”:“美元”,“客户”:“cus_N27I4C187MRZac”,“指纹图谱”:“wrigOuKxXT 4GeRSr”,“最后4个”:“6789”,“元数据”:{},“路由_编号”:“110000000”,“状态”:“已验证”}
如何成为“客户”:“cus_N27I4C187MRZac”在我创建外部帐户时存储。
1条答案
按热度按时间tzcvj98z1#
外部账户基本上是一个银行账户,供您的关联账户创建付款。您可以按照API参考并传递所有必要的信息(即
account_number
和currency
)来创建外部账户。如果有前端集成,也可以在前端使用create a token,将令牌ID传递给后端,调用外部账户创建API创建外部账户。