Skip to content

Commit

Permalink
1.2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrovV committed Mar 31, 2016
1 parent 6ae196a commit 5899fa1
Show file tree
Hide file tree
Showing 32 changed files with 2,572 additions and 1,236 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Requirements

* X-Cart 5.2.x (you can get this plugin to work on older 5.X versions simply by tweaking ```Main.php```)
* [GenesisPHP v1.4](https://github.com/GenesisGateway/genesis_php) - (Integrated in Module)
* PCI-certified server in order to use ```E-ComProcessing Direct```

GenesisPHP Requirements
------------
Expand All @@ -32,6 +33,8 @@ Installation
* Under ```Online methods``` category, click ```Add payment method``` and select ```E-ComProcessing``` from the list
* Enter your credentials and configure the plugin to your liking
* Go back to ```Store setup -> Payment methods``` and toggle the ```E-ComProcessing``` payment method from ```INACTIVE``` to ```ACTIVE```
* If you wish to use ```E-ComProcessing Direct```, the SSL of the Front Store must be enabled.
If you have already configured a SSL Certificate, go to ```System settings``` -> ```HTTPS settings``` and click ```Enable HTTPS``` in order to be able to process direct payment transactions through our gateway

Installation (Manual)
------------
Expand All @@ -44,6 +47,8 @@ Installation (Manual)
* Under ```Online methods``` category, click ```Add payment method``` and select ```E-ComProcessing``` from the list
* Enter your credentials and configure the plugin to your liking
* Go back to ```Store setup -> Payment methods``` and toggle the ```E-ComProcessing``` payment method from ```INACTIVE``` to ```ACTIVE```
* If you wish to use ```E-ComProcessing Direct```, the SSL of the Front Store must be enabled.
If you have already configured a SSL Certificate, go to ```System settings``` -> ```HTTPS settings``` and click ```Enable HTTPS``` in order to be able to process direct payment transactions through our gateway

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,63 @@ class EcomprocessingSettings extends \XLite\Controller\Admin\AAdmin
*/
public function getTitle()
{
return static::t('E-ComProcessing settings');
return static::t($this->getPaymentMethod()->getTitle() . ' Settings');
}

/**
* Get Should Display Message While Configuring the Module
*
* @return boolean
*/
public function getShouldDisplayMessage()
{
return ($this->getPaymentMethod()->getServiceName() == \XLite\Module\EComProcessing\Genesis\Main::ECP_DIRECT);
}

/**
* Returns message style class
*
* @return string
*/
public function getDisplayMessageClass()
{
return \XLite\Module\EComProcessing\Genesis\Main::isStoreOverSecuredConnection()
? 'alert alert-warning'
: 'alert alert-danger';
}

/**
* Returns message text
*
* @return string
*/
public function getDisplayMessageText()
{
return \XLite\Module\EComProcessing\Genesis\Main::isStoreOverSecuredConnection()
? 'HTTPS connection is enabled. You need PCI-DSS certificate in order to use this payment method'
: 'This payment method requires HTTPS connection in order to process payment data! ';
}

/**
* Returns Author Website
*
* @return string
*/
public function getAuthorWebSite()
{
return \XLite\Module\EComProcessing\Genesis\Main::getAuthorWebsite();
}

/**
* Return class name for the controller main form
*
* @return string
*/
protected function getModelFormClass()
public function getModelFormClass()
{
return sprintf(
'\XLite\Module\EComProcessing\Genesis\View\Model\%s',
\XLite\Module\EComProcessing\Genesis\Main::ECP_CHECKOUT
$this->getPaymentMethod()->getServiceName()
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/*
* 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
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* @author E-ComProcessing
* @copyright 2016 E-Comprocessing™
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License, version 2 (GPL-2.0)
*/

namespace XLite\Module\EComProcessing\Genesis\Controller\Customer;

/**
* Checkout controller
*/
class Checkout extends \XLite\Controller\Customer\Checkout implements \XLite\Base\IDecorator
{
/**
* Get Payment Method Checkout Label
*
* @return string
*/
public function getMethodCheckoutLabel(\XLite\Model\Payment\Method $method)
{
return $method->getSetting('title');
}
}
50 changes: 48 additions & 2 deletions classes/XLite/Module/EComProcessing/Genesis/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ abstract class Main extends \XLite\Module\AModule
* Name of the E-ComProcessing Checkout method
*/
const ECP_CHECKOUT = 'EComProcessingCheckout';
const ECP_DIRECT = 'EComProcessingDirect';


/**
* Author name
Expand All @@ -39,6 +41,16 @@ public static function getAuthorName()
return 'E-ComProcessing';
}

/**
* Author Website
*
* @return string
*/
public static function getAuthorWebsite()
{
return 'http://e-comprocessing.com';
}

/**
* Module name
*
Expand Down Expand Up @@ -66,7 +78,7 @@ public static function getMajorVersion()
*/
public static function getMinorVersion()
{
return '2';
return '3';
}

/**
Expand All @@ -76,7 +88,7 @@ public static function getMinorVersion()
*/
public static function getDescription()
{
return 'Allows you to receive credit-card payments via E-Comprocessing\'s - Genesis payment gateway.';
return 'Accept payments through E-ComProcessing\'s Payment Gateway - Genesis';
}

/**
Expand Down Expand Up @@ -134,4 +146,38 @@ public static function isEComProcessingCheckoutEnabled($order = null)

return $result[$index];
}

/**
* Returns true if EComProcessingDirect payment is enabled
*
* @param \XLite\Model\Cart $order Cart object OPTIONAL
*
* @return boolean
*/
public static function isEComProcessingDirectEnabled($order = null)
{
static $result;

$index = isset($order) ? 1 : 0;

if (!isset($result[$index])) {
$paymentMethod = self::getPaymentMethod(self::ECP_DIRECT, true);

if ($order && $result[$index]) {
$result[$index] = $paymentMethod->getProcessor()->isApplicable($order, $paymentMethod);
}
}

return $result[$index];
}

/**
* Check - SSL Enabled
*
* @return boolean
*/
public static function isStoreOverSecuredConnection()
{
return \XLite\Core\Config::getInstance()->Security->customer_security;
}
}
Loading

0 comments on commit 5899fa1

Please sign in to comment.