Skip to content

Commit

Permalink
Merge pull request #175 from HeinrichJulian/OX6-67
Browse files Browse the repository at this point in the history
OX6-67: type and format fixes
  • Loading branch information
fjbender authored Aug 11, 2020
2 parents 30d3cad + 955fdf2 commit 103f2f2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions application/views/admin/de/fcPayOne_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@
'FCPO_TRANSACTIONREDIRECTMETHOD_CRONJOB' => 'Verzögert mit Cronjob (Übertragungssicherheit)',
'FCPO_HELP_TRANSACTIONREDIRECTMETHOD' => 'Wählen Sie die Methode wie Transaktionsstatusmeldungen weitergeleitet werden. Ihnen stehen zur Auswahl:<br><b>Direkte Weiterleitung:</b><br>Bei der direkten Weiterleitung wird die Statusmeldung direkt an die konfigurierten Ziele weitergeleitet. Sie bietet eine hohe Weiterleitungsgeschwindigkeit und eine moderate Übertragungssicherheit.<br><b>Verzögert mit Cronjob:</b><br>Diese Methode leitet die Statusmeldung nicht direkt weiter, sondern sammelt die eingehenden Aufrufe und leitet diese erst durch einen Cronjobaufruf an die Ziele weiter. Diese Methode bietet vor allem eine hohe Übertragungssicherheit. Die Weiterleitungsgeschwindigkeit hängt von der Serverkonfiguration ab. Bitte konsultieren Sie das <a href="">Handbuch</a> um zu erfahren wie Sie diesen Modus effizient einrichten',
'FCPO_TRANSACTIONREDIRECTMETHOD' => 'Weiterleitungsmethode',
'FCPO_TRANSACTIONREDIRECT_TIMEOUT' => 'Zeitlimit in ms bei Direktweiterleitungen',
'FCPO_HELP_TRANSACTIONREDIRECT_TIMEOUT' => 'Um eine unterbrechungsfreie Weiterleitung zu ermöglichen werden Statusmeldungen im Modus "Direkte Weiterleitung" mit einem Zeitlimit versendet. Abhängig von ihrem Serversetup kann es notwendig sein, dass Sie einen höheren Wert als die Voreingstellten 100ms benötigen.',
'FCPO_TRANSACTIONREDIRECT_TIMEOUT' => 'Zeitlimit in Sekunden bei Direktweiterleitungen',
'FCPO_HELP_TRANSACTIONREDIRECT_TIMEOUT' => 'Um eine unterbrechungsfreie Weiterleitung zu ermöglichen werden Statusmeldungen im Modus "Direkte Weiterleitung" mit einem Zeitlimit versendet. Abhängig von ihrem Serversetup kann es notwendig sein, dass Sie einen höheren Wert als die Voreingstellten 100s benötigen.',
'FCPO_FORWARD_REDIRECTS' => 'Transaktionsstatusweiterleitungen',
'FCPO_FORWARD_REDIRECT_TARGETURL' => 'Zieladresse',
'FCPO_FORWARD_REDIRECT_TRIES' => 'Aufrufversuche',
Expand Down
4 changes: 2 additions & 2 deletions application/views/admin/en/fcPayOne_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@
'FCPO_TRANSACTIONREDIRECTMETHOD_CRONJOB' => 'Delayed by Cronjob (Secure transaction)',
'FCPO_HELP_TRANSACTIONREDIRECTMETHOD' => 'Choose the method how transaction redirects will be handled. There are two choices:<br><b>Direct redirect:</b><br>Using this method will directly redirect the transaction after receiving it. This mode offers a high redirection speed and a moderate transaction security.<br><b>Delayed by Cronjob:</b><br>Instead of directly redirecting the statusmessage, this method collects incoming messages and will redirect them aftery calling a cronjob. This mode offers a very high transaction security. The speed of redirecting statusmessages depends on the setup of your server. Please visit the <a href="">manual</a> for further information for setting this up efficiantly.',
'FCPO_TRANSACTIONREDIRECTMETHOD' => 'Method of statusmessage redirecting',
'FCPO_TRANSACTIONREDIRECT_TIMEOUT' => 'Timeout for direct redirects',
'FCPO_HELP_TRANSACTIONREDIRECT_TIMEOUT' => 'For offering direct redirects without any interruptions, there is a need for having a timout for mode "Direct redirects". Depending on the setup of your server it can be nessessary to have a higher value then 100ms default.',
'FCPO_TRANSACTIONREDIRECT_TIMEOUT' => 'Timeout in seconds for direct redirects',
'FCPO_HELP_TRANSACTIONREDIRECT_TIMEOUT' => 'For offering direct redirects without any interruptions, there is a need for having a timout for mode "Direct redirects". Depending on the setup of your server it can be nessessary to have a higher value then 100s default.',
'FCPO_FORWARD_REDIRECTS' => 'Transaction status redirects',
'FCPO_FORWARD_REDIRECT_TARGETURL' => 'Target',
'FCPO_FORWARD_REDIRECT_TRIES' => 'Tries',
Expand Down
8 changes: 5 additions & 3 deletions core/fcpayone_events.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class fcpayone_events
public static $sQueryTableFcporequestlog = "
CREATE TABLE fcporequestlog (
OXID int(11) NOT NULL AUTO_INCREMENT,
FCPO_REFNR int(11) NOT NULL DEFAULT '0',
FCPO_REFNR varchar(32) NOT NULL DEFAULT '0',
FCPO_REQUESTTYPE varchar(32) NOT NULL DEFAULT '',
FCPO_RESPONSESTATUS varchar(32) NOT NULL DEFAULT '',
FCPO_REQUEST text NOT NULL,
Expand Down Expand Up @@ -86,7 +86,7 @@ class fcpayone_events
FCPO_MODE varchar(8) NOT NULL DEFAULT '',
FCPO_PRICE double NOT NULL DEFAULT '0',
FCPO_TXID int(11) NOT NULL DEFAULT '0',
FCPO_REFERENCE int(11) NOT NULL DEFAULT '0',
FCPO_REFERENCE varchar(32) NOT NULL DEFAULT '0',
FCPO_SEQUENCENUMBER int(11) NOT NULL DEFAULT '0',
FCPO_COMPANY varchar(255) NOT NULL DEFAULT '',
FCPO_FIRSTNAME varchar(255) NOT NULL DEFAULT '',
Expand Down Expand Up @@ -347,6 +347,7 @@ class fcpayone_events
public static $sQueryAlterKlarnaCampaigns = "ALTER TABLE `fcpoklarnacampaigns` ADD `FCPAYMENTID` CHAR(32) NOT NULL AFTER `FCPO_CAMPAIGN_CURRENCY`, ADD INDEX (`FCPAYMENTID`);";
public static $sQueryChangeToVarchar1 = "ALTER TABLE fcpotransactionstatus CHANGE FCPO_USERID FCPO_USERID VARCHAR(32) DEFAULT '0' NOT NULL;";
public static $sQueryChangeToVarchar2 = "ALTER TABLE fcpotransactionstatus CHANGE FCPO_TXID FCPO_TXID VARCHAR(32) DEFAULT '0' NOT NULL;";
public static $sQueryChangeToVarchar3 = "ALTER TABLE oxorder fcpotransactionstatus FCPO_REFERENCE FCPO_REFERENCE VARCHAR( 32 ) NOT NULL DEFAULT '0'";
public static $sQueryChangeRefNrToVarchar = "ALTER TABLE oxorder CHANGE FCPOREFNR FCPOREFNR VARCHAR( 32 ) NOT NULL DEFAULT '0'";
public static $sQueryAlterFcpoTransactionStatusChangeToChar = "ALTER TABLE fcpotransactionstatus CHANGE OXID OXID CHAR(32) NOT NULL;";
public static $sQueryAlterFcpoTransactionForwardingChangeToChar = "ALTER TABLE fcpostatusforwarding CHANGE OXID OXID CHAR(32) NOT NULL;";
Expand Down Expand Up @@ -575,7 +576,8 @@ public static function addDatabaseStructure()

self::changeColumnTypeIfWrong('fcpotransactionstatus', 'FCPO_USERID', 'varchar(32)', self::$sQueryChangeToVarchar1);
self::changeColumnTypeIfWrong('fcpotransactionstatus', 'FCPO_TXID', 'varchar(32)', self::$sQueryChangeToVarchar2);
self::changeColumnTypeIfWrong('fcporequestlog', 'FCPO_REFNR', 'int(11)', self::$sQueryChangeFcporequestlog);
self::changeColumnTypeIfWrong('fcpotransactionstatus', 'FCPO_REFERENCE', 'varchar(32)', self::$sQueryChangeToVarchar3);
self::changeColumnTypeIfWrong('fcporequestlog', 'FCPO_REFNR', 'varchar(32)', self::$sQueryChangeFcporequestlog);
self::changeColumnTypeIfWrong('oxorder', 'FCPOREFNR', 'varchar(32)', self::$sQueryChangeRefNrToVarchar);
self::changeColumnTypeIfWrong('fcpotransactionstatus', 'OXID', 'int(11)', self::$sQueryAlterFcpoTransactionStatusChangeToChar);
self::changeColumnTypeIfWrong('fcpostatusforwarding', 'OXID', 'int(11)', self::$sQueryAlterFcpoTransactionForwardingChangeToChar);
Expand Down
9 changes: 6 additions & 3 deletions statusforward.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class fcPayOneTransactionStatusForwarder extends fcPayOneTransactionStatusBase {
'FCPO_PRICE'=>'price',
'FCPO_TXID'=>'txid',
'FCPO_REFERENCE'=>'reference',
'FCPO_SEQUENCENUMBER'=>'reference',
'FCPO_SEQUENCENUMBER'=>'sequencenumber',
'FCPO_COMPANY'=>'company',
'FCPO_FIRSTNAME'=>'firstname',
'FCPO_LASTNAME'=>'lastname',
Expand Down Expand Up @@ -294,7 +294,7 @@ protected function _forwardRequest($sQueueId, $sForwardId, $sStatusmessageId) {
curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($oCurl, CURLOPT_TIMEOUT_MS, $iTimeout);
curl_setopt($oCurl, CURLOPT_TIMEOUT, $iTimeout);

$mResult = curl_exec($oCurl);
$mCurlInfo = curl_getinfo($oCurl);
Expand Down Expand Up @@ -394,14 +394,17 @@ protected function _fetchPostParams($sStatusmessageId)
protected function _cleanParams($aParams)
{
$aCleanedParams = array();
foreach ($aParams as $sKey=>$sValue) {
foreach ($aParams as $sKey => $sValue) {
$blValid = (
isset($this->_aDbFields2Params[$sKey]) &&
$sValue != ''
);
if (!$blValid) {
continue;
}
if ($sKey === 'FCPO_TXTIME') {
$sValue = strtotime($sValue);
}
$sCallKey = $this->_aDbFields2Params[$sKey];
$aCleanedParams[$sCallKey] = $sValue;
}
Expand Down

0 comments on commit 103f2f2

Please sign in to comment.