Skip to content

Commit

Permalink
1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrovv committed Dec 29, 2016
1 parent 7ea354c commit 6456d17
Show file tree
Hide file tree
Showing 23 changed files with 2,252 additions and 1,343 deletions.
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
*Put a short and clear description of the bug or issue here, if needed*

**This is for features**:

TODO:

* [ ] Some feature TODO
* [ ] Another feature TODO

**This is for bugs**

**Steps to Reproduce**

* Step 1
* Step 2
* Step 3, etc

**Expected Results**

**Actual Results**

**Browser/Operating System**

**Additional Comments**
18 changes: 18 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
* Description of changes 1
* Description of changes 2
* Description of changes 3, etc

Fixes eMerchantPay/prestashop-ecp-plugin#number

-----------------

Before merging the PR make sure the following are checked:

* [ ] [Good commit messages][1] are used.
* [ ] Commit message starts with `{f|b}{year}{month}{day}{num}`, e.g. f2016071101
* [ ] Necessary specs are added.
* [ ] All specs are passing.
* [ ] All automated or manual PR comments are resolved or proper explanation is included for the given change
* [ ] The PR relates to **only** one subject with a clear title

[1]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
41 changes: 36 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Genesis client for Prestashop
E-ComProcessing Gateway Module for Prestashop
=============================

This is a Payment Module for Prestashop that gives you the ability to process payments through E-ComProcessing's Payment Gateway - Genesis.

Requirements
------------

* Prestashop 1.5.x - 1.6.x
* Prestashop 1.5.x - 1.6.x - 1.7.x (Tested up to __1.7.0.2__)
* [GenesisPHP v1.4](https://github.com/GenesisGateway/genesis_php) - (Integrated in Module)
* PCI-certified server (in order to use ```E-ComProcessing Direct```)
* PCI-certified server in order to use ```E-ComProcessing Direct```

GenesisPHP Requirements
------------
Expand All @@ -22,9 +22,8 @@ GenesisPHP Requirements
* [XMLReader](https://php.net/xmlreader)
* [XMLWriter](https://php.net/xmlwriter)

Installation
Installation (Manual)
------------

* Upload the contents of folder (excluding ```README.md```) to the ```<root>``` folder of your Prestashop installation
* Login into your ```Prestashop Admin Panel```
* Navigate to ```Modules``` -> ```Payment```
Expand All @@ -33,6 +32,38 @@ Installation
* You can find the new payment methods in the ```Checkout``` section in your Store Front
* Clear the cache via ```Advanced Parameters``` -> ```Performance``` -> ```Clear cache```

Installation (Upload via Admin Panel)
------------
__Recommended if you do not have FTP account to upload the plugin code directly to your Prestashop__

* Download the Source code of the Plugin as zip file
* Decompress the zip archive and create a new archive of the folder ```ecomprocessing```, which is inside of ```modules``` folder
* Login into your ```Prestashop Admin Panel```
* Navigate to ```Modules and Services``` in the main menu
* Click the button ```Upload a module``` or ```Add a new module``` (depending on the version of Prestashop) and choose the manually created ```zip``` file.
* If you are using Prestashop 1.7.x, then the plugin will be automatically installed. If you are using an older version of Prestashop, find our ```E-ComProcessing Payment Gateway``` Module below and install it
* After the Module is installed, you could ```Configure``` the newly installed ```E-ComProcessing Payment Gateway``` to your needs and click ```Save``` button when ready
* You can find the new payment methods in the ```Checkout``` section in your Store Front
* Clear the cache via ```Advanced Parameters``` -> ```Performance``` -> ```Clear cache```

__Note__: If you have payment restrictions in place, you'll have to add the newly installed payment method to the ```Currencies``` / ```Countries``` / ```Groups``` you wish to appear on.

Enable PrestaShop SSL
------------
This steps should be followed if you wish to use the ```E-ComProcessing Direct``` Method.

* Ensure you have installed a valid __SSL Certificate__ on your __PCI-DSS Certified__ Web Server and you have configured your __Virtual Host__ properly.
* Login to your PrestaShop Admin Panel
* Navigate to ```Shop Parameters``` -> ```General```
* Click the link ```Please click here to check if your shop supports HTTPS``` near to the ```Enable SSL``` option
* Set ```Enable SSL``` to __Yes__
* Click ```Save```
* Set ```Enable SSL on all pages``` to __Yes__
* Click again the ```Save``` button
* It is recommended to add a __Rewrite Rule__ from ```http``` to ```https``` or to add a __Permanent Redirect__ to ```https``` in your virtual host

_Note_: If you have trouble with your credentials or terminal configuration, get in touch with our [support] team

You're now ready to process payments through our gateway.

[support]: mailto:tech-support@e-comprocessing.net
168 changes: 91 additions & 77 deletions modules/ecomprocessing/classes/EComProcessingInstall.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/*
* Copyright (C) 2015 E-Comprocessing™
* Copyright (C) 2016 E-Comprocessing™
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -13,7 +13,7 @@
* GNU General Public License for more details.
*
* @author E-Comprocessing™
* @copyright 2015 E-Comprocessing™
* @copyright 2016 E-Comprocessing™
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPL-2.0)
*/

Expand All @@ -28,22 +28,27 @@
*/
class EComProcessingInstall
{
private $status = true;
private $status = true;

private $hooks = array(
'header',
'payment',
'paymentTop',
'orderConfirmation',
'adminOrder',
'BackOfficeHeader',
);
private $hooks = array(
'header',
'payment',
'paymentTop',
'orderConfirmation',
'adminOrder',
'BackOfficeHeader',
/*
* Hooks for 1.7.x
*/
'displayAdminOrder',
'paymentOptions'
);

/**
* Create the table/tables required by the module
*/
public function createSchema()
{
/**
* Create the table/tables required by the module
*/
public function createSchema()
{
$schema = '
CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'ecomprocessing_transactions`
(
Expand All @@ -64,80 +69,89 @@ public function createSchema()
engine=`' . _MYSQL_ENGINE_ . '`
DEFAULT charset=utf8;';

if (!Db::getInstance()->execute($schema)) {
$this->status = false;
if (!Db::getInstance()->execute($schema)) {
$this->status = false;
throw new PrestaShopException('Module Install: Unable to create MySQL Database');
}
}
}
}

/**
* Register all Hooks required by the module
*
* @param $instance EComProcessing
*
* @throws PrestaShopException
*/
public function registerHooks($instance)
{
foreach ($this->hooks as $hook) {
if (!$instance->registerHook($hook)) {
$this->status = false;
throw new PrestaShopException('Module Install: Hook (' . $hook . ') can\'t be registered!');
}
}
}
/**
* Updates the scheme, if a new version of the module is directly copied in the root folder
* without deinstalling the old one and installing the new one
*/
public static function doProcessSchemaUpdate()
{
// nothing
}

/**
* Delete the table/tables required by the module
*/
public function dropSchema()
{
$schema = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'ecomprocessing_transactions`';
/**
* Register all Hooks required by the module
*
* @param $instance EComProcessing
*
* @throws PrestaShopException
*/
public function registerHooks($instance)
{
foreach ($this->hooks as $hook) {
if (!$instance->registerHook($hook)) {
$this->status = false;
throw new PrestaShopException('Module Install: Hook (' . $hook . ') can\'t be registered!');
}
}
}

if (!Db::getInstance()->execute($schema)) {
$this->status = false;
/**
* Delete the table/tables required by the module
*/
public function dropSchema()
{
$schema = 'DROP TABLE IF EXISTS `'._DB_PREFIX_.'ecomprocessing_transactions`';

if (!Db::getInstance()->execute($schema)) {
$this->status = false;
throw new PrestaShopException('Module Uninstall: Unable to DROP transactions table!');
}
}
}
}

/**
* Delete registered hooks
*
* @param $instance EComProcessing
*
* @throws PrestaShopException
*/
public function dropHooks($instance)
{
foreach ($this->hooks as $hook) {
if (!$instance->unregisterHook($hook)) {
$this->status = false;
throw new PrestaShopException('Module Uninstall: Hook (' . $hook . ') can\'t be unregistered!');
}
}
}
/**
* Delete registered hooks
*
* @param $instance EComProcessing
*
* @throws PrestaShopException
*/
public function dropHooks($instance)
{
foreach ($this->hooks as $hook) {
if (!$instance->unregisterHook($hook)) {
$this->status = false;
throw new PrestaShopException('Module Uninstall: Hook (' . $hook . ') can\'t be unregistered!');
}
}
}

/**
* Delete module configuration
*
* @param EComProcessing $instance
* @throws PrestaShopException
*/
public function dropKeys($instance)
{
foreach ($instance->getConfigKeys() as $key) {
if (!Configuration::deleteByName($key)) {
$this->status = false;
public function dropKeys($instance)
{
foreach ($instance->getConfigKeys() as $key) {
if (!Configuration::deleteByName($key)) {
$this->status = false;
throw new PrestaShopException('Module Uninstall: Unable to remove configuration keys');
}
}
}
}
}
}

/**
* Return the status of all processed methods
* @return bool
*/
public function isSuccessful() {
return $this->status;
}
/**
* Return the status of all processed methods
* @return bool
*/
public function isSuccessful() {
return $this->status;
}
}
Loading

0 comments on commit 6456d17

Please sign in to comment.