Skip to content

Commit 63fe6db

Browse files
committed
Fixes - Code review #1
1 parent 0bf7ee0 commit 63fe6db

File tree

7 files changed

+27
-31
lines changed

7 files changed

+27
-31
lines changed

upload/admin/includes/modules/payment/paylike/composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"name": "esparks/module-paylike",
3-
"description": "Paylike integration with payment gateway prestashop",
4-
"type": "prestashop-module",
2+
"name": "paylike/module-paylike",
3+
"description": "Paylike integration with payment gateway oscommerce",
4+
"type": "oscommerce-module",
55
"version": "1.0.6",
66
"license": [
77
"GPL-3.0-or-later"
88
],
99
"authors": [
1010
{
11-
"name": "Ionut Calara",
12-
"email": "ionut.calara@gmail.com"
11+
"name": "Genuineq",
12+
"email": "office@genuineq.com"
1313
}
1414
],
1515
"require": {

upload/admin/includes/modules/payment/paylike/helpers/Paylike_Keys_Validator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function validateAppKeyField($value, $mode)
2727
/** Load the identity from API**/
2828
$identity = $paylikeClient->apps()->fetch();
2929
} catch (\Paylike\Exception\ApiException $exception) {
30-
$this->logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
30+
self::logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
3131
return sprintf(ERROR_APP_KEY_INVALID, $mode);
3232
}
3333

@@ -43,13 +43,13 @@ public function validateAppKeyField($value, $mode)
4343
}
4444
}
4545
} catch (\Paylike\Exception\ApiException $exception) {
46-
$this->logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
46+
self::logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
4747
}
4848
/** Check if public keys array for the current mode is populated **/
4949
if (empty($this->validationPublicKeys[$mode])) {
5050
/** Generate the error based on the current mode **/
5151
$error = sprintf(ERROR_APP_KEY_INVALID_MODE, $mode, array_values(array_diff(array_keys($this->validationPublicKeys), array($mode)))[0]);
52-
$this->logMessage($error);
52+
self::logMessage($error);
5353
return $error;
5454
}
5555
}
@@ -71,7 +71,7 @@ public function validatePublicKeyField($value, $mode)
7171
/** Check if the local stored public keys array is empty OR the key is not in public keys list **/
7272
if (empty($this->validationPublicKeys[$mode]) || ! in_array($value, $this->validationPublicKeys[$mode])) {
7373
$error = sprintf(ERROR_PUBLIC_KEY_INVALID, $mode);
74-
$this->logMessage($error);
74+
self::logMessage($error);
7575
return $error;
7676
}
7777
}

upload_CE-Phoenix-2341-Frozen/admin/includes/modules/payment/paylike/composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"name": "esparks/module-paylike",
3-
"description": "Paylike integration with payment gateway prestashop",
4-
"type": "prestashop-module",
2+
"name": "paylike/module-paylike",
3+
"description": "Paylike integration with payment gateway oscommerce",
4+
"type": "oscommerce-module",
55
"version": "1.0.6",
66
"license": [
77
"GPL-3.0-or-later"
88
],
99
"authors": [
1010
{
11-
"name": "Ionut Calara",
12-
"email": "ionut.calara@gmail.com"
11+
"name": "Genuineq",
12+
"email": "office@genuineq.com"
1313
}
1414
],
1515
"require": {

upload_CE-Phoenix-2341-Frozen/admin/includes/modules/payment/paylike/helpers/Paylike_Keys_Validator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function validateAppKeyField($value, $mode)
2727
/** Load the identity from API**/
2828
$identity = $paylikeClient->apps()->fetch();
2929
} catch (\Paylike\Exception\ApiException $exception) {
30-
$this->logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
30+
self::logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
3131
return sprintf(ERROR_APP_KEY_INVALID, $mode);
3232
}
3333

@@ -43,13 +43,13 @@ public function validateAppKeyField($value, $mode)
4343
}
4444
}
4545
} catch (\Paylike\Exception\ApiException $exception) {
46-
$this->logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
46+
self::logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
4747
}
4848
/** Check if public keys array for the current mode is populated **/
4949
if (empty($this->validationPublicKeys[$mode])) {
5050
/** Generate the error based on the current mode **/
5151
$error = sprintf(ERROR_APP_KEY_INVALID_MODE, $mode, array_values(array_diff(array_keys($this->validationPublicKeys), array($mode)))[0]);
52-
$this->logMessage($error);
52+
self::logMessage($error);
5353
return $error;
5454
}
5555
}
@@ -71,7 +71,7 @@ public function validatePublicKeyField($value, $mode)
7171
/** Check if the local stored public keys array is empty OR the key is not in public keys list **/
7272
if (empty($this->validationPublicKeys[$mode]) || ! in_array($value, $this->validationPublicKeys[$mode])) {
7373
$error = sprintf(ERROR_PUBLIC_KEY_INVALID, $mode);
74-
$this->logMessage($error);
74+
self::logMessage($error);
7575
return $error;
7676
}
7777
}

upload_ce_phoenix/admin/includes/modules/payment/paylike/composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"name": "esparks/module-paylike",
3-
"description": "Paylike integration with payment gateway prestashop",
4-
"type": "prestashop-module",
2+
"name": "paylike/module-paylike",
3+
"description": "Paylike integration with payment gateway oscommerce",
4+
"type": "oscommerce-module",
55
"version": "1.0.6",
66
"license": [
77
"GPL-3.0-or-later"
88
],
99
"authors": [
1010
{
11-
"name": "Ionut Calara",
12-
"email": "ionut.calara@gmail.com"
11+
"name": "Genuineq",
12+
"email": "office@genuineq.com"
1313
}
1414
],
1515
"require": {

upload_ce_phoenix/admin/includes/modules/payment/paylike/helpers/Paylike_Keys_Validator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function validateAppKeyField($value, $mode)
2727
/** Load the identity from API**/
2828
$identity = $paylikeClient->apps()->fetch();
2929
} catch (\Paylike\Exception\ApiException $exception) {
30-
$this->logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
30+
self::logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
3131
return sprintf(ERROR_APP_KEY_INVALID, $mode);
3232
}
3333

@@ -43,13 +43,13 @@ public function validateAppKeyField($value, $mode)
4343
}
4444
}
4545
} catch (\Paylike\Exception\ApiException $exception) {
46-
$this->logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
46+
self::logMessage(sprintf(ERROR_APP_KEY_INVALID, $mode));
4747
}
4848
/** Check if public keys array for the current mode is populated **/
4949
if (empty($this->validationPublicKeys[$mode])) {
5050
/** Generate the error based on the current mode **/
5151
$error = sprintf(ERROR_APP_KEY_INVALID_MODE, $mode, array_values(array_diff(array_keys($this->validationPublicKeys), array($mode)))[0]);
52-
$this->logMessage($error);
52+
self::logMessage($error);
5353
return $error;
5454
}
5555
}
@@ -71,7 +71,7 @@ public function validatePublicKeyField($value, $mode)
7171
/** Check if the local stored public keys array is empty OR the key is not in public keys list **/
7272
if (empty($this->validationPublicKeys[$mode]) || ! in_array($value, $this->validationPublicKeys[$mode])) {
7373
$error = sprintf(ERROR_PUBLIC_KEY_INVALID, $mode);
74-
$this->logMessage($error);
74+
self::logMessage($error);
7575
return $error;
7676
}
7777
}

upload_ce_phoenix/admin/includes/modules/payment/paylike/validate.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,11 @@
1919
/* Validate module keys */
2020
function validate($vars)
2121
{
22-
2322
global $validation_keys;
2423
$mode = $vars['MODULE_PAYMENT_PAYLIKE_TRANSACTION_MODE'];
2524
$payment_paylike_app_key = $mode == "Live"?$vars[$validation_keys['LIVE_APP_KEY']]:$vars[$validation_keys['TEST_APP_KEY']];
2625
$payment_paylike_public_key = $mode == "Live"?$vars[$validation_keys['LIVE_PUBLIC_KEY']]:$vars[$validation_keys['TEST_PUBLIC_KEY']];
2726

28-
$payment_paylike_app_key;
29-
$payment_paylike_public_key;
30-
3127
/* Initialize validator object */
3228
$validator = new PaylikeValidator();
3329
$errors = array();

0 commit comments

Comments
 (0)