申请费错误 - 条纹



当我尝试使用以下代码以条纹收取申请费时

$charge = StripeCharge::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)
);

我收到以下错误

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).
)

我以前在条纹工作过,上次我没有这个问题。我的捐款表格(用于向我使用的条纹捐款收费)和我正在执行条纹操作的页面位于同一站点。我目前只是在测试。

您可能使用的是不支持 Stripe-Account 标头的旧版 Stripe PHP 库。理想情况下,您应该使用最新版本(此时为 4.4.0)。

如果这不是问题所在,则 $stripe_connected_user_id 变量的值可能为空。确保变量包含有效的帐户 ID ( "acct_..." )。

最新更新