diff --git a/202/_dev/js/acdc.js b/202/_dev/js/acdc.js index e59557d2..5f9e6551 100644 --- a/202/_dev/js/acdc.js +++ b/202/_dev/js/acdc.js @@ -38,8 +38,6 @@ const ACDC = function(conf) { this.isMoveButtonAtEnd = conf['isMoveButtonAtEnd'] === undefined ? null : conf['isMoveButtonAtEnd']; this.buttonForm = conf['buttonForm'] === undefined ? null : conf['buttonForm']; - - this.isCardFields = conf['isCardFields'] === undefined ? false : conf['isCardFields']; }; ACDC.prototype.initButton = function() { @@ -71,7 +69,7 @@ ACDC.prototype.getIdOrder = function() { headers: { 'content-type': 'application/json;charset=utf-8' }, - body: JSON.stringify({page: 'cart', addAddress: 1, sca_verification: (this.isCardFields ? 'SCA_WHEN_REQUIRED' : '')}), + body: JSON.stringify({page: 'cart', addAddress: 1, sca_verification: 'SCA_WHEN_REQUIRED'}), }).then(function(res) { return res.json(); }).then(function(data) { @@ -111,11 +109,7 @@ ACDC.prototype.getPaypalButtonsContainer = function() { }; ACDC.prototype.initFields = function() { - if (this.isCardFields) { - this.initCardFields(); - } else { - this.initHostedFields(); - } + this.initCardFields(); }; ACDC.prototype.initCardFields = function() { diff --git a/202/build.xml b/202/build.xml index 1fd219e0..8d49cf03 100644 --- a/202/build.xml +++ b/202/build.xml @@ -31,7 +31,7 @@ - + diff --git a/classes/ACDC/AcdcPaymentMethod.php b/classes/ACDC/AcdcPaymentMethod.php index ecb596f4..e181664e 100644 --- a/classes/ACDC/AcdcPaymentMethod.php +++ b/classes/ACDC/AcdcPaymentMethod.php @@ -29,7 +29,6 @@ use Configuration; use Context; -use PayPal; use PaypalAddons\classes\AbstractMethodPaypal; use PaypalAddons\classes\Constants\PaypalConfigurations; @@ -66,11 +65,7 @@ public function render() protected function getTemplatePath() { - if ($this->isCardFields()) { - return 'module:paypal/views/templates/acdc/payment-option-card-fields.tpl'; - } else { - return 'module:paypal/views/templates/acdc/payment-option.tpl'; - } + return 'module:paypal/views/templates/acdc/payment-option.tpl'; } protected function getTplVars() @@ -79,7 +74,6 @@ protected function getTplVars() 'psPaypalDir' => _PS_MODULE_DIR_ . 'paypal', 'JSvars' => [ PaypalConfigurations::MOVE_BUTTON_AT_END => (int) Configuration::get(PaypalConfigurations::MOVE_BUTTON_AT_END), - 'isCardFields' => $this->isCardFields(), ], 'JSscripts' => $this->getScripts(), ]; @@ -90,23 +84,12 @@ protected function getTplVars() protected function getScripts() { $scripts = []; - - if ($this->isCardFields()) { - $srcLib = $this->method->getUrlJsSdkLib(['components' => 'card-fields,marks']); - } else { - $srcLib = $this->method->getUrlJsSdkLib(['components' => 'hosted-fields,marks']); - } - + $srcLib = $this->method->getUrlJsSdkLib(['components' => 'card-fields,marks']); $scripts['tot-paypal-acdc-sdk'] = [ 'src' => $srcLib, 'data-namespace' => 'totPaypalAcdcSdk', 'data-partner-attribution-id' => $this->getPartnerId(), ]; - - if (!$this->isCardFields()) { - $scripts['tot-paypal-acdc-sdk']['data-client-token'] = $this->getClientToken(); - } - $scripts['acdc'] = [ 'src' => __PS_BASE_URI__ . 'modules/paypal/views/js/acdc.js', ]; @@ -129,9 +112,4 @@ protected function getClientToken() return ''; } - - protected function isCardFields() - { - return (int) Configuration::get(PayPal::USE_CARD_FIELDS); - } } diff --git a/classes/API/ExtensionSDK/AccessTokenRequest.php b/classes/API/ExtensionSDK/AccessTokenRequest.php index 7468ce3f..5e4939b0 100644 --- a/classes/API/ExtensionSDK/AccessTokenRequest.php +++ b/classes/API/ExtensionSDK/AccessTokenRequest.php @@ -44,6 +44,8 @@ class AccessTokenRequest implements HttpRequestInterface, WrapperInterface */ protected $paypalCustomerId; + protected $body = null; + public function __construct($paypalCustomerId = null) { $this->headers['Content-Type'] = 'application/x-www-form-urlencoded'; @@ -78,8 +80,19 @@ public function setHeaders($headers) return $this; } + public function setBody($body) + { + $this->body = $body; + + return $this; + } + public function getBody() { + if (false === empty($this->body)) { + return $this->body; + } + $body = [ 'grant_type' => 'client_credentials', ]; diff --git a/classes/API/ExtensionSDK/GetCredentialsRequest.php b/classes/API/ExtensionSDK/GetCredentialsRequest.php new file mode 100644 index 00000000..454e2968 --- /dev/null +++ b/classes/API/ExtensionSDK/GetCredentialsRequest.php @@ -0,0 +1,93 @@ + + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * @copyright PayPal + * + */ + +namespace PaypalAddons\classes\API\ExtensionSDK; + +if (!defined('_PS_VERSION_')) { + exit; +} + +use PaypalAddons\classes\API\HttpAdoptedResponse; +use PaypalAddons\classes\API\HttpResponse; +use PaypalAddons\classes\API\Request\HttpRequestInterface; +use PaypalAddons\classes\API\WrapperInterface; + +class GetCredentialsRequest implements HttpRequestInterface, WrapperInterface +{ + protected $headers = []; + /** @var string */ + protected $partnerId; + + public function __construct($partnerId) + { + $this->partnerId = (string) $partnerId; + } + + public function getPath() + { + return sprintf('/v1/customer/partners/%s/merchant-integrations/credentials', $this->partnerId); + } + + /** @return array*/ + public function getHeaders() + { + return $this->headers; + } + + /** + * @param array $headers + * + * @return self + */ + public function setHeaders($headers) + { + if (is_array($headers)) { + $this->headers = $headers; + } + + return $this; + } + + public function getMethod() + { + return 'GET'; + } + + public function wrap($object) + { + if ($object instanceof HttpResponse) { + return new HttpAdoptedResponse($object); + } + + return $object; + } + + public function getBody() + { + return null; + } +} diff --git a/classes/API/HttpJsonResponse.php b/classes/API/HttpJsonResponse.php index 75ae9a64..0b61d79e 100644 --- a/classes/API/HttpJsonResponse.php +++ b/classes/API/HttpJsonResponse.php @@ -45,7 +45,7 @@ public function getHeaders() return $this->response->getHeaders(); } - public function setHeaders($headers) + public function setHeaders(array $headers) { return $this->response->setHeaders($headers); } diff --git a/classes/API/Onboarding/PaypalGetAuthToken.php b/classes/API/Onboarding/PaypalGetAuthToken.php index 62f7246a..2119bf34 100644 --- a/classes/API/Onboarding/PaypalGetAuthToken.php +++ b/classes/API/Onboarding/PaypalGetAuthToken.php @@ -28,8 +28,10 @@ namespace PaypalAddons\classes\API\Onboarding; use Exception; -use GuzzleHttp\Client; -use GuzzleHttp\RequestOptions; +use PaypalAddons\classes\AbstractMethodPaypal; +use PaypalAddons\classes\API\ExtensionSDK\AccessTokenRequest; +use PaypalAddons\classes\API\HttpAdoptedResponse; +use PaypalAddons\classes\API\PaypalClient; use PaypalAddons\classes\API\Response\Error; use PaypalAddons\classes\API\Response\ResponseGetAuthToken; use Throwable; @@ -40,8 +42,8 @@ class PaypalGetAuthToken { - /** @var */ - protected $httpClient; + /** @var PaypalClient */ + protected $client; /** @var string */ protected $authCode; @@ -54,11 +56,9 @@ class PaypalGetAuthToken public function __construct($authCode, $sharedId, $sellerNonce, $sandbox) { - // Depending on the guzzle version, Client take 'base_uri' or 'base_url' parameter - $this->httpClient = new Client([ - 'base_uri' => $sandbox ? 'https://api.sandbox.paypal.com' : 'https://api.paypal.com', - 'base_url' => $sandbox ? 'https://api.sandbox.paypal.com' : 'https://api.paypal.com', - ]); + $method = AbstractMethodPaypal::load(); + $method->setSandbox($sandbox); + $this->client = PaypalClient::get($method); $this->authCode = $authCode; $this->sharedId = $sharedId; $this->sellerNonce = $sellerNonce; @@ -70,38 +70,36 @@ public function __construct($authCode, $sharedId, $sellerNonce, $sandbox) public function execute() { $returnResponse = new ResponseGetAuthToken(); - $body = sprintf('grant_type=authorization_code&code=%s&code_verifier=%s', $this->authCode, $this->sellerNonce); + $request = new AccessTokenRequest(); + $request->setBody( + sprintf('grant_type=authorization_code&code=%s&code_verifier=%s', $this->authCode, $this->sellerNonce) + ); + $request->setHeaders([ + 'Content-Type' => 'text/plain', + 'Authorization' => 'Basic ' . base64_encode($this->sharedId), + ]); try { - $response = $this->httpClient->post( - '/v1/oauth2/token', - [ - RequestOptions::BODY => $body, - RequestOptions::HEADERS => [ - 'Content-Type' => 'text/plain', - 'Authorization' => 'Basic ' . base64_encode($this->sharedId), - ], - ] - ); - - $responseDecode = json_decode($response->getBody()->getContents()); + /** @var HttpAdoptedResponse $response */ + $response = $this->client->execute($request); + $responseDecode = $response->getAdoptedResponse(); $returnResponse->setSuccess(true) - ->setData($returnResponse) - ->setAuthToken($responseDecode->access_token) - ->setRefreshToken($responseDecode->refresh_token) - ->setTokenType($responseDecode->token_type) - ->setNonce($responseDecode->nonce); + ->setData($response) + ->setAuthToken($responseDecode->result->access_token) + ->setRefreshToken($responseDecode->result->refresh_token) + ->setTokenType($responseDecode->result->token_type) + ->setNonce($responseDecode->result->nonce); } catch (Throwable $e) { $error = new Error(); $error ->setMessage($e->getMessage()) - ->setErrorCode(empty($e->statusCode) ? $e->getCode() : $e->statusCode); + ->setErrorCode($e->getCode()); $returnResponse->setError($error)->setSuccess(false); } catch (Exception $e) { $error = new Error(); $error ->setMessage($e->getMessage()) - ->setErrorCode(empty($e->statusCode) ? $e->getCode() : $e->statusCode); + ->setErrorCode($e->getCode()); $returnResponse->setError($error)->setSuccess(false); } diff --git a/classes/API/Onboarding/PaypalGetCredentials.php b/classes/API/Onboarding/PaypalGetCredentials.php index a27f7afe..f5f53ba3 100644 --- a/classes/API/Onboarding/PaypalGetCredentials.php +++ b/classes/API/Onboarding/PaypalGetCredentials.php @@ -28,8 +28,10 @@ namespace PaypalAddons\classes\API\Onboarding; use Exception; -use GuzzleHttp\Client; -use GuzzleHttp\RequestOptions; +use PaypalAddons\classes\AbstractMethodPaypal; +use PaypalAddons\classes\API\ExtensionSDK\GetCredentialsRequest; +use PaypalAddons\classes\API\HttpAdoptedResponse; +use PaypalAddons\classes\API\PaypalClient; use PaypalAddons\classes\API\Response\Error; use PaypalAddons\classes\API\Response\ResponseGetCredentials; use Throwable; @@ -40,8 +42,8 @@ class PaypalGetCredentials { - /** @var */ - protected $httpClient; + /** @var PaypalClient */ + protected $client; /** @var string */ protected $authToken; @@ -51,11 +53,9 @@ class PaypalGetCredentials public function __construct($authToken, $partnerId, $sandbox) { - // Depending on the guzzle version, Client take 'base_uri' or 'base_url' parameter - $this->httpClient = new Client([ - 'base_uri' => $sandbox ? 'https://api.sandbox.paypal.com' : 'https://api.paypal.com', - 'base_url' => $sandbox ? 'https://api.sandbox.paypal.com' : 'https://api.paypal.com', - ]); + $method = AbstractMethodPaypal::load(); + $method->setSandbox($sandbox); + $this->client = PaypalClient::get($method); $this->authToken = $authToken; $this->partnerId = $partnerId; } @@ -63,35 +63,31 @@ public function __construct($authToken, $partnerId, $sandbox) public function execute() { $returnResponse = new ResponseGetCredentials(); - $uri = sprintf('/v1/customer/partners/%s/merchant-integrations/credentials', $this->partnerId); + $request = new GetCredentialsRequest($this->partnerId); + $request->setHeaders([ + 'Authorization' => 'Bearer ' . $this->authToken, + ]); try { - $response = $this->httpClient->get( - $uri, - [ - RequestOptions::HEADERS => [ - 'Authorization' => 'Bearer ' . $this->authToken, - ], - ] - ); - - $responseDecode = json_decode($response->getBody()->getContents()); + /** @var HttpAdoptedResponse $response */ + $response = $this->client->execute($request); + $responseDecode = $response->getAdoptedResponse(); $returnResponse->setSuccess(true) - ->setClientId($responseDecode->client_id) - ->setSecret($responseDecode->client_secret) - ->setMerchantId($responseDecode->payer_id) - ->setData($returnResponse); + ->setClientId($responseDecode->result->client_id) + ->setSecret($responseDecode->result->client_secret) + ->setMerchantId($responseDecode->result->payer_id) + ->setData($response); } catch (Throwable $e) { $error = new Error(); $error ->setMessage($e->getMessage()) - ->setErrorCode(empty($e->statusCode) ? $e->getCode() : $e->statusCode); + ->setErrorCode($e->getCode()); $returnResponse->setError($error)->setSuccess(false); } catch (Exception $e) { $error = new Error(); $error ->setMessage($e->getMessage()) - ->setErrorCode(empty($e->statusCode) ? $e->getCode() : $e->statusCode); + ->setErrorCode($e->getCode()); $returnResponse->setError($error)->setSuccess(false); } diff --git a/classes/API/Request/PaypalOrderGetRequest.php b/classes/API/Request/PaypalOrderGetRequest.php index c5f1c174..10e2b15d 100644 --- a/classes/API/Request/PaypalOrderGetRequest.php +++ b/classes/API/Request/PaypalOrderGetRequest.php @@ -118,43 +118,32 @@ public function execute() protected function getAddress1($exec) { - return $exec->result->purchase_units[0]->shipping->address->address_line_1; + return empty($exec->result->purchase_units[0]->shipping->address->address_line_1) ? '' : $exec->result->purchase_units[0]->shipping->address->address_line_1; } protected function getAddress2($exec) { - $address = $exec->result->purchase_units[0]->shipping->address; - if (isset($address->address_line_2)) { - return $address->address_line_2; - } else { - return ''; - } + return empty($exec->result->purchase_units[0]->shipping->address->address_line_2) ? '' : $exec->result->purchase_units[0]->shipping->address->address_line_2; } protected function getCity($exec) { - return $exec->result->purchase_units[0]->shipping->address->admin_area_2; + return empty($exec->result->purchase_units[0]->shipping->address->admin_area_2) ? '' : $exec->result->purchase_units[0]->shipping->address->admin_area_2; } protected function getPostCode($exec) { - return $exec->result->purchase_units[0]->shipping->address->postal_code; + return empty($exec->result->purchase_units[0]->shipping->address->postal_code) ? '' : $exec->result->purchase_units[0]->shipping->address->postal_code; } protected function getCountryCode($exec) { - return $exec->result->purchase_units[0]->shipping->address->country_code; + return empty($exec->result->purchase_units[0]->shipping->address->country_code) ? '' : $exec->result->purchase_units[0]->shipping->address->country_code; } protected function getStateCode($exec) { - $address = $exec->result->purchase_units[0]->shipping->address; - - if (isset($address->admin_area_1)) { - return $address->admin_area_1; - } else { - return ''; - } + return empty($exec->result->purchase_units[0]->shipping->address->admin_area_1) ? '' : $exec->result->purchase_units[0]->shipping->address->admin_area_1; } protected function getPhone($exec) @@ -168,7 +157,7 @@ protected function getPhone($exec) protected function getFullName($exec) { - return $exec->result->purchase_units[0]->shipping->name->full_name; + return empty($exec->result->purchase_units[0]->shipping->name->full_name) ? '' : $exec->result->purchase_units[0]->shipping->name->full_name; } protected function getEmail($exec) diff --git a/classes/AbstractMethodPaypal.php b/classes/AbstractMethodPaypal.php index 8de193e8..df940a84 100755 --- a/classes/AbstractMethodPaypal.php +++ b/classes/AbstractMethodPaypal.php @@ -59,6 +59,7 @@ use PaypalAddons\classes\Shortcut\ShortcutSignup; use PaypalAddons\classes\Vaulting\VaultingFunctionality; use PaypalAddons\classes\Webhook\WebhookOption; +use PaypalAddons\services\Checker; use PaypalAddons\services\Order\RefundAmountCalculator; use PaypalAddons\services\PaypalContext; use PaypalAddons\services\ServicePaypalVaulting; @@ -76,6 +77,8 @@ abstract class AbstractMethodPaypal extends AbstractMethod { + const AUTHORIZE = 'AUTHORIZE'; + const SALE = 'CAPTURE'; /** @var bool */ protected $isSandbox; @@ -247,10 +250,7 @@ public function validation() throw new PaypalException(PaypalException::PAYMENT_EXISTS, 'Payment exists.'); } - if ($cart->isAllProductsInStock() !== true || - (method_exists($cart, 'checkAllProductsAreStillAvailableInThisState') && $cart->checkAllProductsAreStillAvailableInThisState() !== true) || - (method_exists($cart, 'checkAllProductsHaveMinimalQuantities') && $cart->checkAllProductsHaveMinimalQuantities() !== true) - ) { + if (false === $this->initChecker()->isProductsAvailable($cart)) { throw new PaypalException(PaypalException::PRODUCT_UNAVAILABLE, sprintf('Cart with id %d contains products unavailable. Cannot capture the order.', (int) $cart->id)); } @@ -949,6 +949,11 @@ public function deleteWebhook($id) return (new Response())->setSuccess(false); } + protected function initChecker() + { + return new Checker(); + } + /** @return string*/ abstract public function getMerchantId(); diff --git a/classes/Form/TechnicalChecklistForm.php b/classes/Form/TechnicalChecklistForm.php index 25ee02ef..94131722 100644 --- a/classes/Form/TechnicalChecklistForm.php +++ b/classes/Form/TechnicalChecklistForm.php @@ -71,6 +71,8 @@ public function getDescription() 'accountConfigured' => $this->method == null ? false : $this->method->isConfigured(), 'sslActivated' => $this->module->isSslActive(), 'localizationUrl' => $this->context->link->getAdminLink('AdminLocalization', true), + 'numberRedundantFiles' => count($this->module->getRedundantFiles()), + 'diagnosticPage' => $this->context->link->getAdminLink('AdminPaypalDiagnostic', true), ]; if ($this->webhookOption->isEligibleContext()) { diff --git a/classes/MethodEC.php b/classes/MethodEC.php index 25c4280d..f56ad7a8 100755 --- a/classes/MethodEC.php +++ b/classes/MethodEC.php @@ -42,10 +42,6 @@ */ class MethodEC extends AbstractMethodPaypal { - const AUTHORIZE = 'AUTHORIZE'; - - const SALE = 'CAPTURE'; - /** @var bool pay with card without pp account */ public $credit_card; @@ -137,7 +133,7 @@ public function getConfig(PayPal $module) public function logOut($sandbox = null) { if ($sandbox == null) { - $mode = Configuration::get('PAYPAL_SANDBOX') ? 'SANDBOX' : 'LIVE'; + $mode = $this->isSandbox() ? 'SANDBOX' : 'LIVE'; } else { $mode = (int) $sandbox ? 'SANDBOX' : 'LIVE'; } diff --git a/classes/MethodMB.php b/classes/MethodMB.php index c894d619..ae4d126d 100644 --- a/classes/MethodMB.php +++ b/classes/MethodMB.php @@ -107,7 +107,7 @@ public function setParameters($values) public function logOut($sandbox = null) { if ($sandbox == null) { - $mode = Configuration::get('PAYPAL_SANDBOX') ? 'SANDBOX' : 'LIVE'; + $mode = $this->isSandbox() ? 'SANDBOX' : 'LIVE'; } else { $mode = (int) $sandbox ? 'SANDBOX' : 'LIVE'; } @@ -164,6 +164,7 @@ public function validation() */ public function confirmCapture($orderPayPal) { + return $this->paypalApiManager->getCaptureAuthorizeRequest($orderPayPal)->execute(); } /** @@ -171,6 +172,7 @@ public function confirmCapture($orderPayPal) */ public function void($orderPayPal) { + return $this->paypalApiManager->getAuthorizationVoidRequest($orderPayPal)->execute(); } /** @@ -454,7 +456,7 @@ public function getPaypalPartnerId() public function getIntent() { - return Configuration::get('PAYPAL_API_INTENT') == 'sale' ? 'CAPTURE' : 'AUTHORIZE'; + return Configuration::get('PAYPAL_API_INTENT') == 'sale' ? self::SALE : self::AUTHORIZE; } public function getMerchantId() diff --git a/classes/MethodPPP.php b/classes/MethodPPP.php index 1cd56649..de1b4721 100755 --- a/classes/MethodPPP.php +++ b/classes/MethodPPP.php @@ -120,7 +120,7 @@ public function setParameters($values) public function logOut($sandbox = null) { if ($sandbox == null) { - $mode = Configuration::get('PAYPAL_SANDBOX') ? 'SANDBOX' : 'LIVE'; + $mode = $this->isSandbox() ? 'SANDBOX' : 'LIVE'; } else { $mode = (int) $sandbox ? 'SANDBOX' : 'LIVE'; } @@ -278,7 +278,7 @@ public function getSecret($sandbox = null) public function getIntent() { - return 'CAPTURE'; + return self::SALE; } public function getReturnUrl() diff --git a/classes/Shortcut/ShortcutPaymentStep.php b/classes/Shortcut/ShortcutPaymentStep.php index 60dc3952..8a981b0d 100644 --- a/classes/Shortcut/ShortcutPaymentStep.php +++ b/classes/Shortcut/ShortcutPaymentStep.php @@ -28,8 +28,6 @@ namespace PaypalAddons\classes\Shortcut; use Configuration; -use MethodMB; -use PaypalAddons\classes\AbstractMethodPaypal; use PaypalAddons\classes\Constants\PaypalConfigurations; use Tools; @@ -42,10 +40,6 @@ class ShortcutPaymentStep extends ShortcutAbstract public function __construct() { parent::__construct(); - - if ($this->method instanceof MethodMB) { - $this->method = AbstractMethodPaypal::load('EC'); - } } public function getTemplatePath() diff --git a/composer.json b/composer.json index 3572ea45..c0ad8147 100644 --- a/composer.json +++ b/composer.json @@ -38,8 +38,7 @@ ] }, "require": { - "php": ">=5.6.0", - "guzzlehttp/guzzle": "6.*" + "php": ">=5.6.0" }, "require-dev": { "php": "^7.3", diff --git a/composer.lock b/composer.lock index 4f917bc3..617d31b5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,643 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3c4a0be3349a6788ce91d6e98e439020", - "packages": [ - { - "name": "guzzlehttp/guzzle", - "version": "6.5.8", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.9", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.5-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5.8" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", - "type": "tidelift" - } - ], - "time": "2022-06-20T22:16:07+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "1.5.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.3" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ], - "time": "2023-05-21T12:31:43+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2023-04-17T16:00:37+00:00" - }, - { - "name": "psr/http-message", - "version": "1.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" - }, - "time": "2023-04-04T09:50:52+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "a287ed7475f85bf6f61890146edbc932c0fff919" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a287ed7475f85bf6f61890146edbc932c0fff919", - "reference": "a287ed7475f85bf6f61890146edbc932c0fff919", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.29.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": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.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": "2024-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/861391a8da9a04cbad2d232ddd9e4893220d6e25", - "reference": "861391a8da9a04cbad2d232ddd9e4893220d6e25", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.29.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": "2024-01-29T20:11:03+00:00" - } - ], + "content-hash": "1be9e583cc4481b26e52fd1d26ae66b1", + "packages": [], "packages-dev": [ { "name": "composer/pcre", @@ -715,24 +80,24 @@ }, { "name": "composer/semver", - "version": "3.4.0", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -776,7 +141,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -792,7 +157,7 @@ "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", @@ -862,16 +227,16 @@ }, { "name": "doctrine/annotations", - "version": "1.14.3", + "version": "1.14.4", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af" + "reference": "253dca476f70808a5aeed3a47cc2cc88c5cab915" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", - "reference": "fb0d71a7393298a7b232cbf4c8b1f73f3ec3d5af", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/253dca476f70808a5aeed3a47cc2cc88c5cab915", + "reference": "253dca476f70808a5aeed3a47cc2cc88c5cab915", "shasum": "" }, "require": { @@ -882,11 +247,11 @@ }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^9 || ^10", - "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "doctrine/coding-standard": "^9 || ^12", + "phpstan/phpstan": "~1.4.10 || ^1.10.28", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "symfony/cache": "^4.4 || ^5.4 || ^6", - "vimeo/psalm": "^4.10" + "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7", + "vimeo/psalm": "^4.30 || ^5.14" }, "suggest": { "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" @@ -932,9 +297,9 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.14.3" + "source": "https://github.com/doctrine/annotations/tree/1.14.4" }, - "time": "2023-02-01T09:20:38+00:00" + "time": "2024-09-05T10:15:52+00:00" }, { "name": "doctrine/deprecations", @@ -1242,16 +607,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -1259,11 +624,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -1289,7 +655,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -1297,7 +663,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nikic/php-parser", @@ -1759,16 +1125,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.26.0", + "version": "1.33.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "231e3186624c03d7e7c890ec662b81e6b0405227" + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/231e3186624c03d7e7c890ec662b81e6b0405227", - "reference": "231e3186624c03d7e7c890ec662b81e6b0405227", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", "shasum": "" }, "require": { @@ -1800,9 +1166,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.26.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" }, - "time": "2024-02-23T16:05:55+00:00" + "time": "2024-10-13T11:25:22+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2474,20 +1840,20 @@ }, { "name": "psr/container", - "version": "1.1.2", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", "shasum": "" }, "require": { - "php": ">=7.4.0" + "php": ">=7.2.0" }, "type": "library", "autoload": { @@ -2516,9 +1882,9 @@ ], "support": { "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/1.1.2" + "source": "https://github.com/php-fig/container/tree/1.1.1" }, - "time": "2021-11-05T16:50:12+00:00" + "time": "2021-03-05T17:36:06+00:00" }, { "name": "psr/event-dispatcher", @@ -3246,16 +2612,16 @@ }, { "name": "sebastian/resource-operations", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", - "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { @@ -3267,7 +2633,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-main": "3.0-dev" } }, "autoload": { @@ -3288,8 +2654,7 @@ "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/3.0.3" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, "funding": [ { @@ -3297,7 +2662,7 @@ "type": "github" } ], - "time": "2020-09-28T06:45:17+00:00" + "time": "2024-03-14T16:00:52+00:00" }, { "name": "sebastian/type", @@ -3410,16 +2775,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.0", + "version": "3.10.3", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", + "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", "shasum": "" }, "require": { @@ -3486,7 +2851,7 @@ "type": "open_collective" } ], - "time": "2024-02-16T15:06:51+00:00" + "time": "2024-09-18T10:38:58+00:00" }, { "name": "symfony/console", @@ -3643,16 +3008,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", "shasum": "" }, "require": { @@ -3690,7 +3055,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" }, "funding": [ { @@ -3706,20 +3071,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2023-01-24T14:02:46+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.35", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7a69a85c7ea5bdd1e875806a99c51a87d3a74b38" + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7a69a85c7ea5bdd1e875806a99c51a87d3a74b38", - "reference": "7a69a85c7ea5bdd1e875806a99c51a87d3a74b38", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/72982eb416f61003e9bb6e91f8b3213600dcf9e9", + "reference": "72982eb416f61003e9bb6e91f8b3213600dcf9e9", "shasum": "" }, "require": { @@ -3775,7 +3140,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.35" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.45" }, "funding": [ { @@ -3791,20 +3156,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v2.5.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1" + "reference": "540f4c73e87fd0c71ca44a6aa305d024ac68cb73" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/f98b54df6ad059855739db6fcbc2d36995283fe1", - "reference": "f98b54df6ad059855739db6fcbc2d36995283fe1", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/540f4c73e87fd0c71ca44a6aa305d024ac68cb73", + "reference": "540f4c73e87fd0c71ca44a6aa305d024ac68cb73", "shasum": "" }, "require": { @@ -3854,7 +3219,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.3" }, "funding": [ { @@ -3870,20 +3235,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2024-01-23T13:51:25+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.35", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "5a553607d4ffbfa9c0ab62facadea296c9db7086" + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/5a553607d4ffbfa9c0ab62facadea296c9db7086", - "reference": "5a553607d4ffbfa9c0ab62facadea296c9db7086", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/57c8294ed37d4a055b77057827c67f9558c95c54", + "reference": "57c8294ed37d4a055b77057827c67f9558c95c54", "shasum": "" }, "require": { @@ -3892,6 +3257,9 @@ "symfony/polyfill-mbstring": "~1.8", "symfony/polyfill-php80": "^1.16" }, + "require-dev": { + "symfony/process": "^5.4|^6.4" + }, "type": "library", "autoload": { "psr-4": { @@ -3918,7 +3286,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.35" + "source": "https://github.com/symfony/filesystem/tree/v5.4.45" }, "funding": [ { @@ -3934,7 +3302,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-10-22T13:05:35+00:00" }, { "name": "symfony/finder", @@ -3999,16 +3367,16 @@ }, { "name": "symfony/options-resolver", - "version": "v5.4.21", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9" + "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", - "reference": "4fe5cf6ede71096839f0e4b4444d65dd3a7c1eb9", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", + "reference": "74e5b6f0db3e8589e6cfd5efb317a1fc2bb52fb6", "shasum": "" }, "require": { @@ -4048,7 +3416,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v5.4.21" + "source": "https://github.com/symfony/options-resolver/tree/v5.4.45" }, "funding": [ { @@ -4064,24 +3432,24 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:03:56+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -4127,7 +3495,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -4143,24 +3511,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -4207,7 +3575,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -4223,7 +3591,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php70", @@ -4293,22 +3661,87 @@ ], "time": "2020-10-23T14:02:19+00:00" }, + { + "name": "symfony/polyfill-php72", + "version": "v1.31.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php72.git", + "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", + "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "metapackage", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php72/tree/v1.31.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": "2024-09-09T11:45:10+00:00" + }, { "name": "symfony/polyfill-php73", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/0f68c03565dcaaf25a890667542e8bd75fe7e5bb", + "reference": "0f68c03565dcaaf25a890667542e8bd75fe7e5bb", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -4351,7 +3784,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.31.0" }, "funding": [ { @@ -4367,24 +3800,24 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.29.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", + "reference": "60328e362d4c2c802a54fcbf04f9d3fb892b4cf8", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { @@ -4431,7 +3864,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.31.0" }, "funding": [ { @@ -4447,20 +3880,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v5.4.36", + "version": "v5.4.46", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975" + "reference": "01906871cb9b5e3cf872863b91aba4ec9767daf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4fdf34004f149cc20b2f51d7d119aa500caad975", - "reference": "4fdf34004f149cc20b2f51d7d119aa500caad975", + "url": "https://api.github.com/repos/symfony/process/zipball/01906871cb9b5e3cf872863b91aba4ec9767daf4", + "reference": "01906871cb9b5e3cf872863b91aba4ec9767daf4", "shasum": "" }, "require": { @@ -4493,7 +3926,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.36" + "source": "https://github.com/symfony/process/tree/v5.4.46" }, "funding": [ { @@ -4509,20 +3942,20 @@ "type": "tidelift" } ], - "time": "2024-02-12T15:49:53+00:00" + "time": "2024-11-06T09:18:28+00:00" }, { "name": "symfony/service-contracts", - "version": "v2.5.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c" + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/4b426aac47d6427cc1a1d0f7e2ac724627f5966c", - "reference": "4b426aac47d6427cc1a1d0f7e2ac724627f5966c", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", "shasum": "" }, "require": { @@ -4576,7 +4009,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" }, "funding": [ { @@ -4592,20 +4025,20 @@ "type": "tidelift" } ], - "time": "2022-05-30T19:17:29+00:00" + "time": "2023-04-21T15:04:16+00:00" }, { "name": "symfony/stopwatch", - "version": "v5.4.35", + "version": "v5.4.45", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "887762aa99ff16f65dc8b48aafead415f942d407" + "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/887762aa99ff16f65dc8b48aafead415f942d407", - "reference": "887762aa99ff16f65dc8b48aafead415f942d407", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fb2c199cf302eb207f8c23e7ee174c1c31a5c004", + "reference": "fb2c199cf302eb207f8c23e7ee174c1c31a5c004", "shasum": "" }, "require": { @@ -4638,7 +4071,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v5.4.35" + "source": "https://github.com/symfony/stopwatch/tree/v5.4.45" }, "funding": [ { @@ -4654,7 +4087,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "theseer/tokenizer", @@ -4776,5 +4209,5 @@ "platform-dev": { "php": "^7.3" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/controllers/admin/AdminPaypalConfigurationController.php b/controllers/admin/AdminPaypalConfigurationController.php index c03a39ad..25329d61 100755 --- a/controllers/admin/AdminPaypalConfigurationController.php +++ b/controllers/admin/AdminPaypalConfigurationController.php @@ -394,6 +394,12 @@ public function ajaxProcessGetMessagingConfig() exit; } + $confing = json_decode(Configuration::get(ConfigurationMap::MESSENGING_CONFIG), true); + + if (!is_array($confing)) { + $confing = []; + } + $messagingConfig = [ 'placements' => ['product', 'homepage', 'cart', 'checkout', 'category'], 'merchantIdentifier' => $this->method->getClientId(), @@ -401,10 +407,7 @@ public function ajaxProcessGetMessagingConfig() 'partnerName' => ($this->method->isSandbox() ? PayPal::PAYPAL_PARTNER_ID_SANDBOX : PayPal::PAYPAL_PARTNER_ID_LIVE), 'bnCode' => $this->method->getPaypalPartnerId(), 'locale' => str_replace('-', '_', Context::getContext()->language->locale), - 'config' => json_decode( - Configuration::get(ConfigurationMap::MESSENGING_CONFIG, null, null, null, '{}'), - true - ), + 'config' => $confing, ]; $jsonResponse->setData(['success' => true, 'config' => $messagingConfig])->send(); diff --git a/controllers/admin/AdminPaypalDiagnostic.php b/controllers/admin/AdminPaypalDiagnostic.php index e593a9e6..f23608cd 100644 --- a/controllers/admin/AdminPaypalDiagnostic.php +++ b/controllers/admin/AdminPaypalDiagnostic.php @@ -31,6 +31,7 @@ require_once _PS_MODULE_DIR_ . 'paypal/vendor/autoload.php'; +use PaypalAddons\services\ToolKit; use PaypalPPBTlib\Extensions\Diagnostic\Controllers\Admin\AdminDiagnosticController; class AdminPaypalDiagnosticController extends AdminDiagnosticController @@ -40,4 +41,24 @@ public function initPageHeaderToolbar() parent::initPageHeaderToolbar(); $this->context->smarty->clearAssign('help_link'); } + + public function initContent() + { + $this->context->smarty->assign('isRedundantFileExist', count($this->module->getRedundantFiles()) > 0); + parent::initContent(); + } + + public function initProcess() + { + parent::initProcess(); + + if (Tools::isSubmit('remove_redundant_files')) { + $kit = new ToolKit(); + $baseDir = _PS_MODULE_DIR_ . 'paypal/'; + + foreach ($this->module->getRedundantFiles() as $file) { + $kit->unlink($baseDir . $file); + } + } + } } diff --git a/controllers/front/abstract.php b/controllers/front/abstract.php index 8093a9f8..4dea4652 100644 --- a/controllers/front/abstract.php +++ b/controllers/front/abstract.php @@ -37,6 +37,9 @@ */ abstract class PaypalAbstarctModuleFrontController extends CommonAbstarctModuleFrontController { + /** @var Module|PayPal */ + public $module; + /** * @return PaymentData */ diff --git a/controllers/front/ecInit.php b/controllers/front/ecInit.php index abe82044..c2d0ddf5 100755 --- a/controllers/front/ecInit.php +++ b/controllers/front/ecInit.php @@ -88,7 +88,7 @@ public function setMethod($method) protected function getMethodType($requestData) { if (empty($requestData['methodType'])) { - return 'EC'; + return $this->module->paypal_method; } else { return $requestData['methodType']; } diff --git a/controllers/front/mbValidation.php b/controllers/front/mbValidation.php index 9386bb91..5b4014fe 100644 --- a/controllers/front/mbValidation.php +++ b/controllers/front/mbValidation.php @@ -26,6 +26,7 @@ */ use PaypalAddons\classes\AbstractMethodPaypal; +use PaypalAddons\services\PaymentData; if (!defined('_PS_VERSION_')) { exit; @@ -52,10 +53,10 @@ public function init() public function postProcess() { $paypal = Module::getInstanceByName($this->name); - $payemtData = json_decode(Tools::getValue('paymentData')); - $this->method->setPaymentId($payemtData->paymentId); - $this->method->setPayerId($payemtData->result->payer->payer_info->payer_id); - $this->method->setRememberedCards($payemtData->result->rememberedCards); + $paymentData = $this->parsePaymentData(Tools::getAllValues()); + $this->method->setPaymentId($paymentData->getPaymentID()); + $this->method->setPayerId($paymentData->getPaymentID()); + $this->method->setRememberedCards($paymentData->getRememberedCards()); try { $this->method->validation(); @@ -83,4 +84,38 @@ public function displayAjaxGetPaymentInfo() ]; $this->jsonValues = $responseContent; } + + protected function parsePaymentData($data) + { + $paymentDataObj = new PaymentData(); + + if (!empty($data['token'])) { + $paymentDataObj->setPaymentID($data['token']); + } + if (!empty($data['PayerID'])) { + $paymentDataObj->setPayerID($data['PayerID']); + } + + if (!empty($data['paymentData'])) { + $paymentData = json_decode($data['paymentData'], true); + + if (!empty($paymentData['paymentId'])) { + $paymentDataObj->setPaymentID($paymentData['paymentId']); + } + if (!empty($paymentData['paymentID'])) { + $paymentDataObj->setPaymentID($paymentData['paymentID']); + } + if (!empty($paymentData['result']['payer']['payer_info']['payer_id'])) { + $paymentDataObj->setPayerID($paymentData['result']['payer']['payer_info']['payer_id']); + } + if (!empty($paymentData['payerID'])) { + $paymentDataObj->setPayerID($paymentData['payerID']); + } + if (!empty($paymentData['result']['rememberedCards'])) { + $paymentDataObj->setRememberedCards($paymentData['result']['rememberedCards']); + } + } + + return $paymentDataObj; + } } diff --git a/controllers/front/vaultList.php b/controllers/front/vaultList.php index e822c21c..2042229b 100755 --- a/controllers/front/vaultList.php +++ b/controllers/front/vaultList.php @@ -118,6 +118,13 @@ public function displayAjaxRemovePaypalVaulting() ])->send(); } + if (!$paypalVaulting->id_customer || $paypalVaulting->id_customer != $this->context->customer->id) { + return $response->setData([ + 'success' => false, + 'message' => 'PayPal vaulting is not found', + ])->send(); + } + if (false === $this->method->deleteVaultPaymentToken($paypalVaulting->vault_id)) { return $response->setData([ 'success' => false, diff --git a/controllers/front/webhookhandler.php b/controllers/front/webhookhandler.php index 90f31245..07968a9a 100644 --- a/controllers/front/webhookhandler.php +++ b/controllers/front/webhookhandler.php @@ -29,7 +29,6 @@ use PaypalAddons\classes\API\Model\WebhookEvent; use PaypalAddons\classes\Constants\WebhookHandler; use PaypalAddons\classes\Webhook\WebhookEventHandler; -use PaypalAddons\services\ServicePaypalOrder; use PaypalPPBTlib\Extensions\ProcessLogger\ProcessLoggerHandler; if (!defined('_PS_VERSION_')) { @@ -41,9 +40,6 @@ */ class PaypalWebhookhandlerModuleFrontController extends PaypalAbstarctModuleFrontController { - /** @var ServicePaypalOrder */ - protected $servicePaypalOrder; - /** @var array */ protected $requestData; @@ -72,7 +68,7 @@ public function run() } if (false == ($this->module->getWebhookOption()->isEnable() && $this->module->getWebhookOption()->isAvailable())) { - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); + header($_SERVER['SERVER_PROTOCOL'] . ' 405 Method Not Allowed', true, 405); return; } @@ -85,7 +81,7 @@ public function run() if ($this->webhookEventHandler->handle($webhookEvent)) { header('HTTP/1.1 200 OK'); } else { - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); + header($_SERVER['SERVER_PROTOCOL'] . ' 422 Unprocessable Content', true, 422); } } else { $paypalOrder = $this->initPaypalOrder($this->getRequest()); @@ -102,7 +98,7 @@ public function run() null ); ProcessLoggerHandler::closeLogger(); - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); + header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request', true, 400); } } catch (\Exception $exception) { } catch (\Throwable $exception) {//for php version > 7 @@ -193,7 +189,7 @@ protected function initPaypalOrder($requestData) if (false == empty($event->getResource()->supplementary_data->related_ids->order_id)) { $paymentId = $event->getResource()->supplementary_data->related_ids->order_id; - return $this->servicePaypalOrder->getPaypalOrderByPaymentId($paymentId); + return $this->module->getPaypalOrderService()->getPaypalOrderByPaymentId($paymentId); } return new PaypalOrder(); diff --git a/package-lock.json b/package-lock.json index aad77fac..117d51eb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3433,9 +3433,9 @@ } }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "dependencies": { "bytes": "3.1.2", @@ -3446,7 +3446,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -3505,21 +3505,6 @@ "node": ">= 0.8" } }, - "node_modules/body-parser/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/bonjour-service": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/bonjour-service/-/bonjour-service-1.1.1.tgz", @@ -4057,12 +4042,18 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4850,6 +4841,22 @@ "node": ">= 10" } }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", @@ -5399,6 +5406,25 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.2.1.tgz", @@ -5986,37 +6012,37 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -6061,14 +6087,23 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, "dependencies": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -6109,25 +6144,10 @@ "node": ">= 0.8" } }, - "node_modules/express/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/express/node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "dependencies": { "debug": "2.6.9", @@ -6148,6 +6168,15 @@ "node": ">= 0.8.0" } }, + "node_modules/express/node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/send/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -6155,15 +6184,15 @@ "dev": true }, "node_modules/express/node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dev": true, "dependencies": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" }, "engines": { "node": ">= 0.8.0" @@ -6535,9 +6564,12 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/function.prototype.name": { "version": "1.1.5", @@ -6616,13 +6648,18 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6899,7 +6936,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -6976,6 +7012,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1" }, @@ -7002,12 +7039,11 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "dependencies": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -7017,7 +7053,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true, "engines": { "node": ">= 0.4" }, @@ -7057,6 +7092,17 @@ "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "dev": true }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -8677,10 +8723,13 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", - "dev": true + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/merge-stream": { "version": "2.0.0", @@ -9609,9 +9658,12 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -10042,9 +10094,9 @@ "dev": true }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "dev": true }, "node_modules/path-type": { @@ -10667,11 +10719,11 @@ "dev": true }, "node_modules/qs": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz", - "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -11635,6 +11687,22 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -11684,13 +11752,17 @@ } }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -16561,9 +16633,9 @@ "dev": true }, "body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "requires": { "bytes": "3.1.2", @@ -16574,7 +16646,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -16618,15 +16690,6 @@ "requires": { "ee-first": "1.1.1" } - }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } } } }, @@ -17028,12 +17091,15 @@ } }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" } }, "callsites": { @@ -17624,6 +17690,16 @@ "execa": "^5.0.0" } }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, "define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", @@ -18049,6 +18125,19 @@ "which-typed-array": "^1.1.9" } }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, "es-module-lexer": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.2.1.tgz", @@ -18479,37 +18568,37 @@ "requires": {} }, "express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.21.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.0.tgz", + "integrity": "sha512-VqcNGcj/Id5ZT1LZ/cfihi3ttTn+NJmkli2eZADigjq29qTlWi/hAQ43t/VLPq8+UX06FCEx3ByOYet6ZFblng==", "dev": true, "requires": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", - "finalhandler": "1.2.0", + "finalhandler": "1.3.1", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", - "qs": "6.11.0", + "qs": "6.13.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.2", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -18544,14 +18633,20 @@ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true }, + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true + }, "finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, "requires": { "debug": "2.6.9", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "2.4.1", "parseurl": "~1.3.3", @@ -18580,19 +18675,10 @@ "ee-first": "1.1.1" } }, - "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } - }, "send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "requires": { "debug": "2.6.9", @@ -18610,6 +18696,12 @@ "statuses": "2.0.1" }, "dependencies": { + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true + }, "ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -18619,15 +18711,15 @@ } }, "serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", "dev": true, "requires": { - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.18.0" + "send": "0.19.0" } }, "statuses": { @@ -18909,9 +19001,9 @@ "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "function.prototype.name": { "version": "1.1.5", @@ -18969,13 +19061,15 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "get-stdin": { @@ -19186,7 +19280,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, "requires": { "get-intrinsic": "^1.1.3" } @@ -19253,6 +19346,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, "requires": { "function-bind": "^1.1.1" } @@ -19270,19 +19364,17 @@ "dev": true }, "has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", - "dev": true, + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", "requires": { - "get-intrinsic": "^1.1.1" + "es-define-property": "^1.0.0" } }, "has-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "dev": true + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==" }, "has-symbols": { "version": "1.0.3", @@ -19304,6 +19396,14 @@ "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", "dev": true }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, "hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -20543,9 +20643,9 @@ } }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", "dev": true }, "merge-stream": { @@ -21250,9 +21350,9 @@ "dev": true }, "object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==" + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" }, "object-keys": { "version": "1.1.1", @@ -21574,9 +21674,9 @@ "dev": true }, "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "dev": true }, "path-type": { @@ -22012,11 +22112,11 @@ } }, "qs": { - "version": "6.11.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.1.tgz", - "integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "querystringify": { @@ -22745,6 +22845,19 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, "setprototypeof": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", @@ -22782,13 +22895,14 @@ "dev": true }, "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" } }, "signal-exit": { diff --git a/paypal.php b/paypal.php index 3a53cc5a..6790f9ee 100755 --- a/paypal.php +++ b/paypal.php @@ -71,6 +71,7 @@ use PaypalAddons\services\WebhookService; use PaypalPPBTlib\Extensions\AbstractModuleExtension; use PaypalPPBTlib\Extensions\Diagnostic\DiagnosticExtension; +use PaypalPPBTlib\Extensions\Diagnostic\Stubs\Concrete\FileIntegrityStub; use PaypalPPBTlib\Extensions\ProcessLogger\ProcessLoggerExtension; use PaypalPPBTlib\Extensions\ProcessLogger\ProcessLoggerHandler; use PaypalPPBTlib\Install\ModuleInstaller; @@ -122,8 +123,6 @@ class PayPal extends \PaymentModule implements WidgetInterface const ACCESS_TOKEN = 'PAYPAL_ACCESS_TOKEN'; - const USE_CARD_FIELDS = 'PAYPAL_USE_CARD_FIELDS'; - const SCA_WHEN_REQUIRED = 'SCA_WHEN_REQUIRED'; const SCA_ALWAYS = 'SCA_ALWAYS'; @@ -416,7 +415,6 @@ public function __construct() PaypalConfigurations::PUI_ENABLED => 1, PaypalConfigurations::SEPA_ENABLED => 1, PaypalConfigurations::ACDC_OPTION => 1, - self::USE_CARD_FIELDS => 1, ]; if (version_compare(_PS_VERSION_, '1.7.6', '<')) { @@ -764,7 +762,7 @@ public function hookPaymentOptions($params) if (Module::isEnabled('braintreeofficial') && (int) Configuration::get('BRAINTREEOFFICIAL_ACTIVATE_PAYPAL')) { return []; } - if (!$this->context->customer->isLogged() && !$this->context->customer->is_guest) { + if (false === $this->context->customer->isLogged(true)) { return []; } @@ -2325,12 +2323,21 @@ public function getPartnerInfo() return $response; } - public static function getPrecision() + public static function getPrecision($currency = null) { if (version_compare(_PS_VERSION_, '1.7.7', '<')) { return _PS_PRICE_DISPLAY_PRECISION_; } else { - return Context::getContext()->getComputingPrecision(); + if ($currency instanceof Currency && Validate::isLoadedObject($currency)) { + $context = Context::getContext()->cloneContext(); + $context->currency = $currency; + $precision = $context->getComputingPrecision(); + unset($context); + + return $precision; + } else { + return Context::getContext()->getComputingPrecision(); + } } } @@ -2348,7 +2355,7 @@ public static function getDecimal($isoCurrency = null) $isoCurrency = $paypal->getPaymentCurrencyIso(); } - $precision = self::getPrecision(); + $precision = self::getPrecision(new Currency(Currency::getIdByIsoCode($isoCurrency))); if (in_array($isoCurrency, $currency_wt_decimal) || ($precision == 0)) { return (int) 0; @@ -2695,6 +2702,9 @@ public function getHooksUnregistered() $hookName = empty($alias) ? $hookName : $alias; + if (in_array($hookName, $hooksUnregistered)) { + continue; + } if (Hook::isModuleRegisteredOnHook($this, $hookName, $this->context->shop->id)) { continue; } @@ -2898,7 +2908,7 @@ public function getWebhookOption() return new WebhookOption(); } - protected function getPaypalOrderService() + public function getPaypalOrderService() { return new ServicePaypalOrder(); } @@ -2919,6 +2929,27 @@ public function registerHooks() return $result; } + public function registerHook($hook_name, $shop_list = null) + { + try { + return parent::registerHook($hook_name, $shop_list); + } catch (Throwable $e) { + } catch (Exception $e) { + } + + ProcessLoggerHandler::openLogger(); + ProcessLoggerHandler::logError( + sprintf( + 'Error during registering the hook %s: %s', + $hook_name, + $e->getMessage() + ) + ); + ProcessLoggerHandler::closeLogger(); + + return false; + } + /** * @param PaypalOrder $paypalOrder * @@ -3089,4 +3120,32 @@ public function isConsiderGiftProductAsDiscount() { return version_compare(_PS_VERSION_, '1.7.4.4', '>=') && version_compare(_PS_VERSION_, '1.7.6', '<'); } + + public function getDiagnosticSettings() + { + return include _PS_MODULE_DIR_ . 'paypal/diagnostic.php'; + } + + public function getRedundantFiles() + { + $diagnosticConf = $this->getDiagnosticSettings(); + + if (empty($diagnosticConf[0]['stubs'][FileIntegrityStub::class])) { + return []; + } + + $stub = new FileIntegrityStub($diagnosticConf[0]['stubs'][FileIntegrityStub::class]); + $stub->setModule($this); + $response = $stub->getHandler()->handle(); + + if (empty($response['created'])) { + return []; + } + + return array_filter( + $response['created'], + function ($file) { + return !preg_match('/^config_[a-z]+\.xml$/', $file) && $file !== 'config.xml'; + }); + } } diff --git a/services/Checker.php b/services/Checker.php index 5fb13c2e..dddc5c0f 100644 --- a/services/Checker.php +++ b/services/Checker.php @@ -27,12 +27,14 @@ namespace PaypalAddons\services; +use Cart; use Context; use Module; use PaypalAddons\classes\AbstractMethodPaypal; use PaypalAddons\classes\Constants\WebHookConf; use PaypalAddons\classes\Webhook\CreateWebhook; use PaypalAddons\classes\Webhook\WebhookAvailability; +use Product; if (!defined('_PS_VERSION_')) { exit; @@ -124,4 +126,47 @@ protected function isWebhookCreated() return $response->isSuccess(); } + + public function isProductsAvailable(Cart $cart) + { + if (!$this->isAllProductsInStock($cart)) { + return false; + } + if (method_exists($cart, 'checkAllProductsAreStillAvailableInThisState') && !$cart->checkAllProductsAreStillAvailableInThisState()) { + return false; + } + if (method_exists($cart, 'checkAllProductsHaveMinimalQuantities') && !$cart->checkAllProductsHaveMinimalQuantities()) { + return false; + } + + return true; + } + + public function isAllProductsInStock(Cart $cart) + { + if (version_compare(_PS_VERSION_, '1.7.3.2', '>=')) { + return $cart->isAllProductsInStock(true); + } + + foreach ($cart->getProducts(false, false, null, false) as $product) { + if ($product['is_virtual']) { + continue; + } + $idProductAttribute = empty($product['id_product_attribute']) ? null : $product['id_product_attribute']; + $availableOutOfStock = Product::isAvailableWhenOutOfStock($product['out_of_stock']); + $productQuantity = Product::getQuantity( + $product['id_product'], + $idProductAttribute, + null, + $cart, + $product['id_customization'] + ); + + if (($productQuantity < 0 && !$availableOutOfStock)) { + return false; + } + } + + return true; + } } diff --git a/services/Order/RefundAmountCalculator.php b/services/Order/RefundAmountCalculator.php index 1862af29..bfc15613 100644 --- a/services/Order/RefundAmountCalculator.php +++ b/services/Order/RefundAmountCalculator.php @@ -32,7 +32,6 @@ } use Order; -use PayPal; class RefundAmountCalculator { @@ -50,7 +49,7 @@ public function calculate($params) } foreach ($params['productList'] as $product) { - $amount += \Tools::ps_round($product['amount'], PayPal::getPrecision()); + $amount += (float) $product['amount']; } if (false == empty($params['partialRefundShippingCost'])) { diff --git a/services/PaymentData.php b/services/PaymentData.php index c901bfca..33297196 100644 --- a/services/PaymentData.php +++ b/services/PaymentData.php @@ -34,42 +34,49 @@ class PaymentData { /** @var string */ - protected $orderId; + protected $orderId = ''; /** @var string */ - protected $payerID; + protected $payerID = ''; /** @var string */ - protected $paymentID; + protected $paymentID = ''; /** @var string */ - protected $billingToken; + protected $billingToken = ''; /** @var string */ - protected $facilitatorAccessToken; + protected $facilitatorAccessToken = ''; + + /** @var string */ + protected $rememberedCards = ''; public function fromArray($data) { - if (false == empty($data['orderID'])) { + if (false === empty($data['orderID'])) { $this->setOrderId($data['orderID']); } - if (false == empty($data['payerID'])) { + if (false === empty($data['payerID'])) { $this->setPayerId($data['payerID']); } - if (false == empty($data['paymentID'])) { + if (false === empty($data['paymentID'])) { $this->setPaymentID($data['paymentID']); } - if (false == empty($data['billingToken'])) { + if (false === empty($data['billingToken'])) { $this->setBillingToken($data['billingToken']); } - if (false == empty($data['facilitatorAccessToken'])) { + if (false === empty($data['facilitatorAccessToken'])) { $this->setFacilitatorAccessToken($data['facilitatorAccessToken']); } + if (false === empty($data['rememberedCards'])) { + $this->setRememberedCards($data['rememberedCards']); + } + return $this; } @@ -82,7 +89,7 @@ public function setOrderId($orderID) return $this; } - protected function setPayerId($payerID) + public function setPayerId($payerID) { if (is_string($payerID)) { $this->payerID = $payerID; @@ -91,7 +98,7 @@ protected function setPayerId($payerID) return $this; } - protected function setPaymentID($paymentID) + public function setPaymentID($paymentID) { if (is_string($paymentID)) { $this->paymentID = $paymentID; @@ -100,7 +107,7 @@ protected function setPaymentID($paymentID) return $this; } - protected function setBillingToken($billingToken) + public function setBillingToken($billingToken) { if (is_string($billingToken)) { $this->billingToken = $billingToken; @@ -109,7 +116,7 @@ protected function setBillingToken($billingToken) return $this; } - protected function setFacilitatorAccessToken($facilitatorAccessToken) + public function setFacilitatorAccessToken($facilitatorAccessToken) { if (is_string($facilitatorAccessToken)) { $this->facilitatorAccessToken = $facilitatorAccessToken; @@ -118,6 +125,15 @@ protected function setFacilitatorAccessToken($facilitatorAccessToken) return $this; } + public function setRememberedCards($rememberedCards) + { + if (is_string($rememberedCards)) { + $this->rememberedCards = $rememberedCards; + } + + return $this; + } + /** * @return string */ @@ -157,4 +173,9 @@ public function getFacilitatorAccessToken() { return $this->facilitatorAccessToken; } + + public function getRememberedCards() + { + return $this->rememberedCards; + } } diff --git a/services/StatusMapping.php b/services/StatusMapping.php index 6164483d..278ea112 100644 --- a/services/StatusMapping.php +++ b/services/StatusMapping.php @@ -30,7 +30,6 @@ use Configuration; use MethodEC; use MethodMB; -use MethodPPP; use PaypalAddons\classes\AbstractMethodPaypal; use PaypalAddons\classes\Constants\PaypalConfigurations; use PaypalAddons\classes\Constants\WebHookType; @@ -182,15 +181,7 @@ public function isModeSale($method = null) $method = AbstractMethodPaypal::load(); } - if ($method instanceof MethodPPP) { - return true; - } - - if ($method instanceof MethodMB) { - return true; - } - - return Configuration::get('PAYPAL_API_INTENT') == 'sale'; + return $method->getIntent() === AbstractMethodPaypal::SALE; } /** diff --git a/services/ToolKit.php b/services/ToolKit.php new file mode 100644 index 00000000..d9e7daf0 --- /dev/null +++ b/services/ToolKit.php @@ -0,0 +1,87 @@ + + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * @copyright PayPal + * + */ + +namespace PaypalAddons\services; + +use Exception; +use Throwable; + +class ToolKit +{ + public function rrmdir($dir) + { + if (false === is_dir($dir)) { + return false; + } + + $objects = scandir($dir); + + foreach ($objects as $object) { + if ($object === '.' || $object === '..') { + continue; + } + if (is_dir($dir . DIRECTORY_SEPARATOR . $object) && !is_link($dir . '/' . $object)) { + $this->rrmdir($dir . DIRECTORY_SEPARATOR . $object); + continue; + } + + $this->unlink($dir . DIRECTORY_SEPARATOR . $object); + } + + return $this->rmdir($dir); + } + + public function unlink($file) + { + if (false === is_file($file)) { + return false; + } + + try { + return unlink($file); + } catch (Exception $e) { + } catch (Throwable $e) { + } + + return false; + } + + public function rmdir($dir) + { + if (false === is_dir($dir)) { + return false; + } + + try { + return rmdir($dir); + } catch (Exception $e) { + } catch (Throwable $e) { + } + + return false; + } +} diff --git a/translations/fr.php b/translations/fr.php index cb2b70cd..ee7fbf43 100644 --- a/translations/fr.php +++ b/translations/fr.php @@ -190,6 +190,7 @@ $_MODULE['<{paypal}prestashop>statusblock_b0fb9d7e6d4ed47cb12f3092943fafc2'] = 'Le protocole SSL doit être activé sur votre site.'; $_MODULE['<{paypal}prestashop>statusblock_ba54b8645ec3d87e95b4da1b5baad66f'] = 'L\'extension cURL PHP doit être activée sur votre serveur.'; $_MODULE['<{paypal}prestashop>statusblock_5914be43ea057f2fd9fa49180f5db5bf'] = 'Vous devez vous connecter à votre compte PayPal.'; +$_MODULE['<{paypal}prestashop>statusblock_85e650a9b75ce606496731a086c28d0b'] = 'Vous avez des fichiers dans votre module PayPal qui ne sont pas présents dans le contenu officiel. Voir plus de détails sur [a @href1@]page de diagnostic.[/a]'; $_MODULE['<{paypal}prestashop>helperoptioninfo_36c23650a89439d28101b389567fe2f5'] = 'Les logs avec ID de commande ne seront pas effacés.'; $_MODULE['<{paypal}prestashop>headerlogo_536b624906878dc3954749a6cef3b0fa'] = 'Activation en 2 étapes simples'; $_MODULE['<{paypal}prestashop>headerlogo_e269d95cbf9105896810d64a7307acdd'] = 'Activez le module PayPal pour commencer à vendre à plus de 300 millions de clients PayPal dans le monde entier'; diff --git a/upgrade/Upgrade-6.4.3.php b/upgrade/Upgrade-6.4.3.php new file mode 100644 index 00000000..e8a6235b --- /dev/null +++ b/upgrade/Upgrade-6.4.3.php @@ -0,0 +1,71 @@ + + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * @copyright PayPal + * + */ + +use PaypalPPBTlib\Extensions\Diagnostic\Stubs\Concrete\FileIntegrityStub; + +if (!defined('_PS_VERSION_')) { + exit; +} + +/** + * @param $module PayPal + * + * @return bool + */ +function upgrade_module_6_4_3(PayPal $module) +{ + $baseDir = _PS_MODULE_DIR_ . 'paypal/'; + $diagnosticConf = include _PS_MODULE_DIR_ . 'paypal/diagnostic.php'; + + if (empty($diagnosticConf[0]['stubs'][FileIntegrityStub::class])) { + return true; + } + + $stub = new FileIntegrityStub($diagnosticConf[0]['stubs'][FileIntegrityStub::class]); + $stub->setModule($module); + $response = $stub->getHandler()->handle(); + + if (empty($response['created'])) { + return true; + } + + $files = array_filter( + $response['created'], + function ($file) { + return !preg_match('/^config_[a-z]+\.xml$/', $file) && $file !== 'config.xml'; + }); + + foreach ($files as $file) { + try { + unlink($baseDir . $file); + } catch (Exception $e) { + } catch (Throwable $e) { + } + } + + return true; +} diff --git a/vendor/.htaccess b/vendor/.htaccess new file mode 100644 index 00000000..3de9e400 --- /dev/null +++ b/vendor/.htaccess @@ -0,0 +1,10 @@ +# Apache 2.2 + + Order deny,allow + Deny from all + + +# Apache 2.4 + + Require all denied + diff --git a/views/templates/acdc/payment-option-card-fields.tpl b/views/templates/acdc/payment-option-card-fields.tpl deleted file mode 100644 index a909a5e8..00000000 --- a/views/templates/acdc/payment-option-card-fields.tpl +++ /dev/null @@ -1,69 +0,0 @@ -{** - * 2007-2024 PayPal - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@prestashop.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade PrestaShop to newer - * versions in the future. If you wish to customize PrestaShop for your - * needs please refer to http://www.prestashop.com for more information. - * - * @author 2007-2024 PayPal - * @author 202 ecommerce - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - * @copyright PayPal - * - *} - -{extends file='module:paypal/views/templates/acdc/payment-option.tpl'} - -{block name='style'} - -{/block} - diff --git a/views/templates/acdc/payment-option.tpl b/views/templates/acdc/payment-option.tpl index 66ede81a..aaf8301c 100644 --- a/views/templates/acdc/payment-option.tpl +++ b/views/templates/acdc/payment-option.tpl @@ -28,11 +28,12 @@ {block name='style'} {/block} @@ -86,24 +91,24 @@
- +
- +
- +
- +
@@ -136,7 +141,6 @@ messages: messages, buttonForm: document.querySelector('[paypal-acdc-form-button]'), isMoveButtonAtEnd: PAYPAL_MOVE_BUTTON_AT_END, - isCardFields: isCardFields, }); acdcObj.initFields(); acdcObj.hideElementTillPaymentOptionChecked( diff --git a/views/templates/admin/_partials/statusBlock.tpl b/views/templates/admin/_partials/statusBlock.tpl index a0331a42..80119bbf 100644 --- a/views/templates/admin/_partials/statusBlock.tpl +++ b/views/templates/admin/_partials/statusBlock.tpl @@ -97,6 +97,16 @@ {/if} {/if} + + {if isset($vars.numberRedundantFiles) && $vars.numberRedundantFiles} +
  • + {include + file=$moduleFullDir|cat:"/views/templates/admin/_partials/icon-status.tpl" + isSuccess=false + } +
    {{l s='You have files in your PayPal module that are not included in the official content. See more details on [a @href1@]diagnostic page.[/a]' mod='paypal'}|paypalreplace:['@href1@' =>{$vars.diagnosticPage|default:'#'}, '@target@' => {'target="blank"'}]}
    +
  • + {/if}
    diff --git a/views/templates/admin/diagnostic/file_integrity.tpl b/views/templates/admin/diagnostic/file_integrity.tpl index 3b8d608b..e93a2079 100644 --- a/views/templates/admin/diagnostic/file_integrity.tpl +++ b/views/templates/admin/diagnostic/file_integrity.tpl @@ -87,6 +87,14 @@ {/foreach} {/if} + + {if isset($isRedundantFileExist) && $isRedundantFileExist} + + {/if} diff --git a/views/templates/sepa/button.tpl b/views/templates/sepa/button.tpl index a30b75f5..33b75050 100644 --- a/views/templates/sepa/button.tpl +++ b/views/templates/sepa/button.tpl @@ -51,8 +51,8 @@ var sepaObj = new SepaButton({ method: 'sepa', button: '#paypal-sepa', - controller: '{$scInitController|escape:'htmlall':'UTF-8'}', - validationController: '{$validationController|escape:'htmlall':'UTF-8'}', + controller: '{$scInitController nofilter}', + validationController: '{$validationController nofilter}', paypal: window[skdNameSpace], isMoveButtonAtEnd: PAYPAL_MOVE_BUTTON_AT_END });