Skip to content

Commit

Permalink
Constant arrays is not compatible with PHP 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Quoc Dat Pham committed Oct 20, 2017
1 parent a325eac commit b481673
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
define('LEMONWAY_VERSION', '1.1.0');
define('LEMONWAY_VERSION', '1.1.1');

class ControllerExtensionPaymentLemonway extends Controller
{
Expand Down Expand Up @@ -54,10 +54,6 @@ public function index()
$this->variables['api_error'] = false;

if ($this->variables['lemonway_status']) { // If enabled
// If Test mode
if ($this->variables['lemonway_is_test_mode']) {
}

// Test the config
if ($this->testConfig()) {
$this->variables['success'] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class ControllerExtensionPaymentLemonWay extends Controller
{
// Constants
const SUPPORTED_LANGS = array(
private $supportedLangs = array(
'da' => 'da', // Danish
'de' => 'ge', // German
'en' => 'en', // English
Expand Down Expand Up @@ -301,7 +301,7 @@ public function checkout()

$moneyInToken = (string)$res->MONEYINWEB->TOKEN;
$lang = substr($this->language->get('code'), 0, 2);
$lang = array_key_exists($lang, self::SUPPORTED_LANGS) ? self::SUPPORTED_LANGS[$lang] : self::DEFAULT_LANG;
$lang = array_key_exists($lang, $this->supportedLangs) ? $this->supportedLangs[$lang] : self::DEFAULT_LANG;

$lwUrl = $config['wkURL'] . '?moneyintoken=' . $moneyInToken . '&p=' . urlencode($config['cssURL']) . '&lang=' . $lang;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class LemonWayService
{
// Constants
const SUPPORTED_LANGS = array(
private $supportedLangs = array(
'en', // English
'fr' // French
);
Expand All @@ -26,15 +26,15 @@ class LemonWayService
*/
public function __construct ($dkurl, $wlLogin, $wlPass, $lang = self::DEFAULT_LANG, $isLogEnabled = 1)
{
$this->dkUrl = $dkurl;
$this->wlLogin = $wlLogin;
$this->wlPass = $wlPass;
$this->lang = in_array($lang, self::SUPPORTED_LANGS) ? $lang : self::DEFAULT_LANG;
$this->isLogEnabled = $isLogEnabled; // Mode debug
$this->dkUrl = $dkurl;
$this->wlLogin = $wlLogin;
$this->wlPass = $wlPass;
$this->lang = in_array($lang, $this->supportedLangs) ? $lang : self::DEFAULT_LANG;
$this->isLogEnabled = $isLogEnabled; // Mode debug

if ($this->isLogEnabled) {
$this->debug_log = new Log('lemonway_debug.log');
}
if ($this->isLogEnabled) {
$this->debug_log = new Log('lemonway_debug.log');
}
}

private function logRequest($serviceUrl, $request) {
Expand Down

0 comments on commit b481673

Please sign in to comment.