-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from PayEx/develop
Updates for version 3.0.3
- Loading branch information
Showing
69 changed files
with
2,464 additions
and
314 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
language: php | ||
sudo: false | ||
|
||
php: | ||
#- 5.3 | ||
- 5.4 | ||
- 5.5 | ||
- 5.6 | ||
|
||
env: | ||
- MAGENTO_VERSION="1.7.0.2" | ||
- MAGENTO_VERSION="1.8.1.0" | ||
- MAGENTO_VERSION="1.9.2.4" | ||
|
||
matrix: | ||
fast_finish: true | ||
allow_failures: | ||
- php: 5.6 | ||
exclude: | ||
# Newer Magento versions uses newer PHP versions | ||
- php: 5.3 | ||
env: MAGENTO_VERSION="1.9.2.4" | ||
|
||
# Old Magento Versions are not officially supported to run with PHP 5.5+ | ||
- php: 5.5 | ||
env: MAGENTO_VERSION="1.7.0.2" | ||
- php: 5.6 | ||
env: MAGENTO_VERSION="1.7.0.2" | ||
|
||
install: | ||
- git submodule update --init --recursive | ||
- composer require firegento/magento ~$MAGENTO_VERSION | ||
- cp phpunit.xml ./vendor/firegento/magento | ||
- cd ./vendor/firegento/magento | ||
- cp ./app/etc/local.xml.template ./app/etc/local.xml | ||
- sed -i -e 's/{{date}}/Thu, 14 Jul 2016 10:03:10 +0000/g' ./app/etc/local.xml | ||
- sed -i -e 's/{{key}}/8532ecf375979bf5658401d2b7ca2040/g' ./app/etc/local.xml | ||
- sed -i -e 's/{{db_prefix}}//g' ./app/etc/local.xml | ||
- sed -i -e 's/{{db_host}}/localhost/g' ./app/etc/local.xml | ||
- sed -i -e 's/{{db_user}}/travis/g' ./app/etc/local.xml | ||
- sed -i -e 's/{{db_pass}}//g' ./app/etc/local.xml | ||
- sed -i -e 's/{{db_name}}/magento_test/g' ./app/etc/local.xml | ||
- sed -i -e 's/{{db_init_statemants}}/SET NAMES utf8/g' ./app/etc/local.xml | ||
- sed -i -e 's/{{db_model}}/mysql4/g' ./app/etc/local.xml | ||
- sed -i -e 's/{{db_pdo_type}}//g' ./app/etc/local.xml | ||
- sed -i -e 's/{{db_type}}/pdo_mysql/g' ./app/etc/local.xml | ||
- sed -i -e 's/{{session_save}}/files/g' ./app/etc/local.xml | ||
- sed -i -e 's/{{admin_frontname}}/admin/g' ./app/etc/local.xml | ||
- wget https://raw.githubusercontent.com/colinmollenhour/modman/master/modman | ||
- chmod +x ./modman | ||
- ./modman init | ||
- ./modman clone https://github.com/EcomDev/EcomDev_PHPUnit.git | ||
- sed -i -e 's/<allow_same_db>0/<allow_same_db>1/g' ./app/etc/local.xml.phpunit | ||
- ./modman link $(readlink -f ./../../../) | ||
- wget https://files.magerun.net/n98-magerun.phar | ||
- chmod +x ./n98-magerun.phar | ||
- wget http://magento7.aait.nu/magento_test.sql | ||
- mysql -e 'create database `magento_test`;' | ||
- mysql -utravis -Dmagento_test < ./magento_test.sql | ||
- ./n98-magerun.phar sys:setup:run | ||
- ./n98-magerun.phar cache:clean | ||
- ./n98-magerun.phar index:reindex:all | ||
- cd shell | ||
- php ./ecomdev-phpunit.php -a magento-config --db-name travis --base-url http://magetest7.local/ | ||
- cd .. | ||
|
||
script: | ||
- phpunit | ||
|
||
notifications: | ||
email: | ||
recipients: | ||
- [email protected] | ||
on_failure: always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
PayEx_Payments/app/code/community/PayEx/Payments/Block/Creditmemo/Totals/Fee.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
class PayEx_Payments_Block_Creditmemo_Totals_Fee extends Mage_Adminhtml_Block_Template | ||
{ | ||
public function initTotals() | ||
{ | ||
$parent = $this->getParentBlock(); | ||
if ($parent->getSource()->getBasePayexPaymentFee() > 0) { | ||
if ($this->displaySalesPayExFeeBoth()) { | ||
$total = new Varien_Object(); | ||
$total->setLabel(Mage::helper('payex')->__('Payment fee (Incl.Tax)')); | ||
$total->setValue($parent->getSource()->getPayexPaymentFee() + $parent->getSource()->getPayexPaymentFeeTax()); | ||
$total->setBaseValue($parent->getSource()->getBasePayexPaymentFee() + $parent->getSource()->getBasePayexPaymentFeeTax()); | ||
$total->setCode('payex_payment_fee_with_tax'); | ||
$parent->addTotalBefore($total, 'shipping'); | ||
|
||
$total = new Varien_Object(); | ||
$total->setLabel(Mage::helper('payex')->__('Payment fee (Excl.Tax)')); | ||
$total->setValue($parent->getSource()->getPayexPaymentFee()); | ||
$total->setBaseValue($parent->getSource()->getBasePayexPaymentFee()); | ||
$total->setCode('payex_payment_fee'); | ||
$parent->addTotalBefore($total, 'payex_payment_fee_with_tax'); | ||
} elseif ($this->displaySalesPayExFeeInclTax()) { | ||
$total = new Varien_Object(); | ||
$total->setLabel(Mage::helper('payex')->__('Payment fee')); | ||
$total->setValue($parent->getSource()->getPayexPaymentFee() + $parent->getSource()->getPayexPaymentFeeTax()); | ||
$total->setBaseValue($parent->getSource()->getBasePayexPaymentFee() + $parent->getSource()->getBasePayexPaymentFeeTax()); | ||
$total->setCode('payex_payment_fee_with_tax'); | ||
$parent->addTotalBefore($total, 'shipping'); | ||
} else { | ||
$total = new Varien_Object(); | ||
$total->setLabel(Mage::helper('payex')->__('Payment fee')); | ||
$total->setValue($parent->getSource()->getPayexPaymentFee()); | ||
$total->setBaseValue($parent->getSource()->getBasePayexPaymentFee()); | ||
$total->setCode('payex_payment_fee'); | ||
$parent->addTotalBefore($total, 'shipping'); | ||
} | ||
} | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Check if display cart prices fee included and excluded tax | ||
* @return mixed | ||
*/ | ||
public function displaySalesPayExFeeBoth() | ||
{ | ||
$config = Mage::getSingleton('payex/fee_config'); | ||
return $config->displaySalesPayExFeeBoth($this->getParentBlock()->getSource()->getStoreId()); | ||
} | ||
|
||
/** | ||
* Check if display cart prices fee included tax | ||
* @return mixed | ||
*/ | ||
public function displaySalesPayExFeeInclTax() | ||
{ | ||
$config = Mage::getSingleton('payex/fee_config'); | ||
return $config->displaySalesPayExFeeInclTax($this->getParentBlock()->getSource()->getStoreId()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.