Skip to content

Commit

Permalink
Merge pull request #1 'OXID-123'
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Bender committed May 19, 2017
2 parents a560fbd + 72d38e2 commit 34729aa
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 20 deletions.
11 changes: 4 additions & 7 deletions application/models/fcporatepay.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function fcpoInsertProfile($sOxid, $aRatePayData)
*/
public function fcpoGetRatePayProfiles($sPaymentId = null)
{
$oDb = $this->_oFcpoHelper->fcpoGetDb(true);
$aReturn = array();

$sFilterPaymentId = "";
Expand All @@ -85,15 +86,11 @@ public function fcpoGetRatePayProfiles($sPaymentId = null)
}

$sQuery = "SELECT * FROM fcporatepay {$sFilterPaymentId}";
$aRatePayProfiles = $this->_oFcpoDb->getAll($sQuery);
$aFields = $this->fcpoGetFields();
$aRatePayProfiles = $oDb->getAll($sQuery);

foreach ($aRatePayProfiles as $aRatePayProfile) {
$sOxid = $aRatePayProfile[0];
foreach ($aRatePayProfile as $iIndex=>$sValue) {
$aRow[$aFields[$iIndex][0]] = $sValue;
}
$aReturn[$sOxid] = $aRow;
$sOxid = $aRatePayProfile['OXID'];
$aReturn[$sOxid] = $aRatePayProfile;
}
return $aReturn;
}
Expand Down
18 changes: 9 additions & 9 deletions lib/fcpohelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ public function fcpoGetSession()
public function fcpoGetDb($blAssoc = false)
{
if ($blAssoc) {
return ( $this->_fcUseDeprecatedInstantiation ) ? oxDb::getDb(true) : oxDb::getDb(oxDB::FETCH_MODE_ASSOC);
return ($this->_fcUseDeprecatedInstantiation()) ? oxDb::getDb(true) : oxDb::getDb(oxDB::FETCH_MODE_ASSOC);
} else {
return ( $this->_fcUseDeprecatedInstantiation ) ? oxDb::getDb() : oxDb::getDb(oxDb::FETCH_MODE_NUM);
return ($this->_fcUseDeprecatedInstantiation()) ? oxDb::getDb() : oxDb::getDb(oxDb::FETCH_MODE_NUM);
}
}

Expand Down Expand Up @@ -355,7 +355,7 @@ public function fcpoGetUtilsDate()
*/
public static function fcpoGetStaticModuleVersion()
{
return '1.0.0';
return '1.0.1';
}

/**
Expand All @@ -366,7 +366,7 @@ public static function fcpoGetStaticModuleVersion()
*/
public function fcpoGetModuleVersion()
{
return '1.0.0';
return '1.0.1';
}

/**
Expand Down Expand Up @@ -507,7 +507,7 @@ public function fcpoGetPayoneStatusList()
'vsettlement',
'transfer',
'invoice',
);
);
}

/**
Expand Down Expand Up @@ -540,10 +540,10 @@ public function fcpoGetIntegratorId()
protected function _fcUseDeprecatedInstantiation()
{
$oConfig = $this->getConfig();
if (( version_compare($oConfig->getVersion(), "4.8.0") < 1 && $oConfig->getEdition() == "CE" )
|| ( version_compare($oConfig->getVersion(), "4.8.0") < 1 && $oConfig->getEdition() == "PE" )
|| ( version_compare($oConfig->getVersion(), "5.1.0") < 1 && $oConfig->getEdition() == "EE" )
) {
if ((version_compare($oConfig->getVersion(), "4.8.0") < 1 && $oConfig->getEdition() == "CE")
|| (version_compare($oConfig->getVersion(), "4.8.0") < 1 && $oConfig->getEdition() == "PE")
|| (version_compare($oConfig->getVersion(), "5.1.0") < 1 && $oConfig->getEdition() == "EE")
) {
return true;
} else {
return false;
Expand Down
2 changes: 1 addition & 1 deletion lib/fcporequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function __construct()
$this->addParameter('integrator_version', $this->_oFcpoHelper->fcpoGetIntegratorVersion());
$this->addParameter('solution_name', 'fatchip');
// $this->addParameter('solution_version', $this->_oFcpoHelper->fcpoGetModuleVersion());
$this->addParameter('solution_version', '2.0.10');
$this->addParameter('solution_version', '1.0.1');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
https://www.payone.de
</a>',
'thumbnail' => 'picture.gif',
'version' => '1.0.0',
'version' => '1.0.1',
'author' => 'FATCHIP GmbH',
'email' => '[email protected]',
'url' => 'http://wiki.fatchip.de/fc/mod_oxid_payone/start',
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/fcPayOne/application/models/fcporatepayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ public function test_fcpoGetRatePayProfiles_Coverage()
$oMockDatabase = $this->getMock('oxDb', array('getAll', 'quote'));
$oMockDatabase->expects($this->atLeastOnce())->method('getAll')->will($this->returnValue($aMockResult));
$oMockDatabase->expects($this->any())->method('quote')->will($this->returnValue(null));
$this->invokeSetAttribute($oTestObject, '_oFcpoDb', $oMockDatabase);

$oHelper = $this->getMockBuilder('fcpohelper')->disableOriginalConstructor()->getMock();
$oHelper->expects($this->any())->method('fcpoGetDb')->will($this->returnValue($oMockDatabase));
$this->invokeSetAttribute($oTestObject, '_oFcpoHelper', $oHelper);

$aExpect = array(
'someValue' => array(''=>'someValue'),
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1

0 comments on commit 34729aa

Please sign in to comment.