#Developer thiwanka
#2co payment 2CO applies a 5.5% commission on each transaction, plus a $0.45 charge per transaction.
# Return _construct(yourammount) function Total Transaction Fees
include(’pay.class.php’);
$Object = new TCO;
echo $Object->_construct(100);
—————————
pay.class.php
#Developer thiwanka
#2co payment 2CO applies a 5.5% commission on each transaction, plus a $0.45 charge per transaction.
# Return PayDoller function Total Transaction Fees
class TCO{
function _construct($Amount){
return round((float)$this->PayDoller($Amount),2);
}
function PayDoller($PureTotal,$commision=5.5,$pertransaction=0.45){
$Total=0.00;
$Total=(float)$PureTotal*($commision/100)+$pertransaction;
$Total=$PureTotal+$Total;
return $Total;
}
}
3 Comments »
+0
-0
Hello thiwankalk - Could you provide some details about the PHP code that you have provided for those who may not be able to read the code?
+0
-1
class TCO{
protected static $commisonPercent = 5.5;
protected static $transactionFee = .45;
function __construct($amount, $commisionByClient = false){
$tcoFee = (($amount/100)*$commisonPercent) + .45;
if($commisionByClient) {
return $amount+$tcoFee;
}
else {
return $amount-$tcoFee;
}
}
}
+0
-0
thats pay.class.php