Initial commit

This commit is contained in:
2020-10-07 10:37:15 +02:00
commit ce5f440392
28157 changed files with 4429172 additions and 0 deletions

1682
modules/ps_wirepayment/composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ps_wirepayment</name>
<displayName><![CDATA[Wire payment]]></displayName>
<version><![CDATA[2.1.0]]></version>
<description><![CDATA[Accept payments by bank transfer.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[payments_gateways]]></tab>
<confirmUninstall><![CDATA[Are you sure about removing these details?]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>ps_wirepayment</name>
<displayName><![CDATA[Transfert bancaire]]></displayName>
<version><![CDATA[2.1.0]]></version>
<description><![CDATA[Accept wire payments by displaying your account details during the checkout and make it easy for your customers to purchase on your store.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[payments_gateways]]></tab>
<confirmUninstall><![CDATA[Êtes-vous certain de vouloir effacer vos données ?]]></confirmUninstall>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;

View File

@@ -0,0 +1,57 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* @since 1.5.0
*/
class Ps_WirepaymentPaymentModuleFrontController extends ModuleFrontController
{
public $ssl = true;
/**
* @see FrontController::initContent()
*/
public function initContent()
{
parent::initContent();
$cart = $this->context->cart;
if (!$this->module->checkCurrency($cart))
Tools::redirect('index.php?controller=order');
$total = sprintf(
$this->getTranslator()->trans('%1$s (tax incl.)', array(), 'Modules.Wirepayment.Shop'),
Tools::displayPrice($cart->getOrderTotal(true, Cart::BOTH))
);
$this->context->smarty->assign(array(
'back_url' => $this->context->link->getPageLink('order', true, NULL, "step=3"),
'confirm_url' => $this->context->link->getModuleLink('ps_wirepayment', 'validation', [], true),
'image_url' => $this->module->getPathUri() . 'ps_wirepayment.jpg',
'cust_currency' => $cart->id_currency,
'currencies' => $this->module->getCurrency((int)$cart->id_currency),
'total' => $total,
'this_path' => $this->module->getPathUri(),
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/'
));
$this->setTemplate('payment_execution.tpl');
}
}

View File

@@ -0,0 +1,61 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* @since 1.5.0
*/
class Ps_WirepaymentValidationModuleFrontController extends ModuleFrontController
{
/**
* @see FrontController::postProcess()
*/
public function postProcess()
{
$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');
// 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_wirepayment')
{
$authorized = true;
break;
}
if (!$authorized)
die($this->module->getTranslator()->trans('This payment method is not available.', array(), 'Modules.Wirepayment.Shop'));
$customer = new Customer($cart->id_customer);
if (!Validate::isLoadedObject($customer))
Tools::redirect('index.php?controller=order&step=1');
$currency = $this->context->currency;
$total = (float)$cart->getOrderTotal(true, Cart::BOTH);
$mailVars = array(
'{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'),
'{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')),
'{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS'))
);
$this->module->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key);
Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key);
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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_wirepayment/logo.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@@ -0,0 +1,35 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* @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_wirepayment', 'payment'));

View File

@@ -0,0 +1,440 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
use PrestaShop\PrestaShop\Core\Payment\PaymentOption;
if (!defined('_PS_VERSION_')) {
exit;
}
class Ps_Wirepayment extends PaymentModule
{
const FLAG_DISPLAY_PAYMENT_INVITE = 'BANK_WIRE_PAYMENT_INVITE';
protected $_html = '';
protected $_postErrors = array();
public $details;
public $owner;
public $address;
public $extra_mail_vars;
public function __construct()
{
$this->name = 'ps_wirepayment';
$this->tab = 'payments_gateways';
$this->version = '2.1.0';
$this->ps_versions_compliancy = array('min' => '1.7.1.0', 'max' => _PS_VERSION_);
$this->author = 'PrestaShop';
$this->controllers = array('payment', 'validation');
$this->is_eu_compatible = 1;
$this->currencies = true;
$this->currencies_mode = 'checkbox';
$config = Configuration::getMultiple(array('BANK_WIRE_DETAILS', 'BANK_WIRE_OWNER', 'BANK_WIRE_ADDRESS', 'BANK_WIRE_RESERVATION_DAYS'));
if (!empty($config['BANK_WIRE_OWNER'])) {
$this->owner = $config['BANK_WIRE_OWNER'];
}
if (!empty($config['BANK_WIRE_DETAILS'])) {
$this->details = $config['BANK_WIRE_DETAILS'];
}
if (!empty($config['BANK_WIRE_ADDRESS'])) {
$this->address = $config['BANK_WIRE_ADDRESS'];
}
if (!empty($config['BANK_WIRE_RESERVATION_DAYS'])) {
$this->reservation_days = $config['BANK_WIRE_RESERVATION_DAYS'];
}
$this->bootstrap = true;
parent::__construct();
$this->displayName = $this->trans('Wire payment', array(), 'Modules.Wirepayment.Admin');
$this->description = $this->trans('Accept wire payments by displaying your account details during the checkout and make it easy for your customers to purchase on your store.', array(), 'Modules.Wirepayment.Admin');
$this->confirmUninstall = $this->trans('Are you sure about removing these details?', array(), 'Modules.Wirepayment.Admin');
if (!isset($this->owner) || !isset($this->details) || !isset($this->address)) {
$this->warning = $this->trans('Account owner and account details must be configured before using this module.', array(), 'Modules.Wirepayment.Admin');
}
if (!count(Currency::checkPaymentCurrencies($this->id))) {
$this->warning = $this->trans('No currency has been set for this module.', array(), 'Modules.Wirepayment.Admin');
}
$this->extra_mail_vars = array(
'{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'),
'{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')),
'{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')),
);
}
public function install()
{
Configuration::updateValue(self::FLAG_DISPLAY_PAYMENT_INVITE, true);
if (!parent::install() || !$this->registerHook('paymentReturn') || !$this->registerHook('paymentOptions')) {
return false;
}
return true;
}
public function uninstall()
{
$languages = Language::getLanguages(false);
foreach ($languages as $lang) {
if (!Configuration::deleteByName('BANK_WIRE_CUSTOM_TEXT', $lang['id_lang'])) {
return false;
}
}
if (!Configuration::deleteByName('BANK_WIRE_DETAILS')
|| !Configuration::deleteByName('BANK_WIRE_OWNER')
|| !Configuration::deleteByName('BANK_WIRE_ADDRESS')
|| !Configuration::deleteByName('BANK_WIRE_RESERVATION_DAYS')
|| !Configuration::deleteByName(self::FLAG_DISPLAY_PAYMENT_INVITE)
|| !parent::uninstall()) {
return false;
}
return true;
}
protected function _postValidation()
{
if (Tools::isSubmit('btnSubmit')) {
Configuration::updateValue(self::FLAG_DISPLAY_PAYMENT_INVITE,
Tools::getValue(self::FLAG_DISPLAY_PAYMENT_INVITE));
if (!Tools::getValue('BANK_WIRE_DETAILS')) {
$this->_postErrors[] = $this->trans('Account details are required.', array(), 'Modules.Wirepayment.Admin');
} elseif (!Tools::getValue('BANK_WIRE_OWNER')) {
$this->_postErrors[] = $this->trans('Account owner is required.', array(), "Modules.Wirepayment.Admin");
}
}
}
protected function _postProcess()
{
if (Tools::isSubmit('btnSubmit')) {
Configuration::updateValue('BANK_WIRE_DETAILS', Tools::getValue('BANK_WIRE_DETAILS'));
Configuration::updateValue('BANK_WIRE_OWNER', Tools::getValue('BANK_WIRE_OWNER'));
Configuration::updateValue('BANK_WIRE_ADDRESS', Tools::getValue('BANK_WIRE_ADDRESS'));
$custom_text = array();
$languages = Language::getLanguages(false);
foreach ($languages as $lang) {
if (Tools::getIsset('BANK_WIRE_CUSTOM_TEXT_'.$lang['id_lang'])) {
$custom_text[$lang['id_lang']] = Tools::getValue('BANK_WIRE_CUSTOM_TEXT_'.$lang['id_lang']);
}
}
Configuration::updateValue('BANK_WIRE_RESERVATION_DAYS', Tools::getValue('BANK_WIRE_RESERVATION_DAYS'));
Configuration::updateValue('BANK_WIRE_CUSTOM_TEXT', $custom_text);
}
$this->_html .= $this->displayConfirmation($this->trans('Settings updated', array(), 'Admin.Global'));
}
protected function _displayBankWire()
{
return $this->display(__FILE__, 'infos.tpl');
}
public function getContent()
{
if (Tools::isSubmit('btnSubmit')) {
$this->_postValidation();
if (!count($this->_postErrors)) {
$this->_postProcess();
} else {
foreach ($this->_postErrors as $err) {
$this->_html .= $this->displayError($err);
}
}
} else {
$this->_html .= '<br />';
}
$this->_html .= $this->_displayBankWire();
$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->getTemplateVarInfos()
);
$newOption = new PaymentOption();
$newOption->setModuleName($this->name)
->setCallToActionText($this->trans('Pay by bank wire', array(), 'Modules.Wirepayment.Shop'))
->setAction($this->context->link->getModuleLink($this->name, 'validation', array(), true))
->setAdditionalInformation($this->fetch('module:ps_wirepayment/views/templates/hook/ps_wirepayment_intro.tpl'));
$payment_options = [
$newOption,
];
return $payment_options;
}
public function hookPaymentReturn($params)
{
if (!$this->active || !Configuration::get(self::FLAG_DISPLAY_PAYMENT_INVITE)) {
return;
}
$state = $params['order']->getCurrentState();
if (
in_array(
$state,
array(
Configuration::get('PS_OS_BANKWIRE'),
Configuration::get('PS_OS_OUTOFSTOCK'),
Configuration::get('PS_OS_OUTOFSTOCK_UNPAID'),
)
)) {
$bankwireOwner = $this->owner;
if (!$bankwireOwner) {
$bankwireOwner = '___________';
}
$bankwireDetails = Tools::nl2br($this->details);
if (!$bankwireDetails) {
$bankwireDetails = '___________';
}
$bankwireAddress = Tools::nl2br($this->address);
if (!$bankwireAddress) {
$bankwireAddress = '___________';
}
$totalToPaid = $params['order']->getOrdersTotalPaid() - $params['order']->getTotalPaid();
$this->smarty->assign(array(
'shop_name' => $this->context->shop->name,
'total' => Tools::displayPrice(
$totalToPaid,
new Currency($params['order']->id_currency),
false
),
'bankwireDetails' => $bankwireDetails,
'bankwireAddress' => $bankwireAddress,
'bankwireOwner' => $bankwireOwner,
'status' => 'ok',
'reference' => $params['order']->reference,
'contact_url' => $this->context->link->getPageLink('contact', true)
));
} else {
$this->smarty->assign(
array(
'status' => 'failed',
'contact_url' => $this->context->link->getPageLink('contact', true),
)
);
}
return $this->fetch('module:ps_wirepayment/views/templates/hook/payment_return.tpl');
}
public function checkCurrency($cart)
{
$currency_order = new Currency($cart->id_currency);
$currencies_module = $this->getCurrency($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 = array(
'form' => array(
'legend' => array(
'title' => $this->trans('Account details', array(), 'Modules.Wirepayment.Admin'),
'icon' => 'icon-envelope'
),
'input' => array(
array(
'type' => 'text',
'label' => $this->trans('Account owner', array(), 'Modules.Wirepayment.Admin'),
'name' => 'BANK_WIRE_OWNER',
'required' => true
),
array(
'type' => 'textarea',
'label' => $this->trans('Account details', array(), 'Modules.Wirepayment.Admin'),
'name' => 'BANK_WIRE_DETAILS',
'desc' => $this->trans('Such as bank branch, IBAN number, BIC, etc.', array(), 'Modules.Wirepayment.Admin'),
'required' => true
),
array(
'type' => 'textarea',
'label' => $this->trans('Bank address', array(), 'Modules.Wirepayment.Admin'),
'name' => 'BANK_WIRE_ADDRESS',
'required' => true
),
),
'submit' => array(
'title' => $this->trans('Save', array(), 'Admin.Actions'),
)
),
);
$fields_form_customization = array(
'form' => array(
'legend' => array(
'title' => $this->trans('Customization', array(), 'Modules.Wirepayment.Admin'),
'icon' => 'icon-cogs'
),
'input' => array(
array(
'type' => 'text',
'label' => $this->trans('Reservation period', array(), 'Modules.Wirepayment.Admin'),
'desc' => $this->trans('Number of days the items remain reserved', array(), 'Modules.Wirepayment.Admin'),
'name' => 'BANK_WIRE_RESERVATION_DAYS',
),
array(
'type' => 'textarea',
'label' => $this->trans('Information to the customer', array(), 'Modules.Wirepayment.Admin'),
'name' => 'BANK_WIRE_CUSTOM_TEXT',
'desc' => $this->trans('Information on the bank transfer (processing time, starting of the shipping...)', array(), 'Modules.Wirepayment.Admin'),
'lang' => true
),
array(
'type' => 'switch',
'label' => $this->trans('Display the invitation to pay in the order confirmation page', array(), 'Modules.Wirepayment.Admin'),
'name' => self::FLAG_DISPLAY_PAYMENT_INVITE,
'is_bool' => true,
'hint' => $this->trans('Your country\'s legislation may require you to send the invitation to pay by email only. Disabling the option will hide the invitation on the confirmation page.', array(), 'Modules.Wirepayment.Admin'),
'values' => array(
array(
'id' => 'active_on',
'value' => true,
'label' => $this->trans('Enabled', array(), 'Admin.Global'),
),
array(
'id' => 'active_off',
'value' => false,
'label' => $this->trans('Disabled', array(), 'Admin.Global'),
)
),
),
),
'submit' => array(
'title' => $this->trans('Save', array(), 'Admin.Actions'),
)
),
);
$helper = new HelperForm();
$helper->show_toolbar = false;
$helper->table = $this->table;
$lang = new Language((int)Configuration::get('PS_LANG_DEFAULT'));
$helper->default_form_language = $lang->id;
$helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? : 0;
$this->fields_form = array();
$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 = array(
'fields_value' => $this->getConfigFieldsValues(),
'languages' => $this->context->controller->getLanguages(),
'id_language' => $this->context->language->id
);
return $helper->generateForm(array($fields_form, $fields_form_customization));
}
public function getConfigFieldsValues()
{
$custom_text = array();
$languages = Language::getLanguages(false);
foreach ($languages as $lang) {
$custom_text[$lang['id_lang']] = Tools::getValue(
'BANK_WIRE_CUSTOM_TEXT_'.$lang['id_lang'],
Configuration::get('BANK_WIRE_CUSTOM_TEXT', $lang['id_lang'])
);
}
return array(
'BANK_WIRE_DETAILS' => Tools::getValue('BANK_WIRE_DETAILS', Configuration::get('BANK_WIRE_DETAILS')),
'BANK_WIRE_OWNER' => Tools::getValue('BANK_WIRE_OWNER', Configuration::get('BANK_WIRE_OWNER')),
'BANK_WIRE_ADDRESS' => Tools::getValue('BANK_WIRE_ADDRESS', Configuration::get('BANK_WIRE_ADDRESS')),
'BANK_WIRE_RESERVATION_DAYS' => Tools::getValue('BANK_WIRE_RESERVATION_DAYS', Configuration::get('BANK_WIRE_RESERVATION_DAYS')),
'BANK_WIRE_CUSTOM_TEXT' => $custom_text,
self::FLAG_DISPLAY_PAYMENT_INVITE => Tools::getValue(self::FLAG_DISPLAY_PAYMENT_INVITE,
Configuration::get(self::FLAG_DISPLAY_PAYMENT_INVITE))
);
}
public function getTemplateVarInfos()
{
$cart = $this->context->cart;
$total = sprintf(
$this->trans('%1$s (tax incl.)', array(), 'Modules.Wirepayment.Shop'),
Tools::displayPrice($cart->getOrderTotal(true, Cart::BOTH))
);
$bankwireOwner = $this->owner;
if (!$bankwireOwner) {
$bankwireOwner = '___________';
}
$bankwireDetails = Tools::nl2br($this->details);
if (!$bankwireDetails) {
$bankwireDetails = '___________';
}
$bankwireAddress = Tools::nl2br($this->address);
if (!$bankwireAddress) {
$bankwireAddress = '___________';
}
$bankwireReservationDays = Configuration::get('BANK_WIRE_RESERVATION_DAYS');
if (false === $bankwireReservationDays) {
$bankwireReservationDays = 7;
}
$bankwireCustomText = Tools::nl2br(Configuration::get('BANK_WIRE_CUSTOM_TEXT', $this->context->language->id));
if (false === $bankwireCustomText) {
$bankwireCustomText = '';
}
return array(
'total' => $total,
'bankwireDetails' => $bankwireDetails,
'bankwireAddress' => $bankwireAddress,
'bankwireOwner' => $bankwireOwner,
'bankwireReservationDays' => (int)$bankwireReservationDays,
'bankwireCustomText' => $bankwireCustomText,
);
}
}

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;

View File

@@ -0,0 +1,58 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
/**
* @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead
*/
include(__DIR__.'/../../config/config.inc.php');
include(__DIR__.'/../../header.php');
include(__DIR__.'/../../init.php');
$context = Context::getContext();
$cart = $context->cart;
$bankwire = Module::getInstanceByName('ps_wirepayment');
if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$bankwire->active)
Tools::redirect('index.php?controller=order&step=1');
// 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_wirepayment')
{
$authorized = true;
break;
}
if (!$authorized)
die($bankwire->getTranslator()->trans('This payment method is not available.', array(), 'Modules.Wirepayment.Shop'));
$customer = new Customer((int)$cart->id_customer);
if (!Validate::isLoadedObject($customer))
Tools::redirect('index.php?controller=order&step=1');
$currency = $context->currency;
$total = (float)($cart->getOrderTotal(true, Cart::BOTH));
$bankwire->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $bankwire->displayName, NULL, array(), (int)$currency->id, false, $customer->secure_key);
$order = new Order($bankwire->currentOrder);
Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$bankwire->id.'&id_order='.$bankwire->currentOrder.'&key='.$customer->secure_key);

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;

View File

@@ -0,0 +1,30 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<dl>
<dt>{l s='Amount' d='Modules.Wirepayment.Shop'}</dt>
<dd>{$total}</dd>
<dt>{l s='Name of account owner' d='Modules.Wirepayment.Shop'}</dt>
<dd>{$bankwireOwner}</dd>
<dt>{l s='Please include these details' d='Modules.Wirepayment.Shop'}</dt>
<dd>{$bankwireDetails nofilter}</dd>
<dt>{l s='Bank name' d='Modules.Wirepayment.Shop'}</dt>
<dd>{$bankwireAddress nofilter}</dd>
</dl>

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;

View File

@@ -0,0 +1,25 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="alert alert-info">
<img src="../modules/ps_wirepayment/logo.png" style="float:left; margin-right:15px;" height="60">
<p><strong>{l s="This module allows you to accept secure payments by bank wire." d='Modules.Wirepayment.Admin'}</strong></p>
<p>{l s="If the client chooses to pay by bank wire, the order status will change to 'Waiting for Payment'." d='Modules.Wirepayment.Admin'}</p>
<p>{l s="That said, you must manually confirm the order upon receiving the bank wire." d='Modules.Wirepayment.Admin'}</p>
</div>

View File

@@ -0,0 +1,25 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<p class="payment_module">
<a href="{$link->getModuleLink('ps_wirepayment', 'payment')|escape:'html'}" title="{l s='Pay by bank wire' d='Modules.Wirepayment.Shop'}">
<img src="{$this_path_bw}logo.png" alt="{l s='Pay by bank wire' d='Modules.Wirepayment.Shop'}" width="86" height="49"/>
{l s='Pay by bank wire' d='Modules.Wirepayment.Shop'}&nbsp;<span>{l s='(order processing will be longer)' d='Modules.Wirepayment.Shop'}</span>
</a>
</p>

View File

@@ -0,0 +1,39 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if $status == 'ok'}
<p>
{l s='Your order on %s is complete.' sprintf=[$shop_name] d='Modules.Wirepayment.Shop'}<br/>
{l s='Please send us a bank wire with:' d='Modules.Wirepayment.Shop'}
</p>
{include file='module:ps_wirepayment/views/templates/hook/_partials/payment_infos.tpl'}
<p>
{l s='Please specify your order reference %s in the bankwire description.' sprintf=[$reference] d='Modules.Wirepayment.Shop'}<br/>
{l s='We\'ve also sent you this information by e-mail.' d='Modules.Wirepayment.Shop'}
</p>
<strong>{l s='Your order will be sent as soon as we receive payment.' d='Modules.Wirepayment.Shop'}</strong>
<p>
{l s='If you have questions, comments or concerns, please contact our [1]expert customer support team[/1].' d='Modules.Wirepayment.Shop' sprintf=['[1]' => "<a href='{$contact_url}'>", '[/1]' => '</a>']}
</p>
{else}
<p class="warning">
{l s='We noticed a problem with your order. If you think this is an error, feel free to contact our [1]expert customer support team[/1].' d='Modules.Wirepayment.Shop' sprintf=['[1]' => "<a href='{$contact_url}'>", '[/1]' => '</a>']}
</p>
{/if}

View File

@@ -0,0 +1,48 @@
{**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<section>
<p>
{l s='Please transfer the invoice amount to our bank account. You will receive our order confirmation by email containing bank details and order number.' d='Modules.Wirepayment.Shop'}
{if $bankwireReservationDays}
{l s='Goods will be reserved %s days for you and we\'ll process the order immediately after receiving the payment.' sprintf=[$bankwireReservationDays] d='Modules.Wirepayment.Shop'}
{/if}
{if $bankwireCustomText }
<a data-toggle="modal" data-target="#bankwire-modal">{l s='More information' d='Modules.Wirepayment.Shop'}</a>
{/if}
</p>
<div class="modal fade" id="bankwire-modal" tabindex="-1" role="dialog" aria-labelledby="Bankwire information" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h2>{l s='Bankwire' d='Modules.Wirepayment.Shop'}</h2>
</div>
<div class="modal-body">
<p>{l s='Payment is made by transfer of the invoice amount to the following account:' d='Modules.Wirepayment.Shop'}</p>
{include file='module:ps_wirepayment/views/templates/hook/_partials/payment_infos.tpl'}
{$bankwireCustomText nofilter}
</div>
</div>
</div>
</div>
</section>

View File

@@ -0,0 +1,29 @@
<?php
/**
* 2007-2020 PrestaShop and Contributors
*
* 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.txt.
* 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.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2020 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
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;