diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e3fbc2654..06117f843 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -16,8 +16,8 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-versions }} - tools: composer:v1 + php-version: ${{ matrix.php-versions }} + tools: composer:v1 - name: Validate composer.json and composer.lock run: composer validate diff --git a/changelog.txt b/changelog.txt index 87329bfa6..1f4e6c82a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,6 @@ *** Changelog *** -= 1.6.1 - TBD = += 1.6.1 - 2021-10-12 = * Fix - Handle authorization capture failures #312 * Fix - Handle denied payment authorization #302 * Fix - Handle failed authorizations when capturing order #303 diff --git a/composer.json b/composer.json index f72cfc0a5..67b00d086 100644 --- a/composer.json +++ b/composer.json @@ -4,14 +4,15 @@ "description": "PayPal Commerce Platform for WooCommerce", "license": "GPL-2.0", "require": { - "dhii/module-interface": "^0.2 || ^0.3", - "psr/container": "1.0.0", - "container-interop/service-provider": "^0.4.0", - "dhii/containers": "v0.1.0-alpha1", - "dhii/wp-containers": "v0.1.0-alpha1", - "psr/log": "^1.1", + "php": "^7.1 | ^8.0", "ext-json": "*", - "ralouphie/getallheaders": "^3.0" + "dhii/module-interface": "^0.2 || ^0.3", + "psr/container": "^1.0", + "container-interop/service-provider": "^0.4.0", + "dhii/containers": "^0.1.0-alpha1", + "psr/log": "^1.1", + "ralouphie/getallheaders": "^3.0", + "wikimedia/composer-merge-plugin": "^1.4" }, "require-dev": { "woocommerce/woocommerce-sniffs": "^0.1.0", @@ -19,10 +20,9 @@ "brain/monkey": "^2.4" }, "autoload": { - "classmap": [ - "modules/", - "src/" - ] + "psr-4": { + "WooCommerce\\PayPalCommerce\\": "src" + } }, "autoload-dev": { "psr-4": { @@ -46,6 +46,11 @@ "type:inpsyde-module" ] }, + "merge-plugin": { + "include": [ + "modules/*/composer.json" + ] + }, "hooks": { "pre-commit": [ "vendor/bin/phpcbf" diff --git a/composer.lock b/composer.lock index 6370a86ba..85469abd8 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": "6f1528613bfae64666db050d9fead669", + "content-hash": "0b4f7dd4cc7706bd902a10f64dbd095e", "packages": [ { "name": "container-interop/service-provider", @@ -35,24 +35,20 @@ ], "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" }, { "name": "dhii/collections-interface", - "version": "v0.3.0-alpha4", + "version": "v0.3.0", "source": { "type": "git", "url": "https://github.com/Dhii/collections-interface.git", - "reference": "da334f75f6477ef7eecaf28df1d5253fe05684ee" + "reference": "74464a969b340d16889eacd9eadc9817f7e7f47a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dhii/collections-interface/zipball/da334f75f6477ef7eecaf28df1d5253fe05684ee", - "reference": "da334f75f6477ef7eecaf28df1d5253fe05684ee", + "url": "https://api.github.com/repos/Dhii/collections-interface/zipball/74464a969b340d16889eacd9eadc9817f7e7f47a", + "reference": "74464a969b340d16889eacd9eadc9817f7e7f47a", "shasum": "" }, "require": { @@ -62,7 +58,7 @@ "require-dev": { "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", "slevomat/coding-standard": "^6.0", - "vimeo/psalm": "^3.11.7 | ^4.0" + "vimeo/psalm": "^4.0" }, "type": "library", "extra": { @@ -90,36 +86,35 @@ } ], "description": "A highly ISP-compliant collection of interfaces that represent maps and lists.", - "support": { - "issues": "https://github.com/Dhii/collections-interface/issues", - "source": "https://github.com/Dhii/collections-interface/tree/v0.3.0-alpha4" - }, - "time": "2021-03-09T17:36:34+00:00" + "time": "2021-10-06T10:56:09+00:00" }, { "name": "dhii/containers", - "version": "v0.1.0-alpha1", + "version": "v0.1.4", "source": { "type": "git", "url": "https://github.com/Dhii/containers.git", - "reference": "73eed5422e106006c81ca1fa8b7213c6be33efbc" + "reference": "42ab24683183fa0dc155f26c6a470ef697bbdc9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dhii/containers/zipball/73eed5422e106006c81ca1fa8b7213c6be33efbc", - "reference": "73eed5422e106006c81ca1fa8b7213c6be33efbc", + "url": "https://api.github.com/repos/Dhii/containers/zipball/42ab24683183fa0dc155f26c6a470ef697bbdc9a", + "reference": "42ab24683183fa0dc155f26c6a470ef697bbdc9a", "shasum": "" }, "require": { "container-interop/service-provider": "^0.4", - "dhii/collections-interface": "^0.3.0-alpha1", + "dhii/collections-interface": "^0.3.0-alpha4", "php": "^7.1 | ^8.0" }, "require-dev": { "gmazzap/andrew": "^1.1", - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "^7.0 | ^8.0 | ^9.0", "psr/container": "^1.0", - "slevomat/coding-standard": "~4.0" + "psr/simple-cache": "^1.0", + "slevomat/coding-standard": "^6.0", + "vimeo/psalm": "^4.0", + "wildwolf/psr-memory-cache": "^1.0" }, "type": "library", "extra": { @@ -147,177 +142,7 @@ "PSR-11", "container" ], - "support": { - "issues": "https://github.com/Dhii/containers/issues", - "source": "https://github.com/Dhii/containers/tree/v0.1.0-alpha1" - }, - "time": "2020-09-14T18:27:47+00:00" - }, - { - "name": "dhii/data-container-interface", - "version": "v0.2.1-alpha1", - "source": { - "type": "git", - "url": "https://github.com/Dhii/data-container-interface.git", - "reference": "6be46e427184b95785d9dd563d6acf2e0700cc31" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/data-container-interface/zipball/6be46e427184b95785d9dd563d6acf2e0700cc31", - "reference": "6be46e427184b95785d9dd563d6acf2e0700cc31", - "shasum": "" - }, - "require": { - "dhii/exception-interface": "^0.1 | ^0.2", - "dhii/factory-interface": "^0.1-alpha1", - "php": "^5.3 | ^7.0", - "psr/container": "^1.0" - }, - "require-dev": { - "codeclimate/php-test-reporter": "<=0.3.2", - "dhii/php-cs-fixer-config": "dev-php-5.3", - "dhii/stringable-interface": "^0.1", - "phpunit/phpunit": "^4.8", - "ptrofimov/xpmock": "^1.1" - }, - "suggest": { - "dhii/stringable-interface": "To be able to pass Stringables as keys" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Data\\Container\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dhii Team", - "email": "development@dhii.co" - } - ], - "description": "Interfaces for working with data containers", - "support": { - "issues": "https://github.com/Dhii/data-container-interface/issues", - "source": "https://github.com/Dhii/data-container-interface/tree/v0.2.1-alpha1" - }, - "abandoned": "dhii/collections-interface", - "time": "2019-05-10T14:17:29+00:00" - }, - { - "name": "dhii/exception-interface", - "version": "v0.2", - "source": { - "type": "git", - "url": "https://github.com/Dhii/exception-interface.git", - "reference": "b69feebf7cb2879cd43977a03342e2393b73f7fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/exception-interface/zipball/b69feebf7cb2879cd43977a03342e2393b73f7fb", - "reference": "b69feebf7cb2879cd43977a03342e2393b73f7fb", - "shasum": "" - }, - "require": { - "dhii/stringable-interface": "^0.1", - "php": "^5.3 | ^7.0" - }, - "require-dev": { - "codeclimate/php-test-reporter": "<=0.3.2", - "dhii/php-cs-fixer-config": "dev-php-5.3", - "phpunit/phpunit": "^4.8", - "ptrofimov/xpmock": "^1.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.2.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Exception\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dhii Team", - "email": "development@dhii.co" - } - ], - "description": "Interfaces for most common exceptions", - "support": { - "issues": "https://github.com/Dhii/exception-interface/issues", - "source": "https://github.com/Dhii/exception-interface/tree/develop" - }, - "time": "2018-08-29T10:42:04+00:00" - }, - { - "name": "dhii/factory-interface", - "version": "v0.1", - "source": { - "type": "git", - "url": "https://github.com/Dhii/factory-interface.git", - "reference": "b8d217aec8838e64ccaa770cb03dc164bf6f0515" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/factory-interface/zipball/b8d217aec8838e64ccaa770cb03dc164bf6f0515", - "reference": "b8d217aec8838e64ccaa770cb03dc164bf6f0515", - "shasum": "" - }, - "require": { - "dhii/exception-interface": "^0.1|^0.2", - "php": "^5.3 | ^7.0" - }, - "require-dev": { - "codeclimate/php-test-reporter": "<=0.3.2", - "dhii/php-cs-fixer-config": "dev-php-5.3", - "dhii/stringable-interface": "^0.1", - "phpunit/phpunit": "^4.8", - "psr/container": "^1.0", - "ptrofimov/xpmock": "^1.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Factory\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dhii Team", - "email": "development@dhii.co" - } - ], - "description": "Interfaces for working with factories.", - "support": { - "issues": "https://github.com/Dhii/factory-interface/issues", - "source": "https://github.com/Dhii/factory-interface/tree/master" - }, - "abandoned": true, - "time": "2018-08-29T11:15:09+00:00" + "time": "2021-10-06T11:13:51+00:00" }, { "name": "dhii/module-interface", @@ -365,119 +190,8 @@ } ], "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/stringable-interface", - "version": "v0.1", - "source": { - "type": "git", - "url": "https://github.com/Dhii/stringable-interface.git", - "reference": "b6653905eef2ebf377749feb80a6d18abbe913ef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/stringable-interface/zipball/b6653905eef2ebf377749feb80a6d18abbe913ef", - "reference": "b6653905eef2ebf377749feb80a6d18abbe913ef", - "shasum": "" - }, - "require": { - "php": "^5.3 | ^7.0" - }, - "require-dev": { - "codeclimate/php-test-reporter": "<=0.3.2", - "dhii/php-cs-fixer-config": "dev-php-5.3", - "phpunit/phpunit": "^4.8", - "ptrofimov/xpmock": "^1.1" - }, - "type": "library", - "autoload": { - "psr-4": { - "Dhii\\Util\\String\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dhii Team", - "email": "development@dhii.co" - } - ], - "description": "Interoperability interface for objects that can be cast to string", - "support": { - "issues": "https://github.com/Dhii/stringable-interface/issues", - "source": "https://github.com/Dhii/stringable-interface/tree/master" - }, - "abandoned": "symfony/polyfill-php80", - "time": "2017-01-23T15:08:20+00:00" - }, - { - "name": "dhii/wp-containers", - "version": "v0.1.0-alpha1", - "source": { - "type": "git", - "url": "https://github.com/Dhii/wp-containers.git", - "reference": "e91a6f741622770ed724a2b594145fa917811f0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Dhii/wp-containers/zipball/e91a6f741622770ed724a2b594145fa917811f0c", - "reference": "e91a6f741622770ed724a2b594145fa917811f0c", - "shasum": "" - }, - "require": { - "dhii/data-container-interface": "^0.2.1-alpha1", - "php": "^7.0 | ^8.0", - "psr/container": "^1.0" - }, - "require-dev": { - "brain/monkey": "^2", - "gmazzap/andrew": "^1.1", - "phpunit/phpunit": "^6", - "slevomat/coding-standard": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Dhii\\Wp\\Containers\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Dhii Team", - "email": "development@dhii.co" - } - ], - "description": "PSR-11 container implementations that wrap some WP features, for convenience and interoperability.", - "keywords": [ - "container", - "dependency injection", - "di", - "wordpress" - ], - "support": { - "issues": "https://github.com/Dhii/wp-containers/issues", - "source": "https://github.com/Dhii/wp-containers/tree/v0.1.0-alpha1" - }, - "abandoned": "wp-oop/containers", - "time": "2019-05-10T15:04:22+00:00" - }, { "name": "psr/container", "version": "1.0.0", @@ -525,10 +239,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" }, { @@ -576,9 +286,6 @@ "psr", "psr-3" ], - "support": { - "source": "https://github.com/php-fig/log/tree/1.1.4" - }, "time": "2021-05-03T11:20:27+00:00" }, { @@ -619,11 +326,56 @@ } ], "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": "wikimedia/composer-merge-plugin", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/composer-merge-plugin.git", + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": ">=5.3.2" + }, + "require-dev": { + "composer/composer": "~1.0.0", + "jakub-onderka/php-parallel-lint": "~0.8", + "phpunit/phpunit": "~4.8|~5.0", + "squizlabs/php_codesniffer": "~2.1.0" + }, + "type": "composer-plugin", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + }, + "class": "Wikimedia\\Composer\\MergePlugin" + }, + "autoload": { + "psr-4": { + "Wikimedia\\Composer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bryan Davis", + "email": "bd808@wikimedia.org" + } + ], + "description": "Composer plugin to merge multiple composer.json files", + "time": "2017-04-25T02:31:25+00:00" } ], "packages-dev": [ @@ -669,10 +421,6 @@ "runkit", "testing" ], - "support": { - "issues": "https://github.com/antecedent/patchwork/issues", - "source": "https://github.com/antecedent/patchwork/tree/2.1.15" - }, "time": "2021-08-22T08:00:13+00:00" }, { @@ -739,10 +487,6 @@ "test", "testing" ], - "support": { - "issues": "https://github.com/Brain-WP/BrainMonkey/issues", - "source": "https://github.com/Brain-WP/BrainMonkey" - }, "time": "2020-10-13T17:56:14+00:00" }, { @@ -809,10 +553,6 @@ "stylecheck", "tests" ], - "support": { - "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", - "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" - }, "time": "2020-12-07T18:04:37+00:00" }, { @@ -864,24 +604,6 @@ "constructor", "instantiate" ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.4.0" - }, - "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" }, { @@ -929,24 +651,20 @@ "keywords": [ "test" ], - "support": { - "issues": "https://github.com/hamcrest/hamcrest-php/issues", - "source": "https://github.com/hamcrest/hamcrest-php/tree/v2.0.1" - }, "time": "2020-07-09T08:09:16+00:00" }, { "name": "mockery/mockery", - "version": "1.3.4", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "31467aeb3ca3188158613322d66df81cedd86626" + "reference": "472fa8ca4e55483d55ee1e73c963718c4393791d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/31467aeb3ca3188158613322d66df81cedd86626", - "reference": "31467aeb3ca3188158613322d66df81cedd86626", + "url": "https://api.github.com/repos/mockery/mockery/zipball/472fa8ca4e55483d55ee1e73c963718c4393791d", + "reference": "472fa8ca4e55483d55ee1e73c963718c4393791d", "shasum": "" }, "require": { @@ -998,11 +716,7 @@ "test double", "testing" ], - "support": { - "issues": "https://github.com/mockery/mockery/issues", - "source": "https://github.com/mockery/mockery/tree/1.3.4" - }, - "time": "2021-02-24T09:51:00+00:00" + "time": "2021-09-13T15:33:03+00:00" }, { "name": "myclabs/deep-copy", @@ -1050,16 +764,6 @@ "object", "object graph" ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.10.2" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], "time": "2020-11-13T09:40:50+00:00" }, { @@ -1115,10 +819,6 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/master" - }, "time": "2018-07-08T19:23:20+00:00" }, { @@ -1166,10 +866,6 @@ } ], "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/master" - }, "time": "2018-07-08T19:19:57+00:00" }, { @@ -1228,10 +924,6 @@ "phpcs", "standards" ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, "time": "2019-12-27T09:44:58+00:00" }, { @@ -1284,10 +976,6 @@ "polyfill", "standards" ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" - }, "time": "2021-02-15T10:24:51+00:00" }, { @@ -1338,10 +1026,6 @@ "standards", "wordpress" ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" - }, "time": "2021-07-21T11:09:57+00:00" }, { @@ -1391,10 +1075,6 @@ "reflection", "static analysis" ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" - }, "time": "2020-04-27T09:25:28+00:00" }, { @@ -1447,10 +1127,6 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/4.x" - }, "time": "2019-12-28T18:55:12+00:00" }, { @@ -1498,10 +1174,6 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/0.7.2" - }, "time": "2019-08-22T18:11:29+00:00" }, { @@ -1565,10 +1237,6 @@ "spy", "stub" ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" - }, "time": "2020-03-05T15:02:03+00:00" }, { @@ -1632,10 +1300,6 @@ "testing", "xunit" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/master" - }, "time": "2018-10-31T16:06:48+00:00" }, { @@ -1686,16 +1350,6 @@ "filesystem", "iterator" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2021-07-19T06:46:01+00:00" }, { @@ -1737,10 +1391,6 @@ "keywords": [ "template" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -1790,16 +1440,6 @@ "keywords": [ "timer" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T08:20:02+00:00" }, { @@ -1849,16 +1489,6 @@ "keywords": [ "tokenizer" ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/3.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "abandoned": true, "time": "2021-07-26T12:15:06+00:00" }, @@ -1944,10 +1574,6 @@ "testing", "xunit" ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/7.5.20" - }, "time": "2020-01-08T08:45:45+00:00" }, { @@ -1993,16 +1619,6 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T08:15:22+00:00" }, { @@ -2067,16 +1683,6 @@ "compare", "equality" ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T08:04:30+00:00" }, { @@ -2133,16 +1739,6 @@ "unidiff", "unified diff" ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:59:04+00:00" }, { @@ -2196,16 +1792,6 @@ "environment", "hhvm" ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:53:42+00:00" }, { @@ -2273,16 +1859,6 @@ "export", "exporter" ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:47:53+00:00" }, { @@ -2334,10 +1910,6 @@ "keywords": [ "global state" ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" - }, "time": "2017-04-27T15:39:26+00:00" }, { @@ -2385,16 +1957,6 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:40:27+00:00" }, { @@ -2440,16 +2002,6 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:37:18+00:00" }, { @@ -2503,16 +2055,6 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:34:24+00:00" }, { @@ -2555,16 +2097,6 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], "time": "2020-11-30T07:30:19+00:00" }, { @@ -2608,10 +2140,6 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -2663,11 +2191,6 @@ "phpcs", "standards" ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, "time": "2021-04-09T00:54:41+00:00" }, { @@ -2730,23 +2253,6 @@ "polyfill", "portable" ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" - }, - "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-02-19T12:13:01+00:00" }, { @@ -2787,10 +2293,6 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/master" - }, "time": "2019-06-13T22:48:21+00:00" }, { @@ -2840,10 +2342,6 @@ "check", "validate" ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" - }, "time": "2020-07-08T17:02:28+00:00" }, { @@ -2884,10 +2382,6 @@ "woocommerce", "wordpress" ], - "support": { - "issues": "https://github.com/woocommerce/woocommerce-sniffs/issues", - "source": "https://github.com/woocommerce/woocommerce-sniffs/tree/0.1.1" - }, "time": "2021-07-29T17:25:16+00:00" }, { @@ -2934,11 +2428,6 @@ "standards", "wordpress" ], - "support": { - "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", - "source": "https://github.com/WordPress/WordPress-Coding-Standards", - "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" - }, "time": "2020-05-13T23:57:56+00:00" } ], @@ -2948,8 +2437,9 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { + "php": "^7.1 | ^8.0", "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.1.0" + "plugin-api-version": "1.1.0" } diff --git a/docker/Dockerfile_wp b/docker/Dockerfile_wp index 357ff2f1e..a698095d7 100644 --- a/docker/Dockerfile_wp +++ b/docker/Dockerfile_wp @@ -56,6 +56,7 @@ RUN apt-get install -y \ curl \ git \ yarn \ + ca-certificates \ # These are for extensions zlib1g-dev \ libicu-dev \ @@ -63,6 +64,9 @@ RUN apt-get install -y \ # For installing things from URL wget +# https://github.com/nodesource/distributions/issues/1266 +RUN update-ca-certificates + RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ php composer-setup.php --install-dir=/usr/bin --filename=composer --version=1.10.22 && \ php -r "unlink('composer-setup.php');" diff --git a/modules/ppcp-admin-notices/composer.json b/modules/ppcp-admin-notices/composer.json new file mode 100644 index 000000000..697ef0137 --- /dev/null +++ b/modules/ppcp-admin-notices/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-admin-notices", + "type": "dhii-mod", + "description": "Admin notices module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\AdminNotices\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-admin-notices/services.php b/modules/ppcp-admin-notices/services.php index 6dd3931fc..32dfe5357 100644 --- a/modules/ppcp-admin-notices/services.php +++ b/modules/ppcp-admin-notices/services.php @@ -9,19 +9,19 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\AdminNotices; -use Dhii\Data\Container\ContainerInterface; +use Psr\Container\ContainerInterface; use WooCommerce\PayPalCommerce\AdminNotices\Renderer\Renderer; use WooCommerce\PayPalCommerce\AdminNotices\Renderer\RendererInterface; use WooCommerce\PayPalCommerce\AdminNotices\Repository\Repository; use WooCommerce\PayPalCommerce\AdminNotices\Repository\RepositoryInterface; return array( - 'admin-notices.renderer' => static function ( $container ): RendererInterface { + 'admin-notices.renderer' => static function ( ContainerInterface $container ): RendererInterface { $repository = $container->get( 'admin-notices.repository' ); return new Renderer( $repository ); }, - 'admin-notices.repository' => static function ( $container ): RepositoryInterface { + 'admin-notices.repository' => static function ( ContainerInterface $container ): RepositoryInterface { return new Repository(); }, diff --git a/modules/ppcp-admin-notices/src/class-adminnotices.php b/modules/ppcp-admin-notices/src/AdminNotices.php similarity index 72% rename from modules/ppcp-admin-notices/src/class-adminnotices.php rename to modules/ppcp-admin-notices/src/AdminNotices.php index 686ae4db6..390d5742d 100644 --- a/modules/ppcp-admin-notices/src/class-adminnotices.php +++ b/modules/ppcp-admin-notices/src/AdminNotices.php @@ -20,9 +20,7 @@ use Psr\Container\ContainerInterface; class AdminNotices implements ModuleInterface { /** - * Sets up the module. - * - * @return ServiceProviderInterface + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( @@ -32,15 +30,13 @@ class AdminNotices implements ModuleInterface { } /** - * Runs the module. - * - * @param ContainerInterface $container The container. + * {@inheritDoc} */ - public function run( ContainerInterface $container ): void { + public function run( ContainerInterface $c ): void { add_action( 'admin_notices', - function() use ( $container ) { - $renderer = $container->get( 'admin-notices.renderer' ); + function() use ( $c ) { + $renderer = $c->get( 'admin-notices.renderer' ); $renderer->render(); } ); diff --git a/modules/ppcp-admin-notices/src/Entity/class-message.php b/modules/ppcp-admin-notices/src/Entity/Message.php similarity index 100% rename from modules/ppcp-admin-notices/src/Entity/class-message.php rename to modules/ppcp-admin-notices/src/Entity/Message.php diff --git a/modules/ppcp-admin-notices/src/Renderer/class-renderer.php b/modules/ppcp-admin-notices/src/Renderer/Renderer.php similarity index 100% rename from modules/ppcp-admin-notices/src/Renderer/class-renderer.php rename to modules/ppcp-admin-notices/src/Renderer/Renderer.php diff --git a/modules/ppcp-admin-notices/src/Renderer/class-rendererinterface.php b/modules/ppcp-admin-notices/src/Renderer/RendererInterface.php similarity index 100% rename from modules/ppcp-admin-notices/src/Renderer/class-rendererinterface.php rename to modules/ppcp-admin-notices/src/Renderer/RendererInterface.php diff --git a/modules/ppcp-admin-notices/src/Repository/class-repository.php b/modules/ppcp-admin-notices/src/Repository/Repository.php similarity index 100% rename from modules/ppcp-admin-notices/src/Repository/class-repository.php rename to modules/ppcp-admin-notices/src/Repository/Repository.php diff --git a/modules/ppcp-admin-notices/src/Repository/class-repositoryinterface.php b/modules/ppcp-admin-notices/src/Repository/RepositoryInterface.php similarity index 100% rename from modules/ppcp-admin-notices/src/Repository/class-repositoryinterface.php rename to modules/ppcp-admin-notices/src/Repository/RepositoryInterface.php diff --git a/modules/ppcp-api-client/composer.json b/modules/ppcp-api-client/composer.json new file mode 100644 index 000000000..faa4f3d9c --- /dev/null +++ b/modules/ppcp-api-client/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-api-client", + "type": "dhii-mod", + "description": "API client module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\ApiClient\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-api-client/services.php b/modules/ppcp-api-client/services.php index f5d140c90..060570793 100644 --- a/modules/ppcp-api-client/services.php +++ b/modules/ppcp-api-client/services.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\ApiClient; +use Psr\Container\ContainerInterface; use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer; use WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\IdentityToken; @@ -47,10 +48,10 @@ use WooCommerce\PayPalCommerce\ApiClient\Repository\PayPalRequestIdRepository; use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings; return array( - 'api.host' => function( $container ) : string { + 'api.host' => function( ContainerInterface $container ) : string { return PAYPAL_API_URL; }, - 'api.paypal-host' => function( $container ) : string { + 'api.paypal-host' => function( ContainerInterface $container ) : string { return PAYPAL_API_URL; }, 'api.partner_merchant_id' => static function () : string { @@ -71,7 +72,7 @@ return array( 'api.prefix' => static function (): string { return 'WC-'; }, - 'api.bearer' => static function ( $container ): Bearer { + 'api.bearer' => static function ( ContainerInterface $container ): Bearer { $cache = new Cache( 'ppcp-paypal-bearer' ); $key = $container->get( 'api.key' ); $secret = $container->get( 'api.secret' ); @@ -87,7 +88,7 @@ return array( $settings ); }, - 'api.endpoint.partners' => static function ( $container ) : PartnersEndpoint { + 'api.endpoint.partners' => static function ( ContainerInterface $container ) : PartnersEndpoint { return new PartnersEndpoint( $container->get( 'api.host' ), $container->get( 'api.bearer' ), @@ -97,10 +98,10 @@ return array( $container->get( 'api.merchant_id' ) ); }, - 'api.factory.sellerstatus' => static function ( $container ) : SellerStatusFactory { + 'api.factory.sellerstatus' => static function ( ContainerInterface $container ) : SellerStatusFactory { return new SellerStatusFactory(); }, - 'api.endpoint.payment-token' => static function ( $container ) : PaymentTokenEndpoint { + 'api.endpoint.payment-token' => static function ( ContainerInterface $container ) : PaymentTokenEndpoint { return new PaymentTokenEndpoint( $container->get( 'api.host' ), $container->get( 'api.bearer' ), @@ -109,7 +110,7 @@ return array( $container->get( 'api.prefix' ) ); }, - 'api.endpoint.webhook' => static function ( $container ) : WebhookEndpoint { + 'api.endpoint.webhook' => static function ( ContainerInterface $container ) : WebhookEndpoint { return new WebhookEndpoint( $container->get( 'api.host' ), @@ -119,7 +120,7 @@ return array( $container->get( 'woocommerce.logger.woocommerce' ) ); }, - 'api.endpoint.partner-referrals' => static function ( $container ) : PartnerReferrals { + 'api.endpoint.partner-referrals' => static function ( ContainerInterface $container ) : PartnerReferrals { return new PartnerReferrals( $container->get( 'api.host' ), @@ -128,7 +129,7 @@ return array( $container->get( 'woocommerce.logger.woocommerce' ) ); }, - 'api.endpoint.identity-token' => static function ( $container ) : IdentityToken { + 'api.endpoint.identity-token' => static function ( ContainerInterface $container ) : IdentityToken { $logger = $container->get( 'woocommerce.logger.woocommerce' ); $prefix = $container->get( 'api.prefix' ); @@ -139,7 +140,7 @@ return array( $prefix ); }, - 'api.endpoint.payments' => static function ( $container ): PaymentsEndpoint { + 'api.endpoint.payments' => static function ( ContainerInterface $container ): PaymentsEndpoint { $authorizations_factory = $container->get( 'api.factory.authorization' ); $capture_factory = $container->get( 'api.factory.capture' ); $logger = $container->get( 'woocommerce.logger.woocommerce' ); @@ -152,7 +153,7 @@ return array( $logger ); }, - 'api.endpoint.login-seller' => static function ( $container ) : LoginSeller { + 'api.endpoint.login-seller' => static function ( ContainerInterface $container ) : LoginSeller { $logger = $container->get( 'woocommerce.logger.woocommerce' ); return new LoginSeller( @@ -161,7 +162,7 @@ return array( $logger ); }, - 'api.endpoint.order' => static function ( $container ): OrderEndpoint { + 'api.endpoint.order' => static function ( ContainerInterface $container ): OrderEndpoint { $order_factory = $container->get( 'api.factory.order' ); $patch_collection_factory = $container->get( 'api.factory.patch-collection-factory' ); $logger = $container->get( 'woocommerce.logger.woocommerce' ); @@ -186,36 +187,36 @@ return array( $paypal_request_id ); }, - 'api.repository.paypal-request-id' => static function( $container ) : PayPalRequestIdRepository { + 'api.repository.paypal-request-id' => static function( ContainerInterface $container ) : PayPalRequestIdRepository { return new PayPalRequestIdRepository(); }, - 'api.repository.application-context' => static function( $container ) : ApplicationContextRepository { + 'api.repository.application-context' => static function( ContainerInterface $container ) : ApplicationContextRepository { $settings = $container->get( 'wcgateway.settings' ); return new ApplicationContextRepository( $settings ); }, - 'api.repository.partner-referrals-data' => static function ( $container ) : PartnerReferralsData { + 'api.repository.partner-referrals-data' => static function ( ContainerInterface $container ) : PartnerReferralsData { $merchant_email = $container->get( 'api.merchant_email' ); $dcc_applies = $container->get( 'api.helpers.dccapplies' ); return new PartnerReferralsData( $merchant_email, $dcc_applies ); }, - 'api.repository.cart' => static function ( $container ): CartRepository { + 'api.repository.cart' => static function ( ContainerInterface $container ): CartRepository { $factory = $container->get( 'api.factory.purchase-unit' ); return new CartRepository( $factory ); }, - 'api.repository.payee' => static function ( $container ): PayeeRepository { + 'api.repository.payee' => static function ( ContainerInterface $container ): PayeeRepository { $merchant_email = $container->get( 'api.merchant_email' ); $merchant_id = $container->get( 'api.merchant_id' ); return new PayeeRepository( $merchant_email, $merchant_id ); }, - 'api.factory.application-context' => static function ( $container ) : ApplicationContextFactory { + 'api.factory.application-context' => static function ( ContainerInterface $container ) : ApplicationContextFactory { return new ApplicationContextFactory(); }, - 'api.factory.payment-token' => static function ( $container ) : PaymentTokenFactory { + 'api.factory.payment-token' => static function ( ContainerInterface $container ) : PaymentTokenFactory { return new PaymentTokenFactory(); }, - 'api.factory.webhook' => static function ( $container ): WebhookFactory { + 'api.factory.webhook' => static function ( ContainerInterface $container ): WebhookFactory { return new WebhookFactory(); }, 'api.factory.webhook-event' => static function ( $container ): WebhookEventFactory { @@ -226,7 +227,7 @@ return array( $amount_factory = $container->get( 'api.factory.amount' ); return new CaptureFactory( $amount_factory ); }, - 'api.factory.purchase-unit' => static function ( $container ): PurchaseUnitFactory { + 'api.factory.purchase-unit' => static function ( ContainerInterface $container ): PurchaseUnitFactory { $amount_factory = $container->get( 'api.factory.amount' ); $payee_repository = $container->get( 'api.repository.payee' ); @@ -246,34 +247,34 @@ return array( $prefix ); }, - 'api.factory.patch-collection-factory' => static function ( $container ): PatchCollectionFactory { + 'api.factory.patch-collection-factory' => static function ( ContainerInterface $container ): PatchCollectionFactory { return new PatchCollectionFactory(); }, - 'api.factory.payee' => static function ( $container ): PayeeFactory { + 'api.factory.payee' => static function ( ContainerInterface $container ): PayeeFactory { return new PayeeFactory(); }, - 'api.factory.item' => static function ( $container ): ItemFactory { + 'api.factory.item' => static function ( ContainerInterface $container ): ItemFactory { return new ItemFactory(); }, - 'api.factory.shipping' => static function ( $container ): ShippingFactory { + 'api.factory.shipping' => static function ( ContainerInterface $container ): ShippingFactory { $address_factory = $container->get( 'api.factory.address' ); return new ShippingFactory( $address_factory ); }, - 'api.factory.amount' => static function ( $container ): AmountFactory { + 'api.factory.amount' => static function ( ContainerInterface $container ): AmountFactory { $item_factory = $container->get( 'api.factory.item' ); return new AmountFactory( $item_factory ); }, - 'api.factory.payer' => static function ( $container ): PayerFactory { + 'api.factory.payer' => static function ( ContainerInterface $container ): PayerFactory { $address_factory = $container->get( 'api.factory.address' ); return new PayerFactory( $address_factory ); }, - 'api.factory.address' => static function ( $container ): AddressFactory { + 'api.factory.address' => static function ( ContainerInterface $container ): AddressFactory { return new AddressFactory(); }, - 'api.factory.payment-source' => static function ( $container ): PaymentSourceFactory { + 'api.factory.payment-source' => static function ( ContainerInterface $container ): PaymentSourceFactory { return new PaymentSourceFactory(); }, - 'api.factory.order' => static function ( $container ): OrderFactory { + 'api.factory.order' => static function ( ContainerInterface $container ): OrderFactory { $purchase_unit_factory = $container->get( 'api.factory.purchase-unit' ); $payer_factory = $container->get( 'api.factory.payer' ); $application_context_repository = $container->get( 'api.repository.application-context' ); @@ -287,15 +288,15 @@ return array( $payment_source_factory ); }, - 'api.factory.payments' => static function ( $container ): PaymentsFactory { + 'api.factory.payments' => static function ( ContainerInterface $container ): PaymentsFactory { $authorizations_factory = $container->get( 'api.factory.authorization' ); $capture_factory = $container->get( 'api.factory.capture' ); return new PaymentsFactory( $authorizations_factory, $capture_factory ); }, - 'api.factory.authorization' => static function ( $container ): AuthorizationFactory { + 'api.factory.authorization' => static function ( ContainerInterface $container ): AuthorizationFactory { return new AuthorizationFactory(); }, - 'api.helpers.dccapplies' => static function ( $container ) : DccApplies { + 'api.helpers.dccapplies' => static function ( ContainerInterface $container ) : DccApplies { return new DccApplies(); }, ); diff --git a/modules/ppcp-api-client/src/class-apimodule.php b/modules/ppcp-api-client/src/ApiModule.php similarity index 81% rename from modules/ppcp-api-client/src/class-apimodule.php rename to modules/ppcp-api-client/src/ApiModule.php index bdc98924b..68ec588db 100644 --- a/modules/ppcp-api-client/src/class-apimodule.php +++ b/modules/ppcp-api-client/src/ApiModule.php @@ -20,9 +20,7 @@ use Psr\Container\ContainerInterface; class ApiModule implements ModuleInterface { /** - * Sets up the module. - * - * @return ServiceProviderInterface + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( @@ -32,11 +30,9 @@ class ApiModule implements ModuleInterface { } /** - * Runs the module. - * - * @param ContainerInterface $container The container. + * {@inheritDoc} */ - public function run( ContainerInterface $container ): void { + public function run( ContainerInterface $c ): void { add_action( 'woocommerce_after_calculate_totals', function ( \WC_Cart $cart ) { diff --git a/modules/ppcp-api-client/src/Authentication/class-bearer.php b/modules/ppcp-api-client/src/Authentication/Bearer.php similarity index 100% rename from modules/ppcp-api-client/src/Authentication/class-bearer.php rename to modules/ppcp-api-client/src/Authentication/Bearer.php diff --git a/modules/ppcp-api-client/src/Authentication/class-connectbearer.php b/modules/ppcp-api-client/src/Authentication/ConnectBearer.php similarity index 100% rename from modules/ppcp-api-client/src/Authentication/class-connectbearer.php rename to modules/ppcp-api-client/src/Authentication/ConnectBearer.php diff --git a/modules/ppcp-api-client/src/Authentication/class-paypalbearer.php b/modules/ppcp-api-client/src/Authentication/PayPalBearer.php similarity index 100% rename from modules/ppcp-api-client/src/Authentication/class-paypalbearer.php rename to modules/ppcp-api-client/src/Authentication/PayPalBearer.php diff --git a/modules/ppcp-api-client/src/Endpoint/class-identitytoken.php b/modules/ppcp-api-client/src/Endpoint/IdentityToken.php similarity index 100% rename from modules/ppcp-api-client/src/Endpoint/class-identitytoken.php rename to modules/ppcp-api-client/src/Endpoint/IdentityToken.php diff --git a/modules/ppcp-api-client/src/Endpoint/class-loginseller.php b/modules/ppcp-api-client/src/Endpoint/LoginSeller.php similarity index 100% rename from modules/ppcp-api-client/src/Endpoint/class-loginseller.php rename to modules/ppcp-api-client/src/Endpoint/LoginSeller.php diff --git a/modules/ppcp-api-client/src/Endpoint/class-orderendpoint.php b/modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php similarity index 100% rename from modules/ppcp-api-client/src/Endpoint/class-orderendpoint.php rename to modules/ppcp-api-client/src/Endpoint/OrderEndpoint.php diff --git a/modules/ppcp-api-client/src/Endpoint/class-partnerreferrals.php b/modules/ppcp-api-client/src/Endpoint/PartnerReferrals.php similarity index 100% rename from modules/ppcp-api-client/src/Endpoint/class-partnerreferrals.php rename to modules/ppcp-api-client/src/Endpoint/PartnerReferrals.php diff --git a/modules/ppcp-api-client/src/Endpoint/class-partnersendpoint.php b/modules/ppcp-api-client/src/Endpoint/PartnersEndpoint.php similarity index 100% rename from modules/ppcp-api-client/src/Endpoint/class-partnersendpoint.php rename to modules/ppcp-api-client/src/Endpoint/PartnersEndpoint.php diff --git a/modules/ppcp-api-client/src/Endpoint/class-paymenttokenendpoint.php b/modules/ppcp-api-client/src/Endpoint/PaymentTokenEndpoint.php similarity index 100% rename from modules/ppcp-api-client/src/Endpoint/class-paymenttokenendpoint.php rename to modules/ppcp-api-client/src/Endpoint/PaymentTokenEndpoint.php diff --git a/modules/ppcp-api-client/src/Endpoint/class-paymentsendpoint.php b/modules/ppcp-api-client/src/Endpoint/PaymentsEndpoint.php similarity index 99% rename from modules/ppcp-api-client/src/Endpoint/class-paymentsendpoint.php rename to modules/ppcp-api-client/src/Endpoint/PaymentsEndpoint.php index dc5f21743..d750cecf8 100644 --- a/modules/ppcp-api-client/src/Endpoint/class-paymentsendpoint.php +++ b/modules/ppcp-api-client/src/Endpoint/PaymentsEndpoint.php @@ -11,7 +11,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\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\Refund; use WooCommerce\PayPalCommerce\ApiClient\Exception\PayPalApiException; use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException; diff --git a/modules/ppcp-api-client/src/Endpoint/class-requesttrait.php b/modules/ppcp-api-client/src/Endpoint/RequestTrait.php similarity index 100% rename from modules/ppcp-api-client/src/Endpoint/class-requesttrait.php rename to modules/ppcp-api-client/src/Endpoint/RequestTrait.php diff --git a/modules/ppcp-api-client/src/Endpoint/class-webhookendpoint.php b/modules/ppcp-api-client/src/Endpoint/WebhookEndpoint.php similarity index 100% rename from modules/ppcp-api-client/src/Endpoint/class-webhookendpoint.php rename to modules/ppcp-api-client/src/Endpoint/WebhookEndpoint.php diff --git a/modules/ppcp-api-client/src/Entity/class-address.php b/modules/ppcp-api-client/src/Entity/Address.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-address.php rename to modules/ppcp-api-client/src/Entity/Address.php diff --git a/modules/ppcp-api-client/src/Entity/class-amount.php b/modules/ppcp-api-client/src/Entity/Amount.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-amount.php rename to modules/ppcp-api-client/src/Entity/Amount.php diff --git a/modules/ppcp-api-client/src/Entity/class-amountbreakdown.php b/modules/ppcp-api-client/src/Entity/AmountBreakdown.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-amountbreakdown.php rename to modules/ppcp-api-client/src/Entity/AmountBreakdown.php diff --git a/modules/ppcp-api-client/src/Entity/class-applicationcontext.php b/modules/ppcp-api-client/src/Entity/ApplicationContext.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-applicationcontext.php rename to modules/ppcp-api-client/src/Entity/ApplicationContext.php diff --git a/modules/ppcp-api-client/src/Entity/class-authorization.php b/modules/ppcp-api-client/src/Entity/Authorization.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-authorization.php rename to modules/ppcp-api-client/src/Entity/Authorization.php diff --git a/modules/ppcp-api-client/src/Entity/class-authorizationstatus.php b/modules/ppcp-api-client/src/Entity/AuthorizationStatus.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-authorizationstatus.php rename to modules/ppcp-api-client/src/Entity/AuthorizationStatus.php diff --git a/modules/ppcp-api-client/src/Entity/class-authorizationstatusdetails.php b/modules/ppcp-api-client/src/Entity/AuthorizationStatusDetails.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-authorizationstatusdetails.php rename to modules/ppcp-api-client/src/Entity/AuthorizationStatusDetails.php diff --git a/modules/ppcp-api-client/src/Entity/class-capture.php b/modules/ppcp-api-client/src/Entity/Capture.php similarity index 96% rename from modules/ppcp-api-client/src/Entity/class-capture.php rename to modules/ppcp-api-client/src/Entity/Capture.php index 4b4853add..c45f8351a 100644 --- a/modules/ppcp-api-client/src/Entity/class-capture.php +++ b/modules/ppcp-api-client/src/Entity/Capture.php @@ -4,12 +4,12 @@ * * @link https://developer.paypal.com/docs/api/orders/v2/#definition-capture * - * @package Woocommerce\PayPalCommerce\ApiClient\Entity + * @package WooCommerce\PayPalCommerce\ApiClient\Entity */ declare( strict_types=1 ); -namespace Woocommerce\PayPalCommerce\ApiClient\Entity; +namespace WooCommerce\PayPalCommerce\ApiClient\Entity; /** * Class Capture diff --git a/modules/ppcp-api-client/src/Entity/class-capturestatus.php b/modules/ppcp-api-client/src/Entity/CaptureStatus.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-capturestatus.php rename to modules/ppcp-api-client/src/Entity/CaptureStatus.php diff --git a/modules/ppcp-api-client/src/Entity/class-capturestatusdetails.php b/modules/ppcp-api-client/src/Entity/CaptureStatusDetails.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-capturestatusdetails.php rename to modules/ppcp-api-client/src/Entity/CaptureStatusDetails.php diff --git a/modules/ppcp-api-client/src/Entity/class-cardauthenticationresult.php b/modules/ppcp-api-client/src/Entity/CardAuthenticationResult.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-cardauthenticationresult.php rename to modules/ppcp-api-client/src/Entity/CardAuthenticationResult.php diff --git a/modules/ppcp-api-client/src/Entity/class-item.php b/modules/ppcp-api-client/src/Entity/Item.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-item.php rename to modules/ppcp-api-client/src/Entity/Item.php diff --git a/modules/ppcp-api-client/src/Entity/class-money.php b/modules/ppcp-api-client/src/Entity/Money.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-money.php rename to modules/ppcp-api-client/src/Entity/Money.php diff --git a/modules/ppcp-api-client/src/Entity/class-order.php b/modules/ppcp-api-client/src/Entity/Order.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-order.php rename to modules/ppcp-api-client/src/Entity/Order.php diff --git a/modules/ppcp-api-client/src/Entity/class-orderstatus.php b/modules/ppcp-api-client/src/Entity/OrderStatus.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-orderstatus.php rename to modules/ppcp-api-client/src/Entity/OrderStatus.php diff --git a/modules/ppcp-api-client/src/Entity/class-patch.php b/modules/ppcp-api-client/src/Entity/Patch.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-patch.php rename to modules/ppcp-api-client/src/Entity/Patch.php diff --git a/modules/ppcp-api-client/src/Entity/class-patchcollection.php b/modules/ppcp-api-client/src/Entity/PatchCollection.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-patchcollection.php rename to modules/ppcp-api-client/src/Entity/PatchCollection.php diff --git a/modules/ppcp-api-client/src/Entity/class-payee.php b/modules/ppcp-api-client/src/Entity/Payee.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-payee.php rename to modules/ppcp-api-client/src/Entity/Payee.php diff --git a/modules/ppcp-api-client/src/Entity/class-payer.php b/modules/ppcp-api-client/src/Entity/Payer.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-payer.php rename to modules/ppcp-api-client/src/Entity/Payer.php diff --git a/modules/ppcp-api-client/src/Entity/class-payername.php b/modules/ppcp-api-client/src/Entity/PayerName.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-payername.php rename to modules/ppcp-api-client/src/Entity/PayerName.php diff --git a/modules/ppcp-api-client/src/Entity/class-payertaxinfo.php b/modules/ppcp-api-client/src/Entity/PayerTaxInfo.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-payertaxinfo.php rename to modules/ppcp-api-client/src/Entity/PayerTaxInfo.php diff --git a/modules/ppcp-api-client/src/Entity/class-paymentmethod.php b/modules/ppcp-api-client/src/Entity/PaymentMethod.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-paymentmethod.php rename to modules/ppcp-api-client/src/Entity/PaymentMethod.php diff --git a/modules/ppcp-api-client/src/Entity/class-paymentsource.php b/modules/ppcp-api-client/src/Entity/PaymentSource.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-paymentsource.php rename to modules/ppcp-api-client/src/Entity/PaymentSource.php diff --git a/modules/ppcp-api-client/src/Entity/class-paymentsourcecard.php b/modules/ppcp-api-client/src/Entity/PaymentSourceCard.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-paymentsourcecard.php rename to modules/ppcp-api-client/src/Entity/PaymentSourceCard.php diff --git a/modules/ppcp-api-client/src/Entity/class-paymentsourcewallet.php b/modules/ppcp-api-client/src/Entity/PaymentSourceWallet.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-paymentsourcewallet.php rename to modules/ppcp-api-client/src/Entity/PaymentSourceWallet.php diff --git a/modules/ppcp-api-client/src/Entity/class-paymenttoken.php b/modules/ppcp-api-client/src/Entity/PaymentToken.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-paymenttoken.php rename to modules/ppcp-api-client/src/Entity/PaymentToken.php diff --git a/modules/ppcp-api-client/src/Entity/class-payments.php b/modules/ppcp-api-client/src/Entity/Payments.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-payments.php rename to modules/ppcp-api-client/src/Entity/Payments.php diff --git a/modules/ppcp-api-client/src/Entity/class-phone.php b/modules/ppcp-api-client/src/Entity/Phone.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-phone.php rename to modules/ppcp-api-client/src/Entity/Phone.php diff --git a/modules/ppcp-api-client/src/Entity/class-phonewithtype.php b/modules/ppcp-api-client/src/Entity/PhoneWithType.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-phonewithtype.php rename to modules/ppcp-api-client/src/Entity/PhoneWithType.php diff --git a/modules/ppcp-api-client/src/Entity/class-purchaseunit.php b/modules/ppcp-api-client/src/Entity/PurchaseUnit.php similarity index 98% rename from modules/ppcp-api-client/src/Entity/class-purchaseunit.php rename to modules/ppcp-api-client/src/Entity/PurchaseUnit.php index 0ef21455b..770ca0d38 100644 --- a/modules/ppcp-api-client/src/Entity/class-purchaseunit.php +++ b/modules/ppcp-api-client/src/Entity/PurchaseUnit.php @@ -317,8 +317,8 @@ class PurchaseUnit { } } - $fee_items_total = round( $fee_items_total, 2 ); - $fee_tax_total = round( $fee_tax_total, 2 ); + $fee_items_total = round( (float) $fee_items_total, 2 ); + $fee_tax_total = round( (float) $fee_tax_total, 2 ); if ( 0.0 !== $fee_items_total || 0.0 !== $fee_tax_total ) { return true; diff --git a/modules/ppcp-api-client/src/Entity/class-refund.php b/modules/ppcp-api-client/src/Entity/Refund.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-refund.php rename to modules/ppcp-api-client/src/Entity/Refund.php diff --git a/modules/ppcp-api-client/src/Entity/class-sellerstatus.php b/modules/ppcp-api-client/src/Entity/SellerStatus.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-sellerstatus.php rename to modules/ppcp-api-client/src/Entity/SellerStatus.php diff --git a/modules/ppcp-api-client/src/Entity/class-sellerstatusproduct.php b/modules/ppcp-api-client/src/Entity/SellerStatusProduct.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-sellerstatusproduct.php rename to modules/ppcp-api-client/src/Entity/SellerStatusProduct.php diff --git a/modules/ppcp-api-client/src/Entity/class-shipping.php b/modules/ppcp-api-client/src/Entity/Shipping.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-shipping.php rename to modules/ppcp-api-client/src/Entity/Shipping.php diff --git a/modules/ppcp-api-client/src/Entity/class-token.php b/modules/ppcp-api-client/src/Entity/Token.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-token.php rename to modules/ppcp-api-client/src/Entity/Token.php diff --git a/modules/ppcp-api-client/src/Entity/class-webhook.php b/modules/ppcp-api-client/src/Entity/Webhook.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-webhook.php rename to modules/ppcp-api-client/src/Entity/Webhook.php diff --git a/modules/ppcp-api-client/src/Entity/class-webhookevent.php b/modules/ppcp-api-client/src/Entity/WebhookEvent.php similarity index 100% rename from modules/ppcp-api-client/src/Entity/class-webhookevent.php rename to modules/ppcp-api-client/src/Entity/WebhookEvent.php diff --git a/modules/ppcp-api-client/src/Exception/class-notfoundexception.php b/modules/ppcp-api-client/src/Exception/NotFoundException.php similarity index 100% rename from modules/ppcp-api-client/src/Exception/class-notfoundexception.php rename to modules/ppcp-api-client/src/Exception/NotFoundException.php diff --git a/modules/ppcp-api-client/src/Exception/class-paypalapiexception.php b/modules/ppcp-api-client/src/Exception/PayPalApiException.php similarity index 100% rename from modules/ppcp-api-client/src/Exception/class-paypalapiexception.php rename to modules/ppcp-api-client/src/Exception/PayPalApiException.php diff --git a/modules/ppcp-api-client/src/Exception/class-runtimeexception.php b/modules/ppcp-api-client/src/Exception/RuntimeException.php similarity index 100% rename from modules/ppcp-api-client/src/Exception/class-runtimeexception.php rename to modules/ppcp-api-client/src/Exception/RuntimeException.php diff --git a/modules/ppcp-api-client/src/Factory/class-addressfactory.php b/modules/ppcp-api-client/src/Factory/AddressFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-addressfactory.php rename to modules/ppcp-api-client/src/Factory/AddressFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-amountfactory.php b/modules/ppcp-api-client/src/Factory/AmountFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-amountfactory.php rename to modules/ppcp-api-client/src/Factory/AmountFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-applicationcontextfactory.php b/modules/ppcp-api-client/src/Factory/ApplicationContextFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-applicationcontextfactory.php rename to modules/ppcp-api-client/src/Factory/ApplicationContextFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-authorizationfactory.php b/modules/ppcp-api-client/src/Factory/AuthorizationFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-authorizationfactory.php rename to modules/ppcp-api-client/src/Factory/AuthorizationFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-capturefactory.php b/modules/ppcp-api-client/src/Factory/CaptureFactory.php similarity index 95% rename from modules/ppcp-api-client/src/Factory/class-capturefactory.php rename to modules/ppcp-api-client/src/Factory/CaptureFactory.php index ec0309014..beee6753a 100644 --- a/modules/ppcp-api-client/src/Factory/class-capturefactory.php +++ b/modules/ppcp-api-client/src/Factory/CaptureFactory.php @@ -9,7 +9,7 @@ declare( strict_types=1 ); namespace WooCommerce\PayPalCommerce\ApiClient\Factory; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\CaptureStatus; use WooCommerce\PayPalCommerce\ApiClient\Entity\CaptureStatusDetails; diff --git a/modules/ppcp-api-client/src/Factory/class-itemfactory.php b/modules/ppcp-api-client/src/Factory/ItemFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-itemfactory.php rename to modules/ppcp-api-client/src/Factory/ItemFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-orderfactory.php b/modules/ppcp-api-client/src/Factory/OrderFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-orderfactory.php rename to modules/ppcp-api-client/src/Factory/OrderFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-patchcollectionfactory.php b/modules/ppcp-api-client/src/Factory/PatchCollectionFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-patchcollectionfactory.php rename to modules/ppcp-api-client/src/Factory/PatchCollectionFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-payeefactory.php b/modules/ppcp-api-client/src/Factory/PayeeFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-payeefactory.php rename to modules/ppcp-api-client/src/Factory/PayeeFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-payerfactory.php b/modules/ppcp-api-client/src/Factory/PayerFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-payerfactory.php rename to modules/ppcp-api-client/src/Factory/PayerFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-paymentsourcefactory.php b/modules/ppcp-api-client/src/Factory/PaymentSourceFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-paymentsourcefactory.php rename to modules/ppcp-api-client/src/Factory/PaymentSourceFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-paymenttokenfactory.php b/modules/ppcp-api-client/src/Factory/PaymentTokenFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-paymenttokenfactory.php rename to modules/ppcp-api-client/src/Factory/PaymentTokenFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-paymentsfactory.php b/modules/ppcp-api-client/src/Factory/PaymentsFactory.php similarity index 96% rename from modules/ppcp-api-client/src/Factory/class-paymentsfactory.php rename to modules/ppcp-api-client/src/Factory/PaymentsFactory.php index 353c71f44..81f99e53f 100644 --- a/modules/ppcp-api-client/src/Factory/class-paymentsfactory.php +++ b/modules/ppcp-api-client/src/Factory/PaymentsFactory.php @@ -10,7 +10,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\ApiClient\Factory; use WooCommerce\PayPalCommerce\ApiClient\Entity\Authorization; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\Payments; /** diff --git a/modules/ppcp-api-client/src/Factory/class-purchaseunitfactory.php b/modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-purchaseunitfactory.php rename to modules/ppcp-api-client/src/Factory/PurchaseUnitFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-sellerstatusfactory.php b/modules/ppcp-api-client/src/Factory/SellerStatusFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-sellerstatusfactory.php rename to modules/ppcp-api-client/src/Factory/SellerStatusFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-shippingfactory.php b/modules/ppcp-api-client/src/Factory/ShippingFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-shippingfactory.php rename to modules/ppcp-api-client/src/Factory/ShippingFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-webhookeventfactory.php b/modules/ppcp-api-client/src/Factory/WebhookEventFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-webhookeventfactory.php rename to modules/ppcp-api-client/src/Factory/WebhookEventFactory.php diff --git a/modules/ppcp-api-client/src/Factory/class-webhookfactory.php b/modules/ppcp-api-client/src/Factory/WebhookFactory.php similarity index 100% rename from modules/ppcp-api-client/src/Factory/class-webhookfactory.php rename to modules/ppcp-api-client/src/Factory/WebhookFactory.php diff --git a/modules/ppcp-api-client/src/Helper/class-cache.php b/modules/ppcp-api-client/src/Helper/Cache.php similarity index 100% rename from modules/ppcp-api-client/src/Helper/class-cache.php rename to modules/ppcp-api-client/src/Helper/Cache.php diff --git a/modules/ppcp-api-client/src/Helper/class-dccapplies.php b/modules/ppcp-api-client/src/Helper/DccApplies.php similarity index 100% rename from modules/ppcp-api-client/src/Helper/class-dccapplies.php rename to modules/ppcp-api-client/src/Helper/DccApplies.php diff --git a/modules/ppcp-api-client/src/Helper/class-errorresponse.php b/modules/ppcp-api-client/src/Helper/ErrorResponse.php similarity index 100% rename from modules/ppcp-api-client/src/Helper/class-errorresponse.php rename to modules/ppcp-api-client/src/Helper/ErrorResponse.php diff --git a/modules/ppcp-api-client/src/Repository/class-applicationcontextrepository.php b/modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php similarity index 100% rename from modules/ppcp-api-client/src/Repository/class-applicationcontextrepository.php rename to modules/ppcp-api-client/src/Repository/ApplicationContextRepository.php diff --git a/modules/ppcp-api-client/src/Repository/class-cartrepository.php b/modules/ppcp-api-client/src/Repository/CartRepository.php similarity index 100% rename from modules/ppcp-api-client/src/Repository/class-cartrepository.php rename to modules/ppcp-api-client/src/Repository/CartRepository.php diff --git a/modules/ppcp-api-client/src/Repository/class-partnerreferralsdata.php b/modules/ppcp-api-client/src/Repository/PartnerReferralsData.php similarity index 100% rename from modules/ppcp-api-client/src/Repository/class-partnerreferralsdata.php rename to modules/ppcp-api-client/src/Repository/PartnerReferralsData.php diff --git a/modules/ppcp-api-client/src/Repository/class-paypalrequestidrepository.php b/modules/ppcp-api-client/src/Repository/PayPalRequestIdRepository.php similarity index 100% rename from modules/ppcp-api-client/src/Repository/class-paypalrequestidrepository.php rename to modules/ppcp-api-client/src/Repository/PayPalRequestIdRepository.php diff --git a/modules/ppcp-api-client/src/Repository/class-payeerepository.php b/modules/ppcp-api-client/src/Repository/PayeeRepository.php similarity index 100% rename from modules/ppcp-api-client/src/Repository/class-payeerepository.php rename to modules/ppcp-api-client/src/Repository/PayeeRepository.php diff --git a/modules/ppcp-api-client/src/Repository/class-purchaseunitrepositoryinterface.php b/modules/ppcp-api-client/src/Repository/PurchaseUnitRepositoryInterface.php similarity index 100% rename from modules/ppcp-api-client/src/Repository/class-purchaseunitrepositoryinterface.php rename to modules/ppcp-api-client/src/Repository/PurchaseUnitRepositoryInterface.php diff --git a/modules/ppcp-button/composer.json b/modules/ppcp-button/composer.json new file mode 100644 index 000000000..0d818629d --- /dev/null +++ b/modules/ppcp-button/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-button", + "type": "dhii-mod", + "description": "Button module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\Button\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-button/services.php b/modules/ppcp-button/services.php index 737a5032c..6aa8c35a3 100644 --- a/modules/ppcp-button/services.php +++ b/modules/ppcp-button/services.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Button; +use Psr\Container\ContainerInterface; use WooCommerce\PayPalCommerce\Button\Assets\DisabledSmartButton; use WooCommerce\PayPalCommerce\Button\Assets\SmartButton; use WooCommerce\PayPalCommerce\Button\Assets\SmartButtonInterface; @@ -25,7 +26,7 @@ use WooCommerce\PayPalCommerce\Onboarding\Environment; use WooCommerce\PayPalCommerce\Onboarding\State; return array( - 'button.client_id' => static function ( $container ): string { + 'button.client_id' => static function ( ContainerInterface $container ): string { $settings = $container->get( 'wcgateway.settings' ); $client_id = $settings->has( 'client_id' ) ? $settings->get( 'client_id' ) : ''; @@ -43,7 +44,7 @@ return array( return $env->current_environment_is( Environment::SANDBOX ) ? CONNECT_WOO_SANDBOX_CLIENT_ID : CONNECT_WOO_CLIENT_ID; }, - 'button.smart-button' => static function ( $container ): SmartButtonInterface { + 'button.smart-button' => static function ( ContainerInterface $container ): SmartButtonInterface { $state = $container->get( 'onboarding.state' ); /** @@ -84,16 +85,16 @@ return array( $settings_status ); }, - 'button.url' => static function ( $container ): string { + 'button.url' => static function ( ContainerInterface $container ): string { return plugins_url( '/modules/ppcp-button/', dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php' ); }, - 'button.request-data' => static function ( $container ): RequestData { + 'button.request-data' => static function ( ContainerInterface $container ): RequestData { return new RequestData(); }, - 'button.endpoint.change-cart' => static function ( $container ): ChangeCartEndpoint { + 'button.endpoint.change-cart' => static function ( ContainerInterface $container ): ChangeCartEndpoint { if ( ! \WC()->cart ) { throw new RuntimeException( 'cant initialize endpoint at this moment' ); } @@ -105,7 +106,7 @@ return array( $logger = $container->get( 'woocommerce.logger.woocommerce' ); return new ChangeCartEndpoint( $cart, $shipping, $request_data, $repository, $data_store, $logger ); }, - 'button.endpoint.create-order' => static function ( $container ): CreateOrderEndpoint { + 'button.endpoint.create-order' => static function ( ContainerInterface $container ): CreateOrderEndpoint { $request_data = $container->get( 'button.request-data' ); $cart_repository = $container->get( 'api.repository.cart' ); $purchase_unit_factory = $container->get( 'api.factory.purchase-unit' ); @@ -127,7 +128,7 @@ return array( $logger ); }, - 'button.helper.early-order-handler' => static function ( $container ) : EarlyOrderHandler { + 'button.helper.early-order-handler' => static function ( ContainerInterface $container ) : EarlyOrderHandler { $state = $container->get( 'onboarding.state' ); $order_processor = $container->get( 'wcgateway.order-processor' ); @@ -135,7 +136,7 @@ return array( $prefix = $container->get( 'api.prefix' ); return new EarlyOrderHandler( $state, $order_processor, $session_handler, $prefix ); }, - 'button.endpoint.approve-order' => static function ( $container ): ApproveOrderEndpoint { + 'button.endpoint.approve-order' => static function ( ContainerInterface $container ): ApproveOrderEndpoint { $request_data = $container->get( 'button.request-data' ); $order_endpoint = $container->get( 'api.endpoint.order' ); $session_handler = $container->get( 'session.handler' ); @@ -153,7 +154,7 @@ return array( $logger ); }, - 'button.endpoint.data-client-id' => static function( $container ) : DataClientIdEndpoint { + 'button.endpoint.data-client-id' => static function( ContainerInterface $container ) : DataClientIdEndpoint { $request_data = $container->get( 'button.request-data' ); $identity_token = $container->get( 'api.endpoint.identity-token' ); $logger = $container->get( 'woocommerce.logger.woocommerce' ); @@ -163,11 +164,11 @@ return array( $logger ); }, - 'button.helper.three-d-secure' => static function ( $container ): ThreeDSecure { + 'button.helper.three-d-secure' => static function ( ContainerInterface $container ): ThreeDSecure { $logger = $container->get( 'woocommerce.logger.woocommerce' ); return new ThreeDSecure( $logger ); }, - 'button.helper.messages-apply' => static function ( $container ): MessagesApply { + 'button.helper.messages-apply' => static function ( ContainerInterface $container ): MessagesApply { return new MessagesApply(); }, ); diff --git a/modules/ppcp-button/src/Assets/class-disabledsmartbutton.php b/modules/ppcp-button/src/Assets/DisabledSmartButton.php similarity index 100% rename from modules/ppcp-button/src/Assets/class-disabledsmartbutton.php rename to modules/ppcp-button/src/Assets/DisabledSmartButton.php diff --git a/modules/ppcp-button/src/Assets/class-smartbutton.php b/modules/ppcp-button/src/Assets/SmartButton.php similarity index 99% rename from modules/ppcp-button/src/Assets/class-smartbutton.php rename to modules/ppcp-button/src/Assets/SmartButton.php index c9ebc52fc..b9a4d25d7 100644 --- a/modules/ppcp-button/src/Assets/class-smartbutton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -22,7 +22,7 @@ use WooCommerce\PayPalCommerce\Session\SessionHandler; use WooCommerce\PayPalCommerce\Subscription\Helper\SubscriptionHelper; use WooCommerce\PayPalCommerce\Vaulting\PaymentTokenRepository; use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway; -use Woocommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; +use WooCommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings; /** diff --git a/modules/ppcp-button/src/Assets/class-smartbuttoninterface.php b/modules/ppcp-button/src/Assets/SmartButtonInterface.php similarity index 100% rename from modules/ppcp-button/src/Assets/class-smartbuttoninterface.php rename to modules/ppcp-button/src/Assets/SmartButtonInterface.php diff --git a/modules/ppcp-button/src/class-buttonmodule.php b/modules/ppcp-button/src/ButtonModule.php similarity index 84% rename from modules/ppcp-button/src/class-buttonmodule.php rename to modules/ppcp-button/src/ButtonModule.php index 659183db8..8ecc2d871 100644 --- a/modules/ppcp-button/src/class-buttonmodule.php +++ b/modules/ppcp-button/src/ButtonModule.php @@ -27,9 +27,7 @@ class ButtonModule implements ModuleInterface { /** - * Sets up the module. - * - * @return ServiceProviderInterface + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( @@ -39,19 +37,17 @@ class ButtonModule implements ModuleInterface { } /** - * Runs the module. - * - * @param ContainerInterface|null $container The Container. + * {@inheritDoc} */ - public function run( ContainerInterface $container ): void { + public function run( ContainerInterface $c ): void { add_action( 'wp', - static function () use ( $container ) { + static function () use ( $c ) { if ( is_admin() ) { return; } - $smart_button = $container->get( 'button.smart-button' ); + $smart_button = $c->get( 'button.smart-button' ); /** * The Smart Button. * @@ -62,9 +58,9 @@ class ButtonModule implements ModuleInterface { ); add_action( 'wp_enqueue_scripts', - static function () use ( $container ) { + static function () use ( $c ) { - $smart_button = $container->get( 'button.smart-button' ); + $smart_button = $c->get( 'button.smart-button' ); /** * The Smart Button. * @@ -76,8 +72,8 @@ class ButtonModule implements ModuleInterface { add_filter( 'woocommerce_create_order', - static function ( $value ) use ( $container ) { - $early_order_handler = $container->get( 'button.helper.early-order-handler' ); + static function ( $value ) use ( $c ) { + $early_order_handler = $c->get( 'button.helper.early-order-handler' ); if ( ! is_null( $value ) ) { $value = (int) $value; } @@ -90,7 +86,7 @@ class ButtonModule implements ModuleInterface { } ); - $this->register_ajax_endpoints( $container ); + $this->register_ajax_endpoints( $c ); } /** diff --git a/modules/ppcp-button/src/Endpoint/class-approveorderendpoint.php b/modules/ppcp-button/src/Endpoint/ApproveOrderEndpoint.php similarity index 100% rename from modules/ppcp-button/src/Endpoint/class-approveorderendpoint.php rename to modules/ppcp-button/src/Endpoint/ApproveOrderEndpoint.php diff --git a/modules/ppcp-button/src/Endpoint/class-changecartendpoint.php b/modules/ppcp-button/src/Endpoint/ChangeCartEndpoint.php similarity index 100% rename from modules/ppcp-button/src/Endpoint/class-changecartendpoint.php rename to modules/ppcp-button/src/Endpoint/ChangeCartEndpoint.php diff --git a/modules/ppcp-button/src/Endpoint/class-createorderendpoint.php b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php similarity index 96% rename from modules/ppcp-button/src/Endpoint/class-createorderendpoint.php rename to modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php index 60f11ca77..223623ad7 100644 --- a/modules/ppcp-button/src/Endpoint/class-createorderendpoint.php +++ b/modules/ppcp-button/src/Endpoint/CreateOrderEndpoint.php @@ -362,17 +362,8 @@ class CreateOrderEndpoint implements EndpointInterface { * @throws Exception On Error. */ private function process_checkout_form( string $form_values ) { - $form_values = explode( '&', $form_values ); + parse_str( $form_values, $parsed_values ); - $parsed_values = array(); - foreach ( $form_values as $field ) { - $field = explode( '=', $field ); - - if ( count( $field ) !== 2 ) { - continue; - } - $parsed_values[ $field[0] ] = $field[1]; - } $_POST = $parsed_values; $_REQUEST = $parsed_values; @@ -412,16 +403,8 @@ class CreateOrderEndpoint implements EndpointInterface { * @throws Exception On Error. */ private function process_checkout_form_when_creating_account( string $form_values, \WC_Order $wc_order = null ) { - $form_values = explode( '&', $form_values ); - $parsed_values = array(); - foreach ( $form_values as $field ) { - $field = explode( '=', $field ); + parse_str( $form_values, $parsed_values ); - if ( count( $field ) !== 2 ) { - continue; - } - $parsed_values[ $field[0] ] = $field[1]; - } $_POST = $parsed_values; $_REQUEST = $parsed_values; diff --git a/modules/ppcp-button/src/Endpoint/class-dataclientidendpoint.php b/modules/ppcp-button/src/Endpoint/DataClientIdEndpoint.php similarity index 100% rename from modules/ppcp-button/src/Endpoint/class-dataclientidendpoint.php rename to modules/ppcp-button/src/Endpoint/DataClientIdEndpoint.php diff --git a/modules/ppcp-button/src/Endpoint/class-endpointinterface.php b/modules/ppcp-button/src/Endpoint/EndpointInterface.php similarity index 100% rename from modules/ppcp-button/src/Endpoint/class-endpointinterface.php rename to modules/ppcp-button/src/Endpoint/EndpointInterface.php diff --git a/modules/ppcp-button/src/Endpoint/class-requestdata.php b/modules/ppcp-button/src/Endpoint/RequestData.php similarity index 100% rename from modules/ppcp-button/src/Endpoint/class-requestdata.php rename to modules/ppcp-button/src/Endpoint/RequestData.php diff --git a/modules/ppcp-button/src/Exception/class-runtimeexception.php b/modules/ppcp-button/src/Exception/RuntimeException.php similarity index 100% rename from modules/ppcp-button/src/Exception/class-runtimeexception.php rename to modules/ppcp-button/src/Exception/RuntimeException.php diff --git a/modules/ppcp-button/src/Helper/class-earlyorderhandler.php b/modules/ppcp-button/src/Helper/EarlyOrderHandler.php similarity index 100% rename from modules/ppcp-button/src/Helper/class-earlyorderhandler.php rename to modules/ppcp-button/src/Helper/EarlyOrderHandler.php diff --git a/modules/ppcp-button/src/Helper/class-messagesapply.php b/modules/ppcp-button/src/Helper/MessagesApply.php similarity index 100% rename from modules/ppcp-button/src/Helper/class-messagesapply.php rename to modules/ppcp-button/src/Helper/MessagesApply.php diff --git a/modules/ppcp-button/src/Helper/class-messagesdisclaimers.php b/modules/ppcp-button/src/Helper/MessagesDisclaimers.php similarity index 100% rename from modules/ppcp-button/src/Helper/class-messagesdisclaimers.php rename to modules/ppcp-button/src/Helper/MessagesDisclaimers.php diff --git a/modules/ppcp-button/src/Helper/class-threedsecure.php b/modules/ppcp-button/src/Helper/ThreeDSecure.php similarity index 100% rename from modules/ppcp-button/src/Helper/class-threedsecure.php rename to modules/ppcp-button/src/Helper/ThreeDSecure.php diff --git a/modules/ppcp-compat/composer.json b/modules/ppcp-compat/composer.json new file mode 100644 index 000000000..50084eaf9 --- /dev/null +++ b/modules/ppcp-compat/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-compat", + "type": "dhii-mod", + "description": "Compatibility module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\Compat\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-compat/src/class-compatmodule.php b/modules/ppcp-compat/src/CompatModule.php similarity index 90% rename from modules/ppcp-compat/src/class-compatmodule.php rename to modules/ppcp-compat/src/CompatModule.php index 17102b297..34429215c 100644 --- a/modules/ppcp-compat/src/class-compatmodule.php +++ b/modules/ppcp-compat/src/CompatModule.php @@ -35,10 +35,10 @@ class CompatModule implements ModuleInterface { /** * Run the compatibility module. * - * @param ContainerInterface|null $container The Container. + * @param ContainerInterface|null $c The Container. */ - public function run( ContainerInterface $container ): void { - $this->initialize_ppec_compat_layer( $container ); + public function run( ContainerInterface $c ): void { + $this->initialize_ppec_compat_layer( $c ); } /** diff --git a/modules/ppcp-compat/src/PPEC/class-deactivatenote.php b/modules/ppcp-compat/src/PPEC/DeactivateNote.php similarity index 100% rename from modules/ppcp-compat/src/PPEC/class-deactivatenote.php rename to modules/ppcp-compat/src/PPEC/DeactivateNote.php diff --git a/modules/ppcp-compat/src/PPEC/class-mockgateway.php b/modules/ppcp-compat/src/PPEC/MockGateway.php similarity index 100% rename from modules/ppcp-compat/src/PPEC/class-mockgateway.php rename to modules/ppcp-compat/src/PPEC/MockGateway.php diff --git a/modules/ppcp-compat/src/PPEC/class-ppechelper.php b/modules/ppcp-compat/src/PPEC/PPECHelper.php similarity index 100% rename from modules/ppcp-compat/src/PPEC/class-ppechelper.php rename to modules/ppcp-compat/src/PPEC/PPECHelper.php diff --git a/modules/ppcp-compat/src/PPEC/class-settingsimporter.php b/modules/ppcp-compat/src/PPEC/SettingsImporter.php similarity index 100% rename from modules/ppcp-compat/src/PPEC/class-settingsimporter.php rename to modules/ppcp-compat/src/PPEC/SettingsImporter.php diff --git a/modules/ppcp-compat/src/PPEC/class-subscriptionshandler.php b/modules/ppcp-compat/src/PPEC/SubscriptionsHandler.php similarity index 100% rename from modules/ppcp-compat/src/PPEC/class-subscriptionshandler.php rename to modules/ppcp-compat/src/PPEC/SubscriptionsHandler.php diff --git a/modules/ppcp-onboarding/composer.json b/modules/ppcp-onboarding/composer.json new file mode 100644 index 000000000..a063dc01d --- /dev/null +++ b/modules/ppcp-onboarding/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-onboarding", + "type": "dhii-mod", + "description": "Onboarding module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\Onboarding\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-onboarding/services.php b/modules/ppcp-onboarding/services.php index 3fe8b689a..de6de7d3a 100644 --- a/modules/ppcp-onboarding/services.php +++ b/modules/ppcp-onboarding/services.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Onboarding; +use Psr\Container\ContainerInterface; use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer; use WooCommerce\PayPalCommerce\ApiClient\Authentication\ConnectBearer; use WooCommerce\PayPalCommerce\ApiClient\Authentication\PayPalBearer; @@ -18,10 +19,10 @@ use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache; use WooCommerce\PayPalCommerce\Onboarding\Assets\OnboardingAssets; use WooCommerce\PayPalCommerce\Onboarding\Endpoint\LoginSellerEndpoint; use WooCommerce\PayPalCommerce\Onboarding\Render\OnboardingRenderer; -use WooCommerce\PayPalCommerce\Onboarding\Onboarding_REST_Controller; +use WooCommerce\PayPalCommerce\Onboarding\OnboardingRESTController; return array( - 'api.sandbox-host' => static function ( $container ): string { + 'api.sandbox-host' => static function ( ContainerInterface $container ): string { $state = $container->get( 'onboarding.state' ); @@ -35,7 +36,7 @@ return array( } return CONNECT_WOO_SANDBOX_URL; }, - 'api.production-host' => static function ( $container ): string { + 'api.production-host' => static function ( ContainerInterface $container ): string { $state = $container->get( 'onboarding.state' ); @@ -50,7 +51,7 @@ return array( } return CONNECT_WOO_URL; }, - 'api.host' => static function ( $container ): string { + 'api.host' => static function ( ContainerInterface $container ): string { $environment = $container->get( 'onboarding.environment' ); /** @@ -62,19 +63,19 @@ return array( ? (string) $container->get( 'api.sandbox-host' ) : (string) $container->get( 'api.production-host' ); }, - 'api.paypal-host-production' => static function( $container ) : string { + 'api.paypal-host-production' => static function( ContainerInterface $container ) : string { return PAYPAL_API_URL; }, - 'api.paypal-host-sandbox' => static function( $container ) : string { + 'api.paypal-host-sandbox' => static function( ContainerInterface $container ) : string { return PAYPAL_SANDBOX_API_URL; }, - 'api.partner_merchant_id-production' => static function( $container ) : string { + 'api.partner_merchant_id-production' => static function( ContainerInterface $container ) : string { return CONNECT_WOO_MERCHANT_ID; }, - 'api.partner_merchant_id-sandbox' => static function( $container ) : string { + 'api.partner_merchant_id-sandbox' => static function( ContainerInterface $container ) : string { return CONNECT_WOO_SANDBOX_MERCHANT_ID; }, - 'api.paypal-host' => function( $container ) : string { + 'api.paypal-host' => function( ContainerInterface $container ) : string { $environment = $container->get( 'onboarding.environment' ); /** * The current environment. @@ -88,7 +89,7 @@ return array( }, - 'api.bearer' => static function ( $container ): Bearer { + 'api.bearer' => static function ( ContainerInterface $container ): Bearer { $state = $container->get( 'onboarding.state' ); @@ -115,17 +116,17 @@ return array( $settings ); }, - 'onboarding.state' => function( $container ) : State { + 'onboarding.state' => function( ContainerInterface $container ) : State { $environment = $container->get( 'onboarding.environment' ); $settings = $container->get( 'wcgateway.settings' ); return new State( $environment, $settings ); }, - 'onboarding.environment' => function( $container ) : Environment { + 'onboarding.environment' => function( ContainerInterface $container ) : Environment { $settings = $container->get( 'wcgateway.settings' ); return new Environment( $settings ); }, - 'onboarding.assets' => function( $container ) : OnboardingAssets { + 'onboarding.assets' => function( ContainerInterface $container ) : OnboardingAssets { $state = $container->get( 'onboarding.state' ); $login_seller_endpoint = $container->get( 'onboarding.endpoint.login-seller' ); return new OnboardingAssets( @@ -135,14 +136,14 @@ return array( ); }, - 'onboarding.url' => static function ( $container ): string { + 'onboarding.url' => static function ( ContainerInterface $container ): string { return plugins_url( '/modules/ppcp-onboarding/', dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php' ); }, - 'api.endpoint.login-seller-production' => static function ( $container ) : LoginSeller { + 'api.endpoint.login-seller-production' => static function ( ContainerInterface $container ) : LoginSeller { $logger = $container->get( 'woocommerce.logger.woocommerce' ); return new LoginSeller( @@ -152,7 +153,7 @@ return array( ); }, - 'api.endpoint.login-seller-sandbox' => static function ( $container ) : LoginSeller { + 'api.endpoint.login-seller-sandbox' => static function ( ContainerInterface $container ) : LoginSeller { $logger = $container->get( 'woocommerce.logger.woocommerce' ); return new LoginSeller( @@ -162,7 +163,7 @@ return array( ); }, - 'onboarding.endpoint.login-seller' => static function ( $container ) : LoginSellerEndpoint { + 'onboarding.endpoint.login-seller' => static function ( ContainerInterface $container ) : LoginSellerEndpoint { $request_data = $container->get( 'button.request-data' ); $login_seller_production = $container->get( 'api.endpoint.login-seller-production' ); @@ -182,7 +183,7 @@ return array( $logger ); }, - 'api.endpoint.partner-referrals-sandbox' => static function ( $container ) : PartnerReferrals { + 'api.endpoint.partner-referrals-sandbox' => static function ( ContainerInterface $container ) : PartnerReferrals { return new PartnerReferrals( CONNECT_WOO_SANDBOX_URL, @@ -191,7 +192,7 @@ return array( $container->get( 'woocommerce.logger.woocommerce' ) ); }, - 'api.endpoint.partner-referrals-production' => static function ( $container ) : PartnerReferrals { + 'api.endpoint.partner-referrals-production' => static function ( ContainerInterface $container ) : PartnerReferrals { return new PartnerReferrals( CONNECT_WOO_URL, @@ -200,7 +201,7 @@ return array( $container->get( 'woocommerce.logger.woocommerce' ) ); }, - 'onboarding.render' => static function ( $container ) : OnboardingRenderer { + 'onboarding.render' => static function ( ContainerInterface $container ) : OnboardingRenderer { $partner_referrals = $container->get( 'api.endpoint.partner-referrals-production' ); $partner_referrals_sandbox = $container->get( 'api.endpoint.partner-referrals-sandbox' ); @@ -211,7 +212,7 @@ return array( $partner_referrals_sandbox ); }, - 'onboarding.rest' => static function( $container ) : Onboarding_REST_Controller { - return new Onboarding_REST_Controller( $container ); + 'onboarding.rest' => static function( $container ) : OnboardingRESTController { + return new OnboardingRESTController( $container ); }, ); diff --git a/modules/ppcp-onboarding/src/Assets/class-onboardingassets.php b/modules/ppcp-onboarding/src/Assets/OnboardingAssets.php similarity index 100% rename from modules/ppcp-onboarding/src/Assets/class-onboardingassets.php rename to modules/ppcp-onboarding/src/Assets/OnboardingAssets.php diff --git a/modules/ppcp-onboarding/src/Endpoint/class-loginsellerendpoint.php b/modules/ppcp-onboarding/src/Endpoint/LoginSellerEndpoint.php similarity index 100% rename from modules/ppcp-onboarding/src/Endpoint/class-loginsellerendpoint.php rename to modules/ppcp-onboarding/src/Endpoint/LoginSellerEndpoint.php diff --git a/modules/ppcp-onboarding/src/class-environment.php b/modules/ppcp-onboarding/src/Environment.php similarity index 100% rename from modules/ppcp-onboarding/src/class-environment.php rename to modules/ppcp-onboarding/src/Environment.php diff --git a/modules/ppcp-onboarding/src/class-onboardingmodule.php b/modules/ppcp-onboarding/src/OnboardingModule.php similarity index 78% rename from modules/ppcp-onboarding/src/class-onboardingmodule.php rename to modules/ppcp-onboarding/src/OnboardingModule.php index 7fdaf5d55..d05b9509f 100644 --- a/modules/ppcp-onboarding/src/class-onboardingmodule.php +++ b/modules/ppcp-onboarding/src/OnboardingModule.php @@ -24,9 +24,7 @@ use Psr\Container\ContainerInterface; class OnboardingModule implements ModuleInterface { /** - * Sets up the module. - * - * @return ServiceProviderInterface + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( @@ -36,13 +34,11 @@ class OnboardingModule implements ModuleInterface { } /** - * Runs the module. - * - * @param ContainerInterface|null $container The container. + * {@inheritDoc} */ - public function run( ContainerInterface $container ): void { + public function run( ContainerInterface $c ): void { - $asset_loader = $container->get( 'onboarding.assets' ); + $asset_loader = $c->get( 'onboarding.assets' ); /** * The OnboardingAssets. * @@ -65,11 +61,11 @@ class OnboardingModule implements ModuleInterface { add_filter( 'woocommerce_form_field', - static function ( $field, $key, $config ) use ( $container ) { + static function ( $field, $key, $config ) use ( $c ) { if ( 'ppcp_onboarding' !== $config['type'] ) { return $field; } - $renderer = $container->get( 'onboarding.render' ); + $renderer = $c->get( 'onboarding.render' ); $is_production = 'production' === $config['env']; /** @@ -89,8 +85,8 @@ class OnboardingModule implements ModuleInterface { add_action( 'wc_ajax_' . LoginSellerEndpoint::ENDPOINT, - static function () use ( $container ) { - $endpoint = $container->get( 'onboarding.endpoint.login-seller' ); + static function () use ( $c ) { + $endpoint = $c->get( 'onboarding.endpoint.login-seller' ); /** * The ChangeCartEndpoint. @@ -102,7 +98,7 @@ class OnboardingModule implements ModuleInterface { ); // Initialize REST routes at the appropriate time. - $rest_controller = $container->get( 'onboarding.rest' ); + $rest_controller = $c->get( 'onboarding.rest' ); add_action( 'rest_api_init', array( $rest_controller, 'register_routes' ) ); } diff --git a/modules/ppcp-onboarding/src/class-onboarding-rest-controller.php b/modules/ppcp-onboarding/src/OnboardingRESTController.php similarity index 99% rename from modules/ppcp-onboarding/src/class-onboarding-rest-controller.php rename to modules/ppcp-onboarding/src/OnboardingRESTController.php index 1cbc77794..9a5fae43a 100644 --- a/modules/ppcp-onboarding/src/class-onboarding-rest-controller.php +++ b/modules/ppcp-onboarding/src/OnboardingRESTController.php @@ -16,7 +16,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; /** * Exposes and handles REST routes related to onboarding. */ -class Onboarding_REST_Controller { +class OnboardingRESTController { /** * REST namespace. diff --git a/modules/ppcp-onboarding/src/Render/class-onboardingrenderer.php b/modules/ppcp-onboarding/src/Render/OnboardingRenderer.php similarity index 100% rename from modules/ppcp-onboarding/src/Render/class-onboardingrenderer.php rename to modules/ppcp-onboarding/src/Render/OnboardingRenderer.php diff --git a/modules/ppcp-onboarding/src/class-state.php b/modules/ppcp-onboarding/src/State.php similarity index 100% rename from modules/ppcp-onboarding/src/class-state.php rename to modules/ppcp-onboarding/src/State.php diff --git a/modules/ppcp-session/composer.json b/modules/ppcp-session/composer.json new file mode 100644 index 000000000..0a8325e93 --- /dev/null +++ b/modules/ppcp-session/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-session", + "type": "dhii-mod", + "description": "Session module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\Session\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-session/services.php b/modules/ppcp-session/services.php index a57e673a9..b83a1a6a5 100644 --- a/modules/ppcp-session/services.php +++ b/modules/ppcp-session/services.php @@ -9,12 +9,12 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Session; -use Dhii\Data\Container\ContainerInterface; +use Psr\Container\ContainerInterface; use WooCommerce\PayPalCommerce\Session\Cancellation\CancelController; use WooCommerce\PayPalCommerce\Session\Cancellation\CancelView; return array( - 'session.handler' => function ( $container ) : SessionHandler { + 'session.handler' => function ( ContainerInterface $container ) : SessionHandler { if ( is_null( WC()->session ) ) { return new SessionHandler(); @@ -27,10 +27,10 @@ return array( WC()->session->set( SessionHandler::ID, $session_handler ); return $session_handler; }, - 'session.cancellation.view' => function ( $container ) : CancelView { + 'session.cancellation.view' => function ( ContainerInterface $container ) : CancelView { return new CancelView(); }, - 'session.cancellation.controller' => function ( $container ) : CancelController { + 'session.cancellation.controller' => function ( ContainerInterface $container ) : CancelController { return new CancelController( $container->get( 'session.handler' ), $container->get( 'session.cancellation.view' ) diff --git a/modules/ppcp-session/src/Cancellation/class-cancelcontroller.php b/modules/ppcp-session/src/Cancellation/CancelController.php similarity index 100% rename from modules/ppcp-session/src/Cancellation/class-cancelcontroller.php rename to modules/ppcp-session/src/Cancellation/CancelController.php diff --git a/modules/ppcp-session/src/Cancellation/class-cancelview.php b/modules/ppcp-session/src/Cancellation/CancelView.php similarity index 100% rename from modules/ppcp-session/src/Cancellation/class-cancelview.php rename to modules/ppcp-session/src/Cancellation/CancelView.php diff --git a/modules/ppcp-session/src/class-sessionhandler.php b/modules/ppcp-session/src/SessionHandler.php similarity index 100% rename from modules/ppcp-session/src/class-sessionhandler.php rename to modules/ppcp-session/src/SessionHandler.php diff --git a/modules/ppcp-session/src/class-sessionmodule.php b/modules/ppcp-session/src/SessionModule.php similarity index 74% rename from modules/ppcp-session/src/class-sessionmodule.php rename to modules/ppcp-session/src/SessionModule.php index b2c5a5aef..854c93bfb 100644 --- a/modules/ppcp-session/src/class-sessionmodule.php +++ b/modules/ppcp-session/src/SessionModule.php @@ -21,9 +21,7 @@ use Psr\Container\ContainerInterface; class SessionModule implements ModuleInterface { /** - * Sets up the module. - * - * @return ServiceProviderInterface + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( @@ -33,15 +31,13 @@ class SessionModule implements ModuleInterface { } /** - * Run the module. - * - * @param ContainerInterface|null $container The container. + * {@inheritDoc} */ - public function run( ContainerInterface $container ): void { + public function run( ContainerInterface $c ): void { add_action( 'woocommerce_init', - function () use ( $container ) { - $controller = $container->get( 'session.cancellation.controller' ); + function () use ( $c ) { + $controller = $c->get( 'session.cancellation.controller' ); /** * The Cancel controller. * diff --git a/modules/ppcp-status-report/composer.json b/modules/ppcp-status-report/composer.json new file mode 100644 index 000000000..c1738cf6e --- /dev/null +++ b/modules/ppcp-status-report/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-status-report", + "type": "dhii-mod", + "description": "Status report module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\StatusReport\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-status-report/src/class-renderer.php b/modules/ppcp-status-report/src/Renderer.php similarity index 100% rename from modules/ppcp-status-report/src/class-renderer.php rename to modules/ppcp-status-report/src/Renderer.php diff --git a/modules/ppcp-status-report/src/class-statusreportmodule.php b/modules/ppcp-status-report/src/StatusReportModule.php similarity index 90% rename from modules/ppcp-status-report/src/class-statusreportmodule.php rename to modules/ppcp-status-report/src/StatusReportModule.php index 69707dcd3..99440538c 100644 --- a/modules/ppcp-status-report/src/class-statusreportmodule.php +++ b/modules/ppcp-status-report/src/StatusReportModule.php @@ -38,27 +38,27 @@ class StatusReportModule implements ModuleInterface { /** * {@inheritDoc} * - * @param ContainerInterface $container A services container instance. + * @param ContainerInterface $c A services container instance. */ - public function run( ContainerInterface $container ): void { + public function run( ContainerInterface $c ): void { add_action( 'woocommerce_system_status_report', - function () use ( $container ) { + function () use ( $c ) { /* @var State $state The state. */ - $state = $container->get( 'onboarding.state' ); + $state = $c->get( 'onboarding.state' ); /* @var Bearer $bearer The bearer. */ - $bearer = $container->get( 'api.bearer' ); + $bearer = $c->get( 'api.bearer' ); /* @var DccApplies $dcc_applies The ddc applies. */ - $dcc_applies = $container->get( 'api.helpers.dccapplies' ); + $dcc_applies = $c->get( 'api.helpers.dccapplies' ); /* @var MessagesApply $messages_apply The messages apply. */ - $messages_apply = $container->get( 'button.helper.messages-apply' ); + $messages_apply = $c->get( 'button.helper.messages-apply' ); /* @var Renderer $renderer The renderer. */ - $renderer = $container->get( 'status-report.renderer' ); + $renderer = $c->get( 'status-report.renderer' ); $items = array( array( diff --git a/modules/ppcp-subscription/composer.json b/modules/ppcp-subscription/composer.json new file mode 100644 index 000000000..b54dfb9a0 --- /dev/null +++ b/modules/ppcp-subscription/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-subscription", + "type": "dhii-mod", + "description": "Subscription module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\Subscription\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-subscription/services.php b/modules/ppcp-subscription/services.php index 6a6364f15..dbd78239a 100644 --- a/modules/ppcp-subscription/services.php +++ b/modules/ppcp-subscription/services.php @@ -10,12 +10,14 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\Subscription; use WooCommerce\PayPalCommerce\Subscription\Helper\SubscriptionHelper; +use Psr\Container\ContainerInterface; +use WooCommerce\PayPalCommerce\Vaulting\PaymentTokenRepository; return array( - 'subscription.helper' => static function ( $container ): SubscriptionHelper { + 'subscription.helper' => static function ( ContainerInterface $container ): SubscriptionHelper { return new SubscriptionHelper(); }, - 'subscription.renewal-handler' => static function ( $container ): RenewalHandler { + 'subscription.renewal-handler' => static function ( ContainerInterface $container ): RenewalHandler { $logger = $container->get( 'woocommerce.logger.woocommerce' ); $repository = $container->get( 'vaulting.repository.payment-token' ); $endpoint = $container->get( 'api.endpoint.order' ); @@ -29,4 +31,9 @@ return array( $payer_factory ); }, + 'subscription.repository.payment-token' => static function ( ContainerInterface $container ): PaymentTokenRepository { + $factory = $container->get( 'api.factory.payment-token' ); + $endpoint = $container->get( 'api.endpoint.payment-token' ); + return new PaymentTokenRepository( $factory, $endpoint ); + }, ); diff --git a/modules/ppcp-subscription/src/Helper/class-subscriptionhelper.php b/modules/ppcp-subscription/src/Helper/SubscriptionHelper.php similarity index 100% rename from modules/ppcp-subscription/src/Helper/class-subscriptionhelper.php rename to modules/ppcp-subscription/src/Helper/SubscriptionHelper.php diff --git a/modules/ppcp-subscription/src/class-renewalhandler.php b/modules/ppcp-subscription/src/RenewalHandler.php similarity index 100% rename from modules/ppcp-subscription/src/class-renewalhandler.php rename to modules/ppcp-subscription/src/RenewalHandler.php diff --git a/modules/ppcp-subscription/src/class-subscriptionmodule.php b/modules/ppcp-subscription/src/SubscriptionModule.php similarity index 85% rename from modules/ppcp-subscription/src/class-subscriptionmodule.php rename to modules/ppcp-subscription/src/SubscriptionModule.php index 0d75fc834..aca30b3bb 100644 --- a/modules/ppcp-subscription/src/class-subscriptionmodule.php +++ b/modules/ppcp-subscription/src/SubscriptionModule.php @@ -28,9 +28,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException; class SubscriptionModule implements ModuleInterface { /** - * Setup the module. - * - * @return ServiceProviderInterface + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( @@ -40,15 +38,13 @@ class SubscriptionModule implements ModuleInterface { } /** - * Runs the module. - * - * @param ContainerInterface|null $container The container. + * {@inheritDoc} */ - public function run( ContainerInterface $container ): void { + public function run( ContainerInterface $c ): void { add_action( 'woocommerce_scheduled_subscription_payment_' . PayPalGateway::ID, - function ( $amount, $order ) use ( $container ) { - $this->renew( $order, $container ); + function ( $amount, $order ) use ( $c ) { + $this->renew( $order, $c ); }, 10, 2 @@ -56,8 +52,8 @@ class SubscriptionModule implements ModuleInterface { add_action( 'woocommerce_scheduled_subscription_payment_' . CreditCardGateway::ID, - function ( $amount, $order ) use ( $container ) { - $this->renew( $order, $container ); + function ( $amount, $order ) use ( $c ) { + $this->renew( $order, $c ); }, 10, 2 @@ -65,9 +61,9 @@ class SubscriptionModule implements ModuleInterface { add_action( 'woocommerce_subscription_payment_complete', - function ( $subscription ) use ( $container ) { - $payment_token_repository = $container->get( 'vaulting.repository.payment-token' ); - $logger = $container->get( 'woocommerce.logger.woocommerce' ); + function ( $subscription ) use ( $c ) { + $payment_token_repository = $c->get( 'vaulting.repository.payment-token' ); + $logger = $c->get( 'woocommerce.logger.woocommerce' ); $this->add_payment_token_id( $subscription, $payment_token_repository, $logger ); } @@ -75,10 +71,10 @@ class SubscriptionModule implements ModuleInterface { add_filter( 'woocommerce_gateway_description', - function ( $description, $id ) use ( $container ) { - $payment_token_repository = $container->get( 'vaulting.repository.payment-token' ); - $settings = $container->get( 'wcgateway.settings' ); - $subscription_helper = $container->get( 'subscription.helper' ); + function ( $description, $id ) use ( $c ) { + $payment_token_repository = $c->get( 'vaulting.repository.payment-token' ); + $settings = $c->get( 'wcgateway.settings' ); + $subscription_helper = $c->get( 'subscription.helper' ); return $this->display_saved_paypal_payments( $settings, (string) $id, $payment_token_repository, (string) $description, $subscription_helper ); }, @@ -88,10 +84,10 @@ class SubscriptionModule implements ModuleInterface { add_filter( 'woocommerce_credit_card_form_fields', - function ( $default_fields, $id ) use ( $container ) { - $payment_token_repository = $container->get( 'vaulting.repository.payment-token' ); - $settings = $container->get( 'wcgateway.settings' ); - $subscription_helper = $container->get( 'subscription.helper' ); + function ( $default_fields, $id ) use ( $c ) { + $payment_token_repository = $c->get( 'vaulting.repository.payment-token' ); + $settings = $c->get( 'wcgateway.settings' ); + $subscription_helper = $c->get( 'subscription.helper' ); return $this->display_saved_credit_cards( $settings, $id, $payment_token_repository, $default_fields, $subscription_helper ); }, diff --git a/modules/ppcp-vaulting/composer.json b/modules/ppcp-vaulting/composer.json new file mode 100644 index 000000000..d57c09b96 --- /dev/null +++ b/modules/ppcp-vaulting/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-vaulting", + "type": "dhii-mod", + "description": "Vaulting module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\Vaulting\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-vaulting/src/Assets/class-myaccountpaymentsassets.php b/modules/ppcp-vaulting/src/Assets/MyAccountPaymentsAssets.php similarity index 100% rename from modules/ppcp-vaulting/src/Assets/class-myaccountpaymentsassets.php rename to modules/ppcp-vaulting/src/Assets/MyAccountPaymentsAssets.php diff --git a/modules/ppcp-vaulting/src/Endpoint/class-deletepaymenttokenendpoint.php b/modules/ppcp-vaulting/src/Endpoint/DeletePaymentTokenEndpoint.php similarity index 100% rename from modules/ppcp-vaulting/src/Endpoint/class-deletepaymenttokenendpoint.php rename to modules/ppcp-vaulting/src/Endpoint/DeletePaymentTokenEndpoint.php diff --git a/modules/ppcp-vaulting/src/class-paymenttokenrepository.php b/modules/ppcp-vaulting/src/PaymentTokenRepository.php similarity index 100% rename from modules/ppcp-vaulting/src/class-paymenttokenrepository.php rename to modules/ppcp-vaulting/src/PaymentTokenRepository.php diff --git a/modules/ppcp-vaulting/src/class-paymenttokensrenderer.php b/modules/ppcp-vaulting/src/PaymentTokensRenderer.php similarity index 100% rename from modules/ppcp-vaulting/src/class-paymenttokensrenderer.php rename to modules/ppcp-vaulting/src/PaymentTokensRenderer.php diff --git a/modules/ppcp-vaulting/src/class-vaultingmodule.php b/modules/ppcp-vaulting/src/VaultingModule.php similarity index 100% rename from modules/ppcp-vaulting/src/class-vaultingmodule.php rename to modules/ppcp-vaulting/src/VaultingModule.php diff --git a/modules/ppcp-wc-gateway/composer.json b/modules/ppcp-wc-gateway/composer.json new file mode 100644 index 000000000..c8a15a7d6 --- /dev/null +++ b/modules/ppcp-wc-gateway/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-wc-gateway", + "type": "dhii-mod", + "description": "WC gateway module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\WcGateway\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-wc-gateway/module.php b/modules/ppcp-wc-gateway/module.php index 27674e63c..881c93daa 100644 --- a/modules/ppcp-wc-gateway/module.php +++ b/modules/ppcp-wc-gateway/module.php @@ -12,5 +12,5 @@ namespace WooCommerce\PayPalCommerce\WcGateway; use Dhii\Modular\Module\ModuleInterface; return static function (): ModuleInterface { - return new WcGatewayModule(); + return new WCGatewayModule(); }; diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index 6f58c5461..f4488fb66 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\WcGateway; +use Psr\Container\ContainerInterface; use WooCommerce\PayPalCommerce\ApiClient\Entity\ApplicationContext; use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache; use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies; @@ -26,8 +27,8 @@ use WooCommerce\PayPalCommerce\WcGateway\Endpoint\ReturnUrlEndpoint; use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; use WooCommerce\PayPalCommerce\WcGateway\Gateway\TransactionUrlProvider; -use Woocommerce\PayPalCommerce\WcGateway\Helper\DccProductStatus; -use Woocommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; +use WooCommerce\PayPalCommerce\WcGateway\Helper\DCCProductStatus; +use WooCommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; use WooCommerce\PayPalCommerce\WcGateway\Notice\AuthorizeOrderActionNotice; use WooCommerce\PayPalCommerce\WcGateway\Notice\ConnectAdminNotice; use WooCommerce\PayPalCommerce\WcGateway\Notice\DccWithoutPayPalAdminNotice; @@ -41,7 +42,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsRenderer; use WooCommerce\PayPalCommerce\Webhooks\Status\WebhooksStatusPage; return array( - 'wcgateway.paypal-gateway' => static function ( $container ): PayPalGateway { + 'wcgateway.paypal-gateway' => static function ( ContainerInterface $container ): PayPalGateway { $order_processor = $container->get( 'wcgateway.order-processor' ); $settings_renderer = $container->get( 'wcgateway.settings.render' ); $authorized_payments = $container->get( 'wcgateway.processor.authorized-payments' ); @@ -69,7 +70,7 @@ return array( $environment ); }, - 'wcgateway.credit-card-gateway' => static function ( $container ): CreditCardGateway { + 'wcgateway.credit-card-gateway' => static function ( ContainerInterface $container ): CreditCardGateway { $order_processor = $container->get( 'wcgateway.order-processor' ); $settings_renderer = $container->get( 'wcgateway.settings.render' ); $authorized_payments = $container->get( 'wcgateway.processor.authorized-payments' ); @@ -107,12 +108,11 @@ return array( $environment ); }, - 'wcgateway.disabler' => static function ( $container ): DisableGateways { + 'wcgateway.disabler' => static function ( ContainerInterface $container ): DisableGateways { $session_handler = $container->get( 'session.handler' ); $settings = $container->get( 'wcgateway.settings' ); return new DisableGateways( $session_handler, $settings ); }, - 'wcgateway.is-wc-payments-page' => static function ( $container ): bool { $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; $tab = isset( $_GET['tab'] ) ? sanitize_text_field( wp_unslash( $_GET['tab'] ) ) : ''; @@ -139,15 +139,15 @@ return array( return $ppcp_tab ? $ppcp_tab : $section; }, - 'wcgateway.settings' => static function ( $container ): Settings { + 'wcgateway.settings' => static function ( ContainerInterface $container ): Settings { return new Settings(); }, - 'wcgateway.notice.connect' => static function ( $container ): ConnectAdminNotice { + 'wcgateway.notice.connect' => static function ( ContainerInterface $container ): ConnectAdminNotice { $state = $container->get( 'onboarding.state' ); $settings = $container->get( 'wcgateway.settings' ); return new ConnectAdminNotice( $state, $settings ); }, - 'wcgateway.notice.dcc-without-paypal' => static function ( $container ): DccWithoutPayPalAdminNotice { + 'wcgateway.notice.dcc-without-paypal' => static function ( ContainerInterface $container ): DccWithoutPayPalAdminNotice { $state = $container->get( 'onboarding.state' ); $settings = $container->get( 'wcgateway.settings' ); $is_payments_page = $container->get( 'wcgateway.is-wc-payments-page' ); @@ -158,14 +158,14 @@ return array( static function ( $container ): AuthorizeOrderActionNotice { return new AuthorizeOrderActionNotice(); }, - 'wcgateway.settings.sections-renderer' => static function ( $container ): SectionsRenderer { + 'wcgateway.settings.sections-renderer' => static function ( ContainerInterface $container ): SectionsRenderer { return new SectionsRenderer( $container->get( 'wcgateway.current-ppcp-settings-page-id' ) ); }, - 'wcgateway.settings.status' => static function ( $container ): SettingsStatus { + 'wcgateway.settings.status' => static function ( ContainerInterface $container ): SettingsStatus { $settings = $container->get( 'wcgateway.settings' ); return new SettingsStatus( $settings ); }, - 'wcgateway.settings.render' => static function ( $container ): SettingsRenderer { + 'wcgateway.settings.render' => static function ( ContainerInterface $container ): SettingsRenderer { $settings = $container->get( 'wcgateway.settings' ); $state = $container->get( 'onboarding.state' ); $fields = $container->get( 'wcgateway.settings.fields' ); @@ -185,7 +185,7 @@ return array( $page_id ); }, - 'wcgateway.settings.listener' => static function ( $container ): SettingsListener { + 'wcgateway.settings.listener' => static function ( ContainerInterface $container ): SettingsListener { $settings = $container->get( 'wcgateway.settings' ); $fields = $container->get( 'wcgateway.settings.fields' ); $webhook_registrar = $container->get( 'webhook.registrar' ); @@ -195,7 +195,7 @@ return array( $page_id = $container->get( 'wcgateway.current-ppcp-settings-page-id' ); return new SettingsListener( $settings, $fields, $webhook_registrar, $cache, $state, $bearer, $page_id ); }, - 'wcgateway.order-processor' => static function ( $container ): OrderProcessor { + 'wcgateway.order-processor' => static function ( ContainerInterface $container ): OrderProcessor { $session_handler = $container->get( 'session.handler' ); $order_endpoint = $container->get( 'api.endpoint.order' ); @@ -216,32 +216,32 @@ return array( $environment ); }, - 'wcgateway.processor.refunds' => static function ( $container ): RefundProcessor { + 'wcgateway.processor.refunds' => static function ( ContainerInterface $container ): RefundProcessor { $order_endpoint = $container->get( 'api.endpoint.order' ); $payments_endpoint = $container->get( 'api.endpoint.payments' ); $logger = $container->get( 'woocommerce.logger.woocommerce' ); return new RefundProcessor( $order_endpoint, $payments_endpoint, $logger ); }, - 'wcgateway.processor.authorized-payments' => static function ( $container ): AuthorizedPaymentsProcessor { + 'wcgateway.processor.authorized-payments' => static function ( ContainerInterface $container ): AuthorizedPaymentsProcessor { $order_endpoint = $container->get( 'api.endpoint.order' ); $payments_endpoint = $container->get( 'api.endpoint.payments' ); $logger = $container->get( 'woocommerce.logger.woocommerce' ); return new AuthorizedPaymentsProcessor( $order_endpoint, $payments_endpoint, $logger ); }, - 'wcgateway.admin.render-authorize-action' => static function ( $container ): RenderAuthorizeAction { + 'wcgateway.admin.render-authorize-action' => static function ( ContainerInterface $container ): RenderAuthorizeAction { $column = $container->get( 'wcgateway.admin.orders-payment-status-column' ); return new RenderAuthorizeAction( $column ); }, - 'wcgateway.admin.order-payment-status' => static function ( $container ): PaymentStatusOrderDetail { + 'wcgateway.admin.order-payment-status' => static function ( ContainerInterface $container ): PaymentStatusOrderDetail { $column = $container->get( 'wcgateway.admin.orders-payment-status-column' ); return new PaymentStatusOrderDetail( $column ); }, - 'wcgateway.admin.orders-payment-status-column' => static function ( $container ): OrderTablePaymentStatusColumn { + 'wcgateway.admin.orders-payment-status-column' => static function ( ContainerInterface $container ): OrderTablePaymentStatusColumn { $settings = $container->get( 'wcgateway.settings' ); return new OrderTablePaymentStatusColumn( $settings ); }, - 'wcgateway.settings.fields' => static function ( $container ): array { + 'wcgateway.settings.fields' => static function ( ContainerInterface $container ): array { $state = $container->get( 'onboarding.state' ); $messages_disclaimers = $container->get( 'button.helper.messages-disclaimers' ); @@ -1961,13 +1961,13 @@ return array( return $fields; }, - 'wcgateway.checkout.address-preset' => static function( $container ): CheckoutPayPalAddressPreset { + 'wcgateway.checkout.address-preset' => static function( ContainerInterface $container ): CheckoutPayPalAddressPreset { return new CheckoutPayPalAddressPreset( $container->get( 'session.handler' ) ); }, - 'wcgateway.url' => static function ( $container ): string { + 'wcgateway.url' => static function ( ContainerInterface $container ): string { return plugins_url( $container->get( 'wcgateway.relative-path' ), dirname( __FILE__, 3 ) . '/woocommerce-paypal-payments.php' @@ -1982,7 +1982,7 @@ return array( ) . $container->get( 'wcgateway.relative-path' ); }, - 'wcgateway.endpoint.return-url' => static function ( $container ) : ReturnUrlEndpoint { + 'wcgateway.endpoint.return-url' => static function ( ContainerInterface $container ) : ReturnUrlEndpoint { $gateway = $container->get( 'wcgateway.paypal-gateway' ); $endpoint = $container->get( 'api.endpoint.order' ); $prefix = $container->get( 'api.prefix' ); @@ -2008,11 +2008,11 @@ return array( return new TransactionUrlProvider( $sandbox_url_base, $live_url_base ); }, - 'wcgateway.helper.dcc-product-status' => static function ( $container ) : DccProductStatus { + 'wcgateway.helper.dcc-product-status' => static function ( ContainerInterface $container ) : DCCProductStatus { $settings = $container->get( 'wcgateway.settings' ); $partner_endpoint = $container->get( 'api.endpoint.partners' ); - return new DccProductStatus( $settings, $partner_endpoint ); + return new DCCProductStatus( $settings, $partner_endpoint ); }, 'button.helper.messages-disclaimers' => static function ( $container ): MessagesDisclaimers { diff --git a/modules/ppcp-wc-gateway/src/Admin/class-ordertablepaymentstatuscolumn.php b/modules/ppcp-wc-gateway/src/Admin/OrderTablePaymentStatusColumn.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Admin/class-ordertablepaymentstatuscolumn.php rename to modules/ppcp-wc-gateway/src/Admin/OrderTablePaymentStatusColumn.php diff --git a/modules/ppcp-wc-gateway/src/Admin/class-paymentstatusorderdetail.php b/modules/ppcp-wc-gateway/src/Admin/PaymentStatusOrderDetail.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Admin/class-paymentstatusorderdetail.php rename to modules/ppcp-wc-gateway/src/Admin/PaymentStatusOrderDetail.php diff --git a/modules/ppcp-wc-gateway/src/Admin/class-renderauthorizeaction.php b/modules/ppcp-wc-gateway/src/Admin/RenderAuthorizeAction.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Admin/class-renderauthorizeaction.php rename to modules/ppcp-wc-gateway/src/Admin/RenderAuthorizeAction.php diff --git a/modules/ppcp-wc-gateway/src/Assets/class-settingspageassets.php b/modules/ppcp-wc-gateway/src/Assets/SettingsPageAssets.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Assets/class-settingspageassets.php rename to modules/ppcp-wc-gateway/src/Assets/SettingsPageAssets.php diff --git a/modules/ppcp-wc-gateway/src/Checkout/class-checkoutpaypaladdresspreset.php b/modules/ppcp-wc-gateway/src/Checkout/CheckoutPayPalAddressPreset.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Checkout/class-checkoutpaypaladdresspreset.php rename to modules/ppcp-wc-gateway/src/Checkout/CheckoutPayPalAddressPreset.php diff --git a/modules/ppcp-wc-gateway/src/Checkout/class-disablegateways.php b/modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Checkout/class-disablegateways.php rename to modules/ppcp-wc-gateway/src/Checkout/DisableGateways.php diff --git a/modules/ppcp-wc-gateway/src/Endpoint/class-returnurlendpoint.php b/modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Endpoint/class-returnurlendpoint.php rename to modules/ppcp-wc-gateway/src/Endpoint/ReturnUrlEndpoint.php diff --git a/modules/ppcp-wc-gateway/src/Exception/class-notfoundexception.php b/modules/ppcp-wc-gateway/src/Exception/NotFoundException.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Exception/class-notfoundexception.php rename to modules/ppcp-wc-gateway/src/Exception/NotFoundException.php diff --git a/modules/ppcp-wc-gateway/src/Gateway/class-creditcardgateway.php b/modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Gateway/class-creditcardgateway.php rename to modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php diff --git a/modules/ppcp-wc-gateway/src/Gateway/class-paypalgateway.php b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Gateway/class-paypalgateway.php rename to modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php diff --git a/modules/ppcp-wc-gateway/src/Gateway/class-processpaymenttrait.php b/modules/ppcp-wc-gateway/src/Gateway/ProcessPaymentTrait.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Gateway/class-processpaymenttrait.php rename to modules/ppcp-wc-gateway/src/Gateway/ProcessPaymentTrait.php diff --git a/modules/ppcp-wc-gateway/src/Gateway/class-transactionurlprovider.php b/modules/ppcp-wc-gateway/src/Gateway/TransactionUrlProvider.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Gateway/class-transactionurlprovider.php rename to modules/ppcp-wc-gateway/src/Gateway/TransactionUrlProvider.php diff --git a/modules/ppcp-wc-gateway/src/Helper/class-dccproductstatus.php b/modules/ppcp-wc-gateway/src/Helper/DCCProductStatus.php similarity index 94% rename from modules/ppcp-wc-gateway/src/Helper/class-dccproductstatus.php rename to modules/ppcp-wc-gateway/src/Helper/DCCProductStatus.php index 2ec284d1d..ba48b4b54 100644 --- a/modules/ppcp-wc-gateway/src/Helper/class-dccproductstatus.php +++ b/modules/ppcp-wc-gateway/src/Helper/DCCProductStatus.php @@ -2,12 +2,12 @@ /** * Manage the Seller status. * - * @package Woocommerce\PayPalCommerce\WcGateway\Helper + * @package WooCommerce\PayPalCommerce\WcGateway\Helper */ declare( strict_types=1 ); -namespace Woocommerce\PayPalCommerce\WcGateway\Helper; +namespace WooCommerce\PayPalCommerce\WcGateway\Helper; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PartnersEndpoint; use WooCommerce\PayPalCommerce\ApiClient\Entity\SellerStatusProduct; @@ -17,7 +17,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings; /** * Class DccProductStatus */ -class DccProductStatus { +class DCCProductStatus { /** * Caches the status for the current load. diff --git a/modules/ppcp-wc-gateway/src/Helper/class-settingsstatus.php b/modules/ppcp-wc-gateway/src/Helper/SettingsStatus.php similarity index 92% rename from modules/ppcp-wc-gateway/src/Helper/class-settingsstatus.php rename to modules/ppcp-wc-gateway/src/Helper/SettingsStatus.php index f74355a1a..d707dc8f1 100644 --- a/modules/ppcp-wc-gateway/src/Helper/class-settingsstatus.php +++ b/modules/ppcp-wc-gateway/src/Helper/SettingsStatus.php @@ -2,12 +2,12 @@ /** * Helper to get settings status. * - * @package Woocommerce\PayPalCommerce\WcGateway\Helper + * @package WooCommerce\PayPalCommerce\WcGateway\Helper */ declare(strict_types=1); -namespace Woocommerce\PayPalCommerce\WcGateway\Helper; +namespace WooCommerce\PayPalCommerce\WcGateway\Helper; use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings; diff --git a/modules/ppcp-wc-gateway/src/Notice/class-authorizeorderactionnotice.php b/modules/ppcp-wc-gateway/src/Notice/AuthorizeOrderActionNotice.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Notice/class-authorizeorderactionnotice.php rename to modules/ppcp-wc-gateway/src/Notice/AuthorizeOrderActionNotice.php diff --git a/modules/ppcp-wc-gateway/src/Notice/class-connectadminnotice.php b/modules/ppcp-wc-gateway/src/Notice/ConnectAdminNotice.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Notice/class-connectadminnotice.php rename to modules/ppcp-wc-gateway/src/Notice/ConnectAdminNotice.php diff --git a/modules/ppcp-wc-gateway/src/Notice/class-dccwithoutpaypaladminnotice.php b/modules/ppcp-wc-gateway/src/Notice/DccWithoutPayPalAdminNotice.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Notice/class-dccwithoutpaypaladminnotice.php rename to modules/ppcp-wc-gateway/src/Notice/DccWithoutPayPalAdminNotice.php diff --git a/modules/ppcp-wc-gateway/src/Processor/class-authorizedpaymentsprocessor.php b/modules/ppcp-wc-gateway/src/Processor/AuthorizedPaymentsProcessor.php similarity index 98% rename from modules/ppcp-wc-gateway/src/Processor/class-authorizedpaymentsprocessor.php rename to modules/ppcp-wc-gateway/src/Processor/AuthorizedPaymentsProcessor.php index 7e19cd85f..cc232ad04 100644 --- a/modules/ppcp-wc-gateway/src/Processor/class-authorizedpaymentsprocessor.php +++ b/modules/ppcp-wc-gateway/src/Processor/AuthorizedPaymentsProcessor.php @@ -15,7 +15,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PaymentsEndpoint; use WooCommerce\PayPalCommerce\ApiClient\Entity\Authorization; use WooCommerce\PayPalCommerce\ApiClient\Entity\AuthorizationStatus; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\Order; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; diff --git a/modules/ppcp-wc-gateway/src/Processor/class-ordermetatrait.php b/modules/ppcp-wc-gateway/src/Processor/OrderMetaTrait.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Processor/class-ordermetatrait.php rename to modules/ppcp-wc-gateway/src/Processor/OrderMetaTrait.php diff --git a/modules/ppcp-wc-gateway/src/Processor/class-orderprocessor.php b/modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Processor/class-orderprocessor.php rename to modules/ppcp-wc-gateway/src/Processor/OrderProcessor.php diff --git a/modules/ppcp-wc-gateway/src/Processor/class-paymentstatushandlingtrait.php b/modules/ppcp-wc-gateway/src/Processor/PaymentsStatusHandlingTrait.php similarity index 98% rename from modules/ppcp-wc-gateway/src/Processor/class-paymentstatushandlingtrait.php rename to modules/ppcp-wc-gateway/src/Processor/PaymentsStatusHandlingTrait.php index c12d63a18..5e2929d81 100644 --- a/modules/ppcp-wc-gateway/src/Processor/class-paymentstatushandlingtrait.php +++ b/modules/ppcp-wc-gateway/src/Processor/PaymentsStatusHandlingTrait.php @@ -12,7 +12,7 @@ namespace WooCommerce\PayPalCommerce\WcGateway\Processor; use WC_Order; use WooCommerce\PayPalCommerce\ApiClient\Entity\Authorization; use WooCommerce\PayPalCommerce\ApiClient\Entity\AuthorizationStatus; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\CaptureStatus; use WooCommerce\PayPalCommerce\ApiClient\Entity\Order; use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException; diff --git a/modules/ppcp-wc-gateway/src/Processor/class-refundprocessor.php b/modules/ppcp-wc-gateway/src/Processor/RefundProcessor.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Processor/class-refundprocessor.php rename to modules/ppcp-wc-gateway/src/Processor/RefundProcessor.php diff --git a/modules/ppcp-wc-gateway/src/Settings/class-pagematchertrait.php b/modules/ppcp-wc-gateway/src/Settings/PageMatcherTrait.php similarity index 77% rename from modules/ppcp-wc-gateway/src/Settings/class-pagematchertrait.php rename to modules/ppcp-wc-gateway/src/Settings/PageMatcherTrait.php index f47388c85..f3b41fdfb 100644 --- a/modules/ppcp-wc-gateway/src/Settings/class-pagematchertrait.php +++ b/modules/ppcp-wc-gateway/src/Settings/PageMatcherTrait.php @@ -9,15 +9,8 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\WcGateway\Settings; -use WooCommerce\PayPalCommerce\AdminNotices\Entity\Message; -use WooCommerce\PayPalCommerce\ApiClient\Helper\DccApplies; -use WooCommerce\PayPalCommerce\Button\Helper\MessagesApply; -use WooCommerce\PayPalCommerce\Onboarding\State; use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway; -use Psr\Container\ContainerInterface; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; -use Woocommerce\PayPalCommerce\WcGateway\Helper\DccProductStatus; -use Woocommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; use WooCommerce\PayPalCommerce\Webhooks\Status\WebhooksStatusPage; /** diff --git a/modules/ppcp-wc-gateway/src/Settings/class-sectionsrenderer.php b/modules/ppcp-wc-gateway/src/Settings/SectionsRenderer.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Settings/class-sectionsrenderer.php rename to modules/ppcp-wc-gateway/src/Settings/SectionsRenderer.php diff --git a/modules/ppcp-wc-gateway/src/Settings/class-settings.php b/modules/ppcp-wc-gateway/src/Settings/Settings.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Settings/class-settings.php rename to modules/ppcp-wc-gateway/src/Settings/Settings.php diff --git a/modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php b/modules/ppcp-wc-gateway/src/Settings/SettingsListener.php similarity index 100% rename from modules/ppcp-wc-gateway/src/Settings/class-settingslistener.php rename to modules/ppcp-wc-gateway/src/Settings/SettingsListener.php diff --git a/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php b/modules/ppcp-wc-gateway/src/Settings/SettingsRenderer.php similarity index 98% rename from modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php rename to modules/ppcp-wc-gateway/src/Settings/SettingsRenderer.php index 40fbad8ee..3ffcaf3e0 100644 --- a/modules/ppcp-wc-gateway/src/Settings/class-settingsrenderer.php +++ b/modules/ppcp-wc-gateway/src/Settings/SettingsRenderer.php @@ -15,9 +15,9 @@ use WooCommerce\PayPalCommerce\Button\Helper\MessagesApply; use WooCommerce\PayPalCommerce\Onboarding\State; use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway; use Psr\Container\ContainerInterface; +use WooCommerce\PayPalCommerce\WcGateway\Helper\DCCProductStatus; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; -use Woocommerce\PayPalCommerce\WcGateway\Helper\DccProductStatus; -use Woocommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; +use WooCommerce\PayPalCommerce\WcGateway\Helper\SettingsStatus; /** * Class SettingsRenderer @@ -71,7 +71,7 @@ class SettingsRenderer { /** * The DCC Product Status. * - * @var DccProductStatus + * @var DCCProductStatus */ private $dcc_product_status; @@ -90,7 +90,7 @@ class SettingsRenderer { * @param array $fields The setting fields. * @param DccApplies $dcc_applies Whether DCC gateway can be shown. * @param MessagesApply $messages_apply Whether messages can be shown. - * @param DccProductStatus $dcc_product_status The product status. + * @param DCCProductStatus $dcc_product_status The product status. * @param SettingsStatus $settings_status The Settings status helper. * @param string $page_id ID of the current PPCP gateway settings page, or empty if it is not such page. */ @@ -100,7 +100,7 @@ class SettingsRenderer { array $fields, DccApplies $dcc_applies, MessagesApply $messages_apply, - DccProductStatus $dcc_product_status, + DCCProductStatus $dcc_product_status, SettingsStatus $settings_status, string $page_id ) { diff --git a/modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php b/modules/ppcp-wc-gateway/src/WCGatewayModule.php similarity index 87% rename from modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php rename to modules/ppcp-wc-gateway/src/WCGatewayModule.php index 7fd14cdb8..0905d32ff 100644 --- a/modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php +++ b/modules/ppcp-wc-gateway/src/WCGatewayModule.php @@ -35,12 +35,10 @@ use Psr\Container\ContainerInterface; /** * Class WcGatewayModule */ -class WcGatewayModule implements ModuleInterface { +class WCGatewayModule implements ModuleInterface { /** - * Setup the module. - * - * @return ServiceProviderInterface + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( @@ -50,20 +48,18 @@ class WcGatewayModule implements ModuleInterface { } /** - * Runs the module. - * - * @param ContainerInterface|null $container The container. + * {@inheritDoc} */ - public function run( ContainerInterface $container ): void { - $this->register_payment_gateways( $container ); - $this->register_order_functionality( $container ); - $this->register_columns( $container ); - $this->register_checkout_paypal_address_preset( $container ); + public function run( ContainerInterface $c ): void { + $this->register_payment_gateways( $c ); + $this->register_order_functionality( $c ); + $this->register_columns( $c ); + $this->register_checkout_paypal_address_preset( $c ); add_action( 'woocommerce_sections_checkout', - function() use ( $container ) { - $section_renderer = $container->get( 'wcgateway.settings.sections-renderer' ); + function() use ( $c ) { + $section_renderer = $c->get( 'wcgateway.settings.sections-renderer' ); /** * The Section Renderer. * @@ -73,39 +69,39 @@ class WcGatewayModule implements ModuleInterface { } ); - if ( $container->has( 'wcgateway.url' ) ) { + if ( $c->has( 'wcgateway.url' ) ) { $assets = new SettingsPageAssets( - $container->get( 'wcgateway.url' ), - $container->get( 'wcgateway.absolute-path' ), - $container->get( 'api.bearer' ) + $c->get( 'wcgateway.url' ), + $c->get( 'wcgateway.absolute-path' ), + $c->get( 'api.bearer' ) ); $assets->register_assets(); } add_filter( Repository::NOTICES_FILTER, - static function ( $notices ) use ( $container ): array { - $notice = $container->get( 'wcgateway.notice.connect' ); + static function ( $notices ) use ( $c ): array { + $notice = $c->get( 'wcgateway.notice.connect' ); assert( $notice instanceof ConnectAdminNotice ); $connect_message = $notice->connect_message(); if ( $connect_message ) { $notices[] = $connect_message; } - $dcc_without_paypal_notice = $container->get( 'wcgateway.notice.dcc-without-paypal' ); + $dcc_without_paypal_notice = $c->get( 'wcgateway.notice.dcc-without-paypal' ); assert( $dcc_without_paypal_notice instanceof DccWithoutPayPalAdminNotice ); $dcc_without_paypal_message = $dcc_without_paypal_notice->message(); if ( $dcc_without_paypal_message ) { $notices[] = $dcc_without_paypal_message; } - $authorize_order_action = $container->get( 'wcgateway.notice.authorize-order-action' ); + $authorize_order_action = $c->get( 'wcgateway.notice.authorize-order-action' ); $authorized_message = $authorize_order_action->message(); if ( $authorized_message ) { $notices[] = $authorized_message; } - $settings_renderer = $container->get( 'wcgateway.settings.render' ); + $settings_renderer = $c->get( 'wcgateway.settings.render' ); assert( $settings_renderer instanceof SettingsRenderer ); $messages = $settings_renderer->messages(); $notices = array_merge( $notices, $messages ); @@ -115,7 +111,7 @@ class WcGatewayModule implements ModuleInterface { ); add_action( 'woocommerce_paypal_commerce_gateway_deactivate', - static function () use ( $container ) { + static function () use ( $c ) { delete_option( Settings::KEY ); delete_option( PayPalRequestIdRepository::KEY ); delete_option( 'woocommerce_' . PayPalGateway::ID . '_settings' ); @@ -125,8 +121,8 @@ class WcGatewayModule implements ModuleInterface { add_action( 'wc_ajax_' . ReturnUrlEndpoint::ENDPOINT, - static function () use ( $container ) { - $endpoint = $container->get( 'wcgateway.endpoint.return-url' ); + static function () use ( $c ) { + $endpoint = $c->get( 'wcgateway.endpoint.return-url' ); /** * The Endpoint. * diff --git a/modules/ppcp-webhooks/composer.json b/modules/ppcp-webhooks/composer.json new file mode 100644 index 000000000..83dd73952 --- /dev/null +++ b/modules/ppcp-webhooks/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/ppcp-webhooks", + "type": "dhii-mod", + "description": "Webhooks module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\PayPalCommerce\\Webhooks\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/ppcp-webhooks/services.php b/modules/ppcp-webhooks/services.php index 84726058a..539ab7330 100644 --- a/modules/ppcp-webhooks/services.php +++ b/modules/ppcp-webhooks/services.php @@ -28,7 +28,7 @@ use WooCommerce\PayPalCommerce\Webhooks\Status\WebhookSimulation; return array( - 'webhook.registrar' => function( $container ) : WebhookRegistrar { + 'webhook.registrar' => function( ContainerInterface $container ) : WebhookRegistrar { $factory = $container->get( 'api.factory.webhook' ); $endpoint = $container->get( 'api.endpoint.webhook' ); $rest_endpoint = $container->get( 'webhook.endpoint.controller' ); @@ -40,7 +40,7 @@ return array( $logger ); }, - 'webhook.endpoint.controller' => function( $container ) : IncomingWebhookEndpoint { + 'webhook.endpoint.controller' => function( ContainerInterface $container ) : IncomingWebhookEndpoint { $webhook_endpoint = $container->get( 'api.endpoint.webhook' ); $webhook = $container->get( 'webhook.current' ); $handler = $container->get( 'webhook.endpoint.handler' ); @@ -59,7 +59,7 @@ return array( ... $handler ); }, - 'webhook.endpoint.handler' => function( $container ) : array { + 'webhook.endpoint.handler' => function( ContainerInterface $container ) : array { $logger = $container->get( 'woocommerce.logger.woocommerce' ); $prefix = $container->get( 'api.prefix' ); $order_endpoint = $container->get( 'api.endpoint.order' ); diff --git a/modules/ppcp-webhooks/src/Endpoint/class-resubscribeendpoint.php b/modules/ppcp-webhooks/src/Endpoint/ResubscribeEndpoint.php similarity index 100% rename from modules/ppcp-webhooks/src/Endpoint/class-resubscribeendpoint.php rename to modules/ppcp-webhooks/src/Endpoint/ResubscribeEndpoint.php diff --git a/modules/ppcp-webhooks/src/Endpoint/class-simulateendpoint.php b/modules/ppcp-webhooks/src/Endpoint/SimulateEndpoint.php similarity index 100% rename from modules/ppcp-webhooks/src/Endpoint/class-simulateendpoint.php rename to modules/ppcp-webhooks/src/Endpoint/SimulateEndpoint.php diff --git a/modules/ppcp-webhooks/src/Endpoint/class-simulationstateendpoint.php b/modules/ppcp-webhooks/src/Endpoint/SimulationStateEndpoint.php similarity index 100% rename from modules/ppcp-webhooks/src/Endpoint/class-simulationstateendpoint.php rename to modules/ppcp-webhooks/src/Endpoint/SimulationStateEndpoint.php diff --git a/modules/ppcp-webhooks/src/Handler/class-checkoutorderapproved.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php similarity index 100% rename from modules/ppcp-webhooks/src/Handler/class-checkoutorderapproved.php rename to modules/ppcp-webhooks/src/Handler/CheckoutOrderApproved.php diff --git a/modules/ppcp-webhooks/src/Handler/class-checkoutordercompleted.php b/modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php similarity index 100% rename from modules/ppcp-webhooks/src/Handler/class-checkoutordercompleted.php rename to modules/ppcp-webhooks/src/Handler/CheckoutOrderCompleted.php diff --git a/modules/ppcp-webhooks/src/Handler/class-paymentcapturecompleted.php b/modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php similarity index 100% rename from modules/ppcp-webhooks/src/Handler/class-paymentcapturecompleted.php rename to modules/ppcp-webhooks/src/Handler/PaymentCaptureCompleted.php diff --git a/modules/ppcp-webhooks/src/Handler/class-paymentcapturerefunded.php b/modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php similarity index 100% rename from modules/ppcp-webhooks/src/Handler/class-paymentcapturerefunded.php rename to modules/ppcp-webhooks/src/Handler/PaymentCaptureRefunded.php diff --git a/modules/ppcp-webhooks/src/Handler/class-paymentcapturereversed.php b/modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php similarity index 100% rename from modules/ppcp-webhooks/src/Handler/class-paymentcapturereversed.php rename to modules/ppcp-webhooks/src/Handler/PaymentCaptureReversed.php diff --git a/modules/ppcp-webhooks/src/Handler/class-prefixtrait.php b/modules/ppcp-webhooks/src/Handler/PrefixTrait.php similarity index 100% rename from modules/ppcp-webhooks/src/Handler/class-prefixtrait.php rename to modules/ppcp-webhooks/src/Handler/PrefixTrait.php diff --git a/modules/ppcp-webhooks/src/Handler/class-requesthandler.php b/modules/ppcp-webhooks/src/Handler/RequestHandler.php similarity index 100% rename from modules/ppcp-webhooks/src/Handler/class-requesthandler.php rename to modules/ppcp-webhooks/src/Handler/RequestHandler.php diff --git a/modules/ppcp-webhooks/src/class-incomingwebhookendpoint.php b/modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php similarity index 100% rename from modules/ppcp-webhooks/src/class-incomingwebhookendpoint.php rename to modules/ppcp-webhooks/src/IncomingWebhookEndpoint.php diff --git a/modules/ppcp-webhooks/src/Status/Assets/class-webhooksstatuspageassets.php b/modules/ppcp-webhooks/src/Status/Assets/class-webhooksstatuspageassets.php deleted file mode 100644 index 50c6956a4..000000000 --- a/modules/ppcp-webhooks/src/Status/Assets/class-webhooksstatuspageassets.php +++ /dev/null @@ -1,110 +0,0 @@ -module_url = untrailingslashit( $module_url ); - } - - /** - * Registers the scripts and styles. - * - * @return void - */ - public function register(): void { - wp_register_style( - 'ppcp-webhooks-status-page-style', - $this->module_url . '/assets/css/status-page.css', - array(), - 1 - ); - - wp_register_script( - 'ppcp-webhooks-status-page', - $this->module_url . '/assets/js/status-page.js', - array(), - 1, - true - ); - - wp_localize_script( - 'ppcp-webhooks-status-page', - 'PayPalCommerceGatewayWebhooksStatus', - $this->get_script_data() - ); - } - - /** - * Returns the data for the script. - * - * @return array - */ - public function get_script_data() { - return array( - 'resubscribe' => array( - 'endpoint' => home_url( \WC_AJAX::get_endpoint( ResubscribeEndpoint::ENDPOINT ) ), - 'nonce' => wp_create_nonce( ResubscribeEndpoint::nonce() ), - 'button' => '.ppcp-webhooks-resubscribe', - 'failureMessage' => __( 'Operation failed. Check WooCommerce logs for more details.', 'woocommerce-paypal-payments' ), - ), - 'simulation' => array( - 'start' => array( - 'endpoint' => home_url( \WC_AJAX::get_endpoint( SimulateEndpoint::ENDPOINT ) ), - 'nonce' => wp_create_nonce( SimulateEndpoint::nonce() ), - 'button' => '.ppcp-webhooks-simulate', - 'failureMessage' => __( 'Operation failed. Check WooCommerce logs for more details.', 'woocommerce-paypal-payments' ), - ), - 'state' => array( - 'endpoint' => home_url( \WC_AJAX::get_endpoint( SimulationStateEndpoint::ENDPOINT ) ), - 'successState' => WebhookSimulation::STATE_RECEIVED, - 'waitingMessage' => __( 'Waiting for the webhook to arrive...', 'woocommerce-paypal-payments' ), - 'successMessage' => __( 'The webhook was received successfully.', 'woocommerce-paypal-payments' ), - 'tooLongDelayMessage' => __( 'Looks like the webhook cannot be received. Check that your website is accessible from the internet.', 'woocommerce-paypal-payments' ), - ), - ), - ); - } - - /** - * Enqueues the necessary scripts. - * - * @return void - */ - public function enqueue(): void { - wp_enqueue_style( 'ppcp-webhooks-status-page-style' ); - wp_enqueue_script( 'ppcp-webhooks-status-page' ); - } -} diff --git a/modules/ppcp-webhooks/src/Status/class-webhooksimulation.php b/modules/ppcp-webhooks/src/Status/WebhookSimulation.php similarity index 100% rename from modules/ppcp-webhooks/src/Status/class-webhooksimulation.php rename to modules/ppcp-webhooks/src/Status/WebhookSimulation.php diff --git a/modules/ppcp-webhooks/src/Status/class-webhooksstatuspage.php b/modules/ppcp-webhooks/src/Status/WebhooksStatusPage.php similarity index 100% rename from modules/ppcp-webhooks/src/Status/class-webhooksstatuspage.php rename to modules/ppcp-webhooks/src/Status/WebhooksStatusPage.php diff --git a/modules/ppcp-webhooks/src/class-webhookmodule.php b/modules/ppcp-webhooks/src/WebhookModule.php similarity index 96% rename from modules/ppcp-webhooks/src/class-webhookmodule.php rename to modules/ppcp-webhooks/src/WebhookModule.php index fae5c5a3a..398484c78 100644 --- a/modules/ppcp-webhooks/src/class-webhookmodule.php +++ b/modules/ppcp-webhooks/src/WebhookModule.php @@ -27,9 +27,7 @@ use WooCommerce\PayPalCommerce\Webhooks\Status\WebhooksStatusPage; class WebhookModule implements ModuleInterface { /** - * Setup the Webhook module. - * - * @return ServiceProviderInterface + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( @@ -39,9 +37,7 @@ class WebhookModule implements ModuleInterface { } /** - * Run the Webhook module. - * - * @param ContainerInterface|null $container The Container. + * {@inheritDoc} */ public function run( ContainerInterface $container ): void { $logger = $container->get( 'woocommerce.logger.woocommerce' ); diff --git a/modules/ppcp-webhooks/src/class-webhookregistrar.php b/modules/ppcp-webhooks/src/WebhookRegistrar.php similarity index 100% rename from modules/ppcp-webhooks/src/class-webhookregistrar.php rename to modules/ppcp-webhooks/src/WebhookRegistrar.php diff --git a/modules/woocommerce-logging/composer.json b/modules/woocommerce-logging/composer.json new file mode 100644 index 000000000..ebe40607a --- /dev/null +++ b/modules/woocommerce-logging/composer.json @@ -0,0 +1,17 @@ +{ + "name": "woocommerce/woocommerce-logging", + "type": "dhii-mod", + "description": "WC logging module for PPCP", + "license": "GPL-2.0", + "require": { + "php": "^7.1 | ^8.0", + "dhii/module-interface": "^0.3.0-alpha1" + }, + "autoload": { + "psr-4": { + "WooCommerce\\WooCommerce\\Logging\\": "src" + } + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/modules/woocommerce-logging/src/Logger/class-nulllogger.php b/modules/woocommerce-logging/src/Logger/NullLogger.php similarity index 100% rename from modules/woocommerce-logging/src/Logger/class-nulllogger.php rename to modules/woocommerce-logging/src/Logger/NullLogger.php diff --git a/modules/woocommerce-logging/src/Logger/class-woocommercelogger.php b/modules/woocommerce-logging/src/Logger/WooCommerceLogger.php similarity index 100% rename from modules/woocommerce-logging/src/Logger/class-woocommercelogger.php rename to modules/woocommerce-logging/src/Logger/WooCommerceLogger.php diff --git a/modules/woocommerce-logging/src/class-woocommerceloggingmodule.php b/modules/woocommerce-logging/src/WooCommerceLoggingModule.php similarity index 78% rename from modules/woocommerce-logging/src/class-woocommerceloggingmodule.php rename to modules/woocommerce-logging/src/WooCommerceLoggingModule.php index 1d4da4899..29cdad07f 100644 --- a/modules/woocommerce-logging/src/class-woocommerceloggingmodule.php +++ b/modules/woocommerce-logging/src/WooCommerceLoggingModule.php @@ -20,9 +20,7 @@ use Psr\Container\ContainerInterface; class WooCommerceLoggingModule implements ModuleInterface { /** - * Setup the module. - * - * @return ServiceProviderInterface + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( @@ -32,11 +30,9 @@ class WooCommerceLoggingModule implements ModuleInterface { } /** - * Run the module. - * - * @param ContainerInterface $container The container. + * {@inheritDoc} */ - public function run( ContainerInterface $container ): void { + public function run( ContainerInterface $c ): void { } diff --git a/package.json b/package.json index 55c16b69c..b5d5bddf3 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "docker:shell": "docker-compose run --rm wp_dev bash", "docker:install": "docker-compose run --rm composer composer install && yarn run docker:build-js", "docker:build-js": "docker-compose run --rm build yarn run build:dev", - "docker:composer-update": "docker-compose run --rm composer composer update", + "docker:composer-update": "docker-compose run --rm composer composer update && docker-compose run --rm composer composer update --lock", "docker:test": "docker-compose run --rm test vendor/bin/phpunit", "docker:lint": "docker-compose run --rm test vendor/bin/phpcs --parallel=8 -s", "docker:fix-lint": "docker-compose run --rm test vendor/bin/phpcbf", diff --git a/src/class-pluginmodule.php b/src/PluginModule.php similarity index 78% rename from src/class-pluginmodule.php rename to src/PluginModule.php index ef622a978..7f405db42 100644 --- a/src/class-pluginmodule.php +++ b/src/PluginModule.php @@ -20,18 +20,16 @@ use Psr\Container\ContainerInterface; class PluginModule implements ModuleInterface { /** - * Sets the module up. + * {@inheritDoc} */ public function setup(): ServiceProviderInterface { return new ServiceProvider( array(), array() ); } /** - * Runs the module. - * - * @param ContainerInterface|null $container The Container. + * {@inheritDoc} */ - public function run( ContainerInterface $container ): void { + public function run( ContainerInterface $c ): void { } /** diff --git a/tests/PHPUnit/ApiClient/Endpoint/OrderEndpointTest.php b/tests/PHPUnit/ApiClient/Endpoint/OrderEndpointTest.php index 16bd945f7..b64e3c34c 100644 --- a/tests/PHPUnit/ApiClient/Endpoint/OrderEndpointTest.php +++ b/tests/PHPUnit/ApiClient/Endpoint/OrderEndpointTest.php @@ -7,7 +7,7 @@ use Hamcrest\Matchers; use Requests_Utility_CaseInsensitiveDictionary; use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer; use WooCommerce\PayPalCommerce\ApiClient\Entity\ApplicationContext; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\CaptureStatus; use WooCommerce\PayPalCommerce\ApiClient\Entity\Order; use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus; diff --git a/tests/PHPUnit/ApiClient/Endpoint/PaymentsEndpointTest.php b/tests/PHPUnit/ApiClient/Endpoint/PaymentsEndpointTest.php index 337d58ebf..f47282e76 100644 --- a/tests/PHPUnit/ApiClient/Endpoint/PaymentsEndpointTest.php +++ b/tests/PHPUnit/ApiClient/Endpoint/PaymentsEndpointTest.php @@ -8,13 +8,11 @@ use Psr\Log\NullLogger; use Requests_Utility_CaseInsensitiveDictionary; use WooCommerce\PayPalCommerce\ApiClient\Authentication\Bearer; use WooCommerce\PayPalCommerce\ApiClient\Entity\Authorization; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; -use WooCommerce\PayPalCommerce\ApiClient\Entity\ErrorResponseCollection; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\Token; use WooCommerce\PayPalCommerce\ApiClient\Exception\RuntimeException; use WooCommerce\PayPalCommerce\ApiClient\Factory\AuthorizationFactory; use WooCommerce\PayPalCommerce\ApiClient\Factory\CaptureFactory; -use WooCommerce\PayPalCommerce\ApiClient\Factory\ErrorResponseCollectionFactory; use WooCommerce\PayPalCommerce\ApiClient\TestCase; use Mockery; diff --git a/tests/PHPUnit/ApiClient/Factory/PaymentsFactoryTest.php b/tests/PHPUnit/ApiClient/Factory/PaymentsFactoryTest.php index 639d940a4..3540c3905 100644 --- a/tests/PHPUnit/ApiClient/Factory/PaymentsFactoryTest.php +++ b/tests/PHPUnit/ApiClient/Factory/PaymentsFactoryTest.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\ApiClient\Factory; use WooCommerce\PayPalCommerce\ApiClient\Entity\Authorization; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\Payments; use WooCommerce\PayPalCommerce\ApiClient\TestCase; use Mockery; diff --git a/tests/PHPUnit/WcGateway/Gateway/WcGatewayTest.php b/tests/PHPUnit/WcGateway/Gateway/WcGatewayTest.php index 8d3ad40e5..7a1add591 100644 --- a/tests/PHPUnit/WcGateway/Gateway/WcGatewayTest.php +++ b/tests/PHPUnit/WcGateway/Gateway/WcGatewayTest.php @@ -5,7 +5,7 @@ namespace WooCommerce\PayPalCommerce\WcGateway\Gateway; use Psr\Container\ContainerInterface; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\CaptureStatus; use WooCommerce\PayPalCommerce\Onboarding\Environment; use WooCommerce\PayPalCommerce\Onboarding\State; diff --git a/tests/PHPUnit/WcGateway/Processor/AuthorizedPaymentsProcessorTest.php b/tests/PHPUnit/WcGateway/Processor/AuthorizedPaymentsProcessorTest.php index 1f7bed337..80ab8cf29 100644 --- a/tests/PHPUnit/WcGateway/Processor/AuthorizedPaymentsProcessorTest.php +++ b/tests/PHPUnit/WcGateway/Processor/AuthorizedPaymentsProcessorTest.php @@ -10,7 +10,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\PaymentsEndpoint; use WooCommerce\PayPalCommerce\ApiClient\Entity\Authorization; use WooCommerce\PayPalCommerce\ApiClient\Entity\AuthorizationStatus; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\CaptureStatus; use WooCommerce\PayPalCommerce\ApiClient\Entity\Order; use WooCommerce\PayPalCommerce\ApiClient\Entity\Payments; diff --git a/tests/PHPUnit/WcGateway/Processor/OrderProcessorTest.php b/tests/PHPUnit/WcGateway/Processor/OrderProcessorTest.php index 13019b4c1..9872019a3 100644 --- a/tests/PHPUnit/WcGateway/Processor/OrderProcessorTest.php +++ b/tests/PHPUnit/WcGateway/Processor/OrderProcessorTest.php @@ -9,7 +9,7 @@ use Psr\Log\LoggerInterface; use WooCommerce\PayPalCommerce\ApiClient\Endpoint\OrderEndpoint; use WooCommerce\PayPalCommerce\ApiClient\Entity\Authorization; use WooCommerce\PayPalCommerce\ApiClient\Entity\AuthorizationStatus; -use Woocommerce\PayPalCommerce\ApiClient\Entity\Capture; +use WooCommerce\PayPalCommerce\ApiClient\Entity\Capture; use WooCommerce\PayPalCommerce\ApiClient\Entity\CaptureStatus; use WooCommerce\PayPalCommerce\ApiClient\Entity\Order; use WooCommerce\PayPalCommerce\ApiClient\Entity\OrderStatus; diff --git a/wordpress_org_assets/banner-1544x500.png b/wordpress_org_assets/banner-1544x500.png index c1799a118..f75666671 100644 Binary files a/wordpress_org_assets/banner-1544x500.png and b/wordpress_org_assets/banner-1544x500.png differ diff --git a/wordpress_org_assets/banner-772x250.png b/wordpress_org_assets/banner-772x250.png index 9dc7d6f3c..36b7991c2 100644 Binary files a/wordpress_org_assets/banner-772x250.png and b/wordpress_org_assets/banner-772x250.png differ diff --git a/wordpress_org_assets/icon-128x128.png b/wordpress_org_assets/icon-128x128.png index 37f68cead..87c34b428 100644 Binary files a/wordpress_org_assets/icon-128x128.png and b/wordpress_org_assets/icon-128x128.png differ diff --git a/wordpress_org_assets/icon-256x256.png b/wordpress_org_assets/icon-256x256.png index 8a19ca4e7..245d18d4a 100644 Binary files a/wordpress_org_assets/icon-256x256.png and b/wordpress_org_assets/icon-256x256.png differ