2CO calculate class

1 view
Skip to first unread message

thiwankalk

unread,
Nov 4, 2008, 11:19:33 PM11/4/08
to Sri Lanka Web Development
<?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{
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;
}
}
}
?>
Reply all
Reply to author
Forward
0 new messages