关于Stripe费用计算,有没有什么办法可以根据提供的金额获得Stripe费用。
我们必须以这样的方式实现这一点:我们必须向一个经销商支付 x 金额,并向另一经销商支付 y 金额。
第一种情况:
Let say we have $100 to pay to Stripe.
According to our needs, we want to calculate the Stripe fee first and then add that fee to the $100 amount.
e.g:
Amount to be Paid is $100 + $3 (Stripe fee) = $103 (Total) you need to cut from the customers account.
第二种情况:
We need to pay $95 to the dealer and the $5 left we want to keep in our account (excluding the Stripe fee).
如果这是可能的,我们如何实现它?
最佳答案
最简单的方法是为余额交易添加扩展
$charge = \Stripe\Charge::create(array(
"amount" => $totalAmount,
"currency" => $currency_code,
"source" => $stripeToken,
"transfer_group" => $orderId,
"expand" => array("balance_transaction")
));
这将为您提供 Stripe 收取的费用,然后您可以进行剩余的计算
关于stripe-payments - Stripe 费用计算,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36907341/