【发布时间】:2017-01-30 21:10:47
【问题描述】:
当我尝试使用以下代码收取申请费时
$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 工作过,但我没有遇到过这个问题。我的捐赠表格(用于收取我正在使用条带的捐赠)和我正在执行条带操作的页面位于同一站点中。我目前只是在测试。
【问题讨论】:
-
@Ywain 我现在尝试使用以下代码使用目标参数而不是帐户标题进行收费。收费代码如下所示 $charge = \Stripe\Charge::create(array( 'amount' => $amtincents, 'currency' => 'usd', 'source' => $stripetoken, 'destination' = > $_POST['stripe_connected_user_id'], 'application_fee' => $appfee, 'description' => 'Campaign Donation', 'metadata' => array("Campaign Id" => $id) ));我现在得到 Array ( [error] => The 'destination' param cannot be set to your own account.)
-
@Ywain 我现在尝试使用以下代码进行收费,并使用目标参数而不是帐户标题。收费代码如下所示 $charge = \Stripe\Charge::create(array( 'amount' => $amtincents, 'currency' => 'usd', 'source' => $stripetoken, 'destination' = > $_POST['stripe_connected_user_id'], 'application_fee' => $appfee, 'description' => 'Campaign Donation', 'metadata' => array("Campaign Id" => $id) ));我现在收到错误消息([error] => 'destination' 参数不能设置为您自己的帐户。)
标签: stripe-payments stripe-connect