Skip to content

Commit

Permalink
* compatibility for TYPO3 9: transactor 0.8.0 now runs fully under TY…
Browse files Browse the repository at this point in the history
…PO3 9.5.

* set compatibility = 0 to use the new API by default.
* Deprecation 75371: replace GeneralUtility::array2xml_cs() by GeneralUtility::array2xml()
  • Loading branch information
franzholz committed Dec 20, 2019
1 parent 6711ea7 commit a8894b1
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 30 deletions.
4 changes: 4 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2019-12-20 Franz Holzinger <[email protected]>
* compatibility for TYPO3 9: transactor 0.8.0 now runs fully under TYPO3 9.5.
* set compatibility = 0 to use the new API by default.
* Deprecation 75371: replace GeneralUtility::array2xml_cs() by GeneralUtility::array2xml()

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.
Expand Down
15 changes: 10 additions & 5 deletions Classes/Api/Start.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,9 @@ static public function getMarkers (
$conf['_LOCAL_LANG.'],
TRANSACTOR_LANGUAGE_PATH
);

$languageObj->loadLocalLang(
TRANSACTOR_LANGUAGE_PATH . 'locallang_marker.xlf'
);

$locallang = $languageObj->getLocalLang();
$localLangKey = $languageObj->getLocalLangkey();

Expand All @@ -97,6 +95,13 @@ static public function getMarkers (
} else {
$langArray = $locallang['default'];
}
$parser = $cObj;
if (
defined('TYPO3_version') &&
version_compare(TYPO3_version, '7.0.0', '>=')
) {
$parser = \tx_div2007_core::newHtmlParser(false);
}

if (is_array($conf['marks.'])) {
// Substitute Marker Array from TypoScript Setup
Expand All @@ -116,7 +121,7 @@ static public function getMarkers (
$value = $value[0]['target'];
}
$newMarkerArray['###' . strtoupper($key) . '###'] =
$cObj->substituteMarkerArray($value, $markerArray);
$parser->substituteMarkerArray($value, $markerArray);
}
} else {
$langArray = array();
Expand Down Expand Up @@ -516,7 +521,7 @@ static public function render (
$templateFilename = $gatewayProxyObject->getTemplateFilename();
}
}
$localTemplateCode = $cObj->fileResource($templateFilename);
$localTemplateCode = \JambageCom\Div2007\Utility\FrontendUtility::fileResource($templateFilename);

if (
!$localTemplateCode &&
Expand Down Expand Up @@ -595,7 +600,7 @@ static public function render (
) {
$imageOut = $cObj->getContentObject($lConf['extImage'])->render($lConf['extImage.']);
} else {
$imageOut = $cObj->fileResource($lConf['extImage']);
$imageOut = \JambageCom\Div2007\Utility\FrontendUtility::fileResource($lConf['extImage']);
}
$markerArray['###TRANSACTOR_IMAGE###'] = $imageOut;
$markerArray['###TRANSACTOR_WWW###'] = $lConf['extWww'];
Expand Down
20 changes: 7 additions & 13 deletions Classes/Domain/GatewayBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,22 +482,16 @@ public function transactionSetDetails ($detailsArray)
}
}
$xmlOptions =
GeneralUtility::array2xml_cs(
$this->getConfig(),
'phparray',
array(),
'utf-8'
'<?xml version=”1.0” encoding=”utf-8” standalone=”yes” ?>' . LF .
GeneralUtility::array2xml(
$this->getConfig()
);
}
$conf = $this->getConf();
$xmlExtensionConfiguration =
GeneralUtility::array2xml_cs(
$conf,
'phparray',
array(),
'utf-8'
);

'<?xml version=”1.0” encoding=”utf-8” standalone=”yes” ?>' . LF .
GeneralUtility::array2xml(
$this->getConf()
);

// Store order id in database
$dataArray = array(
Expand Down
2 changes: 1 addition & 1 deletion Configuration/TCA/tx_transactor_transactions.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
'crdate' => 'crdate',
'default_sortby' => 'ORDER BY crdate',
'dividers2tabs' => true,
'iconfile' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('transactor') . 'ext_icon.gif',
'iconfile' => 'EXT:' . TRANSACTOR_EXT . '/ext_icon.gif',
'searchFields' => 'uid,reference,orderuid,message,user',
),
'interface' => array (
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"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.16"
"php": ">=5.6.0,<7.3.99",
"typo3/cms-core": ">=6.2.1,<9.5.99",
"jambagecom/div2007": ">=1.10.20"
},
"suggest": {
"jambagecom/migration_core": ">=0.0.0"
Expand Down
2 changes: 1 addition & 1 deletion ext_conf_template.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# cat=basic/enable; type=integer; label=Compatibility Mode: If set to 1, then the old API class.tx_transactor_api.php shall be used by extensions like tt_products. Set this to 0 to use the new API with the namespace class \JambageCom\Transactor\Api\Start .
compatibility = 1
compatibility = 0

# cat=basic/enable; type=integer; label=Maximum characters: Set the maximum number of characters which are used from the item fields in the cart.
maximumCharacters = 64
Expand Down
8 changes: 4 additions & 4 deletions ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'title' => 'Payment Transactor API',
'description' => 'This is a basic API to develop extensions which connect to different payment transaction gateways.',
'category' => 'misc',
'version' => '0.7.3',
'version' => '0.8.0',
'state' => 'stable',
'uploadfolder' => 0,
'createDirs' => '',
Expand All @@ -18,9 +18,9 @@
'author_company' => '',
'constraints' => array(
'depends' => array(
'php' => '5.6.0-7.99.99',
'typo3' => '6.2.1-8.99.99',
'div2007' => '1.10.16-0.0.0',
'php' => '5.6.0-7.3.99',
'typo3' => '6.2.1-9.5.99',
'div2007' => '1.10.20-0.0.0',
),
'conflicts' => array(
),
Expand Down
6 changes: 3 additions & 3 deletions lib/class.tx_transactor_api.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ static public function getMarkers (
$value = $value[0]['target'];
}
$newMarkerArray['###' . strtoupper($key) . '###'] =
$cObj->substituteMarkerArray($value, $markerArray);
tx_div2007_core::substituteMarkerArray($value, $markerArray);
}
} else {
$langArray = array();
Expand Down Expand Up @@ -431,7 +431,7 @@ static public function includeHandleLib (
if (!$templateFilename) {
$templateFilename = ($lConf['templateFile'] ? $lConf['templateFile'] : 'EXT:transactor/template/transactor.tmpl');
}
$localTemplateCode = self::$cObj->fileResource($templateFilename);
$localTemplateCode = \JambageCom\Div2007\Utility\FrontendUtility::fileResource($templateFilename);

if (!$localTemplateCode && $templateFilename != '') {
$errorMessage =
Expand Down Expand Up @@ -493,7 +493,7 @@ static public function includeHandleLib (
) {
$imageOut = self::$cObj->getContentObject($lConf['extImage'])->render($lConf['extImage.']);
} else {
$imageOut = self::$cObj->fileResource($lConf['extImage']);
$imageOut = \JambageCom\Div2007\Utility\FrontendUtility::fileResource($lConf['extImage']);
}
$markerArray['###TRANSACTOR_IMAGE###'] = $imageOut;
$markerArray['###TRANSACTOR_WWW###'] = $lConf['extWww'];
Expand Down

0 comments on commit a8894b1

Please sign in to comment.