Skip to content

Commit

Permalink
Merge pull request #49 from mollie/opencart-2.3
Browse files Browse the repository at this point in the history
Module compatible with OpenCart 2.3
  • Loading branch information
Thijs-Riezebeek authored Sep 20, 2016
2 parents 1be5dfc + bedcbff commit 93a4f3a
Show file tree
Hide file tree
Showing 169 changed files with 9,293 additions and 1,152 deletions.
86 changes: 43 additions & 43 deletions admin/controller/payment/mollie/base.php → ...troller/extension/payment/mollie/base.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
* @property URL $url
* @property User $user
*/
require_once(dirname(DIR_SYSTEM) . "/catalog/controller/payment/mollie/helper.php");
require_once(dirname(DIR_SYSTEM) . "/catalog/controller/extension/payment/mollie/helper.php");

class ControllerPaymentMollieBase extends Controller
class ControllerExtensionPaymentMollieBase extends Controller
{
// Current module name - should be overwritten by subclass using one of the MollieHelper::MODULE_NAME_* values.
const MODULE_NAME = NULL;
Expand Down Expand Up @@ -114,8 +114,8 @@ protected function installAllModules ()
$extensions->install("payment", "mollie_" . $module_name);

// Set permissions.
$this->model_user_user_group->addPermission($user_id, "access", "payment/mollie_" . $module_name);
$this->model_user_user_group->addPermission($user_id, "modify", "payment/mollie_" . $module_name);
$this->model_user_user_group->addPermission($user_id, "access", "extension/payment/mollie_" . $module_name);
$this->model_user_user_group->addPermission($user_id, "modify", "extension/payment/mollie_" . $module_name);
}
}

Expand Down Expand Up @@ -168,7 +168,7 @@ protected function getExtensionModel ()
public function index ()
{
// Load essential models
$this->load->language("payment/mollie");
$this->load->language("extension/payment/mollie");
$this->load->model("setting/setting");
$this->load->model("setting/store");
$this->load->model("localisation/order_status");
Expand Down Expand Up @@ -207,7 +207,7 @@ public function index ()
if ($doRedirect)
{
$this->session->data['success'] = $this->language->get("text_success");
$this->redirect($this->url->link("extension/payment", "token=" . $this->session->data['token'], "SSL"));
$this->redirect($this->url->link("extension/extension", "type=payment&token=" . $this->session->data['token'], "SSL"));
}

// Set data for template
Expand Down Expand Up @@ -320,20 +320,20 @@ public function index ()
);

$data['breadcrumbs'][] = array(
"href" => $this->url->link("extension/payment", "token=" . $this->session->data['token'], "SSL"),
"href" => $this->url->link("extension/extension", "type=payment&token=" . $this->session->data['token'], "SSL"),
"text" => $this->language->get("text_payment"),
"separator" => ' :: ',
);

$data['breadcrumbs'][] = array(
"href" => $this->url->link("payment/mollie_" . static::MODULE_NAME, "token=" . $this->session->data['token'], "SSL"),
"href" => $this->url->link("extension/payment/mollie_" . static::MODULE_NAME, "token=" . $this->session->data['token'], "SSL"),
"text" => $this->language->get("heading_title"),
"separator" => " :: ",
);

// Form action url
$data['action'] = $this->url->link("payment/mollie_" . static::MODULE_NAME, "token=" . $this->session->data['token'], "SSL");
$data['cancel'] = $this->url->link("extension/payment", "token=" . $this->session->data['token'], "SSL");
$data['action'] = $this->url->link("extension/payment/mollie_" . static::MODULE_NAME, "token=" . $this->session->data['token'], "SSL");
$data['cancel'] = $this->url->link("extension/extension", "type=payment&token=" . $this->session->data['token'], "SSL");

// Load global settings. Some are prefixed with mollie_ideal_ for legacy reasons.
$settings = array(
Expand Down Expand Up @@ -435,15 +435,15 @@ public function index ()
// Set different template for Opencart 2 as it uses Bootstrap and a left column
if ($this->isOpencart2())
{
$this->renderTemplate("payment/mollie_2.tpl", $data, array(
$this->renderTemplate("extension/payment/mollie_2.tpl", $data, array(
"header",
"column_left",
"footer",
));
}
else
{
$this->renderTemplate("payment/mollie.tpl", $data, array(
$this->renderTemplate("extension/payment/mollie.tpl", $data, array(
"header",
"footer",
));
Expand All @@ -457,7 +457,7 @@ public function index ()
*/
private function validate ($store = 0)
{
if (!$this->user->hasPermission("modify", "payment/mollie_" . static::MODULE_NAME))
if (!$this->user->hasPermission("modify", "extension/payment/mollie_" . static::MODULE_NAME))
{
$this->error['warning'] = $this->language->get("error_permission");
}
Expand All @@ -482,33 +482,33 @@ protected function checkModuleStatus ()
if ($this->isOpencart22())
{
$mod_files = array(
DIR_APPLICATION . "controller/payment/mollie/base.php",
DIR_APPLICATION . "language/en-gb/payment/mollie.php",
DIR_TEMPLATE . "payment/mollie.tpl",
DIR_TEMPLATE . "payment/mollie_2.tpl",
DIR_CATALOG . "controller/payment/mollie-api-client/",
DIR_CATALOG . "controller/payment/mollie/base.php",
DIR_CATALOG . "language/en-gb/payment/mollie.php",
DIR_CATALOG . "model/payment/mollie/base.php",
DIR_CATALOG . "view/theme/default/template/payment/mollie_checkout_form.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return_2.tpl",
DIR_APPLICATION . "controller/extension/payment/mollie/base.php",
DIR_APPLICATION . "language/en-gb/extension/payment/mollie.php",
DIR_TEMPLATE . "extension/payment/mollie.tpl",
DIR_TEMPLATE . "extension/payment/mollie_2.tpl",
DIR_CATALOG . "controller/extension/payment/mollie-api-client/",
DIR_CATALOG . "controller/extension/payment/mollie/base.php",
DIR_CATALOG . "language/en-gb/extension/payment/mollie.php",
DIR_CATALOG . "model/extension/payment/mollie/base.php",
DIR_CATALOG . "view/theme/default/template/extension/payment/mollie_checkout_form.tpl",
DIR_CATALOG . "view/theme/default/template/extension/payment/mollie_return.tpl",
DIR_CATALOG . "view/theme/default/template/extension/payment/mollie_return_2.tpl",
);
}
else
{
$mod_files = array(
DIR_APPLICATION . "controller/payment/mollie/base.php",
DIR_APPLICATION . "language/english/payment/mollie.php",
DIR_TEMPLATE . "payment/mollie.tpl",
DIR_TEMPLATE . "payment/mollie_2.tpl",
DIR_CATALOG . "controller/payment/mollie-api-client/",
DIR_CATALOG . "controller/payment/mollie/base.php",
DIR_CATALOG . "language/english/payment/mollie.php",
DIR_CATALOG . "model/payment/mollie/base.php",
DIR_CATALOG . "view/theme/default/template/payment/mollie_checkout_form.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return.tpl",
DIR_CATALOG . "view/theme/default/template/payment/mollie_return_2.tpl",
DIR_APPLICATION . "controller/extension/payment/mollie/base.php",
DIR_APPLICATION . "language/english/extension/payment/mollie.php",
DIR_TEMPLATE . "extension/payment/mollie.tpl",
DIR_TEMPLATE . "extension/payment/mollie_2.tpl",
DIR_CATALOG . "controller/extension/payment/mollie-api-client/",
DIR_CATALOG . "controller/extension/payment/mollie/base.php",
DIR_CATALOG . "language/english/extension/payment/mollie.php",
DIR_CATALOG . "model/extension/payment/mollie/base.php",
DIR_CATALOG . "view/theme/default/template/extension/payment/mollie_checkout_form.tpl",
DIR_CATALOG . "view/theme/default/template/extension/payment/mollie_return.tpl",
DIR_CATALOG . "view/theme/default/template/extension/payment/mollie_return_2.tpl",
);
}

Expand All @@ -517,17 +517,17 @@ protected function checkModuleStatus ()
{
if ($this->isOpencart22())
{
$mod_files[] = DIR_APPLICATION . "controller/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_APPLICATION . "language/en-gb/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "controller/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "model/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_APPLICATION . "controller/extension/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_APPLICATION . "language/en-gb/extension/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "controller/extension/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "model/extension/payment/mollie_" . $module_name . ".php";
}
else
{
$mod_files[] = DIR_APPLICATION . "controller/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_APPLICATION . "language/english/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "controller/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "model/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_APPLICATION . "controller/extension/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_APPLICATION . "language/english/extension/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "controller/extension/payment/mollie_" . $module_name . ".php";
$mod_files[] = DIR_CATALOG . "model/extension/payment/mollie_" . $module_name . ".php";
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ModelPaymentMollieBankTransfer extends ModelPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_BANKTRANSFER;
}
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerExtensionPaymentMollieBankTransfer extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_BANKTRANSFER;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ModelPaymentMollieBelfius extends ModelPaymentMollieBase
class ControllerExtensionPaymentMollieBelfius extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_BELFIUS;
}
14 changes: 7 additions & 7 deletions catalog/model/payment/mollie_bitcoin.php → ...ller/extension/payment/mollie_bitcoin.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ModelPaymentMollieBitcoin extends ModelPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_BITCOIN;
}
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerExtensionPaymentMollieBitcoin extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_BITCOIN;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerPaymentMollieCreditcard extends ControllerPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_CREDITCARD;
}
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerExtensionPaymentMollieCreditcard extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_CREDITCARD;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerPaymentMollieDirectDebit extends ControllerPaymentMollieBase
class ControllerExtensionPaymentMollieDirectDebit extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_DIRECTDEBIT;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerPaymentMollieIDEAL extends ControllerPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_IDEAL;
}
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerExtensionPaymentMollieIDEAL extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_IDEAL;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerPaymentMollieMisterCash extends ControllerPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_MISTERCASH;
}
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerExtensionPaymentMollieMisterCash extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_MISTERCASH;
}
14 changes: 7 additions & 7 deletions admin/controller/payment/mollie_paypal.php → ...oller/extension/payment/mollie_paypal.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerPaymentMolliePayPal extends ControllerPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_PAYPAL;
}
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerExtensionPaymentMolliePayPal extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_PAYPAL;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerPaymentMolliePaysafecard extends ControllerPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_PAYSAFECARD;
}
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerExtensionPaymentMolliePaysafecard extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_PAYSAFECARD;
}
14 changes: 7 additions & 7 deletions admin/controller/payment/mollie_sofort.php → ...oller/extension/payment/mollie_sofort.php
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerPaymentMollieSOFORT extends ControllerPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_SOFORT;
}
<?php
require_once(dirname(__FILE__) . "/mollie/base.php");

class ControllerExtensionPaymentMollieSOFORT extends ControllerExtensionPaymentMollieBase
{
const MODULE_NAME = MollieHelper::MODULE_NAME_SOFORT;
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 93a4f3a

Please sign in to comment.