diff --git a/changelog.txt b/changelog.txt index 126fdbba2..d0119b212 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,8 +1,10 @@ *** Changelog *** = 1.7.0 - TBD = +* Fix - DCC orders randomly failing #503 * Fix - Multi-currency broke #481 * Fix - Address information from PayPal shortcut flow not loaded #451 +* Fix - WooCommerce as mu-plugin is not detected as active #461 * Enhancement - Improve onboarding flow, allow no card processing #443 * Enhancement - Add Germany to supported ACDC countries #459 * Enhancement - Add filters to allow ACDC for countries #437 @@ -12,6 +14,8 @@ * Enhancement - Pass address details to credit card fields #479 * Enhancement - Improve onboarding notice #465 * Enhancement - Add transaction ID to WC order and order note when refund is received #473 +* Enhancement - Asset caching may cause bugs on upgrades #501 +* Enhancement - Allow partial capture #483 = 1.6.5 - 2022-01-31 = * Fix - Allow guest users to purchase subscription products from checkout page #422 diff --git a/composer.json b/composer.json index f92d4dbff..ed3c2d4a3 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,10 @@ "dhii/containers": "^0.1.0-alpha1", "psr/log": "^1.1", "ralouphie/getallheaders": "^3.0", - "wikimedia/composer-merge-plugin": "^1.4" + "wikimedia/composer-merge-plugin": "^1.4", + "wp-oop/wordpress-interface": "^0.1.0-alpha1", + "dhii/versions": "^0.1.0-alpha1", + "symfony/polyfill-php80": "^1.19" }, "require-dev": { "woocommerce/woocommerce-sniffs": "^0.1.0", diff --git a/composer.lock b/composer.lock index 1c8ca84eb..1ff2571e2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5ec79a51fc5a2f5576f38dd6e4e87b2d", + "content-hash": "b3ddb500dfb804b3800901e2ac30108a", "packages": [ { "name": "container-interop/service-provider", @@ -35,10 +35,6 @@ ], "description": "Promoting container interoperability through standard service providers", "homepage": "https://github.com/container-interop/service-provider", - "support": { - "issues": "https://github.com/container-interop/service-provider/issues", - "source": "https://github.com/container-interop/service-provider/tree/master" - }, "time": "2017-09-20T14:13:36+00:00" }, { @@ -148,6 +144,57 @@ ], "time": "2021-10-06T11:13:51+00:00" }, + { + "name": "dhii/human-readable-interface", + "version": "v0.2.0-alpha1", + "source": { + "type": "git", + "url": "https://github.com/Dhii/human-readable-interface.git", + "reference": "2b49d664f117faf72fb7af402ad21c0c27c62b6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dhii/human-readable-interface/zipball/2b49d664f117faf72fb7af402ad21c0c27c62b6b", + "reference": "2b49d664f117faf72fb7af402ad21c0c27c62b6b", + "shasum": "" + }, + "require": { + "php": "^7.1 | ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0 | ^7.0 | ^8.0 | ^9.0", + "slevomat/coding-standard": "^6.0", + "symfony/polyfill-php80": "^1.19", + "vimeo/psalm": "^3.11.7 | ^4.0" + }, + "suggest": { + "dhii/i18n-interface": "For internationalizing and translating human readable strings.", + "symfony/polyfill-php80": "To add Stringable interface" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "0.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dhii\\Util\\String\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Dhii Team", + "email": "development@dhii.co" + } + ], + "description": "Interfaces for human readable string interoperation.", + "time": "2021-03-05T00:36:01+00:00" + }, { "name": "dhii/module-interface", "version": "v0.3.0-alpha2", @@ -194,12 +241,142 @@ } ], "description": "Interfaces for modules", - "support": { - "issues": "https://github.com/Dhii/module-interface/issues", - "source": "https://github.com/Dhii/module-interface/tree/v0.3.0-alpha2" - }, "time": "2021-08-23T08:23:01+00:00" }, + { + "name": "dhii/package-interface", + "version": "v0.1.0-alpha4", + "source": { + "type": "git", + "url": "https://github.com/Dhii/package-interface.git", + "reference": "bcc73f4285eead9b482dbb89662b723abf49298b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dhii/package-interface/zipball/bcc73f4285eead9b482dbb89662b723abf49298b", + "reference": "bcc73f4285eead9b482dbb89662b723abf49298b", + "shasum": "" + }, + "require": { + "dhii/validation-interface": "^0.3-alpha1", + "php": "^7.1 | ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", + "slevomat/coding-standard": "^6.0", + "symfony/polyfill-php80": "^1.19", + "vimeo/psalm": "^4.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dhii\\Package\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Ukhanev", + "email": "xedin.unknown@gmail.com" + } + ], + "description": "Interfaces for package-related interop", + "time": "2021-12-08T15:57:36+00:00" + }, + { + "name": "dhii/validation-interface", + "version": "v0.3.0-alpha3", + "source": { + "type": "git", + "url": "https://github.com/Dhii/validation-interface.git", + "reference": "0e73c7bf3d2421ceb79331c60a9bc1b1d5eb65a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dhii/validation-interface/zipball/0e73c7bf3d2421ceb79331c60a9bc1b1d5eb65a6", + "reference": "0e73c7bf3d2421ceb79331c60a9bc1b1d5eb65a6", + "shasum": "" + }, + "require": { + "php": "^7.1 | ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", + "slevomat/coding-standard": "^6.0", + "symfony/polyfill-mbstring": "1.20", + "symfony/polyfill-php80": "^1.19", + "vimeo/psalm": "^3.11.7 | ^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "0.3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Dhii\\Validation\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Ukhanev", + "email": "xedin.unknown@gmail.com" + } + ], + "description": "A base interface for validators", + "time": "2021-01-14T16:19:20+00:00" + }, + { + "name": "dhii/versions", + "version": "v0.1.0-alpha3", + "source": { + "type": "git", + "url": "https://github.com/Dhii/versions.git", + "reference": "120b22b248d0b46e41bac93bf3394516c9d55730" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dhii/versions/zipball/120b22b248d0b46e41bac93bf3394516c9d55730", + "reference": "120b22b248d0b46e41bac93bf3394516c9d55730", + "shasum": "" + }, + "require": { + "dhii/package-interface": "^0.1.0-alpha3", + "php": "^7.1 | ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", + "slevomat/coding-standard": "^6.0", + "symfony/polyfill-php80": "^1.19", + "vimeo/psalm": "^4.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Dhii\\Versions\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Ukhanev", + "email": "xedin.unknown@gmail.com" + } + ], + "description": "Implementation for dealing with SemVer-compliant versions", + "time": "2021-12-08T16:54:50+00:00" + }, { "name": "psr/container", "version": "1.0.0", @@ -247,10 +424,6 @@ "container-interop", "psr" ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/master" - }, "time": "2017-02-14T16:28:37+00:00" }, { @@ -298,9 +471,6 @@ "psr", "psr-3" ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" - }, "time": "2021-05-03T11:20:27+00:00" }, { @@ -341,12 +511,88 @@ } ], "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, "time": "2019-03-08T08:55:37+00:00" }, + { + "name": "symfony/polyfill-php80", + "version": "v1.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/57b712b08eddb97c762a8caa32c84e037892d2e9", + "reference": "57b712b08eddb97c762a8caa32c84e037892d2e9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.23-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-09-13T13:58:33+00:00" + }, { "name": "wikimedia/composer-merge-plugin", "version": "v1.4.1", @@ -395,21 +641,69 @@ ], "description": "Composer plugin to merge multiple composer.json files", "time": "2017-04-25T02:31:25+00:00" + }, + { + "name": "wp-oop/wordpress-interface", + "version": "v0.1.0-alpha2", + "source": { + "type": "git", + "url": "https://github.com/wp-oop/wordpress-interface.git", + "reference": "5e40acb49b76702f409bb5bcd2ea5459c9b946f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wp-oop/wordpress-interface/zipball/5e40acb49b76702f409bb5bcd2ea5459c9b946f5", + "reference": "5e40acb49b76702f409bb5bcd2ea5459c9b946f5", + "shasum": "" + }, + "require": { + "dhii/human-readable-interface": "^0.2.0-alpha1", + "dhii/package-interface": "^0.1-alpha3", + "php": "^7.1 | ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", + "slevomat/coding-standard": "^6.0", + "vimeo/psalm": "^4.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-task/initial-interfaces": "0.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "WpOop\\WordPress\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Anton Ukhanev", + "email": "xedin.unknown@gmail.com" + } + ], + "description": "Interfaces for interop within WordPress", + "time": "2021-04-30T09:37:37+00:00" } ], "packages-dev": [ { "name": "amphp/amp", - "version": "v2.6.1", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae" + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", - "reference": "c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae", + "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", "shasum": "" }, "require": { @@ -431,13 +725,13 @@ } }, "autoload": { - "psr-4": { - "Amp\\": "lib" - }, "files": [ "lib/functions.php", "lib/Internal/functions.php" - ] + ], + "psr-4": { + "Amp\\": "lib" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -462,7 +756,7 @@ } ], "description": "A non-blocking concurrency framework for PHP applications.", - "homepage": "http://amphp.org/amp", + "homepage": "https://amphp.org/amp", "keywords": [ "async", "asynchronous", @@ -480,7 +774,7 @@ "type": "github" } ], - "time": "2021-09-23T18:43:08+00:00" + "time": "2022-02-20T17:52:18+00:00" }, { "name": "amphp/byte-stream", @@ -556,16 +850,16 @@ }, { "name": "antecedent/patchwork", - "version": "2.1.17", + "version": "2.1.21", "source": { "type": "git", "url": "https://github.com/antecedent/patchwork.git", - "reference": "df5aba175a44c2996ced4edf8ec9f9081b5348c0" + "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/df5aba175a44c2996ced4edf8ec9f9081b5348c0", - "reference": "df5aba175a44c2996ced4edf8ec9f9081b5348c0", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", + "reference": "25c1fa0cd9a6e6d0d13863d8df8f050b6733f16d", "shasum": "" }, "require": { @@ -596,31 +890,31 @@ "runkit", "testing" ], - "time": "2021-10-21T14:22:43+00:00" + "time": "2022-02-07T07:28:34+00:00" }, { "name": "brain/monkey", - "version": "2.6.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/Brain-WP/BrainMonkey.git", - "reference": "7042140000b4b18034c0c0010d86274a00f25442" + "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/7042140000b4b18034c0c0010d86274a00f25442", - "reference": "7042140000b4b18034c0c0010d86274a00f25442", + "url": "https://api.github.com/repos/Brain-WP/BrainMonkey/zipball/a31c84515bb0d49be9310f52ef1733980ea8ffbb", + "reference": "a31c84515bb0d49be9310f52ef1733980ea8ffbb", "shasum": "" }, "require": { - "antecedent/patchwork": "^2.0", - "mockery/mockery": ">=0.9 <2", + "antecedent/patchwork": "^2.1.17", + "mockery/mockery": "^1.3.5 || ^1.4.4", "php": ">=5.6.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || ^0.7", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", "phpcompatibility/php-compatibility": "^9.3.0", - "phpunit/phpunit": "^5.7.9 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^5.7.26 || ^6.0 || ^7.0 || >=8.0 <8.5.12 || ^8.5.14 || ^9.0" }, "type": "library", "extra": { @@ -630,12 +924,12 @@ } }, "autoload": { - "psr-4": { - "Brain\\Monkey\\": "src/" - }, "files": [ "inc/api.php" - ] + ], + "psr-4": { + "Brain\\Monkey\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -662,20 +956,20 @@ "test", "testing" ], - "time": "2020-10-13T17:56:14+00:00" + "time": "2021-11-11T15:53:55+00:00" }, { "name": "composer/package-versions-deprecated", - "version": "1.11.99.4", + "version": "1.11.99.5", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "b174585d1fe49ceed21928a945138948cb394600" + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b174585d1fe49ceed21928a945138948cb394600", - "reference": "b174585d1fe49ceed21928a945138948cb394600", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b4f54f74ef3453349c24a845d22392cd31e65f1d", + "reference": "b4f54f74ef3453349c24a845d22392cd31e65f1d", "shasum": "" }, "require": { @@ -731,27 +1025,94 @@ "type": "tidelift" } ], - "time": "2021-09-13T08:41:34+00:00" + "time": "2022-01-17T14:14:24+00:00" }, { - "name": "composer/semver", - "version": "3.2.6", + "name": "composer/pcre", + "version": "1.0.1", "source": { "type": "git", - "url": "https://github.com/composer/semver.git", - "reference": "83e511e247de329283478496f7a1e114c9517506" + "url": "https://github.com/composer/pcre.git", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/83e511e247de329283478496f7a1e114c9517506", - "reference": "83e511e247de329283478496f7a1e114c9517506", + "url": "https://api.github.com/repos/composer/pcre/zipball/67a32d7d6f9f560b726ab25a061b38ff3a80c560", + "reference": "67a32d7d6f9f560b726ab25a061b38ff3a80c560", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.54", + "phpstan/phpstan": "^1.3", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2022-01-21T20:24:37+00:00" + }, + { + "name": "composer/semver", + "version": "3.2.9", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/a951f614bd64dcd26137bc9b7b2637ddcfc57649", + "reference": "a951f614bd64dcd26137bc9b7b2637ddcfc57649", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.4", "symfony/phpunit-bridge": "^4.2 || ^5" }, "type": "library", @@ -807,29 +1168,31 @@ "type": "tidelift" } ], - "time": "2021-10-25T11:34:17+00:00" + "time": "2022-02-04T13:58:43+00:00" }, { "name": "composer/xdebug-handler", - "version": "2.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339" + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/84674dd3a7575ba617f5a76d7e9e29a7d3891339", - "reference": "84674dd3a7575ba617f5a76d7e9e29a7d3891339", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", + "reference": "0c1a3925ec58a4ec98e992b9c7d171e9e184be0a", "shasum": "" }, "require": { + "composer/pcre": "^1", "php": "^5.3.2 || ^7.0 || ^8.0", "psr/log": "^1 || ^2 || ^3" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "symfony/phpunit-bridge": "^4.2 || ^5.0 || ^6.0" }, "type": "library", "autoload": { @@ -866,31 +1229,31 @@ "type": "tidelift" } ], - "time": "2021-07-31T17:03:58+00:00" + "time": "2022-01-04T17:06:45+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.1", + "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { @@ -911,6 +1274,10 @@ "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -922,6 +1289,7 @@ "codesniffer", "composer", "installer", + "phpcbf", "phpcs", "plugin", "qa", @@ -932,7 +1300,7 @@ "stylecheck", "tests" ], - "time": "2020-12-07T18:04:37+00:00" + "time": "2022-02-04T12:51:07+00:00" }, { "name": "dnoegel/php-xdg-base-dir", @@ -1016,20 +1384,6 @@ "constructor", "instantiate" ], - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], "time": "2020-11-10T18:47:58+00:00" }, { @@ -1283,12 +1637,6 @@ "object", "object graph" ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], "time": "2020-11-13T09:40:50+00:00" }, { @@ -1339,16 +1687,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.13.0", + "version": "v4.13.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53" + "reference": "210577fe3cf7badcc5814d99455df46564f3c077" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/50953a2691a922aa1769461637869a0a2faa3f53", - "reference": "50953a2691a922aa1769461637869a0a2faa3f53", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077", + "reference": "210577fe3cf7badcc5814d99455df46564f3c077", "shasum": "" }, "require": { @@ -1387,7 +1735,7 @@ "parser", "php" ], - "time": "2021-09-20T12:20:58+00:00" + "time": "2021-11-30T19:35:32+00:00" }, { "name": "openlss/lib-array2xml", @@ -1542,16 +1890,16 @@ }, { "name": "php-stubs/woocommerce-stubs", - "version": "v5.8.0", + "version": "v5.9.0", "source": { "type": "git", "url": "https://github.com/php-stubs/woocommerce-stubs.git", - "reference": "e3978c519fb1e51585e8c86b489b802aa0c64cee" + "reference": "a7204cfbb5fa90720773122cb68530087de5bc78" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/e3978c519fb1e51585e8c86b489b802aa0c64cee", - "reference": "e3978c519fb1e51585e8c86b489b802aa0c64cee", + "url": "https://api.github.com/repos/php-stubs/woocommerce-stubs/zipball/a7204cfbb5fa90720773122cb68530087de5bc78", + "reference": "a7204cfbb5fa90720773122cb68530087de5bc78", "shasum": "" }, "require": { @@ -1578,28 +1926,31 @@ "woocommerce", "wordpress" ], - "time": "2021-10-15T14:13:09+00:00" + "time": "2021-11-05T10:02:27+00:00" }, { "name": "php-stubs/wordpress-stubs", - "version": "v5.8.1", + "version": "v5.9.0", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "8b333464d3183bccde2fdbb814e3cae592434943" + "reference": "0fa8dd9a1bd2a1b60e85afc6c798fca1f599cc1b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/8b333464d3183bccde2fdbb814e3cae592434943", - "reference": "8b333464d3183bccde2fdbb814e3cae592434943", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/0fa8dd9a1bd2a1b60e85afc6c798fca1f599cc1b", + "reference": "0fa8dd9a1bd2a1b60e85afc6c798fca1f599cc1b", "shasum": "" }, "replace": { "giacocorsiglia/wordpress-stubs": "*" }, "require-dev": { - "giacocorsiglia/stubs-generator": "^0.5.0", - "php": "~7.1" + "nikic/php-parser": "< 4.12.0", + "php": "~7.3 || ~8.0", + "php-stubs/generator": "^0.8.0", + "phpdocumentor/reflection-docblock": "^5.3", + "phpstan/phpstan": "^1.2" }, "suggest": { "paragonie/sodium_compat": "Pure PHP implementation of libsodium", @@ -1618,7 +1969,7 @@ "static analysis", "wordpress" ], - "time": "2021-09-09T22:10:19+00:00" + "time": "2022-01-26T00:27:45+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -1732,16 +2083,16 @@ }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.2", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "a792ab623069f0ce971b2417edef8d9632e32f75" + "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/a792ab623069f0ce971b2417edef8d9632e32f75", - "reference": "a792ab623069f0ce971b2417edef8d9632e32f75", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/d55de55f88697b9cdb94bccf04f14eb3b11cf308", + "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308", "shasum": "" }, "require": { @@ -1778,7 +2129,7 @@ "standards", "wordpress" ], - "time": "2021-07-21T11:09:57+00:00" + "time": "2021-12-30T16:37:40+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -2056,16 +2407,16 @@ }, { "name": "phpunit/php-file-iterator", - "version": "2.0.4", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05" + "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/28af674ff175d0768a5a978e6de83f697d4a7f05", - "reference": "28af674ff175d0768a5a978e6de83f697d4a7f05", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", "shasum": "" }, "require": { @@ -2108,7 +2459,7 @@ "type": "github" } ], - "time": "2021-07-19T06:46:01+00:00" + "time": "2021-12-02T12:42:26+00:00" }, { "name": "phpunit/php-text-template", @@ -2198,12 +2549,6 @@ "keywords": [ "timer" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T08:20:02+00:00" }, { @@ -2253,12 +2598,6 @@ "keywords": [ "tokenizer" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "abandoned": true, "time": "2021-07-26T12:15:06+00:00" }, @@ -2389,12 +2728,6 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T08:15:22+00:00" }, { @@ -2459,12 +2792,6 @@ "compare", "equality" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T08:04:30+00:00" }, { @@ -2521,12 +2848,6 @@ "unidiff", "unified diff" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:59:04+00:00" }, { @@ -2580,26 +2901,20 @@ "environment", "hhvm" ], - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:53:42+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.3", + "version": "3.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e" + "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/6b853149eab67d4da22291d36f5b0631c0fd856e", - "reference": "6b853149eab67d4da22291d36f5b0631c0fd856e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", "shasum": "" }, "require": { @@ -2608,7 +2923,7 @@ }, "require-dev": { "ext-mbstring": "*", - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^8.5" }, "type": "library", "extra": { @@ -2659,7 +2974,7 @@ "type": "github" } ], - "time": "2020-11-30T07:47:53+00:00" + "time": "2021-11-11T13:51:24+00:00" }, { "name": "sebastian/global-state", @@ -2757,12 +3072,6 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:40:27+00:00" }, { @@ -2808,12 +3117,6 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:37:18+00:00" }, { @@ -2867,12 +3170,6 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:34:24+00:00" }, { @@ -2915,12 +3212,6 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:30:19+00:00" }, { @@ -2968,16 +3259,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.1", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e" + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/f268ca40d54617c6e06757f83f699775c9b3ff2e", - "reference": "f268ca40d54617c6e06757f83f699775c9b3ff2e", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", "shasum": "" }, "require": { @@ -3015,20 +3306,20 @@ "phpcs", "standards" ], - "time": "2021-10-11T04:00:11+00:00" + "time": "2021-12-12T21:44:58+00:00" }, { "name": "symfony/console", - "version": "v4.4.30", + "version": "v4.4.37", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "a3f7189a0665ee33b50e9e228c46f50f5acbed22" + "reference": "0259f01dbf9d77badddbbf4c2abb681f24c9cac6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/a3f7189a0665ee33b50e9e228c46f50f5acbed22", - "reference": "a3f7189a0665ee33b50e9e228c46f50f5acbed22", + "url": "https://api.github.com/repos/symfony/console/zipball/0259f01dbf9d77badddbbf4c2abb681f24c9cac6", + "reference": "0259f01dbf9d77badddbbf4c2abb681f24c9cac6", "shasum": "" }, "require": { @@ -3102,25 +3393,28 @@ "type": "tidelift" } ], - "time": "2021-08-25T19:27:26+00:00" + "time": "2022-01-26T16:15:26+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" + "reference": "30885182c981ab175d4d034db0f6f469898070ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", + "reference": "30885182c981ab175d4d034db0f6f469898070ab", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-ctype": "*" + }, "suggest": { "ext-ctype": "For best performance" }, @@ -3178,25 +3472,28 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" + "time": "2021-10-20T20:35:02+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/0abb51d2f102e00a4eefcf46ba7fec406d245825", + "reference": "0abb51d2f102e00a4eefcf46ba7fec406d245825", "shasum": "" }, "require": { "php": ">=7.1" }, + "provide": { + "ext-mbstring": "*" + }, "suggest": { "ext-mbstring": "For best performance" }, @@ -3211,12 +3508,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, "files": [ "bootstrap.php" - ] + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3255,20 +3552,20 @@ "type": "tidelift" } ], - "time": "2021-05-27T12:26:48+00:00" + "time": "2021-11-30T18:21:41+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.23.0", + "version": "v1.24.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010" + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fba8933c384d6476ab14fb7b8526e5287ca7e010", - "reference": "fba8933c384d6476ab14fb7b8526e5287ca7e010", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5", + "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5", "shasum": "" }, "require": { @@ -3285,12 +3582,12 @@ } }, "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, "files": [ "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, "classmap": [ "Resources/stubs" ] @@ -3331,100 +3628,20 @@ "type": "tidelift" } ], - "time": "2021-02-19T12:13:01+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.23.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/1100343ed1a92e3a38f9ae122fc0eb21602547be", - "reference": "1100343ed1a92e3a38f9ae122fc0eb21602547be", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-07-28T13:41:28+00:00" + "time": "2021-06-05T21:20:04+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.9", + "version": "v1.1.11", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26" + "reference": "633df678bec3452e04a7b0337c9bcfe7354124b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b776d18b303a39f56c63747bcb977ad4b27aca26", - "reference": "b776d18b303a39f56c63747bcb977ad4b27aca26", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/633df678bec3452e04a7b0337c9bcfe7354124b3", + "reference": "633df678bec3452e04a7b0337c9bcfe7354124b3", "shasum": "" }, "require": { @@ -3437,7 +3654,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-main": "1.1-dev" }, "thanks": { "name": "symfony/contracts", @@ -3487,7 +3704,7 @@ "type": "tidelift" } ], - "time": "2020-07-06T13:19:58+00:00" + "time": "2021-11-04T13:32:43+00:00" }, { "name": "theseer/tokenizer", @@ -3531,16 +3748,16 @@ }, { "name": "vimeo/psalm", - "version": "4.11.2", + "version": "4.21.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "6fba5eb554f9507b72932f9c75533d8af593688d" + "reference": "d8bec4c7aaee111a532daec32fb09de5687053d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/6fba5eb554f9507b72932f9c75533d8af593688d", - "reference": "6fba5eb554f9507b72932f9c75533d8af593688d", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/d8bec4c7aaee111a532daec32fb09de5687053d1", + "reference": "d8bec4c7aaee111a532daec32fb09de5687053d1", "shasum": "" }, "require": { @@ -3548,7 +3765,7 @@ "amphp/byte-stream": "^1.5", "composer/package-versions-deprecated": "^1.8.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0", + "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -3564,7 +3781,7 @@ "openlss/lib-array2xml": "^1.0", "php": "^7.1|^8", "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", "webmozart/path-util": "^2.3" }, "provide": { @@ -3582,11 +3799,12 @@ "psalm/plugin-phpunit": "^0.16", "slevomat/coding-standard": "^7.0", "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0", + "symfony/process": "^4.3 || ^5.0 || ^6.0", "weirdan/prophecy-shim": "^1.0 || ^2.0" }, "suggest": { - "ext-igbinary": "^2.0.5" + "ext-curl": "In order to send data to shepherd", + "ext-igbinary": "^2.0.5 is required, used to serialize caching data" }, "bin": [ "psalm", @@ -3605,13 +3823,13 @@ } }, "autoload": { - "psr-4": { - "Psalm\\": "src/Psalm/" - }, "files": [ "src/functions.php", "src/spl_object_id.php" - ] + ], + "psr-4": { + "Psalm\\": "src/Psalm/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -3628,7 +3846,7 @@ "inspection", "php" ], - "time": "2021-10-26T17:28:17+00:00" + "time": "2022-02-18T04:34:15+00:00" }, { "name": "webmozart/assert", @@ -3723,20 +3941,21 @@ } ], "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "abandoned": "symfony/filesystem", "time": "2015-12-17T08:42:14+00:00" }, { "name": "woocommerce/woocommerce-sniffs", - "version": "0.1.1", + "version": "0.1.2", "source": { "type": "git", "url": "https://github.com/woocommerce/woocommerce-sniffs.git", - "reference": "eb604d751b61c42f31ff1aa24113c7c0de438553" + "reference": "5566270d280a300bc24bd0cb055a8b9325afdd6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/woocommerce/woocommerce-sniffs/zipball/eb604d751b61c42f31ff1aa24113c7c0de438553", - "reference": "eb604d751b61c42f31ff1aa24113c7c0de438553", + "url": "https://api.github.com/repos/woocommerce/woocommerce-sniffs/zipball/5566270d280a300bc24bd0cb055a8b9325afdd6b", + "reference": "5566270d280a300bc24bd0cb055a8b9325afdd6b", "shasum": "" }, "require": { @@ -3763,7 +3982,7 @@ "woocommerce", "wordpress" ], - "time": "2021-07-29T17:25:16+00:00" + "time": "2022-01-21T20:13:23+00:00" }, { "name": "wp-coding-standards/wpcs", diff --git a/modules/ppcp-admin-notices/src/Repository/Repository.php b/modules/ppcp-admin-notices/src/Repository/Repository.php index 066ed0ea8..e13a5dd6c 100644 --- a/modules/ppcp-admin-notices/src/Repository/Repository.php +++ b/modules/ppcp-admin-notices/src/Repository/Repository.php @@ -25,6 +25,9 @@ class Repository implements RepositoryInterface { */ public function current_message(): array { return array_filter( + /** + * Returns the list of admin messages. + */ (array) apply_filters( self::NOTICES_FILTER, array() diff --git a/modules/ppcp-api-client/services.php b/modules/ppcp-api-client/services.php index 4b2f877b3..415902033 100644 --- a/modules/ppcp-api-client/services.php +++ b/modules/ppcp-api-client/services.php @@ -422,6 +422,9 @@ return array( * The matrix which countries and currency combinations can be used for DCC. */ 'api.dcc-supported-country-currency-matrix' => static function ( ContainerInterface $container ) : array { + /** + * Returns which countries and currency combinations can be used for DCC. + */ return apply_filters( 'woocommerce_paypal_payments_supported_country_currency_matrix', array( @@ -567,6 +570,9 @@ return array( * Which countries support which credit cards. Empty credit card arrays mean no restriction on currency. */ 'api.dcc-supported-country-card-matrix' => static function ( ContainerInterface $container ) : array { + /** + * Returns which countries support which credit cards. Empty credit card arrays mean no restriction on currency. + */ return apply_filters( 'woocommerce_paypal_payments_supported_country_card_matrix', array( diff --git a/modules/ppcp-api-client/src/Endpoint/PaymentsEndpoint.php b/modules/ppcp-api-client/src/Endpoint/PaymentsEndpoint.php index d750cecf8..e470dba46 100644 --- a/modules/ppcp-api-client/src/Endpoint/PaymentsEndpoint.php +++ b/modules/ppcp-api-client/src/Endpoint/PaymentsEndpoint.php @@ -12,6 +12,7 @@ namespace WooCommerce\PayPalCommerce\ApiClient\Endpoint; use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer; use WooCommerce\PayPalCommerce\ApiClient\Entity\Authorization; use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Money; use WooCommerce\PayPalCommerce\ApiClient\Entity\Refund; use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException; use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException; @@ -146,22 +147,32 @@ class PaymentsEndpoint { /** * Capture an authorization by a given ID. * - * @param string $authorization_id The id. + * @param string $authorization_id The id. + * @param Money|null $amount The amount to capture. If not specified, the whole authorized amount is captured. * * @return Capture * @throws RuntimeException If the request fails. * @throws PayPalApiException If the request fails. */ - public function capture( string $authorization_id ): Capture { + public function capture( string $authorization_id, ?Money $amount = null ): Capture { $bearer = $this->bearer->bearer(); $url = trailingslashit( $this->host ) . 'v2/payments/authorizations/' . $authorization_id . '/capture'; - $args = array( + + $data = array( + 'final_capture' => true, + ); + if ( $amount ) { + $data['amount'] = $amount->to_array(); + } + + $args = array( 'method' => 'POST', 'headers' => array( 'Authorization' => 'Bearer ' . $bearer->token(), 'Content-Type' => 'application/json', 'Prefer' => 'return=representation', ), + 'body' => wp_json_encode( $data, JSON_FORCE_OBJECT ), ); $response = $this->request( $url, $args ); diff --git a/modules/ppcp-api-client/src/Entity/PaymentToken.php b/modules/ppcp-api-client/src/Entity/PaymentToken.php index ca919dc2f..686813817 100644 --- a/modules/ppcp-api-client/src/Entity/PaymentToken.php +++ b/modules/ppcp-api-client/src/Entity/PaymentToken.php @@ -105,6 +105,9 @@ class PaymentToken { * @return array */ public static function get_valid_types() { + /** + * Returns a list of valid payment token types. + */ return apply_filters( 'woocommerce_paypal_payments_valid_payment_token_types', array( diff --git a/modules/ppcp-api-client/src/Factory/PayerFactory.php b/modules/ppcp-api-client/src/Factory/PayerFactory.php index 70d33dee3..6bec8fe80 100644 --- a/modules/ppcp-api-client/src/Factory/PayerFactory.php +++ b/modules/ppcp-api-client/src/Factory/PayerFactory.php @@ -55,10 +55,12 @@ class PayerFactory { $national_number = preg_replace( '/[^0-9]/', '', $national_number ); $national_number = substr( $national_number, 0, 14 ); - $phone = new PhoneWithType( - 'HOME', - new Phone( $national_number ) - ); + if ( $national_number ) { + $phone = new PhoneWithType( + 'HOME', + new Phone( $national_number ) + ); + } } return new Payer( new PayerName( @@ -91,10 +93,12 @@ class PayerFactory { $national_number = preg_replace( '/[^0-9]/', '', $national_number ); $national_number = substr( $national_number, 0, 14 ); - $phone = new PhoneWithType( - 'HOME', - new Phone( $national_number ) - ); + if ( $national_number ) { + $phone = new PhoneWithType( + 'HOME', + new Phone( $national_number ) + ); + } } return new Payer( new PayerName( @@ -176,10 +180,12 @@ class PayerFactory { if ( null !== $national_number ) { $national_number = substr( $national_number, 0, 14 ); - $phone = new PhoneWithType( - 'HOME', - new Phone( $national_number ) - ); + if ( $national_number ) { + $phone = new PhoneWithType( + 'HOME', + new Phone( $national_number ) + ); + } } } diff --git a/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php b/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php index c018d9917..37c371fb0 100644 --- a/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php +++ b/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php @@ -134,6 +134,9 @@ class PurchaseUnitFactory { $invoice_id, $soft_descriptor ); + /** + * Returns PurchaseUnit for the WC order. + */ return apply_filters( 'woocommerce_paypal_payments_purchase_unit_from_wc_order', $purchase_unit, diff --git a/modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php b/modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php index bfc28b25a..f6c87c804 100644 --- a/modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php +++ b/modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php @@ -74,7 +74,10 @@ class ApplicationContextRepository { $parts = explode( '-', $locale ); if ( count( $parts ) === 3 ) { - return substr( $locale, 0, strrpos( $locale, '-' ) ); + $ret = substr( $locale, 0, strrpos( $locale, '-' ) ); + if ( false !== $ret ) { + return $ret; + } } return 'en'; diff --git a/modules/ppcp-api-client/src/Repository/CustomerRepository.php b/modules/ppcp-api-client/src/Repository/CustomerRepository.php index 93134624e..99063b7e3 100644 --- a/modules/ppcp-api-client/src/Repository/CustomerRepository.php +++ b/modules/ppcp-api-client/src/Repository/CustomerRepository.php @@ -45,6 +45,8 @@ class CustomerRepository { } $unique_id = substr( $this->prefix . strrev( uniqid() ), 0, self::CLIENT_ID_MAX_LENGTH ); + assert( is_string( $unique_id ) ); + WC()->session->set( 'ppcp_guest_customer_id', $unique_id ); return $unique_id; diff --git a/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php b/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php index cdcdabac5..e2a13c949 100644 --- a/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php +++ b/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php @@ -75,10 +75,16 @@ class PartnerReferralsData { return array( 'partner_config_override' => array( 'partner_logo_url' => 'https://connect.woocommerce.com/images/woocommerce_logo.png', + /** + * Returns the URL which will be opened at the end of onboarding. + */ 'return_url' => apply_filters( 'woocommerce_paypal_payments_partner_config_override_return_url', admin_url( 'admin.php?page=wc-settings&tab=checkout§ion=ppcp-gateway' ) ), + /** + * Returns the description of the URL which will be opened at the end of onboarding. + */ 'return_url_description' => apply_filters( 'woocommerce_paypal_payments_partner_config_override_return_url_description', __( 'Return to your shop.', 'woocommerce-paypal-payments' ) diff --git a/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js b/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js index 559803b3c..a4eb8f146 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/CreditCardRenderer.js @@ -9,7 +9,6 @@ class CreditCardRenderer { this.cardValid = false; this.formValid = false; this.currentHostedFieldsInstance = null; - this.formSubmissionSubscribed = false; } render(wrapper, contextConfig) { @@ -122,7 +121,7 @@ class CreditCardRenderer { }); - if (!this.formSubmissionSubscribed) { + if (document.querySelector(wrapper).getAttribute('data-ppcp-subscribed') !== true) { document.querySelector(wrapper + ' button').addEventListener( 'click', event => { @@ -130,7 +129,8 @@ class CreditCardRenderer { this._submit(contextConfig); } ); - this.formSubmissionSubscribed = true; + + document.querySelector(wrapper).setAttribute('data-ppcp-subscribed', true); } }); @@ -143,7 +143,7 @@ class CreditCardRenderer { } disableFields() { - if( this.currentHostedFieldsInstance) { + if (this.currentHostedFieldsInstance) { this.currentHostedFieldsInstance.setAttribute({ field: 'number', attribute: 'disabled' @@ -160,7 +160,7 @@ class CreditCardRenderer { } enableFields() { - if( this.currentHostedFieldsInstance) { + if (this.currentHostedFieldsInstance) { this.currentHostedFieldsInstance.removeAttribute({ field: 'number', attribute: 'disabled' diff --git a/modules/ppcp-button/services.php b/modules/ppcp-button/services.php index f068cf5bb..9cec5b302 100644 --- a/modules/ppcp-button/services.php +++ b/modules/ppcp-button/services.php @@ -73,6 +73,7 @@ return array( $currency = $container->get( 'api.shop.currency' ); return new SmartButton( $container->get( 'button.url' ), + $container->get( 'ppcp.asset-version' ), $container->get( 'session.handler' ), $settings, $payer_factory, diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 667560dbc..08e22815b 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -44,6 +44,13 @@ class SmartButton implements SmartButtonInterface { */ private $module_url; + /** + * The assets version. + * + * @var string + */ + private $version; + /** * The Session Handler. * @@ -125,6 +132,7 @@ class SmartButton implements SmartButtonInterface { * SmartButton constructor. * * @param string $module_url The URL to the module. + * @param string $version The assets version. * @param SessionHandler $session_handler The Session Handler. * @param Settings $settings The Settings. * @param PayerFactory $payer_factory The Payer factory. @@ -140,6 +148,7 @@ class SmartButton implements SmartButtonInterface { */ public function __construct( string $module_url, + string $version, SessionHandler $session_handler, Settings $settings, PayerFactory $payer_factory, @@ -155,6 +164,7 @@ class SmartButton implements SmartButtonInterface { ) { $this->module_url = $module_url; + $this->version = $version; $this->session_handler = $session_handler; $this->settings = $settings; $this->payer_factory = $payer_factory; @@ -406,7 +416,7 @@ class SmartButton implements SmartButtonInterface { 'ppcp-hosted-fields', untrailingslashit( $this->module_url ) . '/assets/css/hosted-fields.css', array(), - 1 + $this->version ); } if ( $load_script ) { @@ -414,7 +424,7 @@ class SmartButton implements SmartButtonInterface { 'ppcp-smart-button', untrailingslashit( $this->module_url ) . '/assets/js/button.js', array( 'jquery' ), - '1.3.2', + $this->version, true ); @@ -1012,38 +1022,50 @@ class SmartButton implements SmartButtonInterface { } /** - * Return action name PayPal buttons will be rendered at on checkout page. + * Returns the action name that PayPal button will use for rendering on the checkout page. * * @return string Action name. */ private function checkout_button_renderer_hook(): string { + /** + * The filter returning the action name that PayPal button will use for rendering on the checkout page. + */ return (string) apply_filters( 'woocommerce_paypal_payments_checkout_button_renderer_hook', 'woocommerce_review_order_after_payment' ); } /** - * Return action name PayPal DCC button will be rendered at on checkout page. + * Returns the action name that PayPal DCC button will use for rendering on the checkout page. * * @return string */ private function checkout_dcc_button_renderer_hook(): string { + /** + * The filter returning the action name that PayPal DCC button will use for rendering on the checkout page. + */ return (string) apply_filters( 'woocommerce_paypal_payments_checkout_dcc_renderer_hook', 'woocommerce_review_order_after_submit' ); } /** - * Return action name PayPal button and Pay Later message will be rendered at on pay-order page. + * Returns the action name that PayPal button and Pay Later message will use for rendering on the pay-order page. * * @return string */ private function pay_order_renderer_hook(): string { + /** + * The filter returning the action name that PayPal button and Pay Later message will use for rendering on the pay-order page. + */ return (string) apply_filters( 'woocommerce_paypal_payments_pay_order_dcc_renderer_hook', 'woocommerce_pay_order_after_submit' ); } /** - * Return action name PayPal button will be rendered next to Proceed to checkout button (normally displayed in cart). + * Returns action name that PayPal button will use for rendering next to Proceed to checkout button (normally displayed in cart). * * @return string */ private function proceed_to_checkout_button_renderer_hook(): string { + /** + * The filter returning the action name that PayPal button will use for rendering next to Proceed to checkout button (normally displayed in cart). + */ return (string) apply_filters( 'woocommerce_paypal_payments_proceed_to_checkout_button_renderer_hook', 'woocommerce_proceed_to_checkout' @@ -1051,11 +1073,14 @@ class SmartButton implements SmartButtonInterface { } /** - * Return action name PayPal button will be rendered in the WC mini cart. + * Returns the action name that PayPal button will use for rendering in the WC mini cart. * * @return string */ private function mini_cart_button_renderer_hook(): string { + /** + * The filter returning the action name that PayPal button will use for rendering in the WC mini cart. + */ return (string) apply_filters( 'woocommerce_paypal_payments_mini_cart_button_renderer_hook', 'woocommerce_widget_shopping_cart_after_buttons' @@ -1063,11 +1088,14 @@ class SmartButton implements SmartButtonInterface { } /** - * Return action name PayPal button and Pay Later message will be rendered at on the single product page. + * Returns the action name that PayPal button and Pay Later message will use for rendering on the single product page. * * @return string */ private function single_product_renderer_hook(): string { + /** + * The filter returning the action name that PayPal button and Pay Later message will use for rendering on the single product page. + */ return (string) apply_filters( 'woocommerce_paypal_payments_single_product_renderer_hook', 'woocommerce_single_product_summary' ); } } diff --git a/modules/ppcp-compat/src/PPEC/PPECHelper.php b/modules/ppcp-compat/src/PPEC/PPECHelper.php index 09fca3c19..71e16e544 100644 --- a/modules/ppcp-compat/src/PPEC/PPECHelper.php +++ b/modules/ppcp-compat/src/PPEC/PPECHelper.php @@ -89,6 +89,9 @@ class PPECHelper { * @return bool */ public static function use_ppec_compat_layer_for_subscriptions() { + /** + * The filter returning whether the compatibility layer for PPEC Subscriptions should be initialized. + */ return ( ! self::is_gateway_available() ) && self::site_has_ppec_subscriptions() && apply_filters( 'woocommerce_paypal_payments_process_legacy_subscriptions', true ); } diff --git a/modules/ppcp-onboarding/assets/css/onboarding.css b/modules/ppcp-onboarding/assets/css/onboarding.css index 98cc7608f..084b96a22 100644 --- a/modules/ppcp-onboarding/assets/css/onboarding.css +++ b/modules/ppcp-onboarding/assets/css/onboarding.css @@ -59,29 +59,72 @@ ul.ppcp-onboarding-options-sublist { .ppcp-muted-text { opacity: 0.6; + font-size: 85%; } -.ppcp-onboarding-header { +#field-ppcp_onboarading_header > td, #field-ppcp_onboarading_options > td { + padding: 0; +} + +.ppcp-onboarding-header, .ppcp-onboarding-cards-options { display: flex; - width: 1000px; + width: 1200px; } .ppcp-onboarding-header-left, .ppcp-onboarding-header-right { flex: 50%; } +.ppcp-onboarding-header-right { + text-align: right; +} + .ppcp-onboarding-header h2 { margin-top: 0; } +.ppcp-onboarding-header-left img { + height: 60px; +} + .ppcp-onboarding-header-cards img, .ppcp-onboarding-header-paypal-logos img { margin: 5px; } .ppcp-onboarding-header-cards img { - height: 40px; + height: 37px; } .ppcp-onboarding-header-paypal-logos img { - height: 45px; + height: 32px; +} + +.ppcp-onboarding-cards-options table { + margin-left: 35px; + margin-right: 15px; +} + +.ppcp-onboarding-cards-options table td { + padding-top: 2px; +} + +.ppcp-onboarding-cards-options table td:first-child { + vertical-align: top; +} + +.ppcp-onboarding-cards-options table tr:not(:last-child) td { + padding-bottom: 0; +} + +.ppcp-onboarding-cards-options table tr td:first-child { + width: 350px; +} + +.ppcp-onboarding-cards-screen { + flex: 1; + align-self: center; +} + +.ppcp-onboarding-cards-screen img { + width: 100%; } diff --git a/modules/ppcp-onboarding/assets/images/cards-screen-acdc.png b/modules/ppcp-onboarding/assets/images/cards-screen-acdc.png new file mode 100644 index 000000000..028012bb1 Binary files /dev/null and b/modules/ppcp-onboarding/assets/images/cards-screen-acdc.png differ diff --git a/modules/ppcp-onboarding/assets/images/cards-screen-basic.png b/modules/ppcp-onboarding/assets/images/cards-screen-basic.png new file mode 100644 index 000000000..106902102 Binary files /dev/null and b/modules/ppcp-onboarding/assets/images/cards-screen-basic.png differ diff --git a/modules/ppcp-onboarding/assets/js/onboarding.js b/modules/ppcp-onboarding/assets/js/onboarding.js index 4db2ad4ec..0753ad943 100644 --- a/modules/ppcp-onboarding/assets/js/onboarding.js +++ b/modules/ppcp-onboarding/assets/js/onboarding.js @@ -85,7 +85,8 @@ const ppcp_onboarding = { authCode: authCode, sharedId: sharedId, nonce: PayPalCommerceGatewayOnboarding.nonce, - env: env + env: env, + acceptCards: document.querySelector('#ppcp-onboarding-accept-cards').checked, } ) } @@ -144,6 +145,15 @@ function ppcp_onboarding_productionCallback(...args) { document.querySelectorAll(ppcpButtonSelectors.join()).forEach( element => element.style.display = !isExpress ? '' : 'none' ); + + const screemImg = document.querySelector('#ppcp-onboarding-cards-screen-img'); + if (screemImg) { + const currentRb = Array.from(document.querySelectorAll('#ppcp-onboarding-dcc-options input[type="radio"]')) + .filter(rb => rb.checked)[0] ?? null; + + const imgUrl = currentRb.getAttribute('data-screen-url'); + screemImg.src = imgUrl; + } }; const updateManualInputControls = (shown, isSandbox, isAnyEnvOnboarded) => { diff --git a/modules/ppcp-onboarding/services.php b/modules/ppcp-onboarding/services.php index 81e25ad31..a3a2fec58 100644 --- a/modules/ppcp-onboarding/services.php +++ b/modules/ppcp-onboarding/services.php @@ -131,9 +131,11 @@ return array( $login_seller_endpoint = $container->get( 'onboarding.endpoint.login-seller' ); return new OnboardingAssets( $container->get( 'onboarding.url' ), + $container->get( 'ppcp.asset-version' ), $state, $container->get( 'onboarding.environment' ), - $login_seller_endpoint + $login_seller_endpoint, + $container->get( 'wcgateway.current-ppcp-settings-page-id' ) ); }, @@ -214,7 +216,9 @@ return array( ); }, 'onboarding.render-options' => static function ( ContainerInterface $container ) : OnboardingOptionsRenderer { - return new OnboardingOptionsRenderer(); + return new OnboardingOptionsRenderer( + $container->get( 'onboarding.url' ) + ); }, 'onboarding.rest' => static function( $container ) : OnboardingRESTController { return new OnboardingRESTController( $container ); diff --git a/modules/ppcp-onboarding/src/Assets/OnboardingAssets.php b/modules/ppcp-onboarding/src/Assets/OnboardingAssets.php index b05bd3023..55e99c0d1 100644 --- a/modules/ppcp-onboarding/src/Assets/OnboardingAssets.php +++ b/modules/ppcp-onboarding/src/Assets/OnboardingAssets.php @@ -12,6 +12,7 @@ namespace WooCommerce\PayPalCommerce\Onboarding\Assets; use WooCommerce\PayPalCommerce\Onboarding\Endpoint\LoginSellerEndpoint; use WooCommerce\PayPalCommerce\Onboarding\Environment; use WooCommerce\PayPalCommerce\Onboarding\State; +use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; /** * Class OnboardingAssets @@ -25,6 +26,13 @@ class OnboardingAssets { */ private $module_url; + /** + * The assets version. + * + * @var string + */ + private $version; + /** * The State. * @@ -46,25 +54,38 @@ class OnboardingAssets { */ private $login_seller_endpoint; + /** + * ID of the current PPCP gateway settings page, or empty if it is not such page. + * + * @var string + */ + protected $page_id; + /** * OnboardingAssets constructor. * * @param string $module_url The URL to the module. + * @param string $version The assets version. * @param State $state The State object. * @param Environment $environment The Environment. * @param LoginSellerEndpoint $login_seller_endpoint The LoginSeller endpoint. + * @param string $page_id ID of the current PPCP gateway settings page, or empty if it is not such page. */ public function __construct( string $module_url, + string $version, State $state, Environment $environment, - LoginSellerEndpoint $login_seller_endpoint + LoginSellerEndpoint $login_seller_endpoint, + string $page_id ) { $this->module_url = untrailingslashit( $module_url ); + $this->version = $version; $this->state = $state; $this->environment = $environment; $this->login_seller_endpoint = $login_seller_endpoint; + $this->page_id = $page_id; } /** @@ -79,14 +100,14 @@ class OnboardingAssets { 'ppcp-onboarding', $url, array(), - 1 + $this->version ); $url = untrailingslashit( $this->module_url ) . '/assets/js/settings.js'; wp_register_script( 'ppcp-settings', $url, array(), - 1, + $this->version, true ); @@ -95,7 +116,7 @@ class OnboardingAssets { 'ppcp-onboarding', $url, array( 'jquery' ), - 1, + $this->version, true ); wp_localize_script( @@ -122,7 +143,7 @@ class OnboardingAssets { 'current_state' => State::get_state_name( $this->state->current_state() ), 'current_env' => $this->environment->current_environment(), 'error_messages' => array( - 'no_credentials' => __( 'Enter the credentials.', 'woocommerce-paypal-payments' ), + 'no_credentials' => __( 'API credentials must be entered to save the settings.', 'woocommerce-paypal-payments' ), ), ); } @@ -149,7 +170,6 @@ class OnboardingAssets { * @return bool */ private function should_render_onboarding_script(): bool { - global $current_section; - return 'ppcp-gateway' === $current_section; + return PayPalGateway::ID === $this->page_id; } } diff --git a/modules/ppcp-onboarding/src/Endpoint/LoginSellerEndpoint.php b/modules/ppcp-onboarding/src/Endpoint/LoginSellerEndpoint.php index 38b54331b..b8a458609 100644 --- a/modules/ppcp-onboarding/src/Endpoint/LoginSellerEndpoint.php +++ b/modules/ppcp-onboarding/src/Endpoint/LoginSellerEndpoint.php @@ -128,6 +128,7 @@ class LoginSellerEndpoint implements EndpointInterface { $this->settings->set( 'sandbox_on', $is_sandbox ); $this->settings->set( 'products_dcc_enabled', null ); $this->settings->persist(); + $endpoint = $is_sandbox ? $this->login_seller_sandbox : $this->login_seller_production; $credentials = $endpoint->credentials_for( $data['sharedId'], @@ -143,10 +144,30 @@ class LoginSellerEndpoint implements EndpointInterface { } $this->settings->set( 'client_secret', $credentials->client_secret ); $this->settings->set( 'client_id', $credentials->client_id ); + + $accept_cards = (bool) ( $data['acceptCards'] ?? true ); + $funding_sources = array(); + if ( $this->settings->get( 'disable_funding' ) ) { + $funding_sources = $this->settings->get( 'disable_funding' ); + if ( ! is_array( $funding_sources ) ) { + $funding_sources = array(); + } + } + if ( $accept_cards ) { + $funding_sources = array_diff( $funding_sources, array( 'card' ) ); + } else { + if ( ! in_array( 'card', $funding_sources, true ) ) { + $funding_sources[] = 'card'; + } + } + $this->settings->set( 'disable_funding', $funding_sources ); + $this->settings->persist(); + if ( $this->cache->has( PayPalBearer::CACHE_KEY ) ) { $this->cache->delete( PayPalBearer::CACHE_KEY ); } + wp_schedule_single_event( time() + 5, WebhookRegistrar::EVENT_HOOK diff --git a/modules/ppcp-onboarding/src/Render/OnboardingOptionsRenderer.php b/modules/ppcp-onboarding/src/Render/OnboardingOptionsRenderer.php index 852a60ad9..be69cf4ce 100644 --- a/modules/ppcp-onboarding/src/Render/OnboardingOptionsRenderer.php +++ b/modules/ppcp-onboarding/src/Render/OnboardingOptionsRenderer.php @@ -13,6 +13,22 @@ namespace WooCommerce\PayPalCommerce\Onboarding\Render; * Class OnboardingRenderer */ class OnboardingOptionsRenderer { + /** + * The module url. + * + * @var string + */ + private $module_url; + + /** + * OnboardingOptionsRenderer constructor. + * + * @param string $module_url The module url (for assets). + */ + public function __construct( string $module_url ) { + $this->module_url = $module_url; + } + /** * Renders the onboarding options. * @@ -23,7 +39,7 @@ class OnboardingOptionsRenderer {