`funcoins_account` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'FunCoins account',
`funcoins_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000 COMMENT 'Transfered amount',
`funcoins_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'Booking timestamp',
-`funcoins_type` ENUM('WITHDRAW','PAYOUT') NOT NULL DEFAULT 'PAYOUT' COMMENT 'Transaction type',
+`funcoins_type` ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED' COMMENT 'Transaction type',
`fucoins_tan` VARCHAR(255) NULL DEFAULT NULL COMMENT 'TAN from API',
`funcoins_api_response` TINYTEXT COMMENT 'Clear text API response (only for debugging)',
`funcoins_api_status` INT(4) NULL DEFAULT NULL COMMENT 'Status code from API',
`primera_account` VARCHAR(255) NOT NULL DEFAULT '',
`primera_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`primera_timestamp` VARCHAR(10) NOT NULL DEFAULT 0,
-`primera_type` ENUM('IN','OUT','FAILED') NOT NULL DEFAULT 'FAILED',
+`primera_type` ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED',
`primera_api_message` TINYTEXT,
`primera_api_status` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
} // END - if
// Version of this extension
-setThisExtensionVersion('0.0.4');
+setThisExtensionVersion('0.0.5');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5'));
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
`wernis_account` VARCHAR(255) NOT NULL DEFAULT '',
`wernis_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`wernis_timestamp` VARCHAR(10) NOT NULL DEFAULT 0,
-`wernis_type` ENUM('IN','OUT') NOT NULL DEFAULT 'OUT',
+`wernis_type` ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED',
`wernis_api_message` TINYTEXT,
`wernis_api_status` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
// Update notes
setExtensionUpdateNotes("Überweisungen vom Portal werden nun über die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
break;
+
+ case '0.0.5': // SQL queries for v0.0.5
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_wernis` CHANGE `wernis_type` `wernis_type` ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED'");
+
+ // Update notes
+ setExtensionUpdateNotes("IN/OUT ersetzt mit WITHDRAW/PAYOUT.");
+ break;
} // END - switch
break;
'WERNIS_STATUS_UNKNWOWN' => "Wernis-Typ <span class=\"data\">%s</span> unbekannt.",
'WERNIS_STATUS_WITHDRAW' => "Einzahlung von WDS66",
'WERNIS_STATUS_PAYOUT' => "Auszahlung an WDS66",
+ 'WERNIS_STATUS_FAILED' => "Fehlgeschlagen",
'WERNIS_TIMESTAMP' => "Buchungszeitmarke",
'WERNIS_ACCOUNT' => "WDS66-Hauptaccount",
'WERNIS_TOTAL_WERNIS' => "Gesamt überwiesen",
$result = true;
// Log the transfer
- WERNIS_LOG_TRANSFER($wdsId, $amount, 'IN');
+ WERNIS_LOG_TRANSFER($wdsId, $amount, 'WITHDRAW');
} else {
// Status failure text
WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
$result = true;
// Log the transfer
- WERNIS_LOG_TRANSFER($wdsId, $amount, 'OUT');
+ WERNIS_LOG_TRANSFER($wdsId, $amount, 'PAYOUT');
} else {
// Status failure text
WERNIS_STATUS_MESSAGE($return['message'], $return['status']);
// Translate the status IN/OUT
function translateWernisTransferStatus ($status) {
- // Default status
+ // Default status is unknown
$return = '{%message,WERNIS_STATUS_UNKNWOWN=' . $status . '%}';
- // Which status?
- switch ($status) {
- case 'IN': // Withdraw
- $return = '{--WERNIS_STATUS_WITHDRAW--}';
- break;
+ // Construct message id
+ $messageId = 'WERNIS_STATUS_' . $status;
- case 'OUT': // Payout
- $return = '{--WERNIS_STATUS_PAYOUT--}';
- break;
- } // END - switch
+ // Is it there?
+ if (isMessageIdValid($messageId)) {
+ // Then use it as message string
+ $return = '{--' . $messageId . '--}';
+ } // END - if
// Return the status
return $return;