Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Commit

Permalink
Remove urlencode
Browse files Browse the repository at this point in the history
  • Loading branch information
Dat committed Feb 9, 2017
1 parent 2acfbd5 commit 52a4b1d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 46 deletions.
4 changes: 2 additions & 2 deletions src/lemonwaymkt/controllers/front/moneyout.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ public function postProcess()
"wallet" => $this->moneyout->id_lw_wallet,
"amountTot" => $this->moneyout->amount_to_pay,
'amountCom' => number_format((float)Configuration::get('LEMONWAY_COMMISSION_AMOUNT'), 2, '.', ''),
"message" => urlencode(Configuration::get('PS_SHOP_NAME')) . " - " . sprintf($this->module->l("Moneyout of %s %s initiated by %s"),
"message" => Configuration::get('PS_SHOP_NAME') . " - " . sprintf($this->module->l("Moneyout of %s %s initiated by %s"),
$this->moneyout->amount_to_pay,
$this->context->currency->sign,
urlencode($shop_name)
$shop_name
),
"ibanId" => $this->moneyout->id_lw_iban,
"autCommission" => Configuration::get('LEMONWAY_IS_AUTO_COMMISSION'),
Expand Down
55 changes: 16 additions & 39 deletions src/lemonwaymkt/controllers/front/wallet.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
require_once _PS_MODULE_DIR_ . 'marketplace/classes/MarketplaceCustomer.php';
require_once _PS_MODULE_DIR_ . 'lemonway/classes/Wallet.php';
require_once _PS_MODULE_DIR_ . 'lemonway/classes/Iban.php';
require_once _PS_MODULE_DIR_ . 'lemonway/classes/MoneyOut.php';
require_once _PS_MODULE_DIR_ . 'lemonway/lemonway.php';

require_once _PS_MODULE_DIR_.'marketplace/classes/MarketplaceCustomer.php';
require_once _PS_MODULE_DIR_.'lemonway/classes/Wallet.php';
require_once _PS_MODULE_DIR_.'lemonway/classes/Iban.php';
require_once _PS_MODULE_DIR_.'lemonway/classes/MoneyOut.php';
require_once _PS_MODULE_DIR_.'lemonway/lemonway.php';
class LemonwaymktWalletModuleFrontController extends ModuleFrontController
{
public $auth = true;
Expand All @@ -23,49 +23,33 @@ public function postProcess()
$has_wallet = false;

$wallet = new WalletCore();
if($walletExist = $wallet->getByCustomerId($this->context->customer->id))
{
if ($walletExist = $wallet->getByCustomerId($this->context->customer->id)) {
$wallet = $walletExist;
$this->context->smarty->assign('wallet',$wallet);
$has_wallet = true;
}


if(Tools::isSubmit('createWalletSubmit') && !$has_wallet){
if (Tools::isSubmit('createWalletSubmit') && !$has_wallet) {

$customer = $this->context->customer;
$mkt_customer_obj = new MarketplaceCustomer();
$mkt_customer = $mkt_customer_obj->findMarketPlaceCustomer($customer->id);
if(!$mkt_customer ||( is_array($mkt_customer) && !$mkt_customer['is_seller']))
{
if (!$mkt_customer ||( is_array($mkt_customer) && !$mkt_customer['is_seller'])) {
$this->errors[] = $this->module->l('You are not a vendor or your account is not active!');
}
else
{
try {

} else {
try {
$wallet = $this->module->registerWallet($customer,$mkt_customer['marketplace_seller_id']);
if($wallet)
{
if ($wallet) {
$this->context->smarty->assign('wallet',$wallet);
$has_wallet = true;
}


} catch (Exception $e) {

$this->errors[] = $e->getMessage();

}

}

}
elseif (Tools::isSubmit('uploadDocSubmit') && $has_wallet){

} elseif (Tools::isSubmit('uploadDocSubmit') && $has_wallet) {
$file = Tools::fileAttachment();
if(!$file)
{
if(!$file) {
$m = $this->module;
$uploadErrors = array(
0 => $m->l('There is no error, the file uploaded with success'),
Expand All @@ -79,17 +63,10 @@ public function postProcess()
);
$errorId = (int)$_FILES['fileUpload']['error'];
$this->errors[] = $uploadErrors[$errorId];
}
else{

if(!Tools::isSubmit('file_type'))
{
} else {
if (!Tools::isSubmit('file_type')) {
$this->errors[] = $this->module->l('You must to choose a file type!');

}
else{


} else {
$params = array(
'wallet'=>$wallet->id_lw_wallet,
'fileName'=>$file['name'],
Expand Down
6 changes: 3 additions & 3 deletions src/lemonwaymkt/lemonwaymkt.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function __construct()
{
$this->name = 'lemonwaymkt';
$this->tab = 'payments_gateways';
$this->version = '1.1.1';
$this->version = '1.1.2';
$this->author = 'SIRATECK';
$this->need_instance = 0;
$this->dependencies = array('lemonway','marketplace');
Expand All @@ -32,7 +32,7 @@ public function __construct()
parent::__construct();

$this->displayName = $this->l('Lemonway Marketplace');
$this->description = $this->l('It\' adaptive Lemonway payment for marketplace module from Webkul');
$this->description = $this->l('It\'s adaptive Lemonway payment for marketplace module from Webkul');

$this->confirmUninstall = $this->l('Are you sure you want to uninstall my module? You will be loose your datas !');

Expand Down Expand Up @@ -579,7 +579,7 @@ public function hookActionValidateOrder($params)
"debitWallet" => $w_transac->debit_wallet,
"creditWallet" => $w_transac->credit_wallet,
"amount" => number_format((float)$w_transac->amount_to_pay, 2, '.', ''),
"message" => urlencode(Configuration::get('PS_SHOP_NAME')) . " - " . sprintf($this->l('Send payment for order %s'), $id_order)
"message" => Configuration::get('PS_SHOP_NAME') . " - " . sprintf($this->l('Send payment for order %s'), $id_order)
);


Expand Down
2 changes: 1 addition & 1 deletion src/lemonwaymkt/translations/en.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
global $_MODULE;
$_MODULE = array();
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_4f14c0acb8298b5aaa86383d9903138f'] = 'Lemonway Marketplace';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_b2c91cdb21c3b5d450314b52aa569168'] = 'It\' adaptive Lemonway payment for marketplace module from Webkul';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_a6658ad62a4d1bd48bcc88456eab065b'] = 'It\'s adaptive Lemonway payment for marketplace module from Webkul';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_88d15f5a603d28b02127831b1dc1b1ff'] = 'Are you sure you want to uninstall my module? You will be loose your datas !';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_92d4773a9f32fc3333cb8238471cf763'] = 'You have to enable the cURL extension on your server to install this module';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_dd494653c5f48808325fca382527bc96'] = 'MARKETPLACE CONFIGURATION';
Expand Down
2 changes: 1 addition & 1 deletion src/lemonwaymkt/translations/fr.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
global $_MODULE;
$_MODULE = array();
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_4f14c0acb8298b5aaa86383d9903138f'] = 'Lemonway Marketplace';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_b2c91cdb21c3b5d450314b52aa569168'] = 'Ce module adapte le paiement inter-wallet pour le module Marketplace webkul';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_a6658ad62a4d1bd48bcc88456eab065b'] = 'Ce module adapte le paiement inter-wallet pour le module Marketplace Webkul';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_88d15f5a603d28b02127831b1dc1b1ff'] = 'Etes vous sûr de vouloir désinstaller le module.';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_92d4773a9f32fc3333cb8238471cf763'] = 'Vous devez activer l\'extension PHP cURL pour utiliser le module';
$_MODULE['<{lemonwaymkt}prestashop>lemonwaymkt_dd494653c5f48808325fca382527bc96'] = 'Configuration Marketplace';
Expand Down

0 comments on commit 52a4b1d

Please sign in to comment.