Skip to content

Commit

Permalink
* bugfix: paymentmethods.xml must be used in the old API for the paym…
Browse files Browse the repository at this point in the history
…ent methods, and not paymentmethods.xlf.

* remove dependency from migration_core. Replace all t3lib_div calls by TYPO3\CMS\Core\Utility\GeneralUtility. Replace all t3lib_extMgm calls by TYPO3\CMS\Core\Utility\ExtensionManagementUtility. Replace t3lib_Singleton by \TYPO3\CMS\Core\SingletonInterface
* use makeInstance instead of getUserObj
  • Loading branch information
franzholz committed Nov 5, 2019
1 parent 757a44a commit 6711ea7
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 25 deletions.
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@

2019-11-05 Franz Holzinger <[email protected]>
* bugfix: paymentmethods.xml must be used in the old API for the payment methods, and not paymentmethods.xlf.
* remove dependency from migration_core. Replace all t3lib_div calls by TYPO3\CMS\Core\Utility\GeneralUtility. Replace all t3lib_extMgm calls by TYPO3\CMS\Core\Utility\ExtensionManagementUtility. Replace t3lib_Singleton by \TYPO3\CMS\Core\SingletonInterface
* use makeInstance instead of getUserObj

2019-08-27 Franz Holzinger <[email protected]>
* readd ext_autoload.php for TYPO3 6.2

Expand Down
2 changes: 1 addition & 1 deletion Classes/Api/PaymentPreviousApi.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static public function getGatewayProxyObject (
$confScript
)
{
$result = FALSE;
$result = false;

if (
is_array($confScript) &&
Expand Down
6 changes: 1 addition & 5 deletions Classes/Api/Start.php
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ static public function render (
}
}

if ($finalize) { // neu
if ($finalize) {
// add the markers for a processed transaction
$parameters = $gatewayProxyObject->transactionGetParameters();
foreach ($parameters as $key => $parameter) {
Expand All @@ -675,10 +675,6 @@ static public function render (
$parameter
);
}

// $markerArray['###TRANSACTOR_' . strtoupper($key) . '###'] = strip_tags($parameter);


}

$gatewayStatus = array();
Expand Down
3 changes: 2 additions & 1 deletion Classes/Request/Parameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
*
*/

use TYPO3\CMS\Core\Utility\GeneralUtility;


class Parameters implements \TYPO3\CMS\Core\SingletonInterface
Expand Down Expand Up @@ -89,7 +90,7 @@ static public function getPiVars ()
self::$prefixId &&
!isset(self::$piVars[self::$prefixId])
) {
self::$piVars = t3lib_div::_GPmerged(self::$prefixId);
self::$piVars = GeneralUtility::_GPmerged(self::$prefixId);
}
$result = self::$piVars;
return $result;
Expand Down
6 changes: 3 additions & 3 deletions composer.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
}
],
"license": [
"GPL-2.0+"
"GPL-2.0-or-later"
],
"require": {
"php": ">=5.6.0,<7.99.99",
"typo3/cms-core": ">=6.2.0,<8.99.99",
"jambagecom/div2007": ">=1.10.7"
"jambagecom/div2007": ">=1.10.16"
},
"suggest": {
"jambagecom/migration_core": ">=0.0.0"
Expand All @@ -43,7 +43,7 @@
]
},
"replace": {
"transactor": "self.version",
"jambagecom/transactor": "self.version",
"typo3-ter/transactor": "self.version"
},
"extra": {
Expand Down
3 changes: 0 additions & 3 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
),
'conflicts' => array(
),
'suggests' => array(
'migration_core' => '0.0.0-0.99.99',
),
),
);

10 changes: 5 additions & 5 deletions lib/class.tx_transactor_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static public function init (
$cObj = \JambageCom\Div2007\Utility\FrontendUtility::getContentObjectRenderer();
}

$languageObj = GeneralUtility::getUserObj(\JambageCom\Transactor\Api\Localization::class);
$languageObj = GeneralUtility::makeInstance(\JambageCom\Transactor\Api\Localization::class);
$languageObj->init1(
$pLangObj,
$conf['_LOCAL_LANG.'],
Expand All @@ -72,7 +72,7 @@ static public function getMarkers (
&$markerArray
) {
$cObj = \JambageCom\Div2007\Utility\FrontendUtility::getContentObjectRenderer();
$languageObj = GeneralUtility::getUserObj(\JambageCom\Transactor\Api\Localization::class);
$languageObj = GeneralUtility::makeInstance(\JambageCom\Transactor\Api\Localization::class);
$languageObj->init1(
'',
$conf['marks.']
Expand Down Expand Up @@ -239,7 +239,7 @@ static public function includeHandleLib (
&$localTemplateCode,
&$errorMessage
) {
$languageObj = GeneralUtility::getUserObj(\JambageCom\Transactor\Api\Localization::class);
$languageObj = GeneralUtility::makeInstance(\JambageCom\Transactor\Api\Localization::class);
$bFinalize = false;
$bFinalVerify = false;
$gatewayExtKey = '';
Expand Down Expand Up @@ -596,7 +596,7 @@ static public function checkRequired (
$ok = $gatewayProxyObject->transaction_validate();

if (!$ok) {
$languageObj = GeneralUtility::getUserObj(\JambageCom\Transactor\Api\Localization::class);
$languageObj = GeneralUtility::makeInstance(\JambageCom\Transactor\Api\Localization::class);

$errorMessage =
$languageObj->getLabel(
Expand Down Expand Up @@ -813,7 +813,7 @@ static protected function getPaymentBasket (
&$basketArray
) {
$bUseStaticInfo = false;
$languageObj = GeneralUtility::getUserObj(\JambageCom\Transactor\Api\Localization::class);
$languageObj = GeneralUtility::makeInstance(\JambageCom\Transactor\Api\Localization::class);

if (ExtensionManagementUtility::isLoaded('static_info_tables')) {
$bUseStaticInfo = true;
Expand Down
4 changes: 2 additions & 2 deletions model/class.tx_transactor_gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ public function setConfig ($config, $index = '') {
*/
public function getAvailablePaymentMethods () {

$filename = ExtensionManagementUtility::extPath($this->getExtKey()) . 'paymentmethods.xlf';
$filenamepath = GeneralUtility::getUrl(ExtensionManagementUtility::extPath($this->getExtKey()) . 'paymentmethods.xlf');
$filename = ExtensionManagementUtility::extPath($this->getExtKey()) . 'paymentmethods.xml';
$filenamepath = GeneralUtility::getUrl(ExtensionManagementUtility::extPath($this->getExtKey()) . 'paymentmethods.xml');

if ($filenamepath) {
$result = GeneralUtility::xml2array($filenamepath);
Expand Down
7 changes: 5 additions & 2 deletions model/class.tx_transactor_gatewayfactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
* @author Robert Lemke <[email protected]>
*/

use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;


final class tx_transactor_gatewayfactory {

Expand Down Expand Up @@ -77,8 +80,8 @@ public static function getInstance () {
*/
public static function registerGatewayExt ($extKey) {

if (t3lib_extMgm::isLoaded($extKey)) {
$gatewayProxy = t3lib_div::getUserObj('tx_transactor_gatewayproxy');
if (ExtensionManagementUtility::isLoaded($extKey)) {
$gatewayProxy = GeneralUtility::makeInstance('tx_transactor_gatewayproxy');
$gatewayProxy->init($extKey);
self::$gatewayProxyObjects[$extKey] = $gatewayProxy;
$result = self::$gatewayProxyObjects[$extKey];
Expand Down
2 changes: 1 addition & 1 deletion model/class.tx_transactor_gatewayproxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function init ($extKey) {


public function getGatewayObj () {
$result = GeneralUtility::getUserObj($this->gatewayClass);
$result = GeneralUtility::makeInstance($this->gatewayClass);
if (!is_object($result)) {
throw new RuntimeException('ERROR in the Payment Transactor API (transactor) used by the extension "' . $this->gatewayExt . '": no object exists for the class "' . $this->gatewayClass . '"', 2020290000);
}
Expand Down
2 changes: 1 addition & 1 deletion model/class.tx_transactor_language.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/


class tx_transactor_language extends tx_div2007_alpha_language_base implements t3lib_Singleton {
class tx_transactor_language extends tx_div2007_alpha_language_base implements \TYPO3\CMS\Core\SingletonInterface {
public function init1 ($pObj, $cObj, $conf, $scriptRelPath) {

parent::init(
Expand Down
3 changes: 2 additions & 1 deletion model/class.tx_transactor_model_control.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*
*/

use TYPO3\CMS\Core\Utility\GeneralUtility;


class tx_transactor_model_control {
Expand Down Expand Up @@ -80,7 +81,7 @@ static public function getPiVars () {
self::$prefixId &&
!isset(self::$piVars[self::$prefixId])
) {
self::$piVars = t3lib_div::_GPmerged(self::$prefixId);
self::$piVars = GeneralUtility::_GPmerged(self::$prefixId);
}
$result = self::$piVars;
return $result;
Expand Down

0 comments on commit 6711ea7

Please sign in to comment.