<commit_before><?php

/**
 * Adyen Payment Module
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so we can send you a copy immediately.
 *
 * @category	Adyen
 * @package	Adyen_Payment
 * @copyright	Copyright (c) 2011 Adyen (http://www.adyen.com)
 * @license	http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
/**
 * @category   Payment Gateway
 * @package    Adyen_Payment
 * @author     Adyen
 * @property   Adyen B.V
 * @copyright  Copyright (c) 2014 Adyen BV (http://www.adyen.com)
 */
class Adyen_Payment_Block_Sales_Order_Totals extends Mage_Sales_Block_Order_Totals {

	protected function _initTotals()
	{
		parent::_initTotals();
		$this->addTotal(
			new Varien_Object(
				array(
					'code'      => 'payment_fee',
					'strong'    => false,
					'value'     => $this->getSource()->getPaymentFeeAmount(),
					'base_value'=> $this->getSource()->getBasePaymentFeeAmount(),
					'label'     => $this->helper('adyen')->__('Payment Fee'),
					'area'      => '',
				)
			),
			'subtotal'
		);

        $this->addTotal(
            new Varien_Object(
                array(
                    'code'      => 'payment_installment_fee',
                    'strong'    => false,
                    'value'     => $this->getSource()->getPaymentInstallmentFeeAmount(),
                    'base_value'=> $this->getSource()->getBasePaymentInstallmentFeeAmount(),
                    'label'     => $this->helper('adyen')->__('Payment Fee Installments'),
                    'area'      => '',
                )
            ),
            'subtotal'
        );
		return $this;
	}
}<commit_msg>Fixes #88 check if the values are zero if not only then show the total (this is visable on the order confirmation email)<commit_after><?php

/**
 * Adyen Payment Module
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to <EMAIL> so we can send you a copy immediately.
 *
 * @category	Adyen
 * @package	Adyen_Payment
 * @copyright	Copyright (c) 2011 Adyen (http://www.adyen.com)
 * @license	http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
/**
 * @category   Payment Gateway
 * @package    Adyen_Payment
 * @author     Adyen
 * @property   Adyen B.V
 * @copyright  Copyright (c) 2014 Adyen BV (http://www.adyen.com)
 */
class Adyen_Payment_Block_Sales_Order_Totals extends Mage_Sales_Block_Order_Totals {

	protected function _initTotals()
	{
		parent::_initTotals();

        if (((float)$this->getSource()->getPaymentFeeAmount()) != 0) {
            $this->addTotal(
                new Varien_Object(
                    array(
                        'code'      => 'payment_fee',
                        'strong'    => false,
                        'value'     => $this->getSource()->getPaymentFeeAmount(),
                        'base_value'=> $this->getSource()->getBasePaymentFeeAmount(),
                        'label'     => $this->helper('adyen')->__('Payment Fee'),
                        'area'      => '',
                    )
                ),
                'subtotal'
            );
        }

        if (((float)$this->getSource()->getPaymentInstallmentFeeAmount()) != 0) {
            $this->addTotal(
                new Varien_Object(
                    array(
                        'code'      => 'payment_installment_fee',
                        'strong'    => false,
                        'value'     => $this->getSource()->getPaymentInstallmentFeeAmount(),
                        'base_value'=> $this->getSource()->getBasePaymentInstallmentFeeAmount(),
                        'label'     => $this->helper('adyen')->__('Payment Fee Installments'),
                        'area'      => '',
                    )
                ),
                'subtotal'
            );
        }
		return $this;
	}
}
{'fraction_non_alphanumeric': 0.12788120567375885, 'fraction_numerical': 0.007978723404255319, 'mean_word_length': 1.978877887788779, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5042751', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1291, 'n_words': 332}