You need to login in order to make a new post. If you do not have a community account, you can get one here.

PHP class - return total transaction ammount

#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;
}
}

RSS feed

3 Comments »

# Comment by joel 2CO Staff
2008-10-06 10:02:05

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?

 
 
# Comment by thiwankalk
2008-10-06 10:22:22

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;
}
}
}

 
 
# Comment by thiwankalk
2008-10-06 10:22:48

thats pay.class.php

 
 
You need to login before leaving a comment If you do not have an account, you can register one here.

Recent Activity:

Welcome to 2Checkout!

2Checkout is a full-service e-commerce solution recognized by Inc. Magazine as one of the fastest growing companies in the United States. 2CO’s proprietary technology supports back-office functions including financial reporting, tracking, fraud prevention, affiliate tracking, customer service and sales tracking. Click here to learn more.

Now a faster, easier way to get paid – the 2CO reloadable MasterCard®.

Sign up today and receive a $10 credit on your card.


Click here to learn more.

Spotlight Product

Spotlight Product

Canadian Mini Muks

Spotlight Supplier

Spotlight Supplier

Chocolate Shoppe


Popular Tags