Skip to content

Commit

Permalink
Merge pull request #39 from pagantis/INT-834
Browse files Browse the repository at this point in the history
Int 834
  • Loading branch information
pgarcess authored Feb 3, 2020
2 parents da3f716 + cc19576 commit 7a26868
Show file tree
Hide file tree
Showing 18 changed files with 509 additions and 477 deletions.
4 changes: 2 additions & 2 deletions Documentation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Here you have a complete list of configurations you can change and it's explanat

| Field | Description<br/><br/>
| :------------- |:-------------|
| PAGANTIS_TITLE | Payment title to show in checkout page. By default:"Instant financing".
| PAGANTIS_SIMULATOR_DISPLAY_TYPE | Installments simulator skin inside product page, in positive case. Recommended value: 'pgSDK.simulator.types.SIMPLE'.
| PAGANTIS_TITLE | Payment title to show in checkout page. By default:"Pago en cuotas".
| PAGANTIS_SIMULATOR_DISPLAY_TYPE | Installments simulator skin inside product page, in positive case. Recommended value: 'pgSDK.simulator.types.SELECTABLE_TEXT_CUSTOM'.
| PAGANTIS_SIMULATOR_DISPLAY_SKIN | Skin of the product page simulator. Recommended value: 'pgSDK.simulator.skins.BLUE'.
| PAGANTIS_SIMULATOR_DISPLAY_POSITION | Choose the place where you want to watch the simulator.
| PAGANTIS_SIMULATOR_START_INSTALLMENTS | Number of installments by default to use in simulator.
Expand Down
12 changes: 6 additions & 6 deletions WC_Pagantis.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Pagantis
* Plugin URI: http://www.pagantis.com/
* Description: Financiar con Pagantis
* Version: 8.2.8
* Version: 8.2.9
* Author: Pagantis
*/

Expand Down Expand Up @@ -33,8 +33,8 @@ class WcPagantis
const ORDERS_TABLE = 'posts';

public $defaultConfigs = array(
'PAGANTIS_TITLE'=>'Instant Financing',
'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'sdk.simulator.types.SIMPLE',
'PAGANTIS_TITLE'=>'Pago en cuotas',
'PAGANTIS_SIMULATOR_DISPLAY_TYPE'=>'sdk.simulator.types.SELECTABLE_TEXT_CUSTOM',
'PAGANTIS_SIMULATOR_DISPLAY_SKIN'=>'sdk.simulator.skins.BLUE',
'PAGANTIS_SIMULATOR_DISPLAY_POSITION'=>'hookDisplayProductButtons',
'PAGANTIS_SIMULATOR_START_INSTALLMENTS'=>3,
Expand All @@ -48,7 +48,7 @@ class WcPagantis
'PAGANTIS_URL_OK'=>'',
'PAGANTIS_URL_KO'=>'',
'PAGANTIS_ALLOWED_COUNTRIES' => 'a:3:{i:0;s:2:"es";i:1;s:2:"it";i:2;s:2:"fr";}',
'PAGANTIS_PROMOTION_EXTRA' => '<p>Finance this product <span class="pmt-no-interest">without interest!</span></p>',
'PAGANTIS_PROMOTION_EXTRA' => '<p>Finance this product <span class="pg-no-interest">without interest!</span></p>',
'PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR' => '.',
'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ','
);
Expand Down Expand Up @@ -302,7 +302,8 @@ public function pagantisAddProductSimulator()
'decimalSeparator' => $this->extraConfig['PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR'],
'pagantisQuotesStart' => $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'],
'pagantisSimulatorSkin' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'],
'pagantisSimulatorPosition' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION']
'pagantisSimulatorPosition' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'],
'separator' => __('ó', 'pagantis')
);
wc_get_template('product_simulator.php', $template_fields, '', $this->template_path);
}
Expand Down Expand Up @@ -619,7 +620,6 @@ private function isPromoted($product_id)
function add_pagantis_widget_js()
{
wp_enqueue_script('pgSDK', 'https://cdn.pagantis.com/js/pg-v2/sdk.js', '', '', true);
wp_enqueue_script('pmtSDK', 'https://cdn.pagamastarde.com/js/pmt-v2/sdk.js', '', '', true);
}

$WcPagantis = new WcPagantis();
3 changes: 3 additions & 0 deletions controllers/notifyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public function processInformation()
try {
require_once(__ROOT__.'/vendor/autoload.php');
try {
if ($_SERVER['REQUEST_METHOD'] == 'GET' && $_GET['origin'] == 'notification') {
return $this->buildResponse();
}
$this->checkConcurrency();
$this->getMerchantOrder();
$this->getPagantisOrderId();
Expand Down
32 changes: 18 additions & 14 deletions controllers/paymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,7 @@ public function __construct()
$this->mainFileLocation = dirname(plugin_dir_path(__FILE__)) . '/WC_Pagantis.php';
$this->plugin_info = get_file_data($this->mainFileLocation, array('Version' => 'Version'), false);
$this->language = strstr(get_locale(), '_', true);

if ($this->language == 'es' || $this->language == '') {
$this->icon = esc_url(plugins_url('../assets/images/logopagamastarde.png', __FILE__));
} else {
$this->icon = esc_url(plugins_url('../assets/images/logo.png', __FILE__));
}
$this->icon = 'https://cdn.digitalorigin.com/assets/master/logos/pg-130x30.svg';

//Panel form fields
$this->form_fields = include(plugin_dir_path(__FILE__).'../includes/settings-pagantis.php');//Panel options
Expand Down Expand Up @@ -299,17 +294,26 @@ public function pagantisReceiptPage($order_id)
;
$orderConfigurationUrls = new Urls();
$cancelUrl = $this->getKoUrl($order);
$callback_arg = array(
'wc-api'=>'wcpagantisgateway',
$callback_arg = array('wc-api'=>'wcpagantisgateway',
'key'=>$order->get_order_key(),
'order-received'=>$order->get_id());
$callback_url = add_query_arg($callback_arg, home_url('/'));
'order-received'=>$order->get_id(),
'origin' => ''
);

$callback_arg_user = $callback_arg;
$callback_arg_user['origin'] = 'redirect';
$callback_url_user = add_query_arg($callback_arg_user, home_url('/'));

$callback_arg_notif = $callback_arg;
$callback_arg_notif['origin'] = 'notification';
$callback_url_notif = add_query_arg($callback_arg_notif, home_url('/'));

$orderConfigurationUrls
->setCancel($cancelUrl)
->setKo($callback_url)
->setAuthorizedNotificationCallback($callback_url)
->setRejectedNotificationCallback($callback_url)
->setOk($callback_url)
->setKo($callback_url_user)
->setAuthorizedNotificationCallback($callback_url_notif)
->setRejectedNotificationCallback(null)
->setOk($callback_url_user)
;
$orderChannel = new Channel();
$orderChannel
Expand Down
Binary file modified languages/pagantis-es_ES.mo
Binary file not shown.
217 changes: 110 additions & 107 deletions languages/pagantis-es_ES.po
Original file line number Diff line number Diff line change
@@ -1,107 +1,110 @@
msgid ""
msgstr ""
"Project-Id-Version: Pagantis WooCommerce V2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-11-11 12:00+0000\n"
"PO-Revision-Date: 2019-11-11 12:01+0000\n"
"Last-Translator: admin <demo@woocommerceshop.com>\n"
"Language-Team: Spanish (Spain)\n"
"Language: es_ES\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.3.1; wp-5.2.2"

#: WC_Pagantis.php:339
msgid "Settings"
msgstr "Ajustes"

#: WC_Pagantis.php:357 controllers/paymentController.php:120
msgid "Documentation"
msgstr "Documentación"

#: WC_Pagantis.php:359
msgid "API documentation"
msgstr "Documentación de la API"

#: WC_Pagantis.php:360
msgid "Support"
msgstr "Soporte"

#: includes/settings-pagantis.php:12
msgid "Activate the module"
msgstr "Activar el modulo"

#: includes/settings-pagantis.php:17
msgid "Public Key"
msgstr "Clave Pública"

#: includes/settings-pagantis.php:19 includes/settings-pagantis.php:24
msgid "MANDATORY. You can get in your pagantis profile"
msgstr "OBLIGATORIO. Puede obtenerla en su perfil de usuario de pagantis"

#: includes/settings-pagantis.php:22
msgid "Secret Key"
msgstr "Clave Privada"

#: includes/settings-pagantis.php:27
msgid "Product simulator"
msgstr "Simulador en el producto"

#: controllers/paymentController.php:119
msgid "Login to your panel"
msgstr "Accede a tu panel"

#: controllers/paymentController.php:136
msgid " is not compatible with your php and/or curl version"
msgstr " no es compatible con su versión de php/curl"

#: controllers/paymentController.php:139
msgid ""
" is not configured correctly, the fields Public Key and Secret Key are "
"mandatory for use this plugin"
msgstr ""
" no está configurado correctamente, los campos Public Key y Secret Key son "
"obligatorios para su uso"

#: controllers/paymentController.php:142
msgid " only can be used in Euros"
msgstr " solo puede ser usado en Euros"

#: controllers/paymentController.php:146 controllers/paymentController.php:149
msgid " only can be payed from 2 to 12 installments"
msgstr " solo puede ser pagado de 2 a 12 plazos"

#: controllers/paymentController.php:151
msgid " can not have a minimum amount less than 0"
msgstr " no puede tener un importe mínimo menor a 0"

#: controllers/paymentController.php:356 controllers/paymentController.php:473
msgid "Payment error "
msgstr "Error en el pago "

#. Author of the plugin
msgid "Pagantis"
msgstr "Pagantis"

#. Description of the plugin
msgid "Financiar con Pagantis"
msgstr "Financiar con Pagantis"

#. URI of the plugin
msgid "http://www.pagantis.com/"
msgstr "http://www.pagantis.com/"

msgid ""
"Financial Payment Gateway. Enable the possibility for your customers to pay "
"their order in confortable installments \n"
"with Pagantis"
msgstr ""
"Pasarela de pagos financieros. Habilite la posibilidad de que sus clientes "
"paguen su pedido en cómodas entregas\n"
"con Pagantis"

msgid "Instant Financing"
msgstr "Financiación Instantánea"
msgid ""
msgstr ""
"Project-Id-Version: Pagantis WooCommerce V2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-01-30 15:05+0000\n"
"PO-Revision-Date: 2020-01-30 15:08+0000\n"
"Last-Translator: admin <demo@woocommerceshop.com>\n"
"Language-Team: Español\n"
"Language: es-ES\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Loco https://localise.biz/\n"
"X-Loco-Version: 2.3.1; wp-5.2.2"

#: WC_Pagantis.php:339
msgid "Settings"
msgstr "Ajustes"

#: WC_Pagantis.php:357 controllers/paymentController.php:120
msgid "Documentation"
msgstr "Documentación"

#: WC_Pagantis.php:359
msgid "API documentation"
msgstr "Documentación de la API"

#: WC_Pagantis.php:360
msgid "Support"
msgstr "Soporte"

#: includes/settings-pagantis.php:12
msgid "Activate the module"
msgstr "Activar el modulo"

#: includes/settings-pagantis.php:17
msgid "Public Key"
msgstr "Clave Pública"

#: includes/settings-pagantis.php:19 includes/settings-pagantis.php:24
msgid "MANDATORY. You can get in your pagantis profile"
msgstr "OBLIGATORIO. Puede obtenerla en su perfil de usuario de pagantis"

#: includes/settings-pagantis.php:22
msgid "Secret Key"
msgstr "Clave Privada"

#: includes/settings-pagantis.php:27
msgid "Product simulator"
msgstr "Simulador en el producto"

#: controllers/paymentController.php:119
msgid "Login to your panel"
msgstr "Accede a tu panel"

#: controllers/paymentController.php:136
msgid " is not compatible with your php and/or curl version"
msgstr " no es compatible con su versión de php/curl"

#: controllers/paymentController.php:139
msgid ""
" is not configured correctly, the fields Public Key and Secret Key are "
"mandatory for use this plugin"
msgstr ""
" no está configurado correctamente, los campos Public Key y Secret Key son "
"obligatorios para su uso"

#: controllers/paymentController.php:142
msgid " only can be used in Euros"
msgstr " solo puede ser usado en Euros"

#: controllers/paymentController.php:146 controllers/paymentController.php:149
msgid " only can be payed from 2 to 12 installments"
msgstr " solo puede ser pagado de 2 a 12 plazos"

#: controllers/paymentController.php:151
msgid " can not have a minimum amount less than 0"
msgstr " no puede tener un importe mínimo menor a 0"

#: controllers/paymentController.php:356 controllers/paymentController.php:473
msgid "Payment error "
msgstr "Error en el pago "

#. Author of the plugin
msgid "Pagantis"
msgstr "Pagantis"

#. Description of the plugin
msgid "Financiar con Pagantis"
msgstr "Financiar con Pagantis"

#. URI of the plugin
msgid "http://www.pagantis.com/"
msgstr "http://www.pagantis.com/"

msgid ""
"Financial Payment Gateway. Enable the possibility for your customers to pay "
"their order in confortable installments \n"
"with Pagantis"
msgstr ""
"Pasarela de pagos financieros. Habilite la posibilidad de que sus clientes "
"paguen su pedido en cómodas entregas\n"
"con Pagantis"

msgid "Pago en cuotas"
msgstr "Pago en cuotas"

msgid "ó"
msgstr "ó"
Binary file modified languages/pagantis-fr_FR.mo
Binary file not shown.
Loading

0 comments on commit 7a26868

Please sign in to comment.