Example #1
0
 /**
  * Get Payment Fee Price
  * @param float $fee
  * @param int $tax_class
  * @return Varien_Object
  */
 public function getPaymentFeePrice($fee, $tax_class)
 {
     // Get Tax Rate
     $request = Mage::getSingleton('tax/calculation')->getRateRequest($this->getQuote()->getShippingAddress(), $this->getQuote()->getBillingAddress(), $this->getQuote()->getCustomerTaxClassId(), $this->getQuote()->getStore());
     $taxRate = Mage::getSingleton('tax/calculation')->getRate($request->setProductClassId($tax_class));
     $priceIncludeTax = Mage::helper('tax')->priceIncludesTax($this->getQuote()->getStore());
     $taxAmount = Mage::getSingleton('tax/calculation')->calcTaxAmount($fee, $taxRate, $priceIncludeTax, true);
     if ($priceIncludeTax) {
         $fee -= $taxAmount;
     }
     $result = new Varien_Object();
     return $result->setPaymentFeePrice($fee)->setPaymentFeeTax($taxAmount);
 }