我发现这个在互联网上哪里可以得到$provideID
的目标参数。我正在使用条纹帐户id https://dashboard.stripe.com/settings/account在这个网址上找到,但它显示我
致命错误:未捕获(状态400)(请求req_m9G1T0vzPcd3Ti)没有这样的帐户:'帐户_***************'
$amount = 1000; // amount in cents
$application_fee = intval($amount * 0.2); // 20% of the amount
$charge = \Stripe\Charge::create(array(
"amount" => $amount,
"currency" => "usd",
"customer" => $customerID,
"destination" => $providerID,
"application_fee" => $application_fee,
));
1条答案
按热度按时间wsxa1bj11#
首先,我强烈建议不要直接创建Charges,因为这是一个有很多限制的旧API,而应该创建PaymentIntents。
其次,在创建Charge或PaymentIntent时,可以传递Stripe账户ID。但只有当该账户ID与您自己的Stripe账户关联时,这才有效。根据您分享的错误,我认为这就是问题所在。
因此,您需要仔细检查您正在使用的帐户ID是否列在您的Stripe控制面板中:https://dashboard.stripe.com/test/connect/accounts/overview