【发布时间】:2016-12-12 15:54:38
【问题描述】:
首先,对不起我的英语。
我想在 Stripe 中创建从账户 A 到账户 B 的费用。账户 A 是托管账户。账户B可以是多个账户中的任意一个。但是,当我尝试使用目标参数创建费用时,API 会返回错误。说:
"error": {
"type": "invalid_request_error",
"message": "The destination param must be a connected account.",
"param": "destination"
}
如何连接目标帐户(帐户 B)以获取此信息??我正在为此使用 php api 条带。接下来这是我使用的示例代码。提前致谢:
\Stripe\Stripe::setApiKey('sk_test_ACCOUNT_A_KEY');
// Charge the order:
$charge = \Stripe\Charge::create(array(
// 'source' => $token,
'customer' => 'cus_ID_CUSTOMER_TO_GET_PAYMENT',
"amount" => 100000,
"currency" => "usd",
"description" => "from account A to account B",
'destination' => 'acct_ID_DESTINATION_ACCOUNT'
)
);
echo "<pre>";
print_r($charge);
echo "</pre>";
【问题讨论】:
-
这两个账户需要用 Stripe Connect 连接(可能使用 Standalone 方式)。看看这里的指南--stripe.com/docs/connect/standalone-accounts 连接两个帐户后,您的代码可能会起作用。
-
嗨@korben,独立帐户允许条带处理一切,连接,创建用户等。我们不能这样做,因为所有这些过程必须对用户透明。它必须在后台进程中(如幕后),我认为这可以通过托管帐户和 api 实现
标签: php stripe-payments stripe-connect