Skip to content

Commit

Permalink
v 2.1.0
Browse files Browse the repository at this point in the history
+ Added AdvancedPaymentOptions hook
+ Added french translation
  • Loading branch information
prestalab committed Aug 9, 2015
1 parent a9345e4 commit b8885fb
Show file tree
Hide file tree
Showing 6 changed files with 126 additions and 9 deletions.
9 changes: 9 additions & 0 deletions .idea/codeStyleSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Creates an unlimited number of fully customizable methods of payment
Allows you to bind to a payment to carrier
It does not require programming skills

v 2.1.0
+ Added AdvancedPaymentOptions hook
+ Added french translation

v 2.0.5
+ Fixed date_add and date_upd fields

Expand Down
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>universalpay</name>
<displayName><![CDATA[Universal Payment Module]]></displayName>
<version><![CDATA[2.0.5]]></version>
<version><![CDATA[2.1.0]]></version>
<description><![CDATA[Payment methods creating.]]></description>
<author><![CDATA[PrestaLab.Ru]]></author><author_uri><![CDATA[http://addons.prestashop.com/ru/payments-gateways/5507-universal-payment-module.html]]></author_uri>
<tab><![CDATA[payments_gateways]]></tab>
Expand Down
52 changes: 52 additions & 0 deletions translations/fr.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

global $_MODULE;
$_MODULE = array();
$_MODULE['<{universalpay}prestashop>adminunipaysystem_b718adec73e04ce3ec720dd11a06a308'] = 'ID';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_8c2857a9ad1d8f31659e35e904e20fa6'] = 'Logo';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_49ee3087348e8d44e1feda1917443987'] = 'Nom';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_c1069a480848e06782b81b8bea9c0c94'] = 'Description brève';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_86754577897acfb25deb69039d49d9a7'] = 'Affiché';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_f9c8caf36e4edd9019ad377a3e5913f9'] = 'Moyens de paiement';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_4e140ba723a03baa6948340bf90e2ef6'] = 'Nom:';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_6252c0f2c2ed83b7b06dfca86d4650bb'] = 'Caractères non valides:';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_6637b53a5820cef0817b7f2a2553bfc8'] = 'Affiché:';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivo';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_234078adec0a64008b6ae77653776cfa'] = 'Description brève:';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_a973d7208bb1ba1588ff414509cf7e4e'] = 'Affiché dans la page de paiement de sélection.';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_d0042a700e9bdf79689d63ee6846dc0e'] = 'Description de message à la clientèle:';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_ccab7bfd5b0b1989d5475c9a1a5effb2'] = '%total% Il sera remplacé par la somme totale';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_446e070f627483565661f8a26b4f4849'] = 'Description de message à transaction réussie:';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_70f76d85dea09b3c0bd1d0c3f8035c34'] = '%order_number% sera remplacé par le numéro de facture, %total% - sera remplacé par montant totale.';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_461900b74731e07320ca79366df3e809'] = 'Image:';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_3f8e67d2ef961f473f481b2da4d74f13'] = 'Upload le logo de paiement à partir de votre ordinateur';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_4617d8d0a8639a14eb051de337cf5498'] = 'État de la commande:';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_6d448d81cdfb465c458a0f221bbef48d'] = 'État de la commande après la création.';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_ab8cba13a061fe8d4a330bcc8d6b0175'] = 'Options de livraison:';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_14c5920c988429689db102b62fc72b2c'] = 'Types de port à associer à cette méthode de paiement';
$_MODULE['<{universalpay}prestashop>adminunipaysystem_38fb7d24e0d60a048f540ecb18e13376'] = 'Sauver';
$_MODULE['<{universalpay}prestashop>universalpay_6d38dff93844d839c18ff54b312d327b'] = 'Module de paiement universelle';
$_MODULE['<{universalpay}prestashop>universalpay_4135c7ed7be4a58bafe97bbc98c191e9'] = 'Créer une méthode de paiement';
$_MODULE['<{universalpay}prestashop>universalpay_c9cc8cce247e49bae79f15173ce97354'] = 'Sauver';
$_MODULE['<{universalpay}prestashop>universalpay_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres';
$_MODULE['<{universalpay}prestashop>universalpay_94ab57ecb6cd678b5a60cafb8d86dbc1'] = 'Ajouter un mode de paiement';
$_MODULE['<{universalpay}prestashop>universalpay_522fbb7b9cfeab6672777c23cc4eac8d'] = 'Module> Paiement';
$_MODULE['<{universalpay}prestashop>universalpay_a599c92bfe99c30fe14bee3a9ec90253'] = 'Touche de confirmation';
$_MODULE['<{universalpay}prestashop>universalpay_1e942b304ac381c702b1e20c42a448ef'] = 'Touche de confirmation dans la liste des méthodes de paiement';
$_MODULE['<{universalpay}prestashop>universalpay_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé';
$_MODULE['<{universalpay}prestashop>universalpay_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé';
$_MODULE['<{universalpay}prestashop>validation_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Ce mode de paiement ne sont pas disponibles';
$_MODULE['<{universalpay}prestashop>form_a82be0f551b8708bc08eb33cd9ded0cf'] = 'Information';
$_MODULE['<{universalpay}prestashop>form_34b6cd75171affba6957e308dcbd92be'] = 'Version';
$_MODULE['<{universalpay}prestashop>form_794df3791a8c800841516007427a2aa3'] = 'Licence';
$_MODULE['<{universalpay}prestashop>form_672caf27f5363dc833bda5099775e891'] = 'Developer';
$_MODULE['<{universalpay}prestashop>form_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Description';
$_MODULE['<{universalpay}prestashop>form_764a18c1d364a1eb563785d57137a945'] = 'Modules et templates pour PrestaShop';
$_MODULE['<{universalpay}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Résumé de la commande';
$_MODULE['<{universalpay}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Panier.';
$_MODULE['<{universalpay}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Afin de confirmation en cliquant sur \'Je confirme ma commande\'';
$_MODULE['<{universalpay}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande';
$_MODULE['<{universalpay}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres méthodes de paiement';
$_MODULE['<{universalpay}prestashop>payment_0881a11f7af33bc1b43e437391129d66'] = 'S`il vous plaît confirmer votre commande en cliquant sur \'Je confirme ma commande\'';
$_MODULE['<{universalpay}prestashop>payment_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande';
50 changes: 42 additions & 8 deletions universalpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

class Universalpay extends PaymentModule
{
private $paysystems = false;
public function __construct()
{
$this->name = 'universalpay';
$this->tab = 'payments_gateways';
$this->version = '2.0.5';
$this->version = '2.1.0';
$this->author = 'PrestaLab.Ru';
$this->need_instance = 1;
$this->module_key = 'a4e3c26ec6e4316dccd6d7da5ca30411';
Expand Down Expand Up @@ -72,6 +73,7 @@ public function install()
&& $this->registerHook('displayAdminOrderContentOrder')
&& $this->registerHook('displayAdminOrderTabOrder')
&& $this->registerHook('displayPaymentReturn')
&& $this->registerHook('advancedPaymentOptions')
&& mkdir(_PS_IMG_DIR_.'pay')
&& self::installModuleTab('AdminUniPaySystem',
array('ru' => 'Платежные системы', 'default' => 'Pay Systems', 'it' =>'Metodi di pagamento'), 'AdminParentModules');
Expand Down Expand Up @@ -203,6 +205,21 @@ public function hookdisplayPayment($params)
if (!$this->checkCurrency($params['cart']))
return;

$paysystems = $this->getPaySystems($params);
$this->smarty->assign(array(
'this_path' => $this->_path,
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/',
'universalpay' => $paysystems,
'universalpay_onepage' => Configuration::get('universalpay_onepage'),
));
return $this->display(__FILE__, 'payment.tpl');
}

public function getPaySystems($params)
{
if ($this->paysystems)
return $this->paysystems;

require_once(dirname(__FILE__).'/classes/UniPaySystem.php');

$paysystems = UniPaySystem::getPaySystems($this->context->language->id, true,
Expand All @@ -213,13 +230,30 @@ public function hookdisplayPayment($params)
array(Tools::DisplayPrice($params['cart']->getOrderTotal(true, Cart::BOTH))),
$paysystem['description']);
unset($paysystem);
$this->smarty->assign(array(
'this_path' => $this->_path,
'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/',
'universalpay' => $paysystems,
'universalpay_onepage' => Configuration::get('universalpay_onepage'),
));
return $this->display(__FILE__, 'payment.tpl');
$this->paysystems = $paysystems;
return $paysystems;
}

public function hookAdvancedPaymentOptions($params)
{
if (!$this->active)
return;
if (!$this->checkCurrency($params['cart']))
return;

$options = array();
$paysystems = $this->getPaySystems($params);
foreach ($paysystems as $paysystem)
{
$po = new Core_Business_Payment_PaymentOption();
$po->setCallToActionText($paysystem['name'])
->setAction($this->context->link->getModuleLink($this->name, 'payment',
array('id_universalpay_system' => $paysystem['id_universalpay_system']), true))
->setLogo(Media::getMediaPath(_PS_IMG_.'pay/'.$paysystem['id_universalpay_system'].'.jpg'))
->setModuleName($this->name);
$options[] = $po;
}
return $options;
}

public function checkCurrency($cart)
Expand Down
18 changes: 18 additions & 0 deletions upgrade/install-2.1.0.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* universalpay
*
* @author 0RS <admin@prestalab.ru>
* @link http://prestalab.ru/
* @copyright Copyright &copy; 2009-2015 PrestaLab.Ru
* @license http://www.opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
* @version 2.0.0
*/

if (!defined('_PS_VERSION_'))
exit;

function upgrade_module_2_1_0($object)
{
return ($object->registerHook('advancedPaymentOptions'));
}

0 comments on commit b8885fb

Please sign in to comment.