Merge trunk

This commit is contained in:
dinamiko 2021-10-13 16:13:42 +02:00
commit a42ae3567f
216 changed files with 675 additions and 951 deletions

View file

@ -1,5 +1,12 @@
*** Changelog ***
= 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
* Fix - Transactions cannot be voided #293
* Fix - Fatal error: get_3ds_contingency() #310
= 1.6.0 - 2021-09-29 =
* Add - Webhook status. #246 #273
* Add - Show CC gateway in admin payments list. #236

View file

@ -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"

626
composer.lock generated
View file

@ -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,10 +35,6 @@
],
"description": "Promoting container interoperability through standard service providers",
"homepage": "https://github.com/container-interop/service-provider",
"support": {
"issues": "https://github.com/container-interop/service-provider/issues",
"source": "https://github.com/container-interop/service-provider/tree/master"
},
"time": "2017-09-20T14:13:36+00:00"
},
{
@ -94,28 +90,31 @@
},
{
"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": {
@ -143,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",
@ -361,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",
@ -521,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"
},
{
@ -572,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"
},
{
@ -615,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": [
@ -665,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"
},
{
@ -735,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"
},
{
@ -805,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"
},
{
@ -860,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"
},
{
@ -925,10 +651,6 @@
"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"
},
{
@ -1042,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"
},
{
@ -1107,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"
},
{
@ -1158,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"
},
{
@ -1220,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"
},
{
@ -1276,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"
},
{
@ -1330,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"
},
{
@ -1383,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"
},
{
@ -1439,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"
},
{
@ -1490,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"
},
{
@ -1557,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"
},
{
@ -1624,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"
},
{
@ -1678,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"
},
{
@ -1729,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"
},
{
@ -1782,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"
},
{
@ -1841,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"
},
@ -1936,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"
},
{
@ -1985,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"
},
{
@ -2059,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"
},
{
@ -2125,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"
},
{
@ -2188,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"
},
{
@ -2265,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"
},
{
@ -2326,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"
},
{
@ -2377,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"
},
{
@ -2432,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"
},
{
@ -2495,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"
},
{
@ -2547,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"
},
{
@ -2600,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"
},
{
@ -2655,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"
},
{
@ -2722,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"
},
{
@ -2779,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"
},
{
@ -2832,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"
},
{
@ -2876,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"
},
{
@ -2926,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"
}
],
@ -2940,6 +2437,7 @@
"prefer-stable": true,
"prefer-lowest": false,
"platform": {
"php": "^7.1 | ^8.0",
"ext-json": "*"
},
"platform-dev": [],

View file

@ -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');"

View file

@ -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
}

View file

@ -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();
},

View file

@ -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();
}
);

View file

@ -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
}

View file

@ -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' );
@ -188,36 +189,36 @@ return array(
$subscription_helper
);
},
'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 {
@ -228,7 +229,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' );
@ -248,34 +249,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' );
@ -289,15 +290,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();
},
);

View file

@ -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 ) {

View file

@ -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;

View file

@ -47,10 +47,25 @@ class AuthorizationStatusDetails {
/**
* Returns the reason explaining authorization status.
* One of AuthorizationStatusDetails constants.
*
* @return string
*/
public function reason(): string {
return $this->reason;
}
/**
* Returns the human-readable reason text explaining authorization status.
*
* @return string
*/
public function text(): string {
switch ( $this->reason ) {
case self::PENDING_REVIEW:
return __( 'Authorization is pending manual review.', 'woocommerce-paypal-payments' );
default:
return $this->reason;
}
}
}

View file

@ -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

View file

@ -0,0 +1,101 @@
<?php
/**
* The CaptureStatusDetails object.
*
* @see https://developer.paypal.com/docs/api/payments/v2/#definition-capture_status_details
*
* @package WooCommerce\PayPalCommerce\ApiClient\Entity
*/
declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\ApiClient\Entity;
/**
* Class CaptureStatusDetails
*/
class CaptureStatusDetails {
const BUYER_COMPLAINT = 'BUYER_COMPLAINT';
const CHARGEBACK = 'CHARGEBACK';
const ECHECK = 'ECHECK';
const INTERNATIONAL_WITHDRAWAL = 'INTERNATIONAL_WITHDRAWAL';
const OTHER = 'OTHER';
const PENDING_REVIEW = 'PENDING_REVIEW';
const RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION = 'RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION';
const REFUNDED = 'REFUNDED';
const TRANSACTION_APPROVED_AWAITING_FUNDING = 'TRANSACTION_APPROVED_AWAITING_FUNDING';
const UNILATERAL = 'UNILATERAL';
const VERIFICATION_REQUIRED = 'VERIFICATION_REQUIRED';
/**
* The reason.
*
* @var string
*/
private $reason;
/**
* CaptureStatusDetails constructor.
*
* @param string $reason The reason explaining capture status.
*/
public function __construct( string $reason ) {
$this->reason = $reason;
}
/**
* Compares the current reason with a given one.
*
* @param string $reason The reason to compare with.
*
* @return bool
*/
public function is( string $reason ): bool {
return $this->reason === $reason;
}
/**
* Returns the reason explaining capture status.
* One of CaptureStatusDetails constants.
*
* @return string
*/
public function reason(): string {
return $this->reason;
}
/**
* Returns the human-readable reason text explaining capture status.
*
* @return string
*/
public function text(): string {
switch ( $this->reason ) {
case self::BUYER_COMPLAINT:
return __( 'The payer initiated a dispute for this captured payment with PayPal.', 'woocommerce-paypal-payments' );
case self::CHARGEBACK:
return __( 'The captured funds were reversed in response to the payer disputing this captured payment with the issuer of the financial instrument used to pay for this captured payment.', 'woocommerce-paypal-payments' );
case self::ECHECK:
return __( 'The payer paid by an eCheck that has not yet cleared.', 'woocommerce-paypal-payments' );
case self::INTERNATIONAL_WITHDRAWAL:
return __( 'Visit your online account. In your Account Overview, accept and deny this payment.', 'woocommerce-paypal-payments' );
case self::OTHER:
return __( 'No additional specific reason can be provided. For more information about this captured payment, visit your account online or contact PayPal.', 'woocommerce-paypal-payments' );
case self::PENDING_REVIEW:
return __( 'The captured payment is pending manual review.', 'woocommerce-paypal-payments' );
case self::RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION:
return __( 'The payee has not yet set up appropriate receiving preferences for their account. For more information about how to accept or deny this payment, visit your account online. This reason is typically offered in scenarios such as when the currency of the captured payment is different from the primary holding currency of the payee.', 'woocommerce-paypal-payments' );
case self::REFUNDED:
return __( 'The captured funds were refunded.', 'woocommerce-paypal-payments' );
case self::TRANSACTION_APPROVED_AWAITING_FUNDING:
return __( 'The payer must send the funds for this captured payment. This code generally appears for manual EFTs.', 'woocommerce-paypal-payments' );
case self::UNILATERAL:
return __( 'The payee does not have a PayPal account.', 'woocommerce-paypal-payments' );
case self::VERIFICATION_REQUIRED:
return __( 'The payee\'s PayPal account is not verified.', 'woocommerce-paypal-payments' );
default:
return $this->reason;
}
}
}

View file

@ -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;

View file

@ -1,66 +0,0 @@
<?php
/**
* The CaptureStatusDetails object.
*
* @see https://developer.paypal.com/docs/api/payments/v2/#definition-capture_status_details
*
* @package WooCommerce\PayPalCommerce\ApiClient\Entity
*/
declare(strict_types=1);
namespace WooCommerce\PayPalCommerce\ApiClient\Entity;
/**
* Class CaptureStatusDetails
*/
class CaptureStatusDetails {
const BUYER_COMPLAINT = 'BUYER_COMPLAINT';
const CHARGEBACK = 'CHARGEBACK';
const ECHECK = 'ECHECK';
const INTERNATIONAL_WITHDRAWAL = 'INTERNATIONAL_WITHDRAWAL';
const OTHER = 'OTHER';
const PENDING_REVIEW = 'PENDING_REVIEW';
const RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION = 'RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION';
const REFUNDED = 'REFUNDED';
const TRANSACTION_APPROVED_AWAITING_FUNDING = 'TRANSACTION_APPROVED_AWAITING_FUNDING';
const UNILATERAL = 'REFUNDED';
const VERIFICATION_REQUIRED = 'VERIFICATION_REQUIRED';
/**
* The reason.
*
* @var string
*/
private $reason;
/**
* CaptureStatusDetails constructor.
*
* @param string $reason The reason explaining capture status.
*/
public function __construct( string $reason ) {
$this->reason = $reason;
}
/**
* Compares the current reason with a given one.
*
* @param string $reason The reason to compare with.
*
* @return bool
*/
public function is( string $reason ): bool {
return $this->reason === $reason;
}
/**
* Returns the reason explaining capture status.
*
* @return string
*/
public function reason(): string {
return $this->reason;
}
}

View file

@ -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;

View file

@ -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;
/**

View file

@ -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
}

View file

@ -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();
},
);

View file

@ -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;
/**

Some files were not shown because too many files have changed in this diff Show more