// merge 1.4 (5916) => 1.5.x

This commit is contained in:
fBrignoli
2011-04-15 10:30:56 +00:00
parent 00aea58693
commit 5e2884a8fa
41 changed files with 443 additions and 126 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
<module>
<name>twenga</name>
<displayName>Twenga API</displayName>
<version>1.4:</version>
<version>1.5</version>
<description>Module role: export of your products on Twenga and installation of the sales tracking brought by Twenga (requires to sign up to Twenga)</description>
<author></author>
<tab>smart_shopping</tab>
+2 -2
View File
@@ -27,7 +27,7 @@ $_MODULE['<{twenga}prestashop>twenga_1f75825a8f4b083cbed0f95efc09abfd'] = 'Por f
$_MODULE['<{twenga}prestashop>twenga_3ea33020a5535b0157de47e53e463633'] = 'Siga este enlace para cambiar el país';
$_MODULE['<{twenga}prestashop>twenga_5d79ec5a879860ff8546580001fe80ee'] = 'Para utilizar el webservicio de Twenga, debe activar la extensión “curl” de PHP';
$_MODULE['<{twenga}prestashop>twenga_5f77daeb6fc30c87e051e5b5d11b034c'] = 'Se han producido errores al llamar al método \"get subscription\" con el API de Twenga';
$_MODULE['<{twenga}prestashop>twenga_da8ac71ff9563d9a5dd0f8894c8bc0ac'] = 'Referencie sus productos en Twenga: ¡PrestaShop le regala 500 clics!';
$_MODULE['<{twenga}prestashop>twenga_da8ac71ff9563d9a5dd0f8894c8bc0ac'] = 'Indexación de sus productos en Twenga';
$_MODULE['<{twenga}prestashop>twenga_0ed6e223384a822859461ca6bab72256'] = '¿Tienes ya una cuenta Twenga Ready to Sell ? ';
$_MODULE['<{twenga}prestashop>twenga_63f97ef2cb80a6cf0a8fa98453577601'] = 'Paso 1 : Copia la hashkey Twenga de tu cuenta Twenga Ready to Sell (puedes encontrarla en: herramientas>tracking>hashkey). Haz clic en \"Test de tracking\". ';
$_MODULE['<{twenga}prestashop>twenga_5ac315e486b693637a06f490f308dc67'] = 'Paso 2 : Vuelve a esta página y copia la hashkey en el campo „hash key“. Haz clic en Save y Activate.';
@@ -37,7 +37,7 @@ $_MODULE['<{twenga}prestashop>twenga_87645feb1c92efecd6a6946d1b498fd7'] = 'Paso
$_MODULE['<{twenga}prestashop>twenga_b26917587d98330d93f87808fc9d7267'] = 'Suscribirse';
$_MODULE['<{twenga}prestashop>twenga_1d79f46fad241d4984e47165ca578ee9'] = '(se han producido errores: contacte con Twenga)';
$_MODULE['<{twenga}prestashop>twenga_195b3777fa9dcc91d27b86391e7f9a49'] = 'Paso 2 : Rellena los campos necesarios a la inscripción';
$_MODULE['<{twenga}prestashop>twenga_767a31e960aa760c42722d2e7373b2ad'] = 'Paso 3 : Cuando recibas la hashkey Twenga por correo electrónico, vuelve a esta página y cópiala en el campo „hash key“. Haz clic en Save e Activate. ';
$_MODULE['<{twenga}prestashop>twenga_767a31e960aa760c42722d2e7373b2ad'] = 'Paso 3 : Cuando recibas la hashkey Twenga por correo electrónico, vuelve a esta página y cópiala en el campo „hash key“. Haz clic en Guardar y Activar.';
$_MODULE['<{twenga}prestashop>twenga_bc88fe7063d7e7da0bf08003f21a1ad2'] = 'Aumente su tráfico - 500 clics gratis';
$_MODULE['<{twenga}prestashop>twenga_2d82e5a3931e70d2c94b9ba6e674edbc'] = 'Haz clic aquí para ver los costes de cada categoría Twenga';
$_MODULE['<{twenga}prestashop>twenga_f9372612b4e86b53c45d31d7ca3402bb'] = 'Twenga Precios';
+1 -1
View File
@@ -3,7 +3,7 @@
global $_MODULE;
$_MODULE = array();
$_MODULE['<{twenga}prestashop>twenga_400b0c914f01bcecf50b936e652695b2'] = 'l\'API de Twenga';
$_MODULE['<{twenga}prestashop>twenga_64ef67f03ba236aef261078101017d57'] = 'Module rôle: l\'exportation de vos produits sur Twenga et l\'installation du suivi des ventes introduit par Twenga (nécessite de s\'inscrire pour Twenga)';
$_MODULE['<{twenga}prestashop>twenga_64ef67f03ba236aef261078101017d57'] = 'Rôle du module : export de vos produits sur Twenga et installation du suivi des ventes apportées par Twenga (inscription sur Twenga requise)';
$_MODULE['<{twenga}prestashop>twenga_2034864b8a4fce12f3621b7ec8912e95'] = 'Le module Twenga marche seulement dans certains pays (liste des iso codes :';
$_MODULE['<{twenga}prestashop>twenga_bcfaccebf745acfd5e75351095a5394a'] = 'Désactiver';
$_MODULE['<{twenga}prestashop>twenga_526d688f37a86d3c3f27d0c5016eb71d'] = 'Réinitialiser';
+4 -4
View File
@@ -27,17 +27,17 @@ $_MODULE['<{twenga}prestashop>twenga_1f75825a8f4b083cbed0f95efc09abfd'] = 'Si pr
$_MODULE['<{twenga}prestashop>twenga_3ea33020a5535b0157de47e53e463633'] = 'Segui questo link per cambiare il Paese';
$_MODULE['<{twenga}prestashop>twenga_5d79ec5a879860ff8546580001fe80ee'] = 'Si prega di attivare l\'estensione PHP \'curl\' per permettere l\'uso della libreria webservice Twenga';
$_MODULE['<{twenga}prestashop>twenga_5f77daeb6fc30c87e051e5b5d11b034c'] = 'Alcuni errori si sono verificati con il Twenga API \"ottenere link di sottoscrizione\":';
$_MODULE['<{twenga}prestashop>twenga_da8ac71ff9563d9a5dd0f8894c8bc0ac'] = 'Referenzia i tuoi prodotti su Twenga: 500 clic offerti da Prestashop!';
$_MODULE['<{twenga}prestashop>twenga_da8ac71ff9563d9a5dd0f8894c8bc0ac'] = 'Indicizza i tuoi prodotti su Twenga';
$_MODULE['<{twenga}prestashop>twenga_0ed6e223384a822859461ca6bab72256'] = 'Sei già inscritto a Twenga Ready to Sell ? ';
$_MODULE['<{twenga}prestashop>twenga_63f97ef2cb80a6cf0a8fa98453577601'] = 'Step 1 : Recupera la hashkey Twenga dal tuo conto Twenga Ready to Sell (tools>tracking>hashkey). Clicca su \"Test the tracking\". ';
$_MODULE['<{twenga}prestashop>twenga_63f97ef2cb80a6cf0a8fa98453577601'] = 'Step 1 : Recupera la hashkey Twenga dal tuo conto Twenga Ready to Sell (tools>tracking>hashkey). Clicca su \"Testare il tracking\". ';
$_MODULE['<{twenga}prestashop>twenga_5ac315e486b693637a06f490f308dc67'] = 'Step 2 : Ritorna su questa pagina copia la hashkey nel campo „hash key“. Clicca su Save e Activate.';
$_MODULE['<{twenga}prestashop>twenga_f5cff2635ec9ecf0249d33a7656f61c5'] = 'Vuoi iscriverti a Twenga Ready to Sell ? ';
$_MODULE['<{twenga}prestashop>twenga_f9c31cabc1e6928068e7394f5453e759'] = 'Come indicizzare i tuoi prodotti su Twenga.it (Da aprile 2011):';
$_MODULE['<{twenga}prestashop>twenga_f9c31cabc1e6928068e7394f5453e759'] = 'Come indicizzare i tuoi prodotti su Twenga.it';
$_MODULE['<{twenga}prestashop>twenga_87645feb1c92efecd6a6946d1b498fd7'] = 'Step 1 : Per iscriverti a Twenga Ready to Sell clicca su questo link';
$_MODULE['<{twenga}prestashop>twenga_b26917587d98330d93f87808fc9d7267'] = 'Iscriviti';
$_MODULE['<{twenga}prestashop>twenga_1d79f46fad241d4984e47165ca578ee9'] = '(Errore/i: si prega di contattare Twenga)';
$_MODULE['<{twenga}prestashop>twenga_195b3777fa9dcc91d27b86391e7f9a49'] = 'Step 2 : Compila i campi richiesti per l’iscrizione ';
$_MODULE['<{twenga}prestashop>twenga_767a31e960aa760c42722d2e7373b2ad'] = 'Step 3 : Una volta ricevuta la hashkey Twenga via email, ritorna su questa pagina e copiala nel campo „hash key“. Clicca su Save e Activate. ';
$_MODULE['<{twenga}prestashop>twenga_767a31e960aa760c42722d2e7373b2ad'] = 'Step 3 : Una volta ricevuta la hashkey Twenga via email, ritorna su questa pagina e copiala nel campo „hash key“. Clicca su Salva e poi su Attivare';
$_MODULE['<{twenga}prestashop>twenga_bc88fe7063d7e7da0bf08003f21a1ad2'] = 'Aumenta il tuo traffico - 500 click offerti';
$_MODULE['<{twenga}prestashop>twenga_2d82e5a3931e70d2c94b9ba6e674edbc'] = 'Clicca qui per visonare i costi per categoria Twenga';
$_MODULE['<{twenga}prestashop>twenga_f9372612b4e86b53c45d31d7ca3402bb'] = 'Prezzi Twenga ';
+45
View File
@@ -0,0 +1,45 @@
<?php
/**
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (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:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA : 6 rue lacepede, 75005 PARIS
* @version Release: $Revision: 1.4 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
**/
class TwengaFieldsAddFeed extends TwengaFields
{
public function __construct()
{
if(!is_array($this->fields) && empty($this->fields))
{
$this->fields['key'] = array(32, array('is_string', 'isCleanHtml'), true);
$this->fields['PARTNER_AUTH_KEY'] = array(56, array('is_string', 'isCleanHtml'), true);
$this->fields['feed_url'] = array(255, array('is_string', 'isCleanHtml'), true);
}
parent::__construct();
}
public function __destruct()
{
}
}
+2 -2
View File
@@ -162,7 +162,7 @@ abstract class TwengaFields
public function getField($name)
{
if (!is_array($this->fields))
throw new TwengaFieldsException(Tools::displayError('For get a field you have to saved some fields !'));
throw new TwengaFieldsException(Tools::displayError('To get a field you have to saved some fields !'));
if(!key_exists($name, $this->fields))
throw new TwengaFieldsException(Tools::displayError('The field').' <b>'.$name.'</b> '.Tools::displayError('doesn\'t exist.'));
return $this->fields[$name];
@@ -326,4 +326,4 @@ abstract class TwengaFields
return str_replace('"', '&quot;', $ret);
}
}
class TwengaFieldsException extends Exception {}
class TwengaFieldsException extends Exception {}
+26 -3
View File
@@ -191,6 +191,7 @@ class TwengaObj
self::$arr_api_url['orderExist'] = 'http://rts.twenga.com/api/Order/Exist';
self::$arr_api_url['orderValidate'] = 'http://rts.twenga.com/api/Order/Validate';
self::$arr_api_url['orderCancel'] = 'http://rts.twenga.com/api/Order/Cancel';
self::$arr_api_url['addFeed'] = 'https://rts.twenga.com/api/Site/AddFeed';
if(self::PARTNER_AUTH_KEY === NULL)
throw new TwengaException(self::$translation_object->l('To activate the Twenga plugin, "PARTNER_AUTH_KEY" contant must be set. Default installation of Prestashop contains this value.', basename(__FILE__, '.php')));
@@ -222,7 +223,7 @@ class TwengaObj
* @param array $params
* @param boolean $authentication
* @throws TwengaException in case of cURL error.
* @return array with status code and response of the cURL reponse.
* @return array with status code and response of the cURL request.
*/
private static function executeQuery($query, array $params = array(), $authentication = true)
{
@@ -299,10 +300,32 @@ class TwengaObj
} catch (Exception $e) {
throw new TwengaException(self::$translation_object->l($e->getMessage(),basename(__FILE__, '.php')), $e->getCode());
}
return (array)$obj_xml;
}
public function addFeed($params = array())
{
require_once realpath(self::$base_dir.'/TwengaAddFeed.php');
$params['key'] = self::$hashkey;
$params['PARTNER_AUTH_KEY'] = self::PARTNER_AUTH_KEY;
try {
self::checkParams(__FUNCTION__, $params);
} catch (TwengaFieldsException $e) {
throw $e;
}
$str_params = self::buildUrlToQuery(self::$arr_api_url[__FUNCTION__],$params);
try {
$response = self::executeQuery($str_params);
self::checkStatusCode($response['status_code']);
$obj_xml = self::parseXml($response['response']);
} catch (TwengaException $e) {
throw $e;
} catch (Exception $e) {
throw new TwengaException(self::$translation_object->l($e->getMessage(),basename(__FILE__, '.php')), $e->getCode());
}
return ((string)$obj_xml->message === 'true') ? true : false;
}
/**
* @param array $params
* @throws TwengaFieldsException
+4 -2
View File
@@ -110,7 +110,7 @@ class Twenga extends PaymentModule
$this->token = Tools::getValue('token');
$this->name = 'twenga';
$this->tab = 'smart_shopping';
$this->version = '1.4:';
$this->version = '1.5';
parent::__construct();
@@ -316,7 +316,9 @@ class Twenga extends PaymentModule
}
if(!$bool_save)
$this->_errors[] = $this->l('Authentication failed.')."<br />\n"
.$this->l('Please review the e-mail sent by Twenga after subscription. If error still occurred, contact Twenga service.');
.$this->l('Please review the e-mail sent by Twenga after subscription. If error still occurred, contact Twenga service.');
else
self::$obj_twenga->addFeed(array('feed_url' => $this->feed_url));
}
}