[英]Application Fee Error - Stripe
When I try to charge an application fee in stripe using the following code当我尝试使用以下代码以条带形式收取申请费时
$charge = \Stripe\Charge::create(array(
'amount' => $amtincents,
'currency' => 'usd',
'source' => $stripetoken,
'application_fee' => $appfee,
'description' => 'Campaign Donation',
'metadata' => array("Campaign Id" => $id)
), array('stripe_account' => $stripe_connected_user_id)
);
I get the following error我收到以下错误
Array
(
[error] => Can only apply an application_fee when the request is made on behalf of another account (using an OAuth key, the Stripe-Account header, or the destination parameter).
)
I have worked in stripe before and last time I did not have this problem.我之前和上次都在 Stripe 工作过,我没有遇到这个问题。 My donation form (for charging the donations I am using stripe) and the page I am performing the stripe operations are in the same site.
我的捐赠表格(用于收取我使用条纹的捐款)和我正在执行条纹操作的页面在同一个站点中。 I am only testing at the moment.
我目前只是在测试。
You might be using an older version of Stripe's PHP library that does not support the Stripe-Account
header.您可能正在使用不支持
Stripe-Account
标头的旧版Stripe PHP 库。 Ideally, you should be using the latest version (4.4.0 at this time).理想情况下,您应该使用最新版本(此时为 4.4.0)。
If that's not the issue, then it's likely that the $stripe_connected_user_id
variable has an empty value.如果这不是问题,则
$stripe_connected_user_id
变量可能具有空值。 Make sure that the variable contains valid account ID ( "acct_..."
).确保变量包含有效的帐户 ID (
"acct_..."
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.