first commit
This commit is contained in:
1570
modules/ps_checkpayment/composer.lock
generated
Normal file
1570
modules/ps_checkpayment/composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
13
modules/ps_checkpayment/config.xml
Normal file
13
modules/ps_checkpayment/config.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>ps_checkpayment</name>
|
||||
<displayName><![CDATA[Check payment]]></displayName>
|
||||
<version><![CDATA[2.0.5]]></version>
|
||||
<description><![CDATA[This module allows you to accept payments by check.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[payments_gateways]]></tab>
|
||||
<confirmUninstall>Are you sure you want to delete these details?</confirmUninstall>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
13
modules/ps_checkpayment/config_pl.xml
Normal file
13
modules/ps_checkpayment/config_pl.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<module>
|
||||
<name>ps_checkpayment</name>
|
||||
<displayName><![CDATA[Czek]]></displayName>
|
||||
<version><![CDATA[2.0.5]]></version>
|
||||
<description><![CDATA[Moduł ten umożliwia przyjmowanie płatności czekiem.]]></description>
|
||||
<author><![CDATA[PrestaShop]]></author>
|
||||
<tab><![CDATA[payments_gateways]]></tab>
|
||||
<confirmUninstall><![CDATA[Jesteś pewien, że chcesz usunąć wszystkie ustawienia?]]></confirmUninstall>
|
||||
<is_configurable>1</is_configurable>
|
||||
<need_instance>1</need_instance>
|
||||
<limited_countries></limited_countries>
|
||||
</module>
|
||||
34
modules/ps_checkpayment/controllers/front/index.php
Normal file
34
modules/ps_checkpayment/controllers/front/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
68
modules/ps_checkpayment/controllers/front/payment.php
Normal file
68
modules/ps_checkpayment/controllers/front/payment.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class Ps_CheckpaymentPaymentModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public $ssl = true;
|
||||
|
||||
/**
|
||||
* @see FrontController::initContent()
|
||||
*/
|
||||
public function initContent()
|
||||
{
|
||||
parent::initContent();
|
||||
|
||||
if (!($this->module instanceof Ps_Checkpayment)) {
|
||||
Tools::redirect('index.php?controller=order');
|
||||
|
||||
return;
|
||||
}
|
||||
$cart = $this->context->cart;
|
||||
if (!$this->module->checkCurrency($cart)) {
|
||||
Tools::redirect('index.php?controller=order');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$this->context->smarty->assign([
|
||||
'nbProducts' => $cart->nbProducts(),
|
||||
'cust_currency' => $cart->id_currency,
|
||||
'currencies' => $this->module->getCurrency((int) $cart->id_currency),
|
||||
'total' => $cart->getOrderTotal(true, Cart::BOTH),
|
||||
'isoCode' => $this->context->language->iso_code,
|
||||
'checkName' => $this->module->checkName,
|
||||
'checkAddress' => Tools::nl2br($this->module->address),
|
||||
'this_path' => $this->module->getPathUri(),
|
||||
'this_path_check' => $this->module->getPathUri(),
|
||||
'this_path_ssl' => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . 'modules/' . $this->module->name . '/',
|
||||
]);
|
||||
|
||||
$this->setTemplate('payment_execution.tpl');
|
||||
}
|
||||
}
|
||||
90
modules/ps_checkpayment/controllers/front/validation.php
Normal file
90
modules/ps_checkpayment/controllers/front/validation.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
|
||||
/**
|
||||
* @since 1.5.0
|
||||
*/
|
||||
class Ps_CheckpaymentValidationModuleFrontController extends ModuleFrontController
|
||||
{
|
||||
public function postProcess()
|
||||
{
|
||||
if (!($this->module instanceof Ps_Checkpayment)) {
|
||||
Tools::redirect('index.php?controller=order&step=1');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$cart = $this->context->cart;
|
||||
|
||||
if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) {
|
||||
Tools::redirect('index.php?controller=order&step=1');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Check that this payment option is still available in case the customer changed his address just before the end of the checkout process
|
||||
$authorized = false;
|
||||
foreach (Module::getPaymentModules() as $module) {
|
||||
if ($module['name'] == 'ps_checkpayment') {
|
||||
$authorized = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$authorized) {
|
||||
die($this->trans('This payment method is not available.', [], 'Modules.Checkpayment.Shop'));
|
||||
}
|
||||
|
||||
$customer = new Customer($cart->id_customer);
|
||||
|
||||
if (!Validate::isLoadedObject($customer)) {
|
||||
Tools::redirect('index.php?controller=order&step=1');
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$currency = $this->context->currency;
|
||||
$total = (float) $cart->getOrderTotal(true, Cart::BOTH);
|
||||
|
||||
$mailVars = [
|
||||
'{check_name}' => Configuration::get('CHEQUE_NAME'),
|
||||
'{check_address}' => Configuration::get('CHEQUE_ADDRESS'),
|
||||
'{check_address_html}' => str_replace("\n", '<br />', Configuration::get('CHEQUE_ADDRESS')), ];
|
||||
|
||||
$this->module->validateOrder(
|
||||
(int) $cart->id,
|
||||
(int) Configuration::get('PS_OS_CHEQUE'),
|
||||
$total,
|
||||
$this->module->displayName,
|
||||
null,
|
||||
$mailVars,
|
||||
(int) $currency->id,
|
||||
false,
|
||||
$customer->secure_key
|
||||
);
|
||||
Tools::redirect('index.php?controller=order-confirmation&id_cart=' . (int) $cart->id . '&id_module=' . (int) $this->module->id . '&id_order=' . $this->module->currentOrder . '&key=' . $customer->secure_key);
|
||||
}
|
||||
}
|
||||
34
modules/ps_checkpayment/controllers/index.php
Normal file
34
modules/ps_checkpayment/controllers/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
34
modules/ps_checkpayment/index.php
Normal file
34
modules/ps_checkpayment/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
BIN
modules/ps_checkpayment/logo.png
Normal file
BIN
modules/ps_checkpayment/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
41
modules/ps_checkpayment/payment.php
Normal file
41
modules/ps_checkpayment/payment.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead
|
||||
*/
|
||||
|
||||
/* SSL Management */
|
||||
$useSSL = true;
|
||||
|
||||
require '../../config/config.inc.php';
|
||||
Tools::displayFileAsDeprecated();
|
||||
|
||||
// init front controller in order to use Tools::redirect
|
||||
$controller = new FrontController();
|
||||
$controller->init();
|
||||
|
||||
Tools::redirect(Context::getContext()->link->getModuleLink('ps_checkpayment', 'payment'));
|
||||
292
modules/ps_checkpayment/ps_checkpayment.php
Normal file
292
modules/ps_checkpayment/ps_checkpayment.php
Normal file
@@ -0,0 +1,292 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
|
||||
use PrestaShop\PrestaShop\Core\Payment\PaymentOption;
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Ps_Checkpayment extends PaymentModule
|
||||
{
|
||||
private $_html = '';
|
||||
private $_postErrors = [];
|
||||
|
||||
public $checkName;
|
||||
public $address;
|
||||
public $extra_mail_vars;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'ps_checkpayment';
|
||||
$this->tab = 'payments_gateways';
|
||||
$this->version = '2.0.5';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->controllers = ['payment', 'validation'];
|
||||
|
||||
$this->currencies = true;
|
||||
$this->currencies_mode = 'checkbox';
|
||||
|
||||
$config = Configuration::getMultiple(['CHEQUE_NAME', 'CHEQUE_ADDRESS']);
|
||||
if (isset($config['CHEQUE_NAME'])) {
|
||||
$this->checkName = $config['CHEQUE_NAME'];
|
||||
}
|
||||
if (isset($config['CHEQUE_ADDRESS'])) {
|
||||
$this->address = $config['CHEQUE_ADDRESS'];
|
||||
}
|
||||
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
$this->displayName = $this->trans('Payments by check', [], 'Modules.Checkpayment.Admin');
|
||||
$this->description = $this->trans('This module allows you to accept payments by check.', [], 'Modules.Checkpayment.Admin');
|
||||
$this->confirmUninstall = $this->trans('Are you sure you want to delete these details?', [], 'Modules.Checkpayment.Admin');
|
||||
$this->ps_versions_compliancy = ['min' => '1.7.1.0', 'max' => _PS_VERSION_];
|
||||
|
||||
if ((!isset($this->checkName) || !isset($this->address) || empty($this->checkName) || empty($this->address))) {
|
||||
$this->warning = $this->trans('The "Payee" and "Address" fields must be configured before using this module.', [], 'Modules.Checkpayment.Admin');
|
||||
}
|
||||
if (!count(Currency::checkPaymentCurrencies($this->id))) {
|
||||
$this->warning = $this->trans('No currency has been set for this module.', [], 'Modules.Checkpayment.Admin');
|
||||
}
|
||||
|
||||
$this->extra_mail_vars = [
|
||||
'{check_name}' => Configuration::get('CHEQUE_NAME'),
|
||||
'{check_address}' => Configuration::get('CHEQUE_ADDRESS'),
|
||||
'{check_address_html}' => Tools::nl2br(Configuration::get('CHEQUE_ADDRESS')),
|
||||
];
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
return parent::install()
|
||||
&& $this->registerHook('paymentOptions')
|
||||
&& $this->registerHook('paymentReturn')
|
||||
;
|
||||
}
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
return Configuration::deleteByName('CHEQUE_NAME')
|
||||
&& Configuration::deleteByName('CHEQUE_ADDRESS')
|
||||
&& parent::uninstall()
|
||||
;
|
||||
}
|
||||
|
||||
private function _postValidation()
|
||||
{
|
||||
if (Tools::isSubmit('btnSubmit')) {
|
||||
if (!Tools::getValue('CHEQUE_NAME')) {
|
||||
$this->_postErrors[] = $this->trans('The "Payee" field is required.', [], 'Modules.Checkpayment.Admin');
|
||||
} elseif (!Tools::getValue('CHEQUE_ADDRESS')) {
|
||||
$this->_postErrors[] = $this->trans('The "Address" field is required.', [], 'Modules.Checkpayment.Admin');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function _postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('btnSubmit')) {
|
||||
Configuration::updateValue('CHEQUE_NAME', Tools::getValue('CHEQUE_NAME'));
|
||||
Configuration::updateValue('CHEQUE_ADDRESS', Tools::getValue('CHEQUE_ADDRESS'));
|
||||
}
|
||||
$this->_html .= $this->displayConfirmation($this->trans('Settings updated', [], 'Admin.Notifications.Success'));
|
||||
}
|
||||
|
||||
private function _displayCheck()
|
||||
{
|
||||
return $this->display(__FILE__, './views/templates/hook/infos.tpl');
|
||||
}
|
||||
|
||||
public function getContent()
|
||||
{
|
||||
$this->_html = '';
|
||||
|
||||
if (Tools::isSubmit('btnSubmit')) {
|
||||
$this->_postValidation();
|
||||
if (!count($this->_postErrors)) {
|
||||
$this->_postProcess();
|
||||
} else {
|
||||
foreach ($this->_postErrors as $err) {
|
||||
$this->_html .= $this->displayError($err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->_html .= $this->_displayCheck();
|
||||
$this->_html .= $this->renderForm();
|
||||
|
||||
return $this->_html;
|
||||
}
|
||||
|
||||
public function hookPaymentOptions($params)
|
||||
{
|
||||
if (!$this->active) {
|
||||
return;
|
||||
}
|
||||
if (!$this->checkCurrency($params['cart'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->smarty->assign(
|
||||
$this->getTemplateVars()
|
||||
);
|
||||
|
||||
$newOption = new PaymentOption();
|
||||
$newOption->setModuleName($this->name)
|
||||
->setCallToActionText($this->trans('Pay by Check', [], 'Modules.Checkpayment.Admin'))
|
||||
->setAction($this->context->link->getModuleLink($this->name, 'validation', [], true))
|
||||
->setAdditionalInformation($this->fetch('module:ps_checkpayment/views/templates/front/payment_infos.tpl'));
|
||||
|
||||
return [$newOption];
|
||||
}
|
||||
|
||||
public function hookPaymentReturn($params)
|
||||
{
|
||||
if (!$this->active) {
|
||||
return;
|
||||
}
|
||||
|
||||
$state = $params['order']->getCurrentState();
|
||||
$rest_to_paid = $params['order']->getOrdersTotalPaid() - $params['order']->getTotalPaid();
|
||||
if (in_array($state, [Configuration::get('PS_OS_CHEQUE'), Configuration::get('PS_OS_OUTOFSTOCK'), Configuration::get('PS_OS_OUTOFSTOCK_UNPAID')])) {
|
||||
$this->smarty->assign([
|
||||
'total_to_pay' => Tools::displayPrice(
|
||||
$rest_to_paid,
|
||||
new Currency($params['order']->id_currency),
|
||||
false
|
||||
),
|
||||
'shop_name' => $this->context->shop->name,
|
||||
'checkName' => $this->checkName,
|
||||
'checkAddress' => Tools::nl2br($this->address),
|
||||
'status' => 'ok',
|
||||
'id_order' => $params['order']->id,
|
||||
]);
|
||||
if (isset($params['order']->reference) && !empty($params['order']->reference)) {
|
||||
$this->smarty->assign('reference', $params['order']->reference);
|
||||
}
|
||||
} else {
|
||||
$this->smarty->assign('status', 'failed');
|
||||
}
|
||||
|
||||
return $this->fetch('module:ps_checkpayment/views/templates/hook/payment_return.tpl');
|
||||
}
|
||||
|
||||
public function checkCurrency($cart)
|
||||
{
|
||||
$currency_order = new Currency((int) ($cart->id_currency));
|
||||
$currencies_module = $this->getCurrency((int) $cart->id_currency);
|
||||
|
||||
if (is_array($currencies_module)) {
|
||||
foreach ($currencies_module as $currency_module) {
|
||||
if ($currency_order->id == $currency_module['id_currency']) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$fields_form = [
|
||||
'form' => [
|
||||
'legend' => [
|
||||
'title' => $this->trans('Contact details', [], 'Modules.Checkpayment.Admin'),
|
||||
'icon' => 'icon-envelope',
|
||||
],
|
||||
'input' => [
|
||||
[
|
||||
'type' => 'text',
|
||||
'label' => $this->trans('Payee (name)', [], 'Modules.Checkpayment.Admin'),
|
||||
'name' => 'CHEQUE_NAME',
|
||||
'required' => true,
|
||||
],
|
||||
[
|
||||
'type' => 'textarea',
|
||||
'label' => $this->trans('Address', [], 'Modules.Checkpayment.Admin'),
|
||||
'desc' => $this->trans('Address where the check should be sent to.', [], 'Modules.Checkpayment.Admin'),
|
||||
'name' => 'CHEQUE_ADDRESS',
|
||||
'required' => true,
|
||||
],
|
||||
],
|
||||
'submit' => [
|
||||
'title' => $this->trans('Save', [], 'Admin.Actions'),
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
$helper = new HelperForm();
|
||||
$helper->show_toolbar = false;
|
||||
$helper->id = (int) Tools::getValue('id_carrier');
|
||||
$helper->identifier = $this->identifier;
|
||||
$helper->submit_action = 'btnSubmit';
|
||||
$helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false) . '&configure=' . $this->name . '&tab_module=' . $this->tab . '&module_name=' . $this->name;
|
||||
$helper->token = Tools::getAdminTokenLite('AdminModules');
|
||||
$helper->tpl_vars = [
|
||||
'fields_value' => $this->getConfigFieldsValues(),
|
||||
];
|
||||
|
||||
return $helper->generateForm([$fields_form]);
|
||||
}
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
return [
|
||||
'CHEQUE_NAME' => Tools::getValue('CHEQUE_NAME', Configuration::get('CHEQUE_NAME')),
|
||||
'CHEQUE_ADDRESS' => Tools::getValue('CHEQUE_ADDRESS', Configuration::get('CHEQUE_ADDRESS')),
|
||||
];
|
||||
}
|
||||
|
||||
public function getTemplateVars()
|
||||
{
|
||||
$cart = $this->context->cart;
|
||||
$total = $this->trans(
|
||||
'%amount% (tax incl.)',
|
||||
[
|
||||
'%amount%' => Tools::displayPrice($cart->getOrderTotal(true, Cart::BOTH)),
|
||||
],
|
||||
'Modules.Checkpayment.Admin'
|
||||
);
|
||||
|
||||
$checkOrder = Configuration::get('CHEQUE_NAME');
|
||||
if (!$checkOrder) {
|
||||
$checkOrder = '___________';
|
||||
}
|
||||
|
||||
$checkAddress = Tools::nl2br(Configuration::get('CHEQUE_ADDRESS'));
|
||||
if (!$checkAddress) {
|
||||
$checkAddress = '___________';
|
||||
}
|
||||
|
||||
return [
|
||||
'checkTotal' => $total,
|
||||
'checkOrder' => $checkOrder,
|
||||
'checkAddress' => $checkAddress,
|
||||
];
|
||||
}
|
||||
}
|
||||
34
modules/ps_checkpayment/translations/index.php
Normal file
34
modules/ps_checkpayment/translations/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
0
modules/ps_checkpayment/translations/pl.php
Normal file
0
modules/ps_checkpayment/translations/pl.php
Normal file
34
modules/ps_checkpayment/upgrade/index.php
Normal file
34
modules/ps_checkpayment/upgrade/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
33
modules/ps_checkpayment/upgrade/upgrade-2.5.7.php
Normal file
33
modules/ps_checkpayment/upgrade/upgrade-2.5.7.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_2_5_7($module)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
38
modules/ps_checkpayment/upgrade/upgrade-2.5.8.php
Normal file
38
modules/ps_checkpayment/upgrade/upgrade-2.5.8.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
function upgrade_module_2_5_8($module)
|
||||
{
|
||||
$hook_to_remove_id = Hook::getIdByName('advancedPaymentApi');
|
||||
if ($hook_to_remove_id) {
|
||||
$module->unregisterHook((int) $hook_to_remove_id);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
42
modules/ps_checkpayment/upgrade/upgrade-3.0.0.php
Normal file
42
modules/ps_checkpayment/upgrade/upgrade-3.0.0.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
function upgrade_module_3_0_0($module)
|
||||
{
|
||||
$result = true;
|
||||
$hook_to_remove_ids = [
|
||||
Hook::getIdByName('displayPaymentEU'),
|
||||
Hook::getIdByName('payment'),
|
||||
];
|
||||
foreach ($hook_to_remove_ids as $hook_to_remove_id) {
|
||||
$result &= $module->unregisterHook((int) $hook_to_remove_id);
|
||||
}
|
||||
$result &= $module->registerHook('paymentOptions');
|
||||
|
||||
return $result;
|
||||
}
|
||||
34
modules/ps_checkpayment/views/index.php
Normal file
34
modules/ps_checkpayment/views/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
34
modules/ps_checkpayment/views/templates/front/index.php
Normal file
34
modules/ps_checkpayment/views/templates/front/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
@@ -0,0 +1,37 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
<section>
|
||||
<p>{l s='Please send us your check following these rules:' d='Modules.Checkpayment.Shop'}
|
||||
<dl>
|
||||
<dt>{l s='Amount' d='Modules.Checkpayment.Shop'}</dt>
|
||||
<dd>{$checkTotal}</dd>
|
||||
<dt>{l s='Payee' d='Modules.Checkpayment.Shop'}</dt>
|
||||
<dd>{$checkOrder}</dd>
|
||||
<dt>{l s='Send your check to this address' d='Modules.Checkpayment.Shop'}</dt>
|
||||
<dd>{$checkAddress nofilter}</dd>
|
||||
</dl>
|
||||
</p>
|
||||
</section>
|
||||
34
modules/ps_checkpayment/views/templates/hook/index.php
Normal file
34
modules/ps_checkpayment/views/templates/hook/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
31
modules/ps_checkpayment/views/templates/hook/infos.tpl
Normal file
31
modules/ps_checkpayment/views/templates/hook/infos.tpl
Normal file
@@ -0,0 +1,31 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
<div class="alert alert-info">
|
||||
<img src="../modules/ps_checkpayment/logo.png" style="float:left; margin-right:15px;" height="60">
|
||||
<p><strong>{l s="This module allows you to accept payments by check." d='Modules.Checkpayment.Admin'}</strong></p>
|
||||
<p>{l s="If the client chooses this payment method, the order status will change to 'Waiting for payment'." d='Modules.Checkpayment.Admin'}</p>
|
||||
<p>{l s="You will need to manually confirm the order as soon as you receive a check." d='Modules.Checkpayment.Admin'}</p>
|
||||
</div>
|
||||
31
modules/ps_checkpayment/views/templates/hook/payment.tpl
Normal file
31
modules/ps_checkpayment/views/templates/hook/payment.tpl
Normal file
@@ -0,0 +1,31 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
<p class="payment_module">
|
||||
<a href="{$link->getModuleLink('ps_checkpayment', 'payment', [], true)|escape:'html'}">
|
||||
<img src="{$this_path_ps_checkpayment}logo.png" alt="{l s='Pay by check' d='Modules.Checkpayment.Shop'}" />
|
||||
{l s='Pay by check' d='Modules.Checkpayment.Shop'} {l s='(order processing will be longer)' d='Modules.Checkpayment.Shop'}
|
||||
</a>
|
||||
</p>
|
||||
@@ -0,0 +1,79 @@
|
||||
{**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*}
|
||||
|
||||
{if $status == 'ok'}
|
||||
<p>
|
||||
{l s='Your order on %s is complete.' sprintf=[$shop_name] d='Modules.Checkpayment.Shop'}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{l s='Your check must include:' d='Modules.Checkpayment.Shop'}
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
{l s='Payment amount.' d='Modules.Checkpayment.Shop'}
|
||||
<span class="price"><strong>{$total_to_pay}</strong></span>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{l s='Payable to the order of' d='Modules.Checkpayment.Shop'}
|
||||
<strong>{if $checkName}{$checkName}{else}___________{/if}</strong>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
{l s='Mail to' d='Modules.Checkpayment.Shop'}
|
||||
<strong>{if $checkAddress}{$checkAddress nofilter}{else}___________{/if}</strong>
|
||||
</li>
|
||||
|
||||
{if !isset($reference)}
|
||||
<li>
|
||||
{l s='Do not forget to insert your order number #%d.' sprintf=[$id_order] d='Modules.Checkpayment.Shop'}
|
||||
</li>
|
||||
{else}
|
||||
<li>
|
||||
{l s='Do not forget to insert your order reference %s.' sprintf=[$reference] d='Modules.Checkpayment.Shop'}
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
{l s='An email has been sent to you with this information.' d='Modules.Checkpayment.Shop'}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<strong>{l s='Your order will be sent as soon as we receive your payment.' d='Modules.Checkpayment.Shop'}</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{l s='For any questions or for further information, please contact our' d='Modules.Checkpayment.Shop'}
|
||||
<a href="{$link->getPageLink('contact', true)|escape:'html'}">{l s='customer service department.' d='Modules.Checkpayment.Shop'}</a>.
|
||||
</p>
|
||||
{else}
|
||||
<p class="warning">
|
||||
{l s='We have noticed that there is a problem with your order. If you think this is an error, you can contact our' d='Modules.Checkpayment.Shop'}
|
||||
<a href="{$link->getPageLink('contact', true)|escape:'html'}">{l s='customer service department.' d='Modules.Checkpayment.Shop'}</a>.
|
||||
</p>
|
||||
{/if}
|
||||
34
modules/ps_checkpayment/views/templates/index.php
Normal file
34
modules/ps_checkpayment/views/templates/index.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright since 2007 PrestaShop SA and Contributors
|
||||
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
|
||||
* that is bundled with this package in the file LICENSE.md.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* https://opensource.org/licenses/AFL-3.0
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to https://devdocs.prestashop.com/ for more information.
|
||||
*
|
||||
* @author PrestaShop SA and Contributors <contact@prestashop.com>
|
||||
* @copyright Since 2007 PrestaShop SA and Contributors
|
||||
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
|
||||
*/
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
|
||||
header('Location: ../');
|
||||
exit;
|
||||
Reference in New Issue
Block a user