【问题标题】:Stripe Connect PHP - Split Payments?Stripe Connect PHP - 拆分付款?
【发布时间】:2017-04-27 02:21:34
【问题描述】:

我正在将 Stripe Connect API 与托管帐户一起使用,以在我的应用上向服务提供商分配付款。

我们的应用希望从每笔费用中抽取 20%,然后将其余部分分配给服务提供商。

我知道我可以收取全额费用并将其发送到托管帐户,如下所示:

\Stripe\Stripe::setApiKey('sk_live_xxxxxx');

$charge = \Stripe\Charge::create(array(
     "amount" => (int) $payment,
     "currency" => "usd",
     "customer" => $customerID,
     "destination" => $providerID
));

但是有没有办法只将 80%(或任何部分金额)的付款发送到目标帐户,而将其余部分保留在我们的综合帐户中?我真的不想为了促进这种模式而不得不两次向客户的信用卡收费。

【问题讨论】:

    标签: php stripe-payments stripe-connect


    【解决方案1】:

    creating a charge with Connect 时,您使用application_fee 参数选择您的平台费用。所以你可以这样做:

    $amount = 1000;  // amount in cents
    $application_fee = intval($amount * 0.2);  // 20% of the amount
    
    $charge = \Stripe\Charge::create(array(
        "amount" => $amount,
        "currency" => "usd",
        "customer" => $customerID,
        "destination" => $providerID,
        "application_fee" => $application_fee,
    ));
    

    【讨论】:

    • 谢谢!像魅力一样工作
    猜你喜欢
    • 2019-09-13
    • 1970-01-01
    • 1970-01-01
    • 2020-09-18
    • 2021-12-27
    • 1970-01-01
    • 2017-04-16
    • 1970-01-01
    • 2021-03-11
    相关资源
    最近更新 更多