├── logo.gif ├── logo.png ├── bankwire.jpg ├── README.md ├── CHANGELOG.txt ├── config.xml ├── upgrade ├── upgrade-1.0.6.php └── upgrade-1.0.8.php ├── index.php ├── translations ├── index.php ├── en.php └── qc.php ├── views ├── index.php └── templates │ ├── index.php │ ├── front │ ├── index.php │ └── payment_execution.tpl │ └── hook │ ├── index.php │ ├── payment.tpl │ ├── infos.tpl │ └── payment_return.tpl ├── controllers ├── index.php └── front │ ├── index.php │ ├── payment.php │ └── validation.php ├── payment.php ├── validation.php └── bankwire.php /logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Bankwire-Prestashop/HEAD/logo.gif -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Bankwire-Prestashop/HEAD/logo.png -------------------------------------------------------------------------------- /bankwire.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Huniko519/Bankwire-Prestashop/HEAD/bankwire.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bankwire-Prestashop 2 | Accept payments for your products via bank wire transfer. 3 | -------------------------------------------------------------------------------- /CHANGELOG.txt: -------------------------------------------------------------------------------- 1 | 2014-04-22 18:56:46 +0200 // Changelog updated 2 | 2014-04-17 11:59:23 +0200 // version compliancy 3 | 2014-03-24 15:16:08 +0100 / MO bankwire : ps_versions_compliancy added 4 | 2014-03-20 14:19:09 +0100 Initial commit 5 | -------------------------------------------------------------------------------- /config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | bankwire 4 | 5 | 6 | 7 | 8 | 9 | 10 | 1 11 | 1 12 | 13 | 14 | -------------------------------------------------------------------------------- /upgrade/upgrade-1.0.6.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | if (!defined('_PS_VERSION_')) 28 | exit; 29 | 30 | function upgrade_module_1_0_6($module) 31 | { 32 | return true; 33 | } 34 | -------------------------------------------------------------------------------- /upgrade/upgrade-1.0.8.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | if (!defined('_PS_VERSION_')) 28 | exit; 29 | 30 | function upgrade_module_1_0_8($module) 31 | { 32 | $hook_to_remove_id = Hook::getIdByName('advancedPaymentApi'); 33 | if ($hook_to_remove_id) { 34 | $module->unregisterHook((int)$hook_to_remove_id); 35 | } 36 | return true; 37 | } 38 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 28 | header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); 29 | 30 | header("Cache-Control: no-store, no-cache, must-revalidate"); 31 | header("Cache-Control: post-check=0, pre-check=0", false); 32 | header("Pragma: no-cache"); 33 | 34 | header("Location: ../"); 35 | exit; -------------------------------------------------------------------------------- /translations/index.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 28 | header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); 29 | 30 | header("Cache-Control: no-store, no-cache, must-revalidate"); 31 | header("Cache-Control: post-check=0, pre-check=0", false); 32 | header("Pragma: no-cache"); 33 | 34 | header("Location: ../"); 35 | exit; -------------------------------------------------------------------------------- /views/index.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 28 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); 29 | 30 | header('Cache-Control: no-store, no-cache, must-revalidate'); 31 | header('Cache-Control: post-check=0, pre-check=0', false); 32 | header('Pragma: no-cache'); 33 | 34 | header('Location: ../../../'); 35 | exit; -------------------------------------------------------------------------------- /controllers/index.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 28 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); 29 | 30 | header('Cache-Control: no-store, no-cache, must-revalidate'); 31 | header('Cache-Control: post-check=0, pre-check=0', false); 32 | header('Pragma: no-cache'); 33 | 34 | header('Location: ../../../'); 35 | exit; -------------------------------------------------------------------------------- /controllers/front/index.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 28 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); 29 | 30 | header('Cache-Control: no-store, no-cache, must-revalidate'); 31 | header('Cache-Control: post-check=0, pre-check=0', false); 32 | header('Pragma: no-cache'); 33 | 34 | header('Location: ../../../../'); 35 | exit; -------------------------------------------------------------------------------- /views/templates/index.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 28 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); 29 | 30 | header('Cache-Control: no-store, no-cache, must-revalidate'); 31 | header('Cache-Control: post-check=0, pre-check=0', false); 32 | header('Pragma: no-cache'); 33 | 34 | header('Location: ../../../../'); 35 | exit; -------------------------------------------------------------------------------- /views/templates/front/index.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 28 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); 29 | 30 | header('Cache-Control: no-store, no-cache, must-revalidate'); 31 | header('Cache-Control: post-check=0, pre-check=0', false); 32 | header('Pragma: no-cache'); 33 | 34 | header('Location: ../../../../../'); 35 | exit; -------------------------------------------------------------------------------- /views/templates/hook/index.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); 28 | header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); 29 | 30 | header('Cache-Control: no-store, no-cache, must-revalidate'); 31 | header('Cache-Control: post-check=0, pre-check=0', false); 32 | header('Pragma: no-cache'); 33 | 34 | header('Location: ../../../../../'); 35 | exit; -------------------------------------------------------------------------------- /views/templates/hook/payment.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * 2007-2016 PrestaShop 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Academic Free License (AFL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/afl-3.0.php 10 | * If you did not receive a copy of the license and are unable to 11 | * obtain it through the world-wide-web, please send an email 12 | * to license@prestashop.com so we can send you a copy immediately. 13 | * 14 | * DISCLAIMER 15 | * 16 | * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 17 | * versions in the future. If you wish to customize PrestaShop for your 18 | * needs please refer to http://www.prestashop.com for more information. 19 | * 20 | * @author PrestaShop SA 21 | * @copyright 2007-2016 PrestaShop SA 22 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 23 | * International Registered Trademark & Property of PrestaShop SA 24 | *} 25 | 26 |

27 | 28 | {l s='Pay by bank wire' mod='bankwire'} 29 | {l s='Pay by bank wire' mod='bankwire'} {l s='(order processing will be longer)' mod='bankwire'} 30 | 31 |

-------------------------------------------------------------------------------- /payment.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | /** 28 | * @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead 29 | */ 30 | 31 | /* SSL Management */ 32 | $useSSL = false; 33 | 34 | require('../../config/config.inc.php'); 35 | Tools::displayFileAsDeprecated(); 36 | 37 | // init front controller in order to use Tools::redirect 38 | $controller = new FrontController(); 39 | $controller->init(); 40 | 41 | Tools::redirect(Context::getContext()->link->getModuleLink('bankwire', 'payment')); -------------------------------------------------------------------------------- /views/templates/hook/infos.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * 2007-2016 PrestaShop 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Academic Free License (AFL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/afl-3.0.php 10 | * If you did not receive a copy of the license and are unable to 11 | * obtain it through the world-wide-web, please send an email 12 | * to license@prestashop.com so we can send you a copy immediately. 13 | * 14 | * DISCLAIMER 15 | * 16 | * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 17 | * versions in the future. If you wish to customize PrestaShop for your 18 | * needs please refer to http://www.prestashop.com for more information. 19 | * 20 | * @author PrestaShop SA 21 | * @copyright 2007-2016 PrestaShop SA 22 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 23 | * International Registered Trademark & Property of PrestaShop SA 24 | *} 25 | 26 |
27 | 28 |

{l s="This module allows you to accept secure payments by bank wire." mod='bankwire'}

29 |

{l s="If the client chooses to pay by bank wire, the order's status will change to 'Waiting for Payment.'" mod='bankwire'}

30 |

{l s="That said, you must manually confirm the order upon receiving the bank wire." mod='bankwire'}

31 |
32 | -------------------------------------------------------------------------------- /controllers/front/payment.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | /** 28 | * @since 1.5.0 29 | */ 30 | class BankwirePaymentModuleFrontController extends ModuleFrontController 31 | { 32 | public $ssl = true; 33 | public $display_column_left = false; 34 | 35 | /** 36 | * @see FrontController::initContent() 37 | */ 38 | public function initContent() 39 | { 40 | parent::initContent(); 41 | 42 | $cart = $this->context->cart; 43 | if (!$this->module->checkCurrency($cart)) 44 | Tools::redirect('index.php?controller=order'); 45 | 46 | $this->context->smarty->assign(array( 47 | 'nbProducts' => $cart->nbProducts(), 48 | 'cust_currency' => $cart->id_currency, 49 | 'currencies' => $this->module->getCurrency((int)$cart->id_currency), 50 | 'total' => $cart->getOrderTotal(true, Cart::BOTH), 51 | 'this_path' => $this->module->getPathUri(), 52 | 'this_path_bw' => $this->module->getPathUri(), 53 | 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/' 54 | )); 55 | 56 | $this->setTemplate('payment_execution.tpl'); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /validation.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | /** 28 | * @deprecated 1.5.0 This file is deprecated, use moduleFrontController instead 29 | */ 30 | 31 | include(dirname(__FILE__).'/../../config/config.inc.php'); 32 | include(dirname(__FILE__).'/../../header.php'); 33 | include(dirname(__FILE__).'/../../init.php'); 34 | 35 | $context = Context::getContext(); 36 | $cart = $context->cart; 37 | $bankwire = Module::getInstanceByName('bankwire'); 38 | 39 | if ($cart->id_customer == 0 OR $cart->id_address_delivery == 0 OR $cart->id_address_invoice == 0 OR !$bankwire->active) 40 | Tools::redirect('index.php?controller=order&step=1'); 41 | 42 | // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process 43 | $authorized = false; 44 | foreach (Module::getPaymentModules() as $module) 45 | if ($module['name'] == 'bankwire') 46 | { 47 | $authorized = true; 48 | break; 49 | } 50 | if (!$authorized) 51 | die($bankwire->l('This payment method is not available.', 'validation')); 52 | 53 | $customer = new Customer((int)$cart->id_customer); 54 | 55 | if (!Validate::isLoadedObject($customer)) 56 | Tools::redirect('index.php?controller=order&step=1'); 57 | 58 | $currency = $context->currency; 59 | $total = (float)($cart->getOrderTotal(true, Cart::BOTH)); 60 | 61 | $bankwire->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $bankwire->displayName, NULL, array(), (int)$currency->id, false, $customer->secure_key); 62 | 63 | $order = new Order($bankwire->currentOrder); 64 | Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$bankwire->id.'&id_order='.$bankwire->currentOrder.'&key='.$customer->secure_key); 65 | -------------------------------------------------------------------------------- /views/templates/hook/payment_return.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * 2007-2016 PrestaShop 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Academic Free License (AFL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/afl-3.0.php 10 | * If you did not receive a copy of the license and are unable to 11 | * obtain it through the world-wide-web, please send an email 12 | * to license@prestashop.com so we can send you a copy immediately. 13 | * 14 | * DISCLAIMER 15 | * 16 | * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 17 | * versions in the future. If you wish to customize PrestaShop for your 18 | * needs please refer to http://www.prestashop.com for more information. 19 | * 20 | * @author PrestaShop SA 21 | * @copyright 2007-2016 PrestaShop SA 22 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 23 | * International Registered Trademark & Property of PrestaShop SA 24 | *} 25 | 26 | {if $status == 'ok'} 27 |

{l s='Your order on %s is complete.' sprintf=$shop_name mod='bankwire'} 28 |

29 | {l s='Please send us a bank wire with' mod='bankwire'} 30 |

- {l s='Amount' mod='bankwire'} {$total_to_pay} 31 |

- {l s='Name of account owner' mod='bankwire'} {if $bankwireOwner}{$bankwireOwner}{else}___________{/if} 32 |

- {l s='Include these details' mod='bankwire'} {if $bankwireDetails}{$bankwireDetails}{else}___________{/if} 33 |

- {l s='Bank name' mod='bankwire'} {if $bankwireAddress}{$bankwireAddress}{else}___________{/if} 34 | {if !isset($reference)} 35 |

- {l s='Do not forget to insert your order number #%d in the subject of your bank wire.' sprintf=$id_order mod='bankwire'} 36 | {else} 37 |

- {l s='Do not forget to insert your order reference %s in the subject of your bank wire.' sprintf=$reference mod='bankwire'} 38 | {/if}

{l s='An email has been sent with this information.' mod='bankwire'} 39 |

{l s='Your order will be sent as soon as we receive payment.' mod='bankwire'} 40 |

{l s='If you have questions, comments or concerns, please contact our' mod='bankwire'} {l s='expert customer support team' mod='bankwire'}. 41 |

42 | {else} 43 |

44 | {l s='We noticed a problem with your order. If you think this is an error, feel free to contact our' mod='bankwire'} 45 | {l s='expert customer support team' mod='bankwire'}. 46 |

47 | {/if} 48 | -------------------------------------------------------------------------------- /controllers/front/validation.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | /** 28 | * @since 1.5.0 29 | */ 30 | class BankwireValidationModuleFrontController extends ModuleFrontController 31 | { 32 | /** 33 | * @see FrontController::postProcess() 34 | */ 35 | public function postProcess() 36 | { 37 | $cart = $this->context->cart; 38 | if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) 39 | Tools::redirect('index.php?controller=order&step=1'); 40 | 41 | // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process 42 | $authorized = false; 43 | foreach (Module::getPaymentModules() as $module) 44 | if ($module['name'] == 'bankwire') 45 | { 46 | $authorized = true; 47 | break; 48 | } 49 | if (!$authorized) 50 | die($this->module->l('This payment method is not available.', 'validation')); 51 | 52 | $customer = new Customer($cart->id_customer); 53 | if (!Validate::isLoadedObject($customer)) 54 | Tools::redirect('index.php?controller=order&step=1'); 55 | 56 | $currency = $this->context->currency; 57 | $total = (float)$cart->getOrderTotal(true, Cart::BOTH); 58 | $mailVars = array( 59 | '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), 60 | '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), 61 | '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) 62 | ); 63 | 64 | $this->module->validateOrder($cart->id, Configuration::get('PS_OS_BANKWIRE'), $total, $this->module->displayName, NULL, $mailVars, (int)$currency->id, false, $customer->secure_key); 65 | 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); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /views/templates/front/payment_execution.tpl: -------------------------------------------------------------------------------- 1 | {* 2 | * 2007-2016 PrestaShop 3 | * 4 | * NOTICE OF LICENSE 5 | * 6 | * This source file is subject to the Academic Free License (AFL 3.0) 7 | * that is bundled with this package in the file LICENSE.txt. 8 | * It is also available through the world-wide-web at this URL: 9 | * http://opensource.org/licenses/afl-3.0.php 10 | * If you did not receive a copy of the license and are unable to 11 | * obtain it through the world-wide-web, please send an email 12 | * to license@prestashop.com so we can send you a copy immediately. 13 | * 14 | * DISCLAIMER 15 | * 16 | * Do not edit or add to this file if you wish to upgrade PrestaShop to newer 17 | * versions in the future. If you wish to customize PrestaShop for your 18 | * needs please refer to http://www.prestashop.com for more information. 19 | * 20 | * @author PrestaShop SA 21 | * @copyright 2007-2016 PrestaShop SA 22 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 23 | * International Registered Trademark & Property of PrestaShop SA 24 | *} 25 | 26 | {capture name=path} 27 | {l s='Checkout' mod='bankwire'}{$navigationPipe}{l s='Bank-wire payment' mod='bankwire'} 28 | {/capture} 29 | 30 | {include file="$tpl_dir./breadcrumb.tpl"} 31 | 32 |

{l s='Order summary' mod='bankwire'}

33 | 34 | {assign var='current_step' value='payment'} 35 | {include file="$tpl_dir./order-steps.tpl"} 36 | 37 | {if $nbProducts <= 0} 38 |

{l s='Your shopping cart is empty.' mod='bankwire'}

39 | {else} 40 | 41 |

{l s='Bank-wire payment' mod='bankwire'}

42 |
43 |

44 | {l s='Bank wire' mod='bankwire'} 45 | {l s='You have chosen to pay by bank wire.' mod='bankwire'} 46 |

47 | {l s='Here is a short summary of your order:' mod='bankwire'} 48 |

49 |

50 | - {l s='The total amount of your order is' mod='bankwire'} 51 | {displayPrice price=$total} 52 | {if $use_taxes == 1} 53 | {l s='(tax incl.)' mod='bankwire'} 54 | {/if} 55 |

56 |

57 | - 58 | {if $currencies|@count > 1} 59 | {l s='We allow several currencies to be sent via bank wire.' mod='bankwire'} 60 |

61 | {l s='Choose one of the following:' mod='bankwire'} 62 | 67 | {else} 68 | {l s='We allow the following currency to be sent via bank wire:' mod='bankwire'} {$currencies.0.name} 69 | 70 | {/if} 71 |

72 |

73 | {l s='Bank wire account information will be displayed on the next page.' mod='bankwire'} 74 |

75 | {l s='Please confirm your order by clicking "I confirm my order".' mod='bankwire'} 76 |

77 |

78 | 79 | {l s='Other payment methods' mod='bankwire'} 80 |

81 |
82 | {/if} 83 | -------------------------------------------------------------------------------- /translations/en.php: -------------------------------------------------------------------------------- 1 | bankwire_05adcee99142c1a60fb38bb1330bbbc1'] = 'Bank wire'; 7 | $_MODULE['<{bankwire}prestashop>bankwire_a246a8e9907530c4c36b8b4c37bbc823'] = 'Accept payments for your products via bank wire transfer.'; 8 | $_MODULE['<{bankwire}prestashop>bankwire_cbe0a99684b145e77f3e14174ac212e3'] = 'Are you sure about removing these details?'; 9 | $_MODULE['<{bankwire}prestashop>bankwire_0ea0227283d959415eda0cfa31d9f718'] = 'Account owner and account details must be configured before using this module.'; 10 | $_MODULE['<{bankwire}prestashop>bankwire_a02758d758e8bec77a33d7f392eb3f8a'] = 'No currency has been set for this module.'; 11 | $_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = 'Account details are required.'; 12 | $_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Account owner is required.'; 13 | $_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'Settings updated'; 14 | $_MODULE['<{bankwire}prestashop>bankwire_4ffaad55a1d22c453e7c9bad67b0598f'] = 'Pay by Bank Wire'; 15 | $_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Contact details'; 16 | $_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Account owner'; 17 | $_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Details'; 18 | $_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'Such as bank branch, IBAN number, BIC, etc.'; 19 | $_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Bank address'; 20 | $_MODULE['<{bankwire}prestashop>bankwire_c9cc8cce247e49bae79f15173ce97354'] = 'Save'; 21 | $_MODULE['<{bankwire}prestashop>validation_e2b7dec8fa4b498156dfee6e4c84b156'] = 'This payment method is not available.'; 22 | $_MODULE['<{bankwire}prestashop>payment_execution_644818852b4dd8cf9da73543e30f045a'] = 'Go back to the Checkout'; 23 | $_MODULE['<{bankwire}prestashop>payment_execution_6ff063fbc860a79759a7369ac32cee22'] = 'Checkout'; 24 | $_MODULE['<{bankwire}prestashop>payment_execution_511e8b930b4d3d6002984c0373eb6d4b'] = 'Bank-wire payment'; 25 | $_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Order summary'; 26 | $_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Your shopping cart is empty.'; 27 | $_MODULE['<{bankwire}prestashop>payment_execution_05adcee99142c1a60fb38bb1330bbbc1'] = 'Bank wire'; 28 | $_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'You have chosen to pay by bank wire.'; 29 | $_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Here is a short summary of your order:'; 30 | $_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'The total amount of your order is'; 31 | $_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = '(tax incl.)'; 32 | $_MODULE['<{bankwire}prestashop>payment_execution_b28be4c423d93e02081f4e79fe2434e8'] = 'We allow several currencies to be sent via bank wire.'; 33 | $_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Choose one of the following:'; 34 | $_MODULE['<{bankwire}prestashop>payment_execution_a854d894458d66d92cabf0411c499ef4'] = 'We allow the following currency to be sent via bank wire:'; 35 | $_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'Bank wire account information will be displayed on the next page.'; 36 | $_MODULE['<{bankwire}prestashop>payment_execution_edd87c9059d88fea45c0bd6384ce92b9'] = 'Please confirm your order by clicking "I confirm my order".'; 37 | $_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'I confirm my order'; 38 | $_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Other payment methods'; 39 | $_MODULE['<{bankwire}prestashop>infos_c1be305030739396775edaca9813f77d'] = 'This module allows you to accept secure payments by bank wire.'; 40 | $_MODULE['<{bankwire}prestashop>infos_60742d06006fde3043c77e6549d71a99'] = 'If the client chooses to pay by bank wire, the order\'s status will change to \'Waiting for Payment.\''; 41 | $_MODULE['<{bankwire}prestashop>infos_5fb4bbf993c23848433caf58e6b2816d'] = 'That said, you must manually confirm the order upon receiving the bank wire.'; 42 | $_MODULE['<{bankwire}prestashop>payment_return_88526efe38fd18179a127024aba8c1d7'] = 'Your order on %s is complete.'; 43 | $_MODULE['<{bankwire}prestashop>payment_return_1f8cdc30326f1f930b0c87b25fdac965'] = 'Please send us a bank wire with'; 44 | $_MODULE['<{bankwire}prestashop>payment_return_b2f40690858b404ed10e62bdf422c704'] = 'Amount'; 45 | $_MODULE['<{bankwire}prestashop>payment_return_5ca0b1b910f393ed1f9f6fa99e414255'] = 'Name of account owner'; 46 | $_MODULE['<{bankwire}prestashop>payment_return_d717aa33e18263b8405ba00e94353cdc'] = 'Include these details'; 47 | $_MODULE['<{bankwire}prestashop>payment_return_984482eb9ff11e6310fef641d2268a2a'] = 'Bank name'; 48 | $_MODULE['<{bankwire}prestashop>payment_return_bb4ec5aac6864a05fcc220cccd8e82f9'] = 'Do not forget to insert your order number #%d in the subject of your bank wire.'; 49 | $_MODULE['<{bankwire}prestashop>payment_return_1faa25b80a8d31e5ef25a78d3336606d'] = 'Do not forget to insert your order reference %s in the subject of your bank wire.'; 50 | $_MODULE['<{bankwire}prestashop>payment_return_19c419a8a4f1cd621853376a930a2e24'] = 'An email has been sent with this information.'; 51 | $_MODULE['<{bankwire}prestashop>payment_return_b9a1cae09e5754424e33764777cfcaa0'] = 'Your order will be sent as soon as we receive payment.'; 52 | $_MODULE['<{bankwire}prestashop>payment_return_ca7e41a658753c87973936d7ce2429a8'] = 'If you have questions, comments or concerns, please contact our'; 53 | $_MODULE['<{bankwire}prestashop>payment_return_66fcf4c223bbf4c7c886d4784e1f62e4'] = 'expert customer support team'; 54 | $_MODULE['<{bankwire}prestashop>payment_return_d15feee53d81ea16269e54d4784fa123'] = 'We noticed a problem with your order. If you think this is an error, feel free to contact our'; 55 | $_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Pay by bank wire'; 56 | $_MODULE['<{bankwire}prestashop>payment_4e1fb9f4b46556d64db55d50629ee301'] = '(order processing will be longer)'; 57 | $_MODULE['<{bankwire}prestashop>payment_return_decce112a9e64363c997b04aa71b7cb8'] = 'customer service department.'; 58 | 59 | 60 | return $_MODULE; 61 | -------------------------------------------------------------------------------- /translations/qc.php: -------------------------------------------------------------------------------- 1 | bankwire_05adcee99142c1a60fb38bb1330bbbc1'] = 'Virement bancaire'; 7 | $_MODULE['<{bankwire}prestashop>bankwire_a246a8e9907530c4c36b8b4c37bbc823'] = 'Accepter les paiements par virement.'; 8 | $_MODULE['<{bankwire}prestashop>bankwire_cbe0a99684b145e77f3e14174ac212e3'] = 'Êtes-vous certain de vouloir effacer vos données ?'; 9 | $_MODULE['<{bankwire}prestashop>bankwire_0ea0227283d959415eda0cfa31d9f718'] = 'Le titulaire du compte et les informations bancaires doivent être configurés.'; 10 | $_MODULE['<{bankwire}prestashop>bankwire_a02758d758e8bec77a33d7f392eb3f8a'] = 'Aucune devise disponible pour ce module'; 11 | $_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = 'Les détails du compte sont requis'; 12 | $_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Le titulaire du compte est requis.'; 13 | $_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'Mise à jour réussie'; 14 | $_MODULE['<{bankwire}prestashop>bankwire_4ffaad55a1d22c453e7c9bad67b0598f'] = 'Payer par virement bancaire'; 15 | $_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Coordonnées'; 16 | $_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Titulaire'; 17 | $_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Détails'; 18 | $_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'Comme le code banque, l\'IBAN ou encore le BIC.'; 19 | $_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Adresse de la banque'; 20 | $_MODULE['<{bankwire}prestashop>bankwire_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; 21 | $_MODULE['<{bankwire}prestashop>validation_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Ce moyen de paiement n\'est pas disponible.'; 22 | $_MODULE['<{bankwire}prestashop>payment_execution_644818852b4dd8cf9da73543e30f045a'] = 'Retour à la commande'; 23 | $_MODULE['<{bankwire}prestashop>payment_execution_6ff063fbc860a79759a7369ac32cee22'] = 'Processus de commande'; 24 | $_MODULE['<{bankwire}prestashop>payment_execution_511e8b930b4d3d6002984c0373eb6d4b'] = 'Paiement par virement bancaire'; 25 | $_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Récapitulatif de commande'; 26 | $_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Votre panier est vide'; 27 | $_MODULE['<{bankwire}prestashop>payment_execution_05adcee99142c1a60fb38bb1330bbbc1'] = 'Virement bancaire'; 28 | $_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'Vous avez choisi de régler par virement bancaire.'; 29 | $_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Voici un bref récapitulatif de votre commande :'; 30 | $_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Le montant total de votre commande s\'élève à'; 31 | $_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = '(avec taxes)'; 32 | $_MODULE['<{bankwire}prestashop>payment_execution_b28be4c423d93e02081f4e79fe2434e8'] = 'Nous acceptons plusieurs devises pour votre virement.'; 33 | $_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Merci de choisir parmi les suivantes :'; 34 | $_MODULE['<{bankwire}prestashop>payment_execution_a854d894458d66d92cabf0411c499ef4'] = 'Nous acceptons la devise suivante pour votre paiement :'; 35 | $_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'Nos coordonnées bancaires seront affichées sur la page suivante.'; 36 | $_MODULE['<{bankwire}prestashop>payment_execution_edd87c9059d88fea45c0bd6384ce92b9'] = 'Veuillez confirmer votre commande en cliquant sur « Je confirme ma commande ».'; 37 | $_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande'; 38 | $_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement'; 39 | $_MODULE['<{bankwire}prestashop>infos_c1be305030739396775edaca9813f77d'] = 'Ce module vous permet d\'accepter les paiements par virement bancaire.'; 40 | $_MODULE['<{bankwire}prestashop>infos_60742d06006fde3043c77e6549d71a99'] = 'Si le client choisit ce mode de paiement, la commande passera à l\'état "Paiement en attente".'; 41 | $_MODULE['<{bankwire}prestashop>infos_5fb4bbf993c23848433caf58e6b2816d'] = 'Par conséquent, vous devez confirmer manuellement la commande dès que vous recevrez le virement.'; 42 | $_MODULE['<{bankwire}prestashop>payment_return_88526efe38fd18179a127024aba8c1d7'] = 'Votre commande sur %s a bien été enregistrée.'; 43 | $_MODULE['<{bankwire}prestashop>payment_return_1f8cdc30326f1f930b0c87b25fdac965'] = 'Veuillez nous envoyer un virement bancaire avec :'; 44 | $_MODULE['<{bankwire}prestashop>payment_return_b2f40690858b404ed10e62bdf422c704'] = 'Montant'; 45 | $_MODULE['<{bankwire}prestashop>payment_return_5ca0b1b910f393ed1f9f6fa99e414255'] = 'à l\'ordre de'; 46 | $_MODULE['<{bankwire}prestashop>payment_return_d717aa33e18263b8405ba00e94353cdc'] = 'suivant ces détails'; 47 | $_MODULE['<{bankwire}prestashop>payment_return_984482eb9ff11e6310fef641d2268a2a'] = 'à cette banque'; 48 | $_MODULE['<{bankwire}prestashop>payment_return_bb4ec5aac6864a05fcc220cccd8e82f9'] = 'N\'oubliez pas d\'indiquer votre numéro de commande %d dans l\'objet de votre virement.'; 49 | $_MODULE['<{bankwire}prestashop>payment_return_1faa25b80a8d31e5ef25a78d3336606d'] = 'N\'oubliez pas d\'indiquer votre référence de commande %s dans le sujet de votre virement.'; 50 | $_MODULE['<{bankwire}prestashop>payment_return_19c419a8a4f1cd621853376a930a2e24'] = 'Un courriel contenant ces informations vous a été envoyé.'; 51 | $_MODULE['<{bankwire}prestashop>payment_return_b9a1cae09e5754424e33764777cfcaa0'] = 'Votre commande sera expédiée dès réception de votre virement.'; 52 | $_MODULE['<{bankwire}prestashop>payment_return_ca7e41a658753c87973936d7ce2429a8'] = 'Pour toute question ou information complémentaire, veuillez contacter notre'; 53 | $_MODULE['<{bankwire}prestashop>payment_return_66fcf4c223bbf4c7c886d4784e1f62e4'] = 'service client'; 54 | $_MODULE['<{bankwire}prestashop>payment_return_d15feee53d81ea16269e54d4784fa123'] = 'Nous avons rencontré un problème avec votre commande. Nous vous invitons à prendre contact avec notre'; 55 | $_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Payer par virement bancaire'; 56 | $_MODULE['<{bankwire}prestashop>payment_4e1fb9f4b46556d64db55d50629ee301'] = '(le traitement de la commande sera plus long)'; 57 | $_MODULE['<{bankwire}prestashop>payment_return_decce112a9e64363c997b04aa71b7cb8'] = 'support client'; 58 | 59 | 60 | return $_MODULE; 61 | -------------------------------------------------------------------------------- /bankwire.php: -------------------------------------------------------------------------------- 1 | 22 | * @copyright 2007-2016 PrestaShop SA 23 | * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) 24 | * International Registered Trademark & Property of PrestaShop SA 25 | */ 26 | 27 | if (!defined('_PS_VERSION_')) 28 | exit; 29 | 30 | class BankWire extends PaymentModule 31 | { 32 | protected $_html = ''; 33 | protected $_postErrors = array(); 34 | 35 | public $details; 36 | public $owner; 37 | public $address; 38 | public $extra_mail_vars; 39 | public function __construct() 40 | { 41 | $this->name = 'bankwire'; 42 | $this->tab = 'payments_gateways'; 43 | $this->version = '1.1.2'; 44 | $this->author = 'Astro'; 45 | $this->controllers = array('payment', 'validation'); 46 | $this->is_eu_compatible = 1; 47 | 48 | $this->currencies = true; 49 | $this->currencies_mode = 'checkbox'; 50 | 51 | $config = Configuration::getMultiple(array('BANK_WIRE_DETAILS', 'BANK_WIRE_OWNER', 'BANK_WIRE_ADDRESS')); 52 | if (!empty($config['BANK_WIRE_OWNER'])) 53 | $this->owner = $config['BANK_WIRE_OWNER']; 54 | if (!empty($config['BANK_WIRE_DETAILS'])) 55 | $this->details = $config['BANK_WIRE_DETAILS']; 56 | if (!empty($config['BANK_WIRE_ADDRESS'])) 57 | $this->address = $config['BANK_WIRE_ADDRESS']; 58 | 59 | $this->bootstrap = true; 60 | parent::__construct(); 61 | 62 | $this->displayName = $this->l('Bank wire'); 63 | $this->description = $this->l('Accept payments for your products via bank wire transfer.'); 64 | $this->confirmUninstall = $this->l('Are you sure about removing these details?'); 65 | $this->ps_versions_compliancy = array('min' => '1.6', 'max' => '1.6.99.99'); 66 | 67 | if (!isset($this->owner) || !isset($this->details) || !isset($this->address)) 68 | $this->warning = $this->l('Account owner and account details must be configured before using this module.'); 69 | if (!count(Currency::checkPaymentCurrencies($this->id))) 70 | $this->warning = $this->l('No currency has been set for this module.'); 71 | 72 | $this->extra_mail_vars = array( 73 | '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), 74 | '{bankwire_details}' => nl2br(Configuration::get('BANK_WIRE_DETAILS')), 75 | '{bankwire_address}' => nl2br(Configuration::get('BANK_WIRE_ADDRESS')) 76 | ); 77 | } 78 | 79 | public function install() 80 | { 81 | if (!parent::install() || !$this->registerHook('payment') || ! $this->registerHook('displayPaymentEU') || !$this->registerHook('paymentReturn')) 82 | return false; 83 | return true; 84 | } 85 | 86 | public function uninstall() 87 | { 88 | if (!Configuration::deleteByName('BANK_WIRE_DETAILS') 89 | || !Configuration::deleteByName('BANK_WIRE_OWNER') 90 | || !Configuration::deleteByName('BANK_WIRE_ADDRESS') 91 | || !parent::uninstall()) 92 | return false; 93 | return true; 94 | } 95 | 96 | protected function _postValidation() 97 | { 98 | if (Tools::isSubmit('btnSubmit')) 99 | { 100 | if (!Tools::getValue('BANK_WIRE_DETAILS')) 101 | $this->_postErrors[] = $this->l('Account details are required.'); 102 | elseif (!Tools::getValue('BANK_WIRE_OWNER')) 103 | $this->_postErrors[] = $this->l('Account owner is required.'); 104 | } 105 | } 106 | 107 | protected function _postProcess() 108 | { 109 | if (Tools::isSubmit('btnSubmit')) 110 | { 111 | Configuration::updateValue('BANK_WIRE_DETAILS', Tools::getValue('BANK_WIRE_DETAILS')); 112 | Configuration::updateValue('BANK_WIRE_OWNER', Tools::getValue('BANK_WIRE_OWNER')); 113 | Configuration::updateValue('BANK_WIRE_ADDRESS', Tools::getValue('BANK_WIRE_ADDRESS')); 114 | } 115 | $this->_html .= $this->displayConfirmation($this->l('Settings updated')); 116 | } 117 | 118 | protected function _displayBankWire() 119 | { 120 | return $this->display(__FILE__, 'infos.tpl'); 121 | } 122 | 123 | public function getContent() 124 | { 125 | if (Tools::isSubmit('btnSubmit')) 126 | { 127 | $this->_postValidation(); 128 | if (!count($this->_postErrors)) 129 | $this->_postProcess(); 130 | else 131 | foreach ($this->_postErrors as $err) 132 | $this->_html .= $this->displayError($err); 133 | } 134 | else 135 | $this->_html .= '
'; 136 | 137 | $this->_html .= $this->_displayBankWire(); 138 | $this->_html .= $this->renderForm(); 139 | 140 | return $this->_html; 141 | } 142 | 143 | public function hookPayment($params) 144 | { 145 | if (!$this->active) 146 | return; 147 | if (!$this->checkCurrency($params['cart'])) 148 | return; 149 | 150 | $this->smarty->assign(array( 151 | 'this_path' => $this->_path, 152 | 'this_path_bw' => $this->_path, 153 | 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' 154 | )); 155 | return $this->display(__FILE__, 'payment.tpl'); 156 | } 157 | 158 | public function hookDisplayPaymentEU($params) 159 | { 160 | if (!$this->active) 161 | return; 162 | 163 | if (!$this->checkCurrency($params['cart'])) 164 | return; 165 | 166 | $payment_options = array( 167 | 'cta_text' => $this->l('Pay by Bank Wire'), 168 | 'logo' => Media::getMediaPath(_PS_MODULE_DIR_.$this->name.'/bankwire.jpg'), 169 | 'action' => $this->context->link->getModuleLink($this->name, 'validation', array(), true) 170 | ); 171 | 172 | return $payment_options; 173 | } 174 | 175 | public function hookPaymentReturn($params) 176 | { 177 | if (!$this->active) 178 | return; 179 | 180 | $state = $params['objOrder']->getCurrentState(); 181 | if (in_array($state, array(Configuration::get('PS_OS_BANKWIRE'), Configuration::get('PS_OS_OUTOFSTOCK'), Configuration::get('PS_OS_OUTOFSTOCK_UNPAID')))) 182 | { 183 | $this->smarty->assign(array( 184 | 'total_to_pay' => Tools::displayPrice($params['total_to_pay'], $params['currencyObj'], false), 185 | 'bankwireDetails' => Tools::nl2br($this->details), 186 | 'bankwireAddress' => Tools::nl2br($this->address), 187 | 'bankwireOwner' => $this->owner, 188 | 'status' => 'ok', 189 | 'id_order' => $params['objOrder']->id 190 | )); 191 | if (isset($params['objOrder']->reference) && !empty($params['objOrder']->reference)) 192 | $this->smarty->assign('reference', $params['objOrder']->reference); 193 | } 194 | else 195 | $this->smarty->assign('status', 'failed'); 196 | return $this->display(__FILE__, 'payment_return.tpl'); 197 | } 198 | 199 | public function checkCurrency($cart) 200 | { 201 | $currency_order = new Currency($cart->id_currency); 202 | $currencies_module = $this->getCurrency($cart->id_currency); 203 | 204 | if (is_array($currencies_module)) 205 | foreach ($currencies_module as $currency_module) 206 | if ($currency_order->id == $currency_module['id_currency']) 207 | return true; 208 | return false; 209 | } 210 | 211 | public function renderForm() 212 | { 213 | $fields_form = array( 214 | 'form' => array( 215 | 'legend' => array( 216 | 'title' => $this->l('Contact details'), 217 | 'icon' => 'icon-envelope' 218 | ), 219 | 'input' => array( 220 | array( 221 | 'type' => 'text', 222 | 'label' => $this->l('Account owner'), 223 | 'name' => 'BANK_WIRE_OWNER', 224 | 'required' => true 225 | ), 226 | array( 227 | 'type' => 'textarea', 228 | 'label' => $this->l('Details'), 229 | 'name' => 'BANK_WIRE_DETAILS', 230 | 'desc' => $this->l('Such as bank branch, IBAN number, BIC, etc.'), 231 | 'required' => true 232 | ), 233 | array( 234 | 'type' => 'textarea', 235 | 'label' => $this->l('Bank address'), 236 | 'name' => 'BANK_WIRE_ADDRESS', 237 | 'required' => true 238 | ), 239 | ), 240 | 'submit' => array( 241 | 'title' => $this->l('Save'), 242 | ) 243 | ), 244 | ); 245 | 246 | $helper = new HelperForm(); 247 | $helper->show_toolbar = false; 248 | $helper->table = $this->table; 249 | $lang = new Language((int)Configuration::get('PS_LANG_DEFAULT')); 250 | $helper->default_form_language = $lang->id; 251 | $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; 252 | $this->fields_form = array(); 253 | $helper->id = (int)Tools::getValue('id_carrier'); 254 | $helper->identifier = $this->identifier; 255 | $helper->submit_action = 'btnSubmit'; 256 | $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; 257 | $helper->token = Tools::getAdminTokenLite('AdminModules'); 258 | $helper->tpl_vars = array( 259 | 'fields_value' => $this->getConfigFieldsValues(), 260 | 'languages' => $this->context->controller->getLanguages(), 261 | 'id_language' => $this->context->language->id 262 | ); 263 | 264 | return $helper->generateForm(array($fields_form)); 265 | } 266 | 267 | public function getConfigFieldsValues() 268 | { 269 | return array( 270 | 'BANK_WIRE_DETAILS' => Tools::getValue('BANK_WIRE_DETAILS', Configuration::get('BANK_WIRE_DETAILS')), 271 | 'BANK_WIRE_OWNER' => Tools::getValue('BANK_WIRE_OWNER', Configuration::get('BANK_WIRE_OWNER')), 272 | 'BANK_WIRE_ADDRESS' => Tools::getValue('BANK_WIRE_ADDRESS', Configuration::get('BANK_WIRE_ADDRESS')), 273 | ); 274 | } 275 | } 276 | --------------------------------------------------------------------------------