payment plugins
This commit is contained in:
34
core/lib/Thelia/Module/PaymentModuleInterface.php
Normal file
34
core/lib/Thelia/Module/PaymentModuleInterface.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
/*************************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* Thelia */
|
||||||
|
/* */
|
||||||
|
/* Copyright (c) OpenStudio */
|
||||||
|
/* email : info@thelia.net */
|
||||||
|
/* web : http://www.thelia.net */
|
||||||
|
/* */
|
||||||
|
/* 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 3 of the License */
|
||||||
|
/* */
|
||||||
|
/* 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. */
|
||||||
|
/* */
|
||||||
|
/* You should have received a copy of the GNU General Public License */
|
||||||
|
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
/* */
|
||||||
|
/*************************************************************************************/
|
||||||
|
|
||||||
|
namespace Thelia\Module;
|
||||||
|
|
||||||
|
use Thelia\Model\Country;
|
||||||
|
|
||||||
|
interface PaymentModuleInterface extends BaseModuleInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function pay();
|
||||||
|
}
|
||||||
76
local/modules/Cheque/Cheque.php
Executable file
76
local/modules/Cheque/Cheque.php
Executable file
@@ -0,0 +1,76 @@
|
|||||||
|
<?php
|
||||||
|
/*************************************************************************************/
|
||||||
|
/* */
|
||||||
|
/* Thelia */
|
||||||
|
/* */
|
||||||
|
/* Copyright (c) OpenStudio */
|
||||||
|
/* email : info@thelia.net */
|
||||||
|
/* web : http://www.thelia.net */
|
||||||
|
/* */
|
||||||
|
/* 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 3 of the License */
|
||||||
|
/* */
|
||||||
|
/* 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. */
|
||||||
|
/* */
|
||||||
|
/* You should have received a copy of the GNU General Public License */
|
||||||
|
/* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
/* */
|
||||||
|
/*************************************************************************************/
|
||||||
|
|
||||||
|
namespace Cheque;
|
||||||
|
|
||||||
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Thelia\Model\Country;
|
||||||
|
use Thelia\Module\BaseModule;
|
||||||
|
use Thelia\Module\PaymentModuleInterface;
|
||||||
|
|
||||||
|
class Cheque extends BaseModule implements PaymentModuleInterface
|
||||||
|
{
|
||||||
|
protected $request;
|
||||||
|
protected $dispatcher;
|
||||||
|
|
||||||
|
public function setRequest(Request $request)
|
||||||
|
{
|
||||||
|
$this->request = $request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequest()
|
||||||
|
{
|
||||||
|
return $this->request;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setDispatcher(EventDispatcherInterface $dispatcher)
|
||||||
|
{
|
||||||
|
$this->dispatcher = $dispatcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getDispatcher()
|
||||||
|
{
|
||||||
|
return $this->dispatcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function pay()
|
||||||
|
{
|
||||||
|
// TODO: Implement pay() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* YOU HAVE TO IMPLEMENT HERE ABSTRACT METHODD FROM BaseModule Class
|
||||||
|
* Like install and destroy
|
||||||
|
*/
|
||||||
|
public function install()
|
||||||
|
{
|
||||||
|
// TODO: Implement install() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy()
|
||||||
|
{
|
||||||
|
// TODO: Implement destroy() method.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
36
local/modules/Cheque/Config/config.xml
Executable file
36
local/modules/Cheque/Config/config.xml
Executable file
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|
||||||
|
<config xmlns="http://thelia.net/schema/dic/config"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://thelia.net/schema/dic/config http://thelia.net/schema/dic/config/thelia-1.0.xsd">
|
||||||
|
|
||||||
|
<loops>
|
||||||
|
<!-- sample definition
|
||||||
|
<loop name="MySuperLoop" class="MyModule\Loop\MySuperLoop" />
|
||||||
|
-->
|
||||||
|
</loops>
|
||||||
|
|
||||||
|
<forms>
|
||||||
|
<!--
|
||||||
|
<form name="MyFormName" class="MyModule\Form\MySuperForm" />
|
||||||
|
-->
|
||||||
|
</forms>
|
||||||
|
|
||||||
|
<commands>
|
||||||
|
<!--
|
||||||
|
<command class="MyModule\Command\MySuperCommand" />
|
||||||
|
-->
|
||||||
|
</commands>
|
||||||
|
|
||||||
|
<templateDirectives>
|
||||||
|
<!-- Sample definition
|
||||||
|
<templateDirectives class="MyModule\Directive\MyTemplateDirective" name="my_filter"/>
|
||||||
|
-->
|
||||||
|
</templateDirectives>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<services>
|
||||||
|
|
||||||
|
</services>
|
||||||
|
-->
|
||||||
|
</config>
|
||||||
0
local/modules/Cheque/Config/plugin.xml
Executable file
0
local/modules/Cheque/Config/plugin.xml
Executable file
@@ -63,7 +63,7 @@ class Colissimo extends BaseModule implements DeliveryModuleInterface
|
|||||||
*/
|
*/
|
||||||
public function getPostage(Country $country)
|
public function getPostage(Country $country)
|
||||||
{
|
{
|
||||||
// TODO: Implement calculate() method.
|
// TODO: Implement getPostage() method.
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user