diff --git a/Dockerfile b/Dockerfile index 0c7616f..feeed51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM php:7.2-apache -ENV WORDPRESS_VERSION=5.2.2 -ENV WOOCOMMERCE_VERSION=3.6.2 +ENV WORDPRESS_VERSION=5.3.2 +ENV WOOCOMMERCE_VERSION=3.9.2 RUN cd /tmp \ && curl https://es.wordpress.org/wordpress-$WORDPRESS_VERSION-es_ES.tar.gz -o $WORDPRESS_VERSION-es_ES.tar.gz \ diff --git a/Documentation/configuration.md b/Documentation/configuration.md index feb56bb..99ec3fd 100644 --- a/Documentation/configuration.md +++ b/Documentation/configuration.md @@ -50,6 +50,8 @@ Here you have a complete list of configurations you can change and it's explanat | PAGANTIS_URL_OK | Location where user will be redirected after a successful payment. This string will be concatenated to the base url to build the full url | PAGANTIS_URL_KO | Location where user will be redirected after a wrong payment. This string will be concatenated to the base url to build the full url | PAGANTIS_ALLOWED_COUNTRIES | Array of country codes where the method can be used +| PAGANTIS_SIMULATOR_DISPLAY_SITUATION | Place to move the text simulator. To disable set to: "default" +| PAGANTIS_SIMULATOR_SELECTOR_VARIATION | Selector to use for products with variations. To disable set to: "default" ##### Edit using database 1 - Open your database management (Frequently Cpanel->phpmyadmin) diff --git a/WC_Pagantis.php b/WC_Pagantis.php index 584a11b..cb2ca80 100644 --- a/WC_Pagantis.php +++ b/WC_Pagantis.php @@ -3,7 +3,7 @@ * Plugin Name: Pagantis * Plugin URI: http://www.pagantis.com/ * Description: Financiar con Pagantis - * Version: 8.3.0 + * Version: 8.3.2 * Author: Pagantis */ @@ -51,7 +51,9 @@ class WcPagantis 'PAGANTIS_ALLOWED_COUNTRIES' => 'a:3:{i:0;s:2:"es";i:1;s:2:"it";i:2;s:2:"fr";}', 'PAGANTIS_PROMOTION_EXTRA' => '

Finance this product without interest!

', 'PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR' => '.', - 'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ',' + 'PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR' => ',', + 'PAGANTIS_SIMULATOR_DISPLAY_SITUATION' => 'default', + 'PAGANTIS_SIMULATOR_SELECTOR_VARIATION' => 'default' ); /** @var Array $extraConfig */ @@ -247,6 +249,15 @@ public function pagantisActivation() $wpdb->insert($tableName, array('config' => 'PAGANTIS_DISPLAY_MAX_AMOUNT', 'value' => '0'), array('%s', '%s')); } + //Adding new selector < v8.3.2 + $tableName = $wpdb->prefix.self::CONFIG_TABLE; + $query = "select * from $tableName where config='PAGANTIS_SIMULATOR_DISPLAY_SITUATION'"; + $results = $wpdb->get_results($query, ARRAY_A); + if (count($results) == 0) { + $wpdb->insert($tableName, array('config' => 'PAGANTIS_SIMULATOR_DISPLAY_SITUATION', 'value' => 'default'), array('%s', '%s')); + $wpdb->insert($tableName, array('config' => 'PAGANTIS_SIMULATOR_SELECTOR_VARIATION', 'value' => 'default'), array('%s', '%s')); + } + $dbConfigs = $wpdb->get_results("select * from $tableName", ARRAY_A); // Convert a multimple dimension array for SQL insert statements into a simple key/value @@ -299,7 +310,7 @@ public function pagantisAddProductSimulator() $post_id = $product->get_id(); $template_fields = array( - 'total' => is_numeric($product->price) ? $product->price : 0, + 'total' => is_numeric($product->get_price()) ? $product->get_price() : 0, 'public_key' => $cfg['pagantis_public_key'], 'simulator_type' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'], 'positionSelector' => $this->extraConfig['PAGANTIS_SIMULATOR_CSS_POSITION_SELECTOR'], @@ -315,7 +326,9 @@ public function pagantisAddProductSimulator() 'pagantisQuotesStart' => $this->extraConfig['PAGANTIS_SIMULATOR_START_INSTALLMENTS'], 'pagantisSimulatorSkin' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'], 'pagantisSimulatorPosition' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_CSS_POSITION'], - 'separator' => __('ó', 'pagantis') + 'separator' => __('ó', 'pagantis'), + 'finalDestination' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SITUATION'], + 'variationSelector' => $this->extraConfig['PAGANTIS_SIMULATOR_SELECTOR_VARIATION'] ); wc_get_template('product_simulator.php', $template_fields, '', $this->template_path); } diff --git a/assets/banner-772x250.png b/assets/banner-772x250.png index b267698..d12b750 100644 Binary files a/assets/banner-772x250.png and b/assets/banner-772x250.png differ diff --git a/assets/icon-128x128.png b/assets/icon-128x128.png index 26fcc7c..ff3aa0b 100644 Binary files a/assets/icon-128x128.png and b/assets/icon-128x128.png differ diff --git a/assets/icon-256x256.png b/assets/icon-256x256.png index e9679bc..5adfe47 100644 Binary files a/assets/icon-256x256.png and b/assets/icon-256x256.png differ diff --git a/assets/screenshot-1.png b/assets/screenshot-1.png index 6177b6b..40d2b1a 100644 Binary files a/assets/screenshot-1.png and b/assets/screenshot-1.png differ diff --git a/assets/screenshot-2.png b/assets/screenshot-2.png index 4949961..7c21692 100644 Binary files a/assets/screenshot-2.png and b/assets/screenshot-2.png differ diff --git a/composer.lock b/composer.lock index f53a10f..131f4a6 100644 --- a/composer.lock +++ b/composer.lock @@ -141,16 +141,16 @@ }, { "name": "pagantis/orders-api-client", - "version": "v2.1.2", + "version": "v2.1.4", "source": { "type": "git", "url": "https://github.com/pagantis/orders-api-client.git", - "reference": "49be6c174bc0a4419782403ad808ddfa1b483255" + "reference": "378d8f62da9051d16a5f10b8e3569469ca9006b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pagantis/orders-api-client/zipball/49be6c174bc0a4419782403ad808ddfa1b483255", - "reference": "49be6c174bc0a4419782403ad808ddfa1b483255", + "url": "https://api.github.com/repos/pagantis/orders-api-client/zipball/378d8f62da9051d16a5f10b8e3569469ca9006b3", + "reference": "378d8f62da9051d16a5f10b8e3569469ca9006b3", "shasum": "" }, "require": { @@ -180,22 +180,22 @@ } ], "description": "Pagantis Orders Api Client in PHP. Use the api with simple methods and using OOP.", - "time": "2019-05-27T14:40:16+00:00" + "time": "2020-02-27T16:03:56+00:00" } ], "packages-dev": [ { "name": "doctrine/instantiator", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "a2c590166b2133a4633738648b6b064edae0814a" + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/a2c590166b2133a4633738648b6b064edae0814a", - "reference": "a2c590166b2133a4633738648b6b064edae0814a", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/ae466f726242e637cebdd526a7d991b9433bacf1", + "reference": "ae466f726242e637cebdd526a7d991b9433bacf1", "shasum": "" }, "require": { @@ -238,39 +238,40 @@ "constructor", "instantiate" ], - "time": "2019-03-17T17:37:11+00:00" + "time": "2019-10-21T16:45:58+00:00" }, { "name": "facebook/webdriver", - "version": "1.7.1", + "version": "1.8.1", "source": { "type": "git", - "url": "https://github.com/facebook/php-webdriver.git", - "reference": "e43de70f3c7166169d0f14a374505392734160e5" + "url": "https://github.com/php-webdriver/php-webdriver.git", + "reference": "262ea0d209c292e0330be1041424887bbbffef04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/e43de70f3c7166169d0f14a374505392734160e5", - "reference": "e43de70f3c7166169d0f14a374505392734160e5", + "url": "https://api.github.com/repos/php-webdriver/php-webdriver/zipball/262ea0d209c292e0330be1041424887bbbffef04", + "reference": "262ea0d209c292e0330be1041424887bbbffef04", "shasum": "" }, "require": { "ext-curl": "*", "ext-json": "*", - "ext-mbstring": "*", "ext-zip": "*", "php": "^5.6 || ~7.0", - "symfony/process": "^2.8 || ^3.1 || ^4.0" + "symfony/polyfill-mbstring": "^1.12", + "symfony/process": "^2.8 || ^3.1 || ^4.0 || ^5.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", + "jakub-onderka/php-parallel-lint": "^1.0", "php-coveralls/php-coveralls": "^2.0", "php-mock/php-mock-phpunit": "^1.1", "phpunit/phpunit": "^5.7", "sebastian/environment": "^1.3.4 || ^2.0 || ^3.0", - "squizlabs/php_codesniffer": "^2.6", - "symfony/var-dumper": "^3.3 || ^4.0" + "sminnee/phpunit-mock-objects": "^3.4", + "squizlabs/php_codesniffer": "^3.5", + "symfony/var-dumper": "^3.3 || ^4.0 || ^5.0" }, "suggest": { "ext-SimpleXML": "For Firefox profile creation" @@ -278,40 +279,45 @@ "type": "library", "extra": { "branch-alias": { - "dev-community": "1.5-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { "psr-4": { "Facebook\\WebDriver\\": "lib/" - } + }, + "files": [ + "lib/Exception/TimeoutException.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], - "description": "A PHP client for Selenium WebDriver", - "homepage": "https://github.com/facebook/php-webdriver", + "description": "A PHP client for Selenium WebDriver. Previously facebook/webdriver.", + "homepage": "https://github.com/php-webdriver/php-webdriver", "keywords": [ - "facebook", + "Chromedriver", + "geckodriver", "php", "selenium", "webdriver" ], - "time": "2019-06-13T08:02:18+00:00" + "abandoned": "php-webdriver/webdriver", + "time": "2020-02-17T08:14:38+00:00" }, { "name": "fzaninotto/faker", - "version": "v1.8.0", + "version": "v1.9.1", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de" + "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de", - "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/fc10d778e4b84d5bd315dad194661e091d307c6f", + "reference": "fc10d778e4b84d5bd315dad194661e091d307c6f", "shasum": "" }, "require": { @@ -320,12 +326,12 @@ "require-dev": { "ext-intl": "*", "phpunit/phpunit": "^4.8.35 || ^5.7", - "squizlabs/php_codesniffer": "^1.5" + "squizlabs/php_codesniffer": "^2.9.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -348,7 +354,7 @@ "faker", "fixtures" ], - "time": "2018-07-12T10:23:15+00:00" + "time": "2019-12-12T13:22:17+00:00" }, { "name": "pagantis/selenium-form-utils", @@ -445,40 +451,38 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "4.3.2", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e" + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/b83ff7cfcfee7827e1e78b637a5904fe6a96698e", - "reference": "b83ff7cfcfee7827e1e78b637a5904fe6a96698e", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", + "reference": "cd72d394ca794d3466a3b2fc09d5a6c1dc86b47e", "shasum": "" }, "require": { - "php": "^7.0", - "phpdocumentor/reflection-common": "^1.0.0 || ^2.0.0", - "phpdocumentor/type-resolver": "~0.4 || ^1.0.0", - "webmozart/assert": "^1.0" + "ext-filter": "^7.1", + "php": "^7.2", + "phpdocumentor/reflection-common": "^2.0", + "phpdocumentor/type-resolver": "^1.0", + "webmozart/assert": "^1" }, "require-dev": { - "doctrine/instantiator": "^1.0.5", - "mockery/mockery": "^1.0", - "phpunit/phpunit": "^6.4" + "doctrine/instantiator": "^1", + "mockery/mockery": "^1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev" + "dev-master": "5.x-dev" } }, "autoload": { "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] + "phpDocumentor\\Reflection\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -489,33 +493,36 @@ { "name": "Mike van Riel", "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2019-09-12T14:27:41+00:00" + "time": "2020-02-22T12:28:44+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.0.1", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9" + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", - "reference": "2e32a6d48972b2c1976ed5d8967145b6cec4a4a9", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", + "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", "shasum": "" }, "require": { - "php": "^7.1", + "php": "^7.2", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "^7.1", - "mockery/mockery": "~1", - "phpunit/phpunit": "^7.0" + "ext-tokenizer": "^7.2", + "mockery/mockery": "~1" }, "type": "library", "extra": { @@ -539,37 +546,37 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2019-08-22T18:11:29+00:00" + "time": "2020-02-18T18:59:58+00:00" }, { "name": "phpspec/prophecy", - "version": "1.9.0", + "version": "v1.10.2", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203" + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/f6811d96d97bdf400077a0cc100ae56aa32b9203", - "reference": "f6811d96d97bdf400077a0cc100ae56aa32b9203", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b4400efc9d206e83138e2bb97ed7f5b14b831cd9", + "reference": "b4400efc9d206e83138e2bb97ed7f5b14b831cd9", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.1|^2.0|^3.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0" + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" }, "require-dev": { - "phpspec/phpspec": "^2.5|^3.2", + "phpspec/phpspec": "^2.5 || ^3.2", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.8.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -602,7 +609,7 @@ "spy", "stub" ], - "time": "2019-10-03T11:07:50+00:00" + "time": "2020-01-20T15:57:02+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1419,16 +1426,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.12.0", + "version": "v1.14.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4" + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/550ebaac289296ce228a706d0867afc34687e3f4", - "reference": "550ebaac289296ce228a706d0867afc34687e3f4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", + "reference": "fbdeaec0df06cf3d51c93de80c7eb76e271f5a38", "shasum": "" }, "require": { @@ -1440,7 +1447,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.12-dev" + "dev-master": "1.14-dev" } }, "autoload": { @@ -1473,29 +1480,88 @@ "polyfill", "portable" ], - "time": "2019-08-06T08:03:45+00:00" + "time": "2020-01-13T11:15:53+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/34094cfa9abe1f0f14f48f490772db7a775559f2", + "reference": "34094cfa9abe1f0f14f48f490772db7a775559f2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.14-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2020-01-13T11:15:53+00:00" }, { "name": "symfony/process", - "version": "v4.3.5", + "version": "v5.0.5", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "50556892f3cc47d4200bfd1075314139c4c9ff4b" + "reference": "fd4a86dd7e36437f2fc080d8c42c7415d828a0a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/50556892f3cc47d4200bfd1075314139c4c9ff4b", - "reference": "50556892f3cc47d4200bfd1075314139c4c9ff4b", + "url": "https://api.github.com/repos/symfony/process/zipball/fd4a86dd7e36437f2fc080d8c42c7415d828a0a8", + "reference": "fd4a86dd7e36437f2fc080d8c42c7415d828a0a8", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.2.5" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.3-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -1522,20 +1588,20 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-09-26T21:17:10+00:00" + "time": "2020-02-08T17:00:58+00:00" }, { "name": "symfony/yaml", - "version": "v3.4.32", + "version": "v3.4.38", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "768f817446da74a776a31eea335540f9dcb53942" + "reference": "bc63e15160866e8730a1f738541b194c401f72bf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/768f817446da74a776a31eea335540f9dcb53942", - "reference": "768f817446da74a776a31eea335540f9dcb53942", + "url": "https://api.github.com/repos/symfony/yaml/zipball/bc63e15160866e8730a1f738541b194c401f72bf", + "reference": "bc63e15160866e8730a1f738541b194c401f72bf", "shasum": "" }, "require": { @@ -1581,35 +1647,33 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2019-09-10T10:38:46+00:00" + "time": "2020-01-16T19:04:26+00:00" }, { "name": "webmozart/assert", - "version": "1.5.0", + "version": "1.7.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4" + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/88e6d84706d09a236046d686bbea96f07b3a34f4", - "reference": "88e6d84706d09a236046d686bbea96f07b3a34f4", + "url": "https://api.github.com/repos/webmozart/assert/zipball/aed98a490f9a8f78468232db345ab9cf606cf598", + "reference": "aed98a490f9a8f78468232db345ab9cf606cf598", "shasum": "" }, "require": { "php": "^5.3.3 || ^7.0", "symfony/polyfill-ctype": "^1.8" }, + "conflict": { + "vimeo/psalm": "<3.6.0" + }, "require-dev": { "phpunit/phpunit": "^4.8.36 || ^7.5.13" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, "autoload": { "psr-4": { "Webmozart\\Assert\\": "src/" @@ -1631,7 +1695,7 @@ "check", "validate" ], - "time": "2019-08-24T08:43:50+00:00" + "time": "2020-02-14T12:15:55+00:00" } ], "aliases": [], diff --git a/controllers/paymentController.php b/controllers/paymentController.php index 238b07a..e7a8a25 100755 --- a/controllers/paymentController.php +++ b/controllers/paymentController.php @@ -187,7 +187,7 @@ public function pagantisReceiptPage($order_id) $userAddress ->setZipCode($shippingAddress['postcode']) ->setFullName($shippingAddress['first_name']." ".$shippingAddress['last_name']) - ->setCountryCode($shippingAddress['country']) + ->setCountryCode($shippingAddress['country'] ? $shippingAddress['country'] : $this->language) ->setCity($shippingAddress['city']) ->setAddress($shippingAddress['address_1']." ".$shippingAddress['address_2']) ; @@ -195,7 +195,7 @@ public function pagantisReceiptPage($order_id) $orderShippingAddress ->setZipCode($shippingAddress['postcode']) ->setFullName($shippingAddress['first_name']." ".$shippingAddress['last_name']) - ->setCountryCode($shippingAddress['country']) + ->setCountryCode($shippingAddress['country'] ? $shippingAddress['country'] : $this->language) ->setCity($shippingAddress['city']) ->setAddress($shippingAddress['address_1']." ".$shippingAddress['address_2']) ->setFixPhone($shippingAddress['phone']) @@ -207,7 +207,7 @@ public function pagantisReceiptPage($order_id) $orderBillingAddress ->setZipCode($billingAddress['postcode']) ->setFullName($billingAddress['first_name']." ".$billingAddress['last_name']) - ->setCountryCode($billingAddress['country']) + ->setCountryCode($billingAddress['country'] ? $billingAddress['country'] : $this->language) ->setCity($billingAddress['city']) ->setAddress($billingAddress['address_1']." ".$billingAddress['address_2']) ->setFixPhone($billingAddress['phone']) @@ -516,7 +516,8 @@ public function payment_fields() 'simulator_type' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_TYPE'], 'promoted_amount' => $promotedAmount, 'thousandSeparator' => $this->extraConfig['PAGANTIS_SIMULATOR_THOUSANDS_SEPARATOR'], - 'decimalSeparator' => $this->extraConfig['PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR'] + 'decimalSeparator' => $this->extraConfig['PAGANTIS_SIMULATOR_DECIMAL_SEPARATOR'], + 'pagantisSimulatorSkin' => $this->extraConfig['PAGANTIS_SIMULATOR_DISPLAY_SKIN'] ); wc_get_template('checkout_description.php', $template_fields, '', $this->template_path); } diff --git a/readme.txt b/readme.txt index 45b741e..5d4a216 100644 --- a/readme.txt +++ b/readme.txt @@ -18,7 +18,7 @@ Allows you to use Pagantis financing payment gateway with the WooCommerce plugin == Installation == -1. Ensure you have latest version of WooCommerce plugin installed +1. Ensure you have latest version of our WooCommerce plugin installed 2. Unzip and upload contents of the plugin to your /wp-content/plugins/ directory 3. Activate the plugin through the 'Plugins' menu in WordPress @@ -36,51 +36,5 @@ Do you have questions or issues with Pagantis financing payment gateway? mail us == Configuration == 1. Visit the WooCommerce settings page, and click on the Payment Gateways tab. -2. Click on "Pago con Paga Mas Tarde" to edit the settings. If you do not see "Pago con Paga Mas Tarde" in the list at the top of the screen make sure you have activated the plugin in the WordPress Plugin Manager. -3. Enable the Payment Method, and add the keys from your account (you can obtain it from https://bo.pagantis.com/api). Click Save. - -== Changelog == - -======= -= 7.2.1 = -- Adapt to Worpress 5.1 -- Adapt to Woocommerce 3.5.6 - -= 7.2.0 = -- Adapt to orders -- Product simulator using js -- Iframe using Pagantis modal launch -- Extra configuration parameters -- Exceptions using module-utils library - -= 6.2.4 = -- SeleniumHelper -- Docker extended domain -- Simulator reload -- Redirect according order status - -= 6.2.3 = -- Ready to marketplace -- Updated readme file -- Using actions for loading script -- Panel links - -= 6.2.2 = -- Add module version to metadata. -- Remove "100%online" from default checkout title. -- Adapted product simulator to get all price format. -- New field result_description for notifications. - -= 6.2.1 = -- Selenium update -- Modify default simulator: Mini -- Simulator default quotes: 3 - -= 6.2.0 = -- Initial release. -- Refactored module. -- Added selenium complete test using Travis. -- Added build status with travis. -- Complete functional test developed including install, register, buy. -- Product & Checkout simulator. -- Price modifier attribute, simulator reload. +2. Click on "Pago con Pagantis" to edit the settings. If you do not see "Pago con Pagantis" in the list at the top of the screen make sure you have activated the plugin in the WordPress Plugin Manager. +3. Enable the Payment Method, and add the keys from your account (you can obtain it from https://bo.pagantis.com/). Click Save. diff --git a/templates/checkout_description.php b/templates/checkout_description.php index 742c93a..be8aeef 100644 --- a/templates/checkout_description.php +++ b/templates/checkout_description.php @@ -37,6 +37,7 @@ function loadSimulator() selector: '.pagantisSimulator', totalAmount: '', totalPromotedAmount: '', + skin : , locale: locale, country: country }); diff --git a/templates/product_simulator.php b/templates/product_simulator.php index 18345e8..5a8ff64 100644 --- a/templates/product_simulator.php +++ b/templates/product_simulator.php @@ -27,10 +27,12 @@ function findQuantitySelector() return (priceDOM != null ); }); } + function finishInterval() { clearInterval(window.loadingSimulator); return true; } + function checkSimulatorContent() { var simulatorLoaded = false; var positionSelector = findPositionSelector(); @@ -45,12 +47,22 @@ function checkSimulatorContent() { return simulatorLoaded; } + function findDestinationSim() + { + var destinationSim = ''; + if (destinationSim === 'default' || destinationSim == '') { + destinationSim = 'woocommerce-product-details__short-description'; + } + + return destinationSim; + } + function moveToPrice() { if ('' === 'sdk.simulator.types.SELECTABLE_TEXT_CUSTOM') { var simnode = document.querySelector(findPositionSelector()); - var detailnode = document.getElementsByClassName('woocommerce-product-details__short-description'); + var detailnode = document.getElementsByClassName(findDestinationSim()); detailnode = detailnode['0']; detailnode.parentNode.insertBefore(simnode,detailnode) @@ -105,17 +117,18 @@ function loadSimulatorPagantis() thousandSeparator: '', decimalSeparator: '' }, - numInstalments : '', + numInstalments : '', skin : , position: }; + window.pgSDK = sdk; if (promotedProduct == 'true') { simulator_options.itemPromotedAmountSelector = priceSelector; } - if (typeof sdk != 'undefined') { - window.WCSimulatorId = sdk.simulator.init(simulator_options); + if (typeof window.pgSDK != 'undefined') { + window.WCSimulatorId = window.pgSDK.simulator.init(simulator_options); if (window.WCSimulatorId!='') { moveToPrice(); @@ -129,6 +142,38 @@ function loadSimulatorPagantis() window.loadingSimulator = setInterval(function () { loadSimulatorPagantis(); }, 2000); + + window.lastPrice = ''; + function updateSimulator() + { + if (window.WCSimulatorId != '') + { + var updateSelector = ''; + + if (updateSelector == 'default' || updateSelector === '') + { + clearInterval(window.variationInterval); + } + else + { + var priceDOM = document.querySelector(updateSelector); + if (priceDOM != null) { + var newPrice = priceDOM.innerText; + if (newPrice != window.lastPrice) { + window.lastPrice = newPrice; + window.pgSDK.simulator.update(window.WCSimulatorId, {itemAmountSelector: updateSelector}) + } + } else { + return false; + } + } + } + } + + window.variationInterval = setInterval(function () { + updateSimulator(); + }, 5000); +