条带:创建订阅的目标费用

时间:2019-03-04 08:48:53

标签: stripe-payments

是否可以在Stripe中为订阅或计划创建目标费用?

我们在平台上使用关联的自定义帐户。由于我们使用SEPA付款,因此无法直接在关联的自定义帐户上创建客户,产品和订阅。相反,我们必须自己向客户收费,然后以某种方式将减去我们的申请费的金额转入关联帐户。

Stripe提供destination charges的一次性费用:

$charge = \Stripe\Charge::create([
  "amount" => 1000,
  "currency" => "eur",
  "source" => "tok_visa",
  "application_fee_amount" => 123,
  "transfer_data" => [
    "destination" => "{CONNECTED_STRIPE_ACCOUNT_ID}",
  ],
]);

但是我们需要订阅功能。我试图在计划和订阅上设置transfer_data和application_fee_amount。但是我只得到一个错误,说applciation_fee_amount和transfer_data是未知参数:

$stripePlatformPlan = Plan::create([
    "currency"  => "eur",
    "interval"  => "month",
    "product"   => $stripePlatformProduct,
    "amount"    => $totalAmount * 100
]);

$stripePlatformSubscription = \Stripe\Subscription::create([
    "customer" => $stripePlatformCustomer,
    "billing"   => "charge_automatically",
    "items"     => [
        "plan"  => $stripePlatformPlan
    ],
    "application_fee_amount" => $applicationFee,
    "transfer_data" => [
        "destination" => $stripeConnectedAccount->id
    ]
]);

0 个答案:

没有答案