Stripe payments 申请费错误-条带

Stripe payments 申请费错误-条带,stripe-payments,stripe-connect,Stripe Payments,Stripe Connect,当我尝试使用以下代码以条带形式收取申请费时 $charge = \Stripe\Charge::create(array( 'amount' => $amtincents, 'currency' => 'usd', 'source' => $stripetoken, 'application_fee' => $appfee, 'description' => 'Campaign Donation', 'metadata

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

$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)
);
我得到以下错误

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工作过,上一次我没有这个问题。我的捐款表(用于收取我使用stripe的捐款)和我执行stripe操作的页面位于同一个站点。我现在只是在测试。

您可能正在使用不支持标题的旧版本。理想情况下,您应该使用最新版本(目前为4.4.0)


如果这不是问题所在,那么
$stripe\u connected\u user\u id
变量可能有一个空值。确保变量包含有效的帐户ID(
“acct”…
)。

我现在尝试使用以下代码,使用destination参数而不是account header来收费。收费代码类似于$charge=\Stripe\charge::create(数组('amount'=>$amtincents,'currency'=>'usd','source'=>$stripetoken,'destination'=>$\u POST['Stripe\u connected\u user\u id'],'application\u fee'=>$appfee,'description'=>'Campaign'=>'活动捐赠','metadata'=>数组(“活动Id”=>$Id));我现在获取.Array([error]=>无法将'destination'参数设置为您自己的帐户。)我现在尝试使用以下收费代码进行收费,并使用destination参数而不是帐户头。收费代码类似于$charge=\Stripe\charge::create(Array)('amount'=>$amtincents','currency'=>'usd','source'=>$stripetoken','destination'=>$\u POST['stripe\u connected\u user\u id'],'application\u fee'=>$appfee','description'=>'Campaign捐赠','metadata'=>数组(“Campaign id”=>$id));我现在得到错误([错误]=>无法将'destination'参数设置到您自己的帐户。)@jai此错误消息表示您提供的帐户ID是平台的帐户ID(即您自己的帐户ID)。您需要提供连接到平台的帐户的ID,而不是平台本身的ID。此帐户ID是在我尝试执行下一页中给出的步骤时创建的。我已存储了条带用户ID。上一页中的进程返回了条带用户ID,我将其存储在数据库中。我正在尝试将其用于collect应用程序费用。很抱歉给您添麻烦,但您能更详细地解释一下吗?或者给我指一个链接,它清楚地告诉我区别是什么?请注意我上面的评论。您的解释还在等待。这是否只是此处给出的测试环境问题。@Y我现在尝试使用以下代码,而不是使用目标参数来收费帐户标题。费用代码类似于$charge=\Stripe\charge::create(数组('amount'=>$amtincents,'currency'=>'usd','source'=>$stripetoken,'destination'=>$\u POST['Stripe\u connected\u user\u id'],'application_fee'=>$appfee','description'=>'Campaign捐赠','metadata'=>数组(“Campaign Id”=>$Id));我现在获得数组([错误]=>无法将'destination'参数设置为您自己的帐户。)@Y我现在尝试使用以下代码进行收费,并使用destination参数而不是account header。收费代码类似于$charge=\Stripe\charge::create(数组('amount'=>$amtincents,'currency'=>'usd','source'=>$stripetoken,'destination'=>$\u POST['Stripe\u connected\u user\u id'],'application_fee'=>$appfee','description'=>'活动捐赠','metadata'=>数组(“活动Id”=>$Id));我现在得到错误([error]=>无法将'destination'参数设置为您自己的帐户。)