【问题标题】:How to take application fee on invoice sent on connected account's behalf如何在代表关联账户发送的发票上收取申请费
【发布时间】:2019-07-08 01:35:12
【问题描述】:

我试图在我代表关联的 Stripe 标准账户发送的 Stripe 发票上收取申请费。但是,我无法弄清楚如何在条纹标准帐户上创建发票 A)然后从中收取费用 B)在我的平台帐户上创建发票并使用申请费来获得报酬。

我能找到的最接近的文档是https://stripe.com/docs/connect/subscriptions#invoices。我下面的代码返回此错误“没有此类发票:in_1E3c6TIMPzVAHwIq4ndgMsBV”。

$item=\Stripe\InvoiceItem::create([
    "customer" => "cus_ETsE8pqOpNnmdB",
    "amount" => 2500,
    "currency" => "usd",
    "description" => "One-time setup fee"
]);
$newInvoice=\Stripe\Invoice::create([
    "customer" => "cus_ETsE8pqOpNnmdB",
]);
$invoice = \Stripe\Invoice::retrieve(
    $newInvoice->id,
    ["stripe_account" => "acct_1AtpdCAO1KumKYA2"]
);
$invoice->application_fee = 100; // amount in cents
$invoice->save();

预期的结果是向连接的标准账户发送带有品牌标识的发票,付款后,我的平台账户会收到费用。

【问题讨论】:

  • 由于您使用 connect 并代表 Connected Account 创建 Invoice,因此您需要使用 Stripe Account 标头 (["stripe_account" => "{CONNECTED_STRIPE_ACCOUNT_ID}"]) 并在关联账户。在这种情况下,您将能够设置application_fee
  • @wsw 做到了!如果您添加为答案,我会接受。对于任何人来说,这里是使它工作的代码:$item=\Stripe\InvoiceItem::create([ "customer" => "cus_EWqTMbhPa537vV", "amount" => 2500],["stripe_account" => "acct_1AtpdCAO1KumKYA2"]); $newInvoice=\Stripe\Invoice::create([ "customer" => "cus_EWqTMbhPa537vV", ],["stripe_account" => "acct_1AtpdCAO1KumKYA2"]); $invoice = \Stripe\Invoice::retrieve( $newInvoice->id, ["stripe_account" => "acct_1AtpdCAO1KumKYA2"] ); $invoice->application_fee = 100; // amount in cents $invoice->save();

标签: stripe-payments


【解决方案1】:

谢谢斯坦,

对于任何人来说,这里是使它工作的代码:

$item = \Stripe\InvoiceItem::create(["customer" => "cus_EWqTMbhPa537vV", "amount" => 2500], ["stripe_account" => "acct_1AtpdCAO1KumKYA2"]);
$newInvoice = \Stripe\Invoice::create(["customer" => "cus_EWqTMbhPa537vV"], ["stripe_account" => "acct_1AtpdCAO1KumKYA2"]);
$invoice = \Stripe\Invoice::retrieve($newInvoice->id, ["stripe_account" => "acct_1AtpdCAO1KumKYA2"]);
$invoice->application_fee = 100; // amount in cents 
$invoice->save();

【讨论】:

    猜你喜欢
    • 2022-01-19
    • 2018-10-15
    • 2023-03-27
    • 2020-04-17
    • 1970-01-01
    • 2011-03-29
    • 1970-01-01
    • 1970-01-01
    • 2014-10-10
    相关资源
    最近更新 更多