Skip to content

Commit f95e362

Browse files
authored
Merge pull request #2 from genuineq/master
Compatibility fixes for CE-Phoenix-2341-Frozen
2 parents 4693021 + 60bfbda commit f95e362

File tree

151 files changed

+12631
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+12631
-22
lines changed

README.md

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,46 @@ Released under the GPL V3 license: https://opensource.org/licenses/GPL-3.0
3131
Anywhere betwen the `head` tags.
3232
6. In: `includes/.htaccess` add:
3333
```
34-
<FilesMatch "paylike\.php$">
35-
<IfModule mod_authz_core.c>
36-
Require all granted
37-
</IfModule>
38-
<IfModule !mod_authz_core.c>
39-
Allow from all
40-
</IfModule>
34+
<FilesMatch "paylike.php">
35+
Allow from all
4136
</FilesMatch>
4237
```
4338
After the last line.
44-
7. Install the Paylike module from modules -> payment in the admin
45-
8. Insert the app key and your public key in the settings and enable the plugin
39+
7. In: `admin/modules.php`
40+
7.1.Add:
41+
```
42+
require_once('includes/modules/payment/paylike/errors.php');
43+
```
44+
Before 'require('includes/application_top.php');' line;
4645
46+
7.2.Add:
47+
```
48+
require_once('includes/modules/payment/paylike/validate.php');
49+
```
50+
After 'reset($HTTP_POST_VARS['configuration']);' line;
51+
52+
7.3.Replace 'tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");' line with:
53+
```
54+
if(sizeof($errors) === 0 || array_search($key, $validation_keys) === FALSE){
55+
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
56+
}
57+
```
58+
59+
7.4.Add:
60+
```
61+
if(sizeof($errors)){
62+
tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=edit'));
63+
}
64+
```
65+
Before 'tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']));' line;
66+
67+
7.5.Add:
68+
```
69+
if(isset($errorHandler))$errorHandler->display();
70+
```
71+
After 'case 'edit':' line.
72+
8. Install the Paylike module from modules -> payment in the admin
73+
9. Insert the app key and your public key in the settings and enable the plugin
4774
4875
## Updating settings
4976

README_CE-Phoenix-2341-Frozen.md

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# osCommerce plugin for Paylike
2+
3+
This plugin is *not* developed or maintained by Paylike but kindly made
4+
available by a user.
5+
6+
Released under the GPL V3 license: https://opensource.org/licenses/GPL-3.0
7+
8+
9+
## Supported osCommerce versions
10+
11+
*The plugin has been tested with osCommerce v.2.3.4.1 and osCommerce CE Phoenix
12+
13+
## Installation
14+
15+
Once you have installed osCommerce, follow these simple steps:
16+
1. Signup at [paylike.io](https://paylike.io) (it’s free)
17+
2. Create a live account
18+
3. Create an app key for your osCommerce website
19+
4. Upload the files in the `upload` folder to root of your osCommerce store.
20+
5. In: `includes/template_top.php` add:
21+
```
22+
<?php
23+
if ( basename( $PHP_SELF ) == 'checkout_confirmation.php' ) {
24+
?>
25+
<script src="https://sdk.paylike.io/3.js"></script>
26+
<script src= "includes/javascript/paylike.js"></script>
27+
<?php
28+
}
29+
?>
30+
```
31+
Anywhere betwen the `head` tags.
32+
6. In: `includes/.htaccess` add:
33+
```
34+
<FilesMatch "paylike.php">
35+
Allow from all
36+
</FilesMatch>
37+
38+
```
39+
After the last line.
40+
7. In: `admin/modules.php`
41+
7.1.Add:
42+
```
43+
require_once('includes/modules/payment/paylike/errors.php');
44+
```
45+
Before 'require('includes/application_top.php');' line;
46+
47+
7.2.Add:
48+
```
49+
require_once('includes/modules/payment/paylike/validate.php');
50+
```
51+
After 'case 'save':' line;
52+
53+
7.3.Replace 'tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");' line with:
54+
```
55+
if(sizeof($errors) === 0 || array_search($key, $validation_keys) === FALSE){
56+
tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
57+
}
58+
```
59+
60+
7.4.Add:
61+
```
62+
if(sizeof($errors)){
63+
tep_redirect(tep_href_link('modules.php', 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'] . '&action=edit'));
64+
}
65+
```
66+
Before 'tep_redirect(tep_href_link('modules.php', 'set=' . $set . '&module=' . $_GET['module']));' line;
67+
68+
7.5.Add:
69+
```
70+
if(isset($errorHandler))$errorHandler->display();
71+
```
72+
After 'case 'edit':' line.
73+
8. Install the Paylike module from modules -> payment in the admin
74+
9. Insert the app key and your public key in the settings and enable the plugin
75+
76+
## Updating settings
77+
78+
Under the Paylike settings, you can:
79+
* Update the title that shows up in the payment popup
80+
* Add test/live keys
81+
* Set payment mode (test/live)
82+
* Change the capture type (Instant/Delayed)
83+
84+
## How to
85+
86+
1. Capture
87+
* In Instant mode, the orders are captured automatically
88+
* In delayed mode you can capture funds only from the paylike dashboard.
89+
2. Refund
90+
* To refund an order you can use the paylike dashboard.
91+
3. Void
92+
* To void an order you can use the paylike dashboard.

README_Phoenix.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# osCommerce plugin for Paylike
2+
3+
This plugin is *not* developed or maintained by Paylike but kindly made
4+
available by a user.
5+
6+
Released under the GPL V3 license: https://opensource.org/licenses/GPL-3.0
7+
8+
9+
## Supported osCommerce versions
10+
11+
*The plugin has been tested with osCommerce v.2.3.4.1 and osCommerce CE Phoenix
12+
13+
## Installation
14+
15+
Once you have installed osCommerce, follow these simple steps:
16+
1. Signup at [paylike.io](https://paylike.io) (it’s free)
17+
2. Create a live account
18+
3. Create an app key for your osCommerce website
19+
4. Upload the files in the `upload` folder to root of your osCommerce store.
20+
5. In: `includes/template_top.php` add:
21+
```
22+
<?php
23+
if ( basename( $PHP_SELF ) == 'checkout_confirmation.php' ) {
24+
?>
25+
<script src="https://sdk.paylike.io/3.js"></script>
26+
<script src= "includes/javascript/paylike.js"></script>
27+
<?php
28+
}
29+
?>
30+
```
31+
Anywhere betwen the `head` tags.
32+
6. In: `includes/.htaccess` add:
33+
```
34+
<FilesMatch "paylike.php">
35+
Allow from all
36+
</FilesMatch>
37+
38+
```
39+
After the last line.
40+
7. Install the Paylike module from modules -> payment in the admin
41+
8. Insert the app key and your public key in the settings and enable the plugin
42+
43+
44+
## Updating settings
45+
46+
Under the Paylike settings, you can:
47+
* Update the title that shows up in the payment popup
48+
* Add test/live keys
49+
* Set payment mode (test/live)
50+
* Change the capture type (Instant/Delayed)
51+
52+
## How to
53+
54+
1. Capture
55+
* In Instant mode, the orders are captured automatically
56+
* In delayed mode you can capture funds only from the paylike dashboard.
57+
2. Refund
58+
* To refund an order you can use the paylike dashboard.
59+
3. Void
60+
* To void an order you can use the paylike dashboard.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "esparks/module-paylike",
3+
"description": "Paylike integration with payment gateway prestashop",
4+
"type": "prestashop-module",
5+
"version": "1.0.6",
6+
"license": [
7+
"GPL-3.0-or-later"
8+
],
9+
"authors": [
10+
{
11+
"name": "Ionut Calara",
12+
"email": "ionut.calara@gmail.com"
13+
}
14+
],
15+
"require": {
16+
"paylike/php-api": "^1.0.3"
17+
}
18+
}

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

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
/* Initialize errors object */
3+
require_once('helpers/Paylike_Errors.php');
4+
$errorHandler = new PaylikeErrors();
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?php
2+
/* Security class check */
3+
if (! class_exists('PaylikeErrors')) :
4+
/**
5+
* Helper class that handles errors via cookies
6+
*/
7+
class PaylikeErrors
8+
{
9+
public $errors = '';
10+
private $cookieName = 'validation_errors';
11+
12+
public function __construct()
13+
{
14+
/* Load current cookie value */
15+
$this->loadCookieErrors();
16+
}
17+
/**
18+
* Dispay errors as HTML list
19+
*/
20+
public function display()
21+
{
22+
if ($this->errors && sizeof($this->errors)) {
23+
echo '<div class="validation_error">';
24+
echo '<ul>';
25+
echo '<li>' . implode('</li><li>', $this->errors) . '</li>';
26+
echo '</ul></div>';
27+
}
28+
}
29+
/**
30+
* Set cookie with list of given values
31+
*
32+
* @param array $list - the list o errors to be stored
33+
*/
34+
public function setCookieErrors($list)
35+
{
36+
setcookie($this->cookieName, json_encode($list), time()+3600);
37+
}
38+
39+
/**
40+
* Read and store cookie value
41+
*/
42+
public function loadCookieErrors()
43+
{
44+
if(isset($_COOKIE[$this->cookieName])){
45+
$this->errors = json_decode($_COOKIE[$this->cookieName], true);
46+
setcookie($this->cookieName, '', time()-3600);
47+
}
48+
}
49+
}
50+
endif; /* End if class_exists. */

0 commit comments

Comments
 (0)