【发布时间】:2018-04-11 03:32:20
【问题描述】:
我们有一件商品要卖 100 美元左右。有 5% 的税适用于它。第三方支付网关收取网关总金额的 3% 的佣金(即 100 的 3%+5%)。 由于无法向客户收取 3% 的支付网关佣金,我们将这笔额外佣金隐藏在商品价格下。 所以价格应该从 100 增加到“X”数量。
(100 + 5% tax) + 3% Commission = (X + 5% Tax) ;
请注意,当从 X + 5% Tax 增加金额时,佣金也会增加。
(100 + 5%) + 3% = (100 + 5) + 3.15 = 108.15
如果我们将 108.15 发送到网关,它会在 108.15 的金额上收取 3.255,这意味着额外收取 0.105。 IE。扣除网关佣金后我们收到的金额较少(104.895)。
我需要隔离不会导致公司额外收费的商品价格。
$tax = 5 ; //5%
$itemAmount = 100 ;
$priceWithTax = $itemAmount + ($itemAmount * 5/100) ;
$commission = 3 ; //3%
//We sent 105 to gateway.. which results 105 to customer and 3.15 to company.
$priceWithTaxCommission = $priceWithTax /* or X */ + ($priceWithTax * $commission/100) ;
$ToGateway = $priceWithTax + ($priceWithTax* 3/100) ;
//Results 108.15, If we sent 108.15 to gateway it again charge 3% on 108.15. Which is wrong.
包含支付网关佣金后如何查询产品价格?
【问题讨论】:
标签: php payment-gateway ccavenue