diff --git a/.vscode/ftp-kr.json b/.vscode/ftp-kr.json index e8b9e821..e127e0de 100644 --- a/.vscode/ftp-kr.json +++ b/.vscode/ftp-kr.json @@ -1,8 +1,8 @@ { - "host": "dedyk8.cyber-folks.pl", - "username": "www@drmaterac.pl", - "password": "0gK9-E-L+mFL@WRk", - "remotePath": "/domains/lulandia.pl/public_html/", + "host": "host978195.hostido.net.pl", + "username": "www@lulandia.pl", + "password": "UvMvZVcLPaxpA9wbrAdB", + "remotePath": "/public_html/", "protocol": "ftp", "port": 0, "fileNameEncoding": "utf8", diff --git a/.vscode/sftp.json b/.vscode/sftp.json index ab2394d5..f28b53b3 100644 --- a/.vscode/sftp.json +++ b/.vscode/sftp.json @@ -1,11 +1,11 @@ { - "name": "dedyk8.cyber-folks.pl", - "host": "dedyk8.cyber-folks.pl", + "name": "host978195.hostido.net.pl", + "host": "host978195.hostido.net.pl", "protocol": "ftp", "port": 21, - "username": "www@drmaterac.pl", - "password": "0gK9-E-L+mFL@WRk", - "remotePath": "/domains/lulandia.pl/public_html/", + "username": "www@lulandia.pl", + "password": "UvMvZVcLPaxpA9wbrAdB", + "remotePath": "/public_html/", "uploadOnSave": false, "useTempFile": false, "openSsh": false diff --git a/modules/paynow/classes/PaynowAdminFormHelper.php b/modules/paynow/classes/PaynowAdminFormHelper.php index 9f9c70dc..00a5347f 100644 --- a/modules/paynow/classes/PaynowAdminFormHelper.php +++ b/modules/paynow/classes/PaynowAdminFormHelper.php @@ -357,13 +357,17 @@ class PaynowAdminFormHelper 'id_option' => Paynow\Model\PaymentMethods\Type::CARD, 'name' => $this->module->getPaymentMethodTitle(Paynow\Model\PaymentMethods\Type::CARD) ], + [ + 'id_option' => 'DIGITAL_WALLETS', + 'name' => $this->translations['Digital wallets'] + ], + [ + 'id_option' => Paynow\Model\PaymentMethods\Type::PAYPO, + 'name' => $this->module->getPaymentMethodTitle(Paynow\Model\PaymentMethods\Type::PAYPO) + ], [ - 'id_option' => Paynow\Model\PaymentMethods\Type::GOOGLE_PAY, - 'name' => $this->module->getPaymentMethodTitle(Paynow\Model\PaymentMethods\Type::GOOGLE_PAY) - ], - [ - 'id_option' => Paynow\Model\PaymentMethods\Type::APPLE_PAY, - 'name' => $this->module->getPaymentMethodTitle(Paynow\Model\PaymentMethods\Type::APPLE_PAY) + 'id_option' => Paynow\Model\PaymentMethods\Type::CLICK_TO_PAY, + 'name' => $this->module->getPaymentMethodTitle(Paynow\Model\PaymentMethods\Type::CLICK_TO_PAY) ] ], 'id' => 'id_option', diff --git a/modules/paynow/classes/PaynowFrontController.php b/modules/paynow/classes/PaynowFrontController.php index 9517a97e..d88bcec5 100644 --- a/modules/paynow/classes/PaynowFrontController.php +++ b/modules/paynow/classes/PaynowFrontController.php @@ -63,16 +63,17 @@ class PaynowFrontController extends ModuleFrontControllerCore ); } - protected function getPaymentStatus($paymentId) + protected function getPaymentStatus($paymentId, $external_id) { - PaynowLogger::info('Retrieving payment status {paymentId={}}', [$paymentId]); + PaynowLogger::info('Retrieving payment status {paymentId={}, externalId={}}', [$paymentId, $external_id]); + $idempotencyKey = PaynowKeysGenerator::generateIdempotencyKey($external_id); try { - $status = (new Paynow\Service\Payment($this->module->getPaynowClient()))->status($paymentId)->getStatus(); + $status = (new Paynow\Service\Payment($this->module->getPaynowClient()))->status($paymentId, $idempotencyKey)->getStatus(); PaynowLogger::info('Retrieved payment status {paymentId={}, status={}}', [$paymentId, $status]); return $status; } catch (PaynowException $exception) { - PaynowLogger::error($exception->getMessage() . ' {paymentId={}}', [$paymentId]); + PaynowLogger::error($exception->getMessage() . ' {paymentId={}, idempotencyKey={}}', [$paymentId, $idempotencyKey]); } return false; diff --git a/modules/paynow/classes/PaynowGDPRHelper.php b/modules/paynow/classes/PaynowGDPRHelper.php index c50606e1..49050880 100644 --- a/modules/paynow/classes/PaynowGDPRHelper.php +++ b/modules/paynow/classes/PaynowGDPRHelper.php @@ -18,6 +18,11 @@ use Paynow\Exception\PaynowException; */ class PaynowGDPRHelper { + // in seconds + private const OPTION_VALIDITY_TIME = 86400; + + private $cart; + /** * @var Client */ @@ -25,10 +30,12 @@ class PaynowGDPRHelper /** * @param Client $client + * @param $cart */ - public function __construct(Client $client) + public function __construct(Client $client, $cart) { $this->client = $client; + $this->cart = $cart; } /** @@ -38,10 +45,10 @@ class PaynowGDPRHelper */ public function getNotices(?string $locale) { - $configurationId = 'PAYNOW_'.$this->isSandbox() ? 'SANDBOX_' : ''.'GDPR_' . $this->cleanLocale($locale); + $configurationId = 'PAYNOW_' . ( $this->isSandbox() ? 'SANDBOX_' : '') .'GDPR_' . $this->cleanLocale($locale); $configurationOption = Configuration::get($configurationId); - if (! $configurationOption) { + if ( !$configurationOption || !$this->isValid( $locale ) ) { $gdpr_notices = $this->retrieve($locale); if ($gdpr_notices) { @@ -54,6 +61,7 @@ class PaynowGDPRHelper ]); } Configuration::updateValue($configurationId, serialize($notices)); + Configuration::updateValue($this->getOptionValidityKey($locale), time() + self::OPTION_VALIDITY_TIME); $configurationOption = Configuration::get($configurationId); } } @@ -77,7 +85,8 @@ class PaynowGDPRHelper { try { PaynowLogger::info("Retrieving GDPR notices"); - return (new Paynow\Service\DataProcessing($this->client))->getNotices($locale)->getAll(); + $idempotencyKey = PaynowKeysGenerator::generateIdempotencyKey(PaynowKeysGenerator::generateExternalIdByCart($this->cart)); + return (new Paynow\Service\DataProcessing($this->client))->getNotices($locale, $idempotencyKey)->getAll(); } catch (PaynowException $exception) { PaynowLogger::error( 'An error occurred during GDPR notices retrieve {code={}, message={}}', @@ -100,4 +109,20 @@ class PaynowGDPRHelper { return Tools::strtoupper(str_replace('-', '_', $locale)); } + + private function isValid( ?string $locale ): bool + { + $optionValidity = Configuration::get($this->getOptionValidityKey($locale)); + + if ( empty( $optionValidity ) ) { + return false; + } + + return time() < (int) $optionValidity; + } + + private function getOptionValidityKey( ?string $locale ): string + { + return 'PAYNOW_'.( $this->isSandbox() ? 'SANDBOX_' : '' ).'GDPR_VALIDITY_' . $this->cleanLocale($locale); + } } diff --git a/modules/paynow/classes/PaynowOrderStateProcessor.php b/modules/paynow/classes/PaynowOrderStateProcessor.php index 23c22926..eb6b52a2 100644 --- a/modules/paynow/classes/PaynowOrderStateProcessor.php +++ b/modules/paynow/classes/PaynowOrderStateProcessor.php @@ -226,7 +226,7 @@ class PaynowOrderStateProcessor $data['paymentId'], $data['externalId'] ); - $this->addOrderPayment($order, $data['paymentId']); + $this->addOrderPayment($order, $data['paymentId'], $payment->total); break; case Paynow\Model\Payment\Status::STATUS_ERROR: $this->changeState( @@ -358,16 +358,49 @@ class PaynowOrderStateProcessor return $previous_status_exists && $is_change_possible; } - /** - * @param $order - * @param $id_payment - */ - private function addOrderPayment($order, $id_payment) + /** + * @param $order + * @param $id_payment + * @param $total + */ + private function addOrderPayment($order, $id_payment, $total) { $payments = $order->getOrderPaymentCollection()->getResults(); if (count($payments) > 0) { $payments[0]->transaction_id = $id_payment; $payments[0]->update(); + } else { + try { + $currentOrder = new Order($order->id); + // in case when order payment was not created + $result = $currentOrder->addOrderPayment( + $total, + $this->module->displayName, + $id_payment + ); + + if (!$result) { + PaynowLogger::error( + 'Cannot create order payment entry', + [ + $currentOrder->id, + $currentOrder->reference, + $id_payment + ] + ); + } + } catch (Throwable $t) { + PaynowLogger::error( + 'Cannot create order payment entry due to exception: ', + [ + $t->getMessage(), + $t->getLine(), + $order->id, + $order->reference, + $id_payment + ] + ); + } } } diff --git a/modules/paynow/classes/PaynowPaymentDataBuilder.php b/modules/paynow/classes/PaynowPaymentDataBuilder.php index 6a643e4a..9798bf7e 100644 --- a/modules/paynow/classes/PaynowPaymentDataBuilder.php +++ b/modules/paynow/classes/PaynowPaymentDataBuilder.php @@ -12,6 +12,7 @@ class PaynowPaymentDataBuilder { + private const MAX_ORDER_ITEM_NAME_LENGTH = 120; private $context; /** @@ -94,6 +95,7 @@ class PaynowPaymentDataBuilder ): array { $currency = Currency::getCurrency($id_currency); $customer = new Customer((int)$id_customer); + $paymentMethodId = Tools::getValue('paymentMethodId'); $request = [ 'amount' => number_format($total_to_paid * 100, 0, '', ''), @@ -114,8 +116,68 @@ class PaynowPaymentDataBuilder ) ]; - if (! empty(Tools::getValue('paymentMethodId'))) { - $request['paymentMethodId'] = (int)Tools::getValue('paymentMethodId'); + try { + $address = new Address($this->context->cart->id_address_delivery); + $invoiceAddress = new Address($this->context->cart->id_address_invoice); + + try { + $state = new State($address->id_state); + } catch (Throwable $e) { + $state = null; + } + + try { + $invoiceState = new State($invoiceAddress->id_state); + } catch (Throwable $e) { + $invoiceState = null; + } + + try { + $country = Country::getIsoById($address->id_country); + } catch (Throwable $e) { + $country = null; + } + + try { + $invoiceCountry = Country::getIsoById($invoiceAddress->id_country); + } catch (Throwable $e) { + $invoiceCountry = null; + } + + $request['buyer']['address'] = [ + 'billing' => [ + 'street' => $invoiceAddress->address1, + 'houseNumber' => $invoiceAddress->address2, + 'apartmentNumber' => '', + 'zipcode' => $invoiceAddress->postcode, + 'city' => $invoiceAddress->city, + 'county' => $invoiceState ? $invoiceState->name : '', + 'country' => $invoiceCountry ?: '', + ], + 'shipping' => [ + 'street' => $address->address1, + 'houseNumber' => $address->address2, + 'apartmentNumber' => '', + 'zipcode' => $address->postcode, + 'city' => $address->city, + 'county' => $state ? $state->name : '', + 'country' => $country ?: '', + ] + ]; + } catch (Throwable $exception) { + PaynowLogger::error('Cannot add addresses to payment data', ['msg' => $exception->getMessage()]); + } + + if (!empty($id_customer) && $this->context->customer){ + if (method_exists($this->context->customer, 'isGuest') && !$this->context->customer->isGuest()) { + $request['buyer']['externalId'] = PaynowKeysGenerator::generateBuyerExternalId($id_customer, $this->module); + } elseif ($this->context->customer->is_guest === '0') { + $request['buyer']['externalId'] = PaynowKeysGenerator::generateBuyerExternalId($id_customer, $this->module); + } + } + + if (! empty($paymentMethodId)) { + $request['paymentMethodId'] = (int)$paymentMethodId; } if (Configuration::get('PAYNOW_PAYMENT_VALIDITY_TIME_ENABLED')) { @@ -126,12 +188,20 @@ class PaynowPaymentDataBuilder $request['authorizationCode'] = (int)preg_replace('/\s+/', '', Tools::getValue('blikCode')); } + if (!empty(Tools::getValue('paymentMethodToken'))) { + $request['paymentMethodToken'] = Tools::getValue('paymentMethodToken'); + } + + if (! empty(Tools::getValue('paymentMethodFingerprint'))) { + $request['buyer']['deviceFingerprint'] = Tools::getValue('paymentMethodFingerprint'); + } + if (Configuration::get('PAYNOW_SEND_ORDER_ITEMS')) { $products = $this->context->cart->getProducts(true); $order_items = []; foreach ($products as $product) { $order_items[] = [ - 'name' => $product['name'], + 'name' => self::truncateOrderItemName($product['name']), 'category' => $this->getCategoriesNames($product['id_category_default']), 'quantity' => $product['quantity'], 'price' => number_format($product['price'] * 100, 0, '', '') @@ -161,4 +231,15 @@ class PaynowPaymentDataBuilder } return implode(", ", $categoriesNames); } + + public static function truncateOrderItemName(string $name): string + { + $name = trim($name); + + if(strlen($name) <= self::MAX_ORDER_ITEM_NAME_LENGTH) { + return $name; + } + + return substr($name, 0, self::MAX_ORDER_ITEM_NAME_LENGTH - 3) . '...'; + } } diff --git a/modules/paynow/classes/PaynowPaymentMethodsHelper.php b/modules/paynow/classes/PaynowPaymentMethodsHelper.php index d0c89c8b..f8e6eadb 100644 --- a/modules/paynow/classes/PaynowPaymentMethodsHelper.php +++ b/modules/paynow/classes/PaynowPaymentMethodsHelper.php @@ -39,20 +39,36 @@ class PaynowPaymentMethodsHelper /** * @param $currency_iso_code * @param $total + * @param $context + * @param $module * * @return PaymentMethods|null */ - public function getAvailable($currency_iso_code, $total): ?PaymentMethods + public function getAvailable($currency_iso_code, $total, $context, $module): ?PaymentMethods { + $applePayEnabled = htmlspecialchars($_COOKIE['applePayEnabled'] ?? '0') === '1'; + $idempotencyKey = PaynowKeysGenerator::generateIdempotencyKey(PaynowKeysGenerator::generateExternalIdByCart($context->cart)); + $buyerExternalId = null; + + if ($context->customer && $context->customer->isLogged()) { + $buyerExternalId = PaynowKeysGenerator::generateBuyerExternalId($context->cart->id_customer, $module); + } + try { - $applePayEnabled = htmlspecialchars($_COOKIE['applePayEnabled'] ?? '0') === '1'; - return $this->payment_client->getPaymentMethods($currency_iso_code, $total, $applePayEnabled); + return $this->payment_client->getPaymentMethods($currency_iso_code, $total, $applePayEnabled, $idempotencyKey, $buyerExternalId); } catch (PaynowException $exception) { PaynowLogger::error( - 'An error occurred during payment methods retrieve {code={}, message={}}', + 'An error occurred during payment methods retrieve {currency={}, total={}, applePayEnabled={}, idempotencyKey={}, buyerExternalId={}, code={}, message={}, errors={}, m={}}', [ + $currency_iso_code, + $total, + $applePayEnabled, + $idempotencyKey, + $buyerExternalId, $exception->getCode(), - $exception->getPrevious()->getMessage() + $exception->getPrevious()->getMessage(), + $exception->getErrors(), + $exception->getMessage() ] ); } diff --git a/modules/paynow/classes/PaynowPaymentOptions.php b/modules/paynow/classes/PaynowPaymentOptions.php index 54546b7a..eafcf513 100644 --- a/modules/paynow/classes/PaynowPaymentOptions.php +++ b/modules/paynow/classes/PaynowPaymentOptions.php @@ -57,11 +57,16 @@ class PaynowPaymentOptions ]; } - $payment_options = []; + $digital_wallets = [ + Paynow\Model\PaymentMethods\Type::CLICK_TO_PAY => null, + Paynow\Model\PaymentMethods\Type::GOOGLE_PAY => null, + Paynow\Model\PaymentMethods\Type::APPLE_PAY => null, + ]; $this->context->smarty->assign([ 'action' => PaynowLinkHelper::getPaymentUrl(), - 'data_processing_notices' => $this->data_processing_notices + 'data_processing_notices' => $this->data_processing_notices, + 'data_paynow_plugin_version' => $this->module->version, ]); $isAnyPblEnabled = false; @@ -74,20 +79,25 @@ class PaynowPaymentOptions } $hiddenPaymentTypes = explode(',', Configuration::get('PAYNOW_HIDE_PAYMENT_TYPES')); + $digitalWalletsHidden = in_array('DIGITAL_WALLETS', $hiddenPaymentTypes); $list = []; + $payment_options = []; /** @var PaymentMethod $payment_method */ foreach ($this->payment_methods->getAll() as $payment_method) { if (isset($list[$payment_method->getType()])) { continue; } + if (in_array($payment_method->getType(), $hiddenPaymentTypes)) { continue; } + if (Paynow\Model\PaymentMethods\Type::PBL == $payment_method->getType()) { if (!$isAnyPblEnabled) { continue; } + $this->context->smarty->assign([ 'paynowPbls' => $this->payment_methods->getOnlyPbls(), ]); @@ -97,23 +107,45 @@ class PaynowPaymentOptions PaynowLinkHelper::getPaymentUrl(), 'module:paynow/views/templates/front/1.7/payment_form.tpl' ); + } elseif (array_key_exists($payment_method->getType(), $digital_wallets)) { + if (!$payment_method->isEnabled() || $digitalWalletsHidden) { + continue; + } + + $digital_wallets[$payment_method->getType()] = $payment_method; } else { if (!$payment_method->isEnabled()) { continue; } + $this->setUpAdditionalTemplateVariables($payment_method); $payment_options[] = $this->getPaymentOption( $this->module->getPaymentMethodTitle($payment_method->getType()), $payment_method->getImage(), PaynowLinkHelper::getPaymentUrl([ - 'paymentMethodId' => $payment_method->getId() + 'paymentMethodId' => $payment_method->getId(), ]), $this->getForm($payment_method) ); } + $list[$payment_method->getType()] = $payment_method->getId(); } + $digital_wallets = array_values(array_filter($digital_wallets)); + if (!empty($digital_wallets)) { + $this->context->smarty->assign([ + 'paynowDigitalWalletsPayments' => $digital_wallets, + ]); + + $payment_options[] = $this->getPaymentOption( + $this->module->getPaymentMethodTitle('DIGITAL_WALLETS'), + $this->module->getDigitalWalletsLogo($digital_wallets), + PaynowLinkHelper::getPaymentUrl(), + 'module:paynow/views/templates/front/1.7/payment_method_digital_wallets_form.tpl' + ); + } + return $payment_options; } @@ -131,10 +163,29 @@ class PaynowPaymentOptions 'action_token' => Tools::encrypt($this->context->customer->secure_key ?? ''), 'action_token_refresh' => Context::getContext()->link->getModuleLink('paynow', 'customerToken'), 'error_message' => $this->getMessage('An error occurred during the payment process'), - 'terms_message' => $this->getMessage('You have to accept terms and conditions'), + 'terms_message' => $this->getMessage('First accept the terms of service, then click pay.'), 'blik_autofocus' => Configuration::get('PAYNOW_BLIK_AUTOFOCUS_ENABLED') === '0' ? '0' : '1', ]); - } + } elseif (Paynow\Model\PaymentMethods\Type::CARD == $payment_method->getType()) { + $this->context->smarty->assign([ + 'action_card' => PaynowLinkHelper::getPaymentUrl([ + 'paymentMethodId' => $payment_method->getId() + ]), + 'action_remove_saved_instrument' => Context::getContext()->link->getModuleLink( + 'paynow', + 'removeSavedInstrument' + ), + 'action_remove_saved_instrument_token' => Tools::encrypt($this->context->customer->secure_key ?? ''), + 'default_card_image' => Media::getMediaPath(_PS_MODULE_DIR_ . $this->module->name . '/views/img/card-default.svg'), + 'paynow_card_instruments' => $payment_method->getSavedInstruments(), + ]); + } elseif (Paynow\Model\PaymentMethods\Type::PAYPO == $payment_method->getType()) { + $this->context->smarty->assign([ + 'action_paypo' => PaynowLinkHelper::getPaymentUrl([ + 'paymentMethodId' => $payment_method->getId() + ]), + ]); + } } private function getForm($payment_method): ?string @@ -143,6 +194,14 @@ class PaynowPaymentOptions return 'module:paynow/views/templates/front/1.7/payment_method_blik_form.tpl'; } + if (Paynow\Model\PaymentMethods\Type::CARD === $payment_method->getType()) { + return 'module:paynow/views/templates/front/1.7/payment_method_card_form.tpl'; + } + + if (Paynow\Model\PaymentMethods\Type::PAYPO === $payment_method->getType()) { + return 'module:paynow/views/templates/front/1.7/payment_method_paypo_form.tpl'; + } + return null; } diff --git a/modules/paynow/classes/PaynowPaymentProcessor.php b/modules/paynow/classes/PaynowPaymentProcessor.php index a60ceb8d..8467e5bf 100644 --- a/modules/paynow/classes/PaynowPaymentProcessor.php +++ b/modules/paynow/classes/PaynowPaymentProcessor.php @@ -128,9 +128,16 @@ class PaynowPaymentProcessor $order->reference ] ); - $idempotency_key = $this->generateIdempotencyKey($external_id); + $idempotency_key = PaynowKeysGenerator::generateIdempotencyKey($external_id); $payment_request_data = $this->paymentDataBuilder->fromOrder($order); + if ( !PaynowPaymentLockData::checkIsCartLocked($order->id_cart, $order->id) ) { + throw new PaynowPaymentAuthorizeException( + 'Cannot create another payment transaction', + $external_id + ); + } + return $this->sendPaymentRequest($payment_request_data, $idempotency_key); } @@ -146,15 +153,17 @@ class PaynowPaymentProcessor $external_id ] ); - $idempotency_key = $this->generateIdempotencyKey($external_id); + $idempotency_key = PaynowKeysGenerator::generateIdempotencyKey($external_id); $payment_request_data = $this->paymentDataBuilder->fromCart($cart, $external_id); - return $this->sendPaymentRequest($payment_request_data, $idempotency_key); - } + if ( !PaynowPaymentLockData::checkIsCartLocked($cart->id) ) { + throw new PaynowPaymentAuthorizeException( + 'Cannot create another payment transaction', + $external_id + ); + } - private function generateIdempotencyKey($external_id): string - { - return substr(uniqid($external_id . '_', true), 0, 45); + return $this->sendPaymentRequest($payment_request_data, $idempotency_key); } /** @@ -165,11 +174,11 @@ class PaynowPaymentProcessor if (PaynowConfigurationHelper::CREATE_ORDER_BEFORE_PAYMENT === (int)Configuration::get('PAYNOW_CREATE_ORDER_STATE') && ! empty($this->module->currentOrder)) { $order = new Order($this->module->currentOrder); - $this->externalId = $order->reference; + $this->externalId = PaynowKeysGenerator::generateExternalIdByOrder($order); } else { $cart = $this->context->cart; - $this->externalId = uniqid($cart->id . '_', false); + $this->externalId = PaynowKeysGenerator::generateExternalIdByCart($cart); } } diff --git a/modules/paynow/composer.json b/modules/paynow/composer.json index ef937fa4..dc3b2b99 100644 --- a/modules/paynow/composer.json +++ b/modules/paynow/composer.json @@ -1,47 +1,54 @@ { - "name": "pay-now/paynow-prestashop", - "description": "Paynow gateway module for PrestaShop", - "license": "MIT", - "authors": [ - { - "name": "mElements S.A.", - "email": "kontakt@paynow.pl" - } - ], - "require": { - "php": ">=7.1", - "ext-json": "*", - "pay-now/paynow-php-sdk": "^2.2", - "nyholm/psr7": "^1.2", - "php-http/curl-client": "^2.1" - }, - "require-dev": { - "prestashop/autoindex": "^1.0", - "friendsofphp/php-cs-fixer": "^2.18", - "squizlabs/php_codesniffer": "^3.6" - }, - "config": { - "platform": { - "php": "7.1" - }, - "prepend-autoloader": false, - "optimize-autoloader": true - }, - "type": "prestashop-module", - "minimum-stability": "stable", - "scripts": { - "cs": [ - "vendor/bin/phpcs --standard=PSR2 --ignore=*/vendor/*,*/Test/* ." + "name": "pay-now/paynow-prestashop", + "description": "Paynow gateway module for PrestaShop", + "license": "MIT", + "authors": [ + { + "name": "mElements S.A.", + "email": "kontakt@paynow.pl" + } ], - "cs-fix": [ - "php vendor/bin/phpcbf --standard=PSR2 --ignore=*/vendor/* ." - ] - }, - "extra": { - "hooks": { - "pre-commit": [ - "php vendor/bin/phpcbf --standard=PSR2 --ignore=*/vendor/* ." - ] + "require": { + "php": ">=7.2", + "ext-json": "*", + "pay-now/paynow-php-sdk": "2.4.4", + "nyholm/psr7": "^1.2", + "php-http/curl-client": "^2.1", + "cweagans/composer-patches": "^1.7" + }, + "require-dev": { + "prestashop/autoindex": "^1.0", + "friendsofphp/php-cs-fixer": "^2.18", + "squizlabs/php_codesniffer": "^3.6", + "symfony/var-dumper": "^4.4", + "symplify/vendor-patches": "^11.4" + }, + "config": { + "platform": { + "php": "7.2" + }, + "prepend-autoloader": false, + "optimize-autoloader": true, + "allow-plugins": { + "php-http/discovery": true, + "cweagans/composer-patches": true + } + }, + "type": "prestashop-module", + "minimum-stability": "stable", + "scripts": { + "cs": [ + "vendor/bin/phpcs --standard=PSR2 --ignore=*/vendor/*,*/Test/* ." + ], + "cs-fix": [ + "php vendor/bin/phpcbf --standard=PSR2 --ignore=*/vendor/* ." + ] + }, + "extra": { + "hooks": { + "pre-commit": [ + "php vendor/bin/phpcbf --standard=PSR2 --ignore=*/vendor/* ." + ] + } } - } } diff --git a/modules/paynow/composer.lock b/modules/paynow/composer.lock index b2f9f50b..1380a541 100644 --- a/modules/paynow/composer.lock +++ b/modules/paynow/composer.lock @@ -4,27 +4,27 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "30a3596ebc37cee590d8fff1f83b1083", + "content-hash": "d5d8e71e53e0f368a6965c71c4e734a6", "packages": [ { "name": "clue/stream-filter", - "version": "v1.6.0", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/clue/stream-filter.git", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e" + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/d6169430c7731d8509da7aecd0af756a5747b78e", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e", + "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7", + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7", "shasum": "" }, "require": { "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -46,7 +46,7 @@ } ], "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/php-stream-filter", + "homepage": "https://github.com/clue/stream-filter", "keywords": [ "bucket brigade", "callback", @@ -58,7 +58,7 @@ ], "support": { "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.6.0" + "source": "https://github.com/clue/stream-filter/tree/v1.7.0" }, "funding": [ { @@ -70,27 +70,74 @@ "type": "github" } ], - "time": "2022-02-21T13:15:14+00:00" + "time": "2023-12-20T15:40:13+00:00" }, { - "name": "nyholm/psr7", - "version": "1.6.1", + "name": "cweagans/composer-patches", + "version": "1.7.3", "source": { "type": "git", - "url": "https://github.com/Nyholm/psr7.git", - "reference": "e874c8c4286a1e010fb4f385f3a55ac56a05cc93" + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/e874c8c4286a1e010fb4f385f3a55ac56a05cc93", - "reference": "e874c8c4286a1e010fb4f385f3a55ac56a05cc93", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db", "shasum": "" }, "require": { - "php": ">=7.1", - "php-http/message-factory": "^1.0", + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3.0" + }, + "require-dev": { + "composer/composer": "~1.0 || ~2.0", + "phpunit/phpunit": "~4.6" + }, + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "support": { + "issues": "https://github.com/cweagans/composer-patches/issues", + "source": "https://github.com/cweagans/composer-patches/tree/1.7.3" + }, + "time": "2022-12-20T22:53:13+00:00" + }, + { + "name": "nyholm/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "shasum": "" + }, + "require": { + "php": ">=7.2", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1 || ^2.0" }, "provide": { "php-http/message-factory-implementation": "1.0", @@ -99,14 +146,15 @@ }, "require-dev": { "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5 || 8.5 || 9.4", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", "symfony/error-handler": "^4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -136,7 +184,7 @@ ], "support": { "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.6.1" + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" }, "funding": [ { @@ -148,24 +196,24 @@ "type": "github" } ], - "time": "2023-04-17T16:03:48+00:00" + "time": "2024-09-09T07:06:30+00:00" }, { "name": "pay-now/paynow-php-sdk", - "version": "2.2.2", + "version": "2.4.4", "source": { "type": "git", "url": "https://github.com/pay-now/paynow-php-sdk.git", - "reference": "33432ca177e937f3f5c6abb9f36c7f979baec67d" + "reference": "0b300739620fc6c838d9af14be50c561c27f50c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pay-now/paynow-php-sdk/zipball/33432ca177e937f3f5c6abb9f36c7f979baec67d", - "reference": "33432ca177e937f3f5c6abb9f36c7f979baec67d", + "url": "https://api.github.com/repos/pay-now/paynow-php-sdk/zipball/0b300739620fc6c838d9af14be50c561c27f50c9", + "reference": "0b300739620fc6c838d9af14be50c561c27f50c9", "shasum": "" }, "require": { - "php": ">=7.1", + "php": ">=7.2", "php-http/client-implementation": "^1.0 || ^2.0", "php-http/discovery": "^1.12", "php-http/httplug": "^2.2", @@ -180,7 +228,7 @@ "php-http/guzzle6-adapter": "^2.0", "php-http/mock-client": "^1.3", "phpcompatibility/php-compatibility": "^9.3", - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "^8.5.36", "squizlabs/php_codesniffer": "^3.4" }, "suggest": { @@ -214,22 +262,22 @@ ], "support": { "issues": "https://github.com/pay-now/paynow-php-sdk/issues", - "source": "https://github.com/pay-now/paynow-php-sdk/tree/v2.2.2" + "source": "https://github.com/pay-now/paynow-php-sdk/tree/v2.4.4" }, - "time": "2023-11-03T14:26:59+00:00" + "time": "2025-05-14T11:25:10+00:00" }, { "name": "php-http/curl-client", - "version": "2.3.0", + "version": "2.3.1", "source": { "type": "git", "url": "https://github.com/php-http/curl-client.git", - "reference": "f7352c0796549949900d28fe991e19c90572386a" + "reference": "085570be588f7cbdc4601e78886eea5b7051ad71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/curl-client/zipball/f7352c0796549949900d28fe991e19c90572386a", - "reference": "f7352c0796549949900d28fe991e19c90572386a", + "url": "https://api.github.com/repos/php-http/curl-client/zipball/085570be588f7cbdc4601e78886eea5b7051ad71", + "reference": "085570be588f7cbdc4601e78886eea5b7051ad71", "shasum": "" }, "require": { @@ -240,7 +288,7 @@ "php-http/message": "^1.2", "psr/http-client": "^1.0", "psr/http-factory-implementation": "^1.0", - "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0" + "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "provide": { "php-http/async-client-implementation": "1.0", @@ -251,6 +299,7 @@ "guzzlehttp/psr7": "^1.0", "laminas/laminas-diactoros": "^2.0", "php-http/client-integration-tests": "^3.0", + "php-http/message-factory": "^1.1", "phpunit/phpunit": "^7.5 || ^9.4" }, "type": "library", @@ -278,22 +327,22 @@ ], "support": { "issues": "https://github.com/php-http/curl-client/issues", - "source": "https://github.com/php-http/curl-client/tree/2.3.0" + "source": "https://github.com/php-http/curl-client/tree/2.3.1" }, - "time": "2023-04-28T14:56:41+00:00" + "time": "2023-11-03T15:32:00+00:00" }, { "name": "php-http/discovery", - "version": "1.19.1", + "version": "1.20.0", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e" + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/57f3de01d32085fea20865f9b16fb0e69347c39e", - "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", "shasum": "" }, "require": { @@ -317,7 +366,8 @@ "php-http/httplug": "^1.0 || ^2.0", "php-http/message-factory": "^1.0", "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", - "symfony/phpunit-bridge": "^6.2" + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" }, "type": "composer-plugin", "extra": { @@ -356,22 +406,22 @@ ], "support": { "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.19.1" + "source": "https://github.com/php-http/discovery/tree/1.20.0" }, - "time": "2023-07-11T07:02:26+00:00" + "time": "2024-10-02T11:20:13+00:00" }, { "name": "php-http/httplug", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67" + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67", + "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", "shasum": "" }, "require": { @@ -413,29 +463,28 @@ ], "support": { "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.4.0" + "source": "https://github.com/php-http/httplug/tree/2.4.1" }, - "time": "2023-04-14T15:10:03+00:00" + "time": "2024-09-23T11:39:58+00:00" }, { "name": "php-http/message", - "version": "1.14.0", + "version": "1.16.2", "source": { "type": "git", "url": "https://github.com/php-http/message.git", - "reference": "2ccee04a28c3d98eb3f2b85ce1e2fcff70c0e63b" + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/2ccee04a28c3d98eb3f2b85ce1e2fcff70c0e63b", - "reference": "2ccee04a28c3d98eb3f2b85ce1e2fcff70c0e63b", + "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", "shasum": "" }, "require": { "clue/stream-filter": "^1.5", - "php": "^7.1 || ^8.0", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0 || ^2.0" + "php": "^7.2 || ^8.0", + "psr/http-message": "^1.1 || ^2.0" }, "provide": { "php-http/message-factory-implementation": "1.0" @@ -443,8 +492,9 @@ "require-dev": { "ergebnis/composer-normalize": "^2.6", "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0", - "laminas/laminas-diactoros": "^2.0", + "guzzlehttp/psr7": "^1.0 || ^2.0", + "laminas/laminas-diactoros": "^2.0 || ^3.0", + "php-http/message-factory": "^1.0.2", "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", "slim/slim": "^3.0" }, @@ -482,9 +532,9 @@ ], "support": { "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.14.0" + "source": "https://github.com/php-http/message/tree/1.16.2" }, - "time": "2023-04-14T14:26:18+00:00" + "time": "2024-10-02T11:34:13+00:00" }, { "name": "php-http/message-factory", @@ -543,16 +593,16 @@ }, { "name": "php-http/promise", - "version": "1.2.0", + "version": "1.3.1", "source": { "type": "git", "url": "https://github.com/php-http/promise.git", - "reference": "ef4905bfb492ff389eb7f12e26925a0f20073050" + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/ef4905bfb492ff389eb7f12e26925a0f20073050", - "reference": "ef4905bfb492ff389eb7f12e26925a0f20073050", + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", "shasum": "" }, "require": { @@ -589,9 +639,9 @@ ], "support": { "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.2.0" + "source": "https://github.com/php-http/promise/tree/1.3.1" }, - "time": "2023-10-24T09:20:26+00:00" + "time": "2024-03-15T13:55:21+00:00" }, { "name": "psr/http-client", @@ -647,20 +697,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -684,7 +734,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -696,31 +746,31 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -735,7 +785,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -749,26 +799,27 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "symfony/options-resolver", - "version": "v3.4.47", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744" + "reference": "583f56160f716dd435f1cd721fd14b548f4bb510" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", - "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/583f56160f716dd435f1cd721fd14b548f4bb510", + "reference": "583f56160f716dd435f1cd721fd14b548f4bb510", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.1.3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -793,7 +844,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony OptionsResolver Component", + "description": "Provides an improved replacement for the array_replace PHP function", "homepage": "https://symfony.com", "keywords": [ "config", @@ -801,7 +852,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v3.4.47" + "source": "https://github.com/symfony/options-resolver/tree/v4.4.44" }, "funding": [ { @@ -817,7 +868,87 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2022-07-20T09:59:04+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.32.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.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": "2025-01-02T08:10:11+00:00" } ], "packages-dev": [ @@ -894,24 +1025,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": { @@ -955,7 +1086,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": [ { @@ -971,7 +1102,7 @@ "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", @@ -1041,16 +1172,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": { @@ -1061,11 +1192,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" @@ -1111,35 +1242,36 @@ ], "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", - "version": "1.1.2", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", - "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", "shasum": "" }, "require": { "php": "^7.1 || ^8.0" }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=13" + }, "require-dev": { - "doctrine/coding-standard": "^9", - "phpstan/phpstan": "1.4.10 || 1.10.15", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "psalm/plugin-phpunit": "0.18.4", - "psr/log": "^1 || ^2 || ^3", - "vimeo/psalm": "4.30.0 || 5.12.0" + "doctrine/coding-standard": "^9 || ^12 || ^13", + "phpstan/phpstan": "1.4.10 || 2.1.11", + "phpstan/phpstan-phpunit": "^1.0 || ^2", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", + "psr/log": "^1 || ^2 || ^3" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -1147,7 +1279,7 @@ "type": "library", "autoload": { "psr-4": { - "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + "Doctrine\\Deprecations\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -1158,22 +1290,22 @@ "homepage": "https://www.doctrine-project.org/", "support": { "issues": "https://github.com/doctrine/deprecations/issues", - "source": "https://github.com/doctrine/deprecations/tree/1.1.2" + "source": "https://github.com/doctrine/deprecations/tree/1.1.5" }, - "time": "2023-09-27T20:04:15+00:00" + "time": "2025-04-07T20:06:18+00:00" }, { "name": "doctrine/lexer", - "version": "2.1.0", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", - "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", + "reference": "861c870e8b75f7c8f69c146c7f89cc1c0f1b49b6", "shasum": "" }, "require": { @@ -1181,11 +1313,11 @@ "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9 || ^10", + "doctrine/coding-standard": "^9 || ^12", "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psalm/plugin-phpunit": "^0.18.3", - "vimeo/psalm": "^4.11 || ^5.0" + "vimeo/psalm": "^4.11 || ^5.21" }, "type": "library", "autoload": { @@ -1222,7 +1354,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/2.1.0" + "source": "https://github.com/doctrine/lexer/tree/2.1.1" }, "funding": [ { @@ -1238,7 +1370,7 @@ "type": "tidelift" } ], - "time": "2022-12-14T08:49:07+00:00" + "time": "2024-02-05T11:35:39+00:00" }, { "name": "friendsofphp/php-cs-fixer", @@ -1555,6 +1687,54 @@ }, "time": "2016-08-06T20:24:11+00:00" }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, { "name": "psr/log", "version": "1.1.4", @@ -1607,16 +1787,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.2", + "version": "3.13.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c", + "reference": "5b5e3821314f947dd040c70f7992a64eac89025c", "shasum": "" }, "require": { @@ -1626,11 +1806,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -1645,22 +1825,49 @@ "authors": [ { "name": "Greg Sherwood", - "role": "lead" + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" } ], "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", "keywords": [ "phpcs", "standards", "static analysis" ], "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" }, - "time": "2023-02-22T23:07:41+00:00" + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" + } + ], + "time": "2025-06-17T22:17:01+00:00" }, { "name": "symfony/console", @@ -1748,27 +1955,27 @@ }, { "name": "symfony/debug", - "version": "v3.4.47", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "ab42889de57fdfcfcc0759ab102e2fd4ea72dcae" + "reference": "1a692492190773c5310bc7877cb590c04c2f05be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/ab42889de57fdfcfcc0759ab102e2fd4ea72dcae", - "reference": "ab42889de57fdfcfcc0759ab102e2fd4ea72dcae", + "url": "https://api.github.com/repos/symfony/debug/zipball/1a692492190773c5310bc7877cb590c04c2f05be", + "reference": "1a692492190773c5310bc7877cb590c04c2f05be", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "psr/log": "~1.0" + "php": ">=7.1.3", + "psr/log": "^1|^2|^3" }, "conflict": { - "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + "symfony/http-kernel": "<3.4" }, "require-dev": { - "symfony/http-kernel": "~2.8|~3.0|~4.0" + "symfony/http-kernel": "^3.4|^4.0|^5.0" }, "type": "library", "autoload": { @@ -1793,10 +2000,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Debug Component", + "description": "Provides tools to ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/debug/tree/v3.4.47" + "source": "https://github.com/symfony/debug/tree/v4.4.44" }, "funding": [ { @@ -1813,35 +2020,43 @@ } ], "abandoned": "symfony/error-handler", - "time": "2020-10-24T10:57:07+00:00" + "time": "2022-07-28T16:29:46+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v3.4.47", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "31fde73757b6bad247c54597beef974919ec6860" + "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/31fde73757b6bad247c54597beef974919ec6860", - "reference": "31fde73757b6bad247c54597beef974919ec6860", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1e866e9e5c1b22168e0ce5f0b467f19bba61266a", + "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.1.3", + "symfony/event-dispatcher-contracts": "^1.1", + "symfony/polyfill-php80": "^1.16" }, "conflict": { - "symfony/dependency-injection": "<3.3" + "symfony/dependency-injection": "<3.4" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "1.1" }, "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.8|~3.0|~4.0", - "symfony/debug": "~3.4|~4.4", - "symfony/dependency-injection": "~3.3|~4.0", - "symfony/expression-language": "~2.8|~3.0|~4.0", - "symfony/stopwatch": "~2.8|~3.0|~4.0" + "psr/log": "^1|^2|^3", + "symfony/config": "^3.4|^4.0|^5.0", + "symfony/dependency-injection": "^3.4|^4.0|^5.0", + "symfony/error-handler": "~3.4|~4.4", + "symfony/expression-language": "^3.4|^4.0|^5.0", + "symfony/http-foundation": "^3.4|^4.0|^5.0", + "symfony/service-contracts": "^1.1|^2", + "symfony/stopwatch": "^3.4|^4.0|^5.0" }, "suggest": { "symfony/dependency-injection": "", @@ -1870,10 +2085,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony EventDispatcher Component", + "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/v3.4.47" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.44" }, "funding": [ { @@ -1889,25 +2104,105 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { - "name": "symfony/filesystem", - "version": "v3.4.47", + "name": "symfony/event-dispatcher-contracts", + "version": "v1.10.0", "source": { "type": "git", - "url": "https://github.com/symfony/filesystem.git", - "reference": "e58d7841cddfed6e846829040dca2cca0ebbbbb3" + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "761c8b8387cfe5f8026594a75fdf0a4e83ba6974" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/e58d7841cddfed6e846829040dca2cca0ebbbbb3", - "reference": "e58d7841cddfed6e846829040dca2cca0ebbbbb3", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/761c8b8387cfe5f8026594a75fdf0a4e83ba6974", + "reference": "761c8b8387cfe5f8026594a75fdf0a4e83ba6974", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" + "php": ">=7.1.3" + }, + "suggest": { + "psr/event-dispatcher": "", + "symfony/event-dispatcher-implementation": "" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "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": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v1.10.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": "2022-07-20T09:59:04+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v4.4.42", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/815412ee8971209bd4c1eecd5f4f481eacd44bf5", + "reference": "815412ee8971209bd4c1eecd5f4f481eacd44bf5", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -1932,10 +2227,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Filesystem Component", + "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v3.4.47" + "source": "https://github.com/symfony/filesystem/tree/v4.4.42" }, "funding": [ { @@ -1951,7 +2246,7 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2022-05-20T08:49:14+00:00" }, { "name": "symfony/finder", @@ -2016,20 +2311,20 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -2039,12 +2334,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2078,7 +2370,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0" }, "funding": [ { @@ -2094,24 +2386,25 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.32.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", "shasum": "" }, "require": { - "php": ">=7.1" + "ext-iconv": "*", + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -2121,12 +2414,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -2161,7 +2451,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0" }, "funding": [ { @@ -2177,7 +2467,7 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-12-23T08:48:59+00:00" }, { "name": "symfony/polyfill-php70", @@ -2198,12 +2488,12 @@ }, "type": "metapackage", "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + }, "branch-alias": { "dev-main": "1.20-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" } }, "notification-url": "https://packagist.org/downloads/", @@ -2249,37 +2539,26 @@ }, { "name": "symfony/polyfill-php72", - "version": "v1.28.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179" + "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/70f4aebd92afca2f865444d30a4d2151c13c3179", - "reference": "70f4aebd92afca2f865444d30a4d2151c13c3179", + "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", + "reference": "fa2ae56c44f03bed91a39bfc9822e31e7c5c38ce", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, - "type": "library", + "type": "metapackage", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "notification-url": "https://packagist.org/downloads/", @@ -2305,7 +2584,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php72/tree/v1.31.0" }, "funding": [ { @@ -2321,24 +2600,25 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v3.4.47", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca" + "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/b8648cf1d5af12a44a51d07ef9bf980921f15fca", - "reference": "b8648cf1d5af12a44a51d07ef9bf980921f15fca", + "url": "https://api.github.com/repos/symfony/process/zipball/5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", + "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.1.3", + "symfony/polyfill-php80": "^1.16" }, "type": "library", "autoload": { @@ -2363,10 +2643,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Process Component", + "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v3.4.47" + "source": "https://github.com/symfony/process/tree/v4.4.44" }, "funding": [ { @@ -2382,24 +2662,107 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2022-06-27T13:16:42+00:00" }, { - "name": "symfony/stopwatch", - "version": "v3.4.47", + "name": "symfony/service-contracts", + "version": "v1.10.0", "source": { "type": "git", - "url": "https://github.com/symfony/stopwatch.git", - "reference": "298b81faad4ce60e94466226b2abbb8c9bca7462" + "url": "https://github.com/symfony/service-contracts.git", + "reference": "afa00c500c2d6aea6e3b2f4862355f507bc5ebb4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/298b81faad4ce60e94466226b2abbb8c9bca7462", - "reference": "298b81faad4ce60e94466226b2abbb8c9bca7462", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/afa00c500c2d6aea6e3b2f4862355f507bc5ebb4", + "reference": "afa00c500c2d6aea6e3b2f4862355f507bc5ebb4", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.1.3", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "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": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v1.10.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": "2022-05-27T14:01:05+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v4.4.46", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "757660703fbd139eea0001b759c6c3bf5bc3ea52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/757660703fbd139eea0001b759c6c3bf5bc3ea52", + "reference": "757660703fbd139eea0001b759c6c3bf5bc3ea52", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/service-contracts": "^1.0|^2" + }, + "require-dev": { + "symfony/polyfill-php72": "~1.5" }, "type": "library", "autoload": { @@ -2424,10 +2787,10 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony Stopwatch Component", + "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v3.4.47" + "source": "https://github.com/symfony/stopwatch/tree/v4.4.46" }, "funding": [ { @@ -2443,7 +2806,139 @@ "type": "tidelift" } ], - "time": "2020-10-24T10:57:07+00:00" + "time": "2022-09-28T12:53:24+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v4.4.47", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "1069c7a3fca74578022fab6f81643248d02f8e63" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/1069c7a3fca74578022fab6f81643248d02f8e63", + "reference": "1069c7a3fca74578022fab6f81643248d02f8e63", + "shasum": "" + }, + "require": { + "php": ">=7.1.3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php72": "~1.5", + "symfony/polyfill-php80": "^1.16" + }, + "conflict": { + "phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0", + "symfony/console": "<3.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^3.4|^4.0|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^1.43|^2.13|^3.0.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "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": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v4.4.47" + }, + "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": "2022-10-03T15:15:11+00:00" + }, + { + "name": "symplify/vendor-patches", + "version": "11.5.0", + "source": { + "type": "git", + "url": "https://github.com/symplify/vendor-patches.git", + "reference": "04941b69734a93ef2736eac1db6d94b6eeee4d19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symplify/vendor-patches/zipball/04941b69734a93ef2736eac1db6d94b6eeee4d19", + "reference": "04941b69734a93ef2736eac1db6d94b6eeee4d19", + "shasum": "" + }, + "require": { + "cweagans/composer-patches": "^1.7", + "php": ">=7.2" + }, + "bin": [ + "bin/vendor-patches" + ], + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Generate vendor patches for packages with single command", + "support": { + "issues": "https://github.com/symplify/vendor-patches/issues", + "source": "https://github.com/symplify/vendor-patches/tree/11.5.0" + }, + "funding": [ + { + "url": "https://www.paypal.me/rectorphp", + "type": "custom" + }, + { + "url": "https://github.com/tomasvotruba", + "type": "github" + } + ], + "time": "2025-07-10T10:13:07+00:00" } ], "aliases": [], @@ -2452,12 +2947,12 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=7.1", + "php": ">=7.2", "ext-json": "*" }, "platform-dev": [], "platform-overrides": { - "php": "7.1" + "php": "7.2" }, "plugin-api-version": "2.3.0" } diff --git a/modules/paynow/config_pl.xml b/modules/paynow/config_pl.xml index a8b374cf..c019c7dd 100644 --- a/modules/paynow/config_pl.xml +++ b/modules/paynow/config_pl.xml @@ -2,7 +2,7 @@ paynow - + diff --git a/modules/paynow/controllers/front/confirmBlik.php b/modules/paynow/controllers/front/confirmBlik.php index bd6aefa0..bdd96576 100644 --- a/modules/paynow/controllers/front/confirmBlik.php +++ b/modules/paynow/controllers/front/confirmBlik.php @@ -28,7 +28,7 @@ class PaynowConfirmBlikModuleFrontController extends PaynowFrontController } $this->order = new Order($this->payment->id_order); - $payment_status_from_api = $this->getPaymentStatus($this->payment->id_payment); + $payment_status_from_api = $this->getPaymentStatus($this->payment->id_payment, $external_id); $statusToProcess = [ 'status' => $payment_status_from_api, 'externalId' => $this->payment->external_id, diff --git a/modules/paynow/controllers/front/return.php b/modules/paynow/controllers/front/return.php index 865e7aa6..8df4fc2a 100644 --- a/modules/paynow/controllers/front/return.php +++ b/modules/paynow/controllers/front/return.php @@ -50,7 +50,7 @@ class PaynowReturnModuleFrontController extends PaynowFrontController } if (Tools::getValue('paymentId')) { - $payment_status_from_api = $this->getPaymentStatus($this->payment->id_payment); + $payment_status_from_api = $this->getPaymentStatus($this->payment->id_payment, $this->payment->external_id); $statusToProcess = [ 'status' => $payment_status_from_api, 'externalId' => $this->payment->external_id, diff --git a/modules/paynow/controllers/front/status.php b/modules/paynow/controllers/front/status.php index 23dbd9c0..1cb31a88 100644 --- a/modules/paynow/controllers/front/status.php +++ b/modules/paynow/controllers/front/status.php @@ -34,7 +34,7 @@ class PaynowStatusModuleFrontController extends PaynowFrontController $payment = PaynowPaymentData::findLastByExternalId($external_id); $payment_status = $payment->status; if (Status::STATUS_CONFIRMED !== $payment->status) { - $payment_status_from_api = $this->getPaymentStatus($payment->id_payment); + $payment_status_from_api = $this->getPaymentStatus($payment->id_payment, $payment->external_id); $statusToProcess = [ 'status' => $payment_status_from_api, 'externalId' => $payment->external_id, diff --git a/modules/paynow/models/PaynowPaymentLockData.php b/modules/paynow/models/PaynowPaymentLockData.php new file mode 100644 index 00000000..ccaecf69 --- /dev/null +++ b/modules/paynow/models/PaynowPaymentLockData.php @@ -0,0 +1,133 @@ + self::TABLE, + 'primary' => self::PRIMARY_KEY, + 'fields' => [ + self::PRIMARY_KEY => ['type' => self::TYPE_INT], + 'id_order' => ['type' => self::TYPE_INT, 'required' => false], + 'id_cart' => ['type' => self::TYPE_INT, 'required' => true], + 'counter' => ['type' => self::TYPE_INT, 'required' => false], + 'created_at' => ['type' => self::TYPE_DATE, 'required' => true], + 'modified_at' => ['type' => self::TYPE_DATE, 'required' => true] + ] + ]; + + public static function create( + $id_order, + $id_cart + ) { + $now = (new DateTime('now', new DateTimeZone(Configuration::get('PS_TIMEZONE'))))->format('Y-m-d H:i:s'); + $model = new PaynowPaymentLockData(); + $model->id_order = $id_order; + $model->id_cart = $id_cart; + $model->counter = 1; + $model->created_at = $now; + $model->modified_at = $now; + + try { + $result = $model->save(false, false); + if (!$result) { + throw new Exception('Locks Model-save() returned false.'); + } + } catch (Exception $e) { + PaynowLogger::debug( + 'Can\'t create paynow lock entry', + [ + 'model' => (array)$model, + 'exception' => $e->getMessage(), + 'file' => $e->getFile(), + 'line' => $e->getline(), + 'DB error' => Db::getInstance()->getMsgError(), + ] + ); + throw $e; + } + } + + /** + * @param $order_id + * + * @return PrestaShopCollection + * @throws PrestaShopException + */ + public static function findByOrderId($order_id) + { + Db::getInstance(_PS_USE_SQL_SLAVE_)->disableCache(); + $queryBuilder = new PrestaShopCollection(self::class); + + return $queryBuilder + ->where('id_order', '=', $order_id) + ->setPageSize(1) + ->getFirst(); + } + + /** + * @param $cart_id + * + * @return PrestaShopCollection + * @throws PrestaShopException + */ + public static function findByCartId($cart_id) + { + Db::getInstance(_PS_USE_SQL_SLAVE_)->disableCache(); + $queryBuilder = new PrestaShopCollection(self::class); + + return $queryBuilder + ->where('id_cart', '=', $cart_id) + ->setPageSize(1) + ->getFirst(); + } + + public static function checkIsCartLocked($id_cart, $id_order = 0): bool + { + Db::getInstance(_PS_USE_SQL_SLAVE_)->disableCache(); + $data = PaynowPaymentLockData::findByCartId($id_cart); + + if ($data) { + if ($data->counter >= self::COUNTER_LIMIT) { + return false; + } + + $data->counter++; + $data->update(); + + return true; + } else { + self::create($id_order, $id_cart); + + return true; + } + } +} diff --git a/modules/paynow/paynow.php b/modules/paynow/paynow.php index 481ff33c..9be668fe 100644 --- a/modules/paynow/paynow.php +++ b/modules/paynow/paynow.php @@ -18,6 +18,7 @@ include_once(dirname(__FILE__) . '/vendor/autoload.php'); include_once(dirname(__FILE__) . '/classes/PaynowFrontController.php'); include_once(dirname(__FILE__) . '/classes/PaynowLogger.php'); include_once(dirname(__FILE__) . '/classes/PaynowHelper.php'); +include_once(dirname(__FILE__) . '/classes/PaynowKeysGenerator.php'); include_once(dirname(__FILE__) . '/classes/PaynowNotificationRetryProcessing.php'); include_once(dirname(__FILE__) . '/classes/PaynowNotificationStopProcessing.php'); include_once(dirname(__FILE__) . '/classes/PaynowConfigurationHelper.php'); @@ -31,11 +32,13 @@ include_once(dirname(__FILE__) . '/classes/PaynowAdminFormHelper.php'); include_once(dirname(__FILE__) . '/classes/PaynowOrderCreateProcessor.php'); include_once(dirname(__FILE__) . '/classes/PaynowOrderStateProcessor.php'); include_once(dirname(__FILE__) . '/models/PaynowPaymentData.php'); +include_once(dirname(__FILE__) . '/models/PaynowPaymentLockData.php'); include_once(dirname(__FILE__) . '/classes/PaynowFrontController.php'); include_once(dirname(__FILE__) . '/classes/PaynowPaymentProcessor.php'); include_once(dirname(__FILE__) . '/classes/PaynowPaymentDataBuilder.php'); include_once(dirname(__FILE__) . '/classes/PaynowGithubClient.php'); include_once(dirname(__FILE__) . '/classes/PaynowLockingHelper.php'); +include_once(dirname(__FILE__) . '/classes/PaynowSavedInstrumentHelper.php'); class Paynow extends PaymentModule { @@ -47,7 +50,7 @@ class Paynow extends PaymentModule { $this->name = 'paynow'; $this->tab = 'payments_gateways'; - $this->version = '1.6.35'; + $this->version = '1.7.12'; $this->ps_versions_compliancy = ['min' => '1.6.0', 'max' => _PS_VERSION_]; $this->author = 'mElements S.A.'; $this->is_eu_compatible = 1; @@ -77,12 +80,14 @@ class Paynow extends PaymentModule public function install() { - if (!parent::install() || + if (!parent::install() || !$this->createDbTables() || !$this->createModuleSettings() || !$this->registerHooks()) { return false; } + + $this->saveShopPluginStatus(Paynow\Service\ShopConfiguration::STATUS_UPDATED); return true; } @@ -91,29 +96,62 @@ class Paynow extends PaymentModule if (!$this->unregisterHooks() || !$this->deleteModuleSettings() || !parent::uninstall()) { return false; } + + $this->saveShopPluginStatus(Paynow\Service\ShopConfiguration::STATUS_UNINSTALLED); return true; } + public function enable($force_all = false) + { + if (!parent::enable($force_all)) { + return false; + } + + $this->saveShopPluginStatus(Paynow\Service\ShopConfiguration::STATUS_ENABLED); + return true; + } + + public function disable($force_all = false) + { + if (!parent::disable($force_all)) { + return false; + } + + $this->saveShopPluginStatus(Paynow\Service\ShopConfiguration::STATUS_DISABLED); + return true; + } + private function createDbTables() { - return Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'paynow_payments` ( - `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , - `id_order` INT(10) UNSIGNED NOT NULL, - `id_cart` INT(10) UNSIGNED NOT NULL, - `id_payment` varchar(30) NOT NULL, - `order_reference` varchar(9) NOT NULL, - `external_id` varchar(50) NOT NULL, - `status` varchar(64) NOT NULL, - `total` DECIMAL(20,6) NOT NULL DEFAULT \'0.000000\', - `locked` TINYINT(1) NOT NULL DEFAULT 0, - `active` tinyint(1) NOT NULL DEFAULT 0, - `counter` tinyint(1) NOT NULL DEFAULT 0, - `sent_at` datetime DEFAULT NULL, - `created_at` datetime, - `modified_at` datetime, - UNIQUE (`id_payment`, `status`), - INDEX `index_order_cart_payment_reference` (`id_order`, `id_cart`, `id_payment`, `order_reference`) - )'); + $result = Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'paynow_payments` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , + `id_order` INT(10) UNSIGNED NOT NULL, + `id_cart` INT(10) UNSIGNED NOT NULL, + `id_payment` varchar(30) NOT NULL, + `order_reference` varchar(9) NOT NULL, + `external_id` varchar(50) NOT NULL, + `status` varchar(64) NOT NULL, + `total` DECIMAL(20,6) NOT NULL DEFAULT \'0.000000\', + `locked` TINYINT(1) NOT NULL DEFAULT 0, + `active` tinyint(1) NOT NULL DEFAULT 0, + `counter` tinyint(1) NOT NULL DEFAULT 0, + `sent_at` datetime DEFAULT NULL, + `created_at` datetime, + `modified_at` datetime, + UNIQUE (`id_payment`, `status`), + INDEX `index_order_cart_payment_reference` (`id_order`, `id_cart`, `id_payment`, `order_reference`) + )'); + + return $result && Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'paynow_payment_locks` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , + `id_order` INT(10) UNSIGNED NOT NULL DEFAULT 0, + `id_cart` INT(10) UNSIGNED NOT NULL DEFAULT 0, + `counter` tinyint(1) NOT NULL DEFAULT 0, + `created_at` datetime, + `modified_at` datetime, + INDEX `index_payment_cart_reference` (`id_cart`), + INDEX `index_payment_order_reference` (`id_order`) + )'); } private function registerHooks() @@ -378,6 +416,12 @@ class Paynow extends PaymentModule return $this->l('Pay by Google Pay'); case \Paynow\Model\PaymentMethods\Type::APPLE_PAY: return $this->l('Pay by Apple Pay'); + case 'DIGITAL_WALLETS': + return $this->l('Pay by digital wallets'); + case \Paynow\Model\PaymentMethods\Type::PAYPO: + return $this->l('PayPo - buy now, pay later'); + case \Paynow\Model\PaymentMethods\Type::CLICK_TO_PAY: + return $this->l('Click To Pay - pay with pre-saved card'); } } @@ -389,13 +433,13 @@ class Paynow extends PaymentModule { $total = number_format($this->context->cart->getOrderTotal() * 100, 0, '', ''); $currency = new Currency($this->context->cart->id_currency); - return (new PaynowPaymentMethodsHelper($this->getPaynowClient()))->getAvailable($currency->iso_code, $total); + return (new PaynowPaymentMethodsHelper($this->getPaynowClient()))->getAvailable($currency->iso_code, $total, $this->context, $this); } private function getGDPRNotices(): array { $locale = $this->context->language->locale ?? $this->context->language->language_code; - return (new PaynowGDPRHelper($this->getPaynowClient()))->getNotices($locale); + return (new PaynowGDPRHelper($this->getPaynowClient(), $this->context->cart))->getNotices($locale); } /** Returns is possible to show payment option @@ -436,14 +480,22 @@ class Paynow extends PaymentModule 'cta_text' => $this->getCallToActionText(), 'logo' => $this->getLogo(), 'paynow_url' => PaynowLinkHelper::getPaymentUrl(), - 'data_processing_notices' => $gdpr_notices ?? null + 'data_processing_notices' => $gdpr_notices ?? null, + 'data_paynow_plugin_version' => $this->version, ]); - $payment_options = []; if ((int)Configuration::get('PAYNOW_SEPARATE_PAYMENT_METHODS') === 1) { $payment_methods = $this->getPaymentMethods(); if (!empty($payment_methods)) { + + $digital_wallets = [ + Paynow\Model\PaymentMethods\Type::CLICK_TO_PAY => null, + Paynow\Model\PaymentMethods\Type::GOOGLE_PAY => null, + Paynow\Model\PaymentMethods\Type::APPLE_PAY => null, + ]; + $list = []; + $payment_options = []; foreach ($payment_methods->getAll() as $payment_method) { if (!isset($list[$payment_method->getType()])) { if (Paynow\Model\PaymentMethods\Type::PBL == $payment_method->getType()) { @@ -454,7 +506,13 @@ class Paynow extends PaymentModule 'authorization' => $payment_method->getAuthorizationType(), 'pbls' => $payment_methods->getOnlyPbls() ]); - } else { + } elseif (array_key_exists($payment_method->getType(), $digital_wallets)) { + if (!$payment_method->isEnabled()) { + continue; + } + + $digital_wallets[$payment_method->getType()] = $payment_method; + } else { if (Paynow\Model\PaymentMethods\Type::BLIK == $payment_method->getType()) { $this->context->smarty->assign([ 'action_blik' => Context::getContext()->link->getModuleLink( @@ -467,22 +525,52 @@ class Paynow extends PaymentModule 'action_token' => Tools::encrypt($this->context->customer->secure_key), 'action_token_refresh' => Context::getContext()->link->getModuleLink('paynow', 'customerToken'), 'error_message' => $this->getTranslationsArray()['An error occurred during the payment process'], - 'terms_message' => $this->getTranslationsArray()['You have to accept terms and conditions'], + 'terms_message' => $this->getTranslationsArray()['First accept the terms of service, then click pay.'], 'blik_autofocus' => Configuration::get('PAYNOW_BLIK_AUTOFOCUS_ENABLED') === '0' ? '0' : '1', ]); } - array_push($payment_options, [ + + $payment_option = [ 'name' => $this->getPaymentMethodTitle($payment_method->getType()), 'image' => $payment_method->getImage(), 'id' => $payment_method->getId(), 'enabled' => $payment_method->isEnabled(), 'type' => $payment_method->getType(), 'authorization' => $payment_method->getAuthorizationType(), - ]); + ]; + + if (Paynow\Model\PaymentMethods\Type::CARD == $payment_method->getType()) { + $payment_option = array_merge($payment_option, [ + 'action_card' => PaynowLinkHelper::getPaymentUrl([ + 'paymentMethodId' => $payment_method->getId() + ]), + 'action_remove_saved_instrument' => Context::getContext()->link->getModuleLink( + 'paynow', + 'removeSavedInstrument' + ), + 'action_token' => Tools::encrypt($this->context->customer->secure_key), + 'default_card_image' => Media::getMediaPath(_PS_MODULE_DIR_ . $this->name . '/views/img/card-default.svg'), + 'instruments' => $payment_method->getSavedInstruments(), + ]); + } + + array_push($payment_options, $payment_option); } $list[$payment_method->getType()] = $payment_method->getId(); } } + + $digital_wallets = array_values(array_filter($digital_wallets)); + if (!empty($digital_wallets)) { + $payment_options[] = [ + 'name' => $this->getPaymentMethodTitle('DIGITAL_WALLETS'), + 'image' => $this->getDigitalWalletsLogo($digital_wallets), + 'type' => 'DIGITAL_WALLETS', + 'authorization' => '', + 'pbls' => $digital_wallets + ]; + } + $this->context->smarty->assign([ 'payment_options' => $payment_options ]); @@ -535,8 +623,11 @@ class Paynow extends PaymentModule */ public function hookActionOrderSlipAdd($params) { - if ((int)Configuration::get('PAYNOW_REFUNDS_ENABLED') === 1 && Tools::isSubmit('makeRefundViaPaynow') && - $this->name == $params['order']->module) { + if ((int)Configuration::get('PAYNOW_REFUNDS_ENABLED') === 1 + && Tools::isSubmit('makeRefundViaPaynow') + && $this->name == $params['order']->module + ) + { (new PaynowRefundProcessor($this->getPaynowClient(), $this->displayName)) ->processFromOrderSlip($params['order']); } @@ -609,6 +700,8 @@ class Paynow extends PaymentModule return $this->fetchTemplate('/views/templates/admin/_partials/upgrade.tpl'); } + $this->sendShopPluginStatus(); + return null; } @@ -641,6 +734,22 @@ class Paynow extends PaymentModule return false; } + public function getDigitalWalletsLogo(array $wallets): string + { + if(count($wallets) === 1) { + return $wallets[0]->getImage(); + } + + $types = array_map(function($dw) { + return strtolower(substr($dw->getType(), 0, 1)); + }, $wallets); + + sort($types); + $types = implode('', $types); + + return Media::getMediaPath(_PS_MODULE_DIR_ . $this->name . '/views/img/digital-wallets-' . $types . '.svg'); + } + public function getLogo() { return Media::getMediaPath(_PS_MODULE_DIR_ . $this->name . '/views/img/logo-paynow.png'); @@ -743,6 +852,60 @@ class Paynow extends PaymentModule } } + private function saveShopPluginStatus($status) + { + $statuses = Configuration::get('PAYNOW_PLUGIN_STATUSES'); + if (empty($statuses)) { + $statuses = []; + } else { + $statuses = json_decode($statuses, true); + } + + date_default_timezone_set('UTC'); + $statuses[] = [ + 'status' => $status, + 'timestamp' => date('Y-m-d\TH:i:s.v\Z'), + ]; + + Configuration::updateValue('PAYNOW_PLUGIN_STATUSES', json_encode($statuses)); + } + + private function sendShopPluginStatus() + { + if ( empty( $this->getApiKey() ) ) { + return; + } + + $statuses = Configuration::get('PAYNOW_PLUGIN_STATUSES'); + Configuration::updateValue('PAYNOW_PLUGIN_STATUSES', json_encode([])); + + if (empty($statuses)) { + return; + } else { + $statuses = json_decode($statuses, true); + } + + if (empty($statuses)) { + return; + } + + $shop_configuration = new Paynow\Service\ShopConfiguration($this->getPaynowClient()); + try { + $shop_configuration->status($statuses); + } catch (Paynow\Exception\PaynowException $exception) { + PaynowLogger::error( + 'An error occurred during shop plugin status send {code={}, message={}}', + [ + $exception->getCode(), + $exception->getPrevious()->getMessage() + ] + ); + foreach ($exception->getErrors() as $error) { + PaynowLogger::error('Error', ['mes' => $error->getMessage()]); + } + } + } + public function getContent() { if (Tools::isSubmit('submit' . $this->name)) { @@ -819,7 +982,6 @@ class Paynow extends PaymentModule 'Wrong BLIK code' => $this->l('Wrong BLIK code'), 'BLIK code has expired' => $this->l('BLIK code has expired'), 'BLIK code already used' => $this->l('BLIK code already used'), - 'You have to accept terms and conditions' => $this->l('You have to accept terms and conditions'), 'Moment of creating order' => $this->l('Moment of creating order'), 'On clicking the Place order' => $this->l('On clicking the Place order'), 'After the successful Paynow payment' => $this->l('After the successful Paynow payment'), @@ -828,6 +990,9 @@ class Paynow extends PaymentModule 'Show retry payment button on selected statuses' => $this->l('Show retry payment button on selected statuses'), 'BLIK field autofocus' => $this->l('BLIK field autofocus'), 'Autofocus on checkout form field: BLIK code. Enabled by default. Disabling may be helpful when checkout page is visualy long (e.g. single-page checkout).' => $this->l('Autofocus on checkout form field: BLIK code. Enabled by default. Disabling may be helpful when checkout page is visualy long (e.g. single-page checkout).'), + 'An error occurred while deleting the saved card.' => $this->l('An error occurred while deleting the saved card.'), + 'First accept the terms of service, then click pay.' => $this->l('First accept the terms of service, then click pay.'), + 'Digital wallets' => $this->l('Digital wallets'), ]; } } diff --git a/modules/paynow/translations/pl.php b/modules/paynow/translations/pl.php index 4e9ddea8..ea2ba46b 100644 --- a/modules/paynow/translations/pl.php +++ b/modules/paynow/translations/pl.php @@ -13,10 +13,17 @@ $_MODULE['<{paynow}prestashop>paynow_cc21116ce900f38c0691823ab193b9a3'] = 'Płat $_MODULE['<{paynow}prestashop>paynow_961d23fcb6c49cee1150dba52beb04ca'] = 'Płatność szybkim przelewem'; $_MODULE['<{paynow}prestashop>paynow_2a34963732b2fea04f1417120be393ae'] = 'Płatność Google Pay'; $_MODULE['<{paynow}prestashop>paynow_111999b13ca63380771744ea02c4906b'] = 'Płatność Apple Pay'; +$_MODULE['<{paynow}prestashop>paynow_80f5e0ec61eb764d2c250d5c1c96da57'] = 'Płatność portfelami cyfrowymi'; +$_MODULE['<{paynow}prestashop>paynow_6b46e5850b6a6bf8af7118c5f21cd916'] = 'PayPo - kup teraz, zapłać później'; +$_MODULE['<{paynow}prestashop>paynow_1557d8cc30061fe149e267e1e196c4dc'] = 'Click To Pay - zapłać zapisaną kartą'; $_MODULE['<{paynow}prestashop>paynow_428a1abd50e8dadb4fdc0f3861dbe04b'] = 'Zleć zwrot środków przez paynow.pl'; $_MODULE['<{paynow}prestashop>paynow_dc34c9c3d4e62630ad62b58828cae5d8'] = 'Musisz wprowadzić klucze integracyjne'; $_MODULE['<{paynow}prestashop>paynow_aaca790b3b211a66ee5ddb51b817cbf2'] = 'Czas ważności płatności musi być większy niż 60 i mniejszy niż 86400 sekund.'; $_MODULE['<{paynow}prestashop>paynow_02436b9306ccb6eeb1e435a6109bf6ca'] = 'Czas ważności płatności musi być liczbą całkowitą'; +$_MODULE['<{paynow}prestashop>paynow_9e900430ecef9d66cd31784b325c89e1'] = 'Niepoprawny format klucza dostępu do API (sandbox)'; +$_MODULE['<{paynow}prestashop>paynow_28a67914858c1ad4333046e878cdaff2'] = 'Niepoprawny format klucza obliczania podpisu (sandbox)'; +$_MODULE['<{paynow}prestashop>paynow_93b851b08ee6b549ccbed93252ba3e3c'] = 'Niepoprawny format klucza dostępu do API (produkcja)'; +$_MODULE['<{paynow}prestashop>paynow_f78db1f0dc7be32221b1e5a18f23ef8d'] = 'Niepoprawny format klucza obliczania podpisu (produkcja)'; $_MODULE['<{paynow}prestashop>paynow_20015706a8cbd457cbb6ea3e7d5dc9b3'] = 'Konfiguracja zapisana'; $_MODULE['<{paynow}prestashop>paynow_f27165ecfba5364104162ba4eef9568b'] = 'Błędna konfiguracja kluczy dostępowych do API'; $_MODULE['<{paynow}prestashop>paynow_c9b759157090f6e673fc780ca46ee3e1'] = 'Odpowiedź z API: '; @@ -45,9 +52,7 @@ $_MODULE['<{paynow}prestashop>paynow_80c85fada5bbc57f4ca99ba8c1634b50'] = 'na st $_MODULE['<{paynow}prestashop>paynow_baa5053eacdd3b516c60cbcc9695c12a'] = 'Zwracaj koszty przesyłki'; $_MODULE['<{paynow}prestashop>paynow_e128ece85361c066ea30a503fb868121'] = 'Dodatkowo ustawienia'; $_MODULE['<{paynow}prestashop>paynow_5c2c5c1ab84b763f09cd2ab6bd5720a3'] = 'Pozwól wybrać metody płatności'; -$_MODULE['<{paynow}prestashop>paynow_ecd133189898f0bb5c22929d945b5a16'] = 'Pokaż przycisk ponów płatność'; -$_MODULE['<{paynow}prestashop>paynow_f80582610895a112b5bd6be72a44b0eb'] = 'Przycisk pokazywany jest na ekranie szczegółów zamówienia.'; -$_MODULE['<{paynow}prestashop>paynow_f073bd1fb850d58894658439ac926d45'] = 'Pokaż przycisk ponów płatność dla wybranych statusów'; +$_MODULE['<{paynow}prestashop>paynow_95a791ac35811c3805b6e51b9899638a'] = 'Ukryj metody płatności'; $_MODULE['<{paynow}prestashop>paynow_b5c4d3273e029a1ab33c3ef315a00916'] = 'Użyj strony potwierdzenie-zamówienia jako strony powrotu do sklepu'; $_MODULE['<{paynow}prestashop>paynow_a6cd1dd6e1c5c70b936136dc687f793e'] = 'Po płatności kupujący zostanie przekierowany do klasycznej strony potwierdzenia zamówienia.'; $_MODULE['<{paynow}prestashop>paynow_33d2b4361184679164c34a538c362744'] = 'Wysyłaj informację o produktach'; @@ -64,14 +69,31 @@ $_MODULE['<{paynow}prestashop>paynow_eed0e5c8805353597a14d1bf8723b6c9'] = 'Potwi $_MODULE['<{paynow}prestashop>paynow_1027fdee59a948aa52827bcb3cbf8f50'] = 'Błędny kod BLIK'; $_MODULE['<{paynow}prestashop>paynow_d91754b07a6dea16490d2411b0b167bb'] = 'Kod jest nieaktualny'; $_MODULE['<{paynow}prestashop>paynow_04da3af7560536b3731ac6a478e71c0d'] = 'Kod był wcześniej wykorzystany'; -$_MODULE['<{paynow}prestashop>paynow_ed9bfacc48621ce7a789eb48ef273d51'] = 'Zaakceptuj warunki świadczenia usługi'; $_MODULE['<{paynow}prestashop>paynow_2d7b427e37231031e942756d082bf03f'] = 'Tworzenie zamówienia'; $_MODULE['<{paynow}prestashop>paynow_247421e49992417c813b035ca3256a01'] = 'Po kliknięciu przycisku Złóż zamówienie'; $_MODULE['<{paynow}prestashop>paynow_8d857bed9bc986ff7295ba154b7a99d1'] = 'Po udanej płatności Paynow'; +$_MODULE['<{paynow}prestashop>paynow_ecd133189898f0bb5c22929d945b5a16'] = 'Pokaż przycisk ponów płatność'; +$_MODULE['<{paynow}prestashop>paynow_f80582610895a112b5bd6be72a44b0eb'] = 'Przycisk pokazywany jest na ekranie szczegółów zamówienia.'; +$_MODULE['<{paynow}prestashop>paynow_f073bd1fb850d58894658439ac926d45'] = 'Pokaż przycisk ponów płatność dla wybranych statusów'; +$_MODULE['<{paynow}prestashop>paynow_18089cf8fe24bbd8110951a7419cdc24'] = 'Autofocus dla pola BLIK'; +$_MODULE['<{paynow}prestashop>paynow_2075cf7a7fc00b561fb19947f3141226'] = 'Autofocus dla pola BLIK na ekrakanie koszyka przy wyborze płatności. Domyślnie włączone. Wyłączenie może być przydatne, jeśli strona kosztyka jest długa (np. jeśli zastosowano moduł pojedynczej strony koszyka)'; +$_MODULE['<{paynow}prestashop>paynow_98725517a57057b6652ac5ac1717688a'] = 'Wystąpił błąd podczas usuwania zapisanej karty.'; +$_MODULE['<{paynow}prestashop>paynow_5df39de6796a1b94e70aeabb30c6f441'] = 'Najpierw zaakceptuj warunki świadczenia usługi, potem kliknij zapłać.'; +$_MODULE['<{paynow}prestashop>paynow_e2c9b039841eebbab5e62a14cdc9ec6b'] = 'Portfele cyfrowe'; +$_MODULE['<{paynow}prestashop>paynowadminformhelper_6adf97f83acf6453d4a6a4b1070f3754'] = 'Żadne'; $_MODULE['<{paynow}prestashop>order_details_d43f2c65af8fb54fa71636c3e5308cf3'] = 'Ponów płatność przez paynow.pl'; +$_MODULE['<{paynow}prestashop>payment_data_processing_info_43340e6cc4e88197d57f8d6d5ea50a46'] = 'Czytaj więcej'; $_MODULE['<{paynow}prestashop>payment_method_blik_form_ea37f7c5bc6b5b74ea529c3d21a468d1'] = 'Podaj kod BLIK'; $_MODULE['<{paynow}prestashop>payment_method_blik_form_99938b17c91170dfb0c2f3f8bc9f2a85'] = 'Zapłać'; -$_MODULE['<{paynow}prestashop>payment_data_processing_info_43340e6cc4e88197d57f8d6d5ea50a46'] = 'Czytaj więcej'; +$_MODULE['<{paynow}prestashop>payment_method_card_form_de03c9a7273f2eb642e921592abb2907'] = 'Wybierz zapisaną kartę lub wprowadź dane nowej:'; +$_MODULE['<{paynow}prestashop>payment_method_card_form_623990b71104bea810bac8c9ebc08471'] = 'Karta:'; +$_MODULE['<{paynow}prestashop>payment_method_card_form_76fd25c5c62f184483aea1dce80902ce'] = 'Wygasła:'; +$_MODULE['<{paynow}prestashop>payment_method_card_form_7896bdb62c4e9bd3baa9f8d56ffaa031'] = 'Wygasa:'; +$_MODULE['<{paynow}prestashop>payment_method_card_form_0f6969d7052da9261e31ddb6e88c136e'] = 'usuń'; +$_MODULE['<{paynow}prestashop>payment_method_card_form_98725517a57057b6652ac5ac1717688a'] = 'Wystąpił błąd podczas usuwania zapisanej karty.'; +$_MODULE['<{paynow}prestashop>payment_method_card_form_3f9742a5b058d0a3f1b7ffa4eed8b9cc'] = 'Usuń kartę'; +$_MODULE['<{paynow}prestashop>payment_method_card_form_20d44104dfc61a9c2de2814c26208c2b'] = 'Wprowadź dane nowej karty'; +$_MODULE['<{paynow}prestashop>payment_method_card_form_f21bac71884b2f861ed0b5479e5607f3'] = 'Możesz ją zapisać w następnym kroku'; $_MODULE['<{paynow}prestashop>return_3eea8b36c11f4bdf099b22d3f8788cff'] = 'Zapłać przelewem online lub BLIK'; $_MODULE['<{paynow}prestashop>return_f403ac95a07ddae169d88c4833ace3ce'] = 'Dziękujemy za złożenie zamówienia!'; $_MODULE['<{paynow}prestashop>return_163136ea55fe3c7b78c2334bd1133a9c'] = 'Numer Twojego zamówienia:'; @@ -85,6 +107,7 @@ $_MODULE['<{paynow}prestashop>confirm_blik_eed0e5c8805353597a14d1bf8723b6c9'] = $_MODULE['<{paynow}prestashop>confirm_blik_1e554f863a6a8e8ec5deca559c6a7408'] = 'Potwierdź płatność BLIKIEM'; $_MODULE['<{paynow}prestashop>confirm_blik_163136ea55fe3c7b78c2334bd1133a9c'] = 'Numer Twojego zamówienia:'; $_MODULE['<{paynow}prestashop>confirm_blik_2a32cf6f2fa4e898ac64c8015a27e27e'] = 'Status zamówienia:'; +$_MODULE['<{paynow}prestashop>payment_method_digital_wallets_form_d13efc31eb6f59b1508f2552b507fa4c'] = 'Wybierz portfel:'; $_MODULE['<{paynow}prestashop>payment_form_427ee560f858d9e02e102b0060d1973e'] = 'Wybierz bank:'; $_MODULE['<{paynow}prestashop>upgrade_7fa519ae904624b16cc755ea761546c1'] = 'Dostępna jest nowa wersja modułu Płacę z paynow.pl'; $_MODULE['<{paynow}prestashop>upgrade_6af7b7a01de0b0b0954a237def7349ef'] = 'Pobierz'; @@ -97,12 +120,3 @@ $_MODULE['<{paynow}prestashop>account_2652eec977dcb2a5aea85f5bec235b05'] = 'z te $_MODULE['<{paynow}prestashop>account_e900e40bc91d3f9f7f0a99fed68a2e96'] = 'środowiska'; $_MODULE['<{paynow}prestashop>account_be11de1ab431efc5d058e52e68667abb'] = 'Klucze uwierzytelniające dostępne są w zakładce Paynow -> Ustawienia -> Sklepy i punkty płatności -> Dane uwierzytelniające w bankowości internetowej mBanku.'; $_MODULE['<{paynow}prestashop>info_37050ea474edaaacb565cbec9d64bea3'] = 'Moduł umożliwia dokonywanie automatycznego zwrotu środków z salda dla płatności zrealizowanych przez paynow.pl. Aby skorzystać z tej opcji musisz wybrać dzienną częstotliwość wypłat w panelu paynow. Aby to zrobić wejdź w `Ustawienia / Harmonogram wypłat` a następnie wybierz ustawienie dla odpowiedniego sklepu.'; -$_MODULE['<{paynow}prestashop>paynow_18089cf8fe24bbd8110951a7419cdc24'] = 'Autofocus dla pola BLIK'; -$_MODULE['<{paynow}prestashop>paynow_2075cf7a7fc00b561fb19947f3141226'] = 'Autofocus dla pola BLIK na ekrakanie koszyka przy wyborze płatności. Domyślnie włączone. Wyłączenie może być przydatne, jeśli strona kosztyka jest długa (np. jeśli zastosowano moduł pojedynczej strony koszyka)'; -$_MODULE['<{paynow}prestashop>paynow_95a791ac35811c3805b6e51b9899638a'] = 'Ukryj metody płatności'; -$_MODULE['<{paynow}prestashop>paynow_9e900430ecef9d66cd31784b325c89e1'] = 'Niepoprawny format klucza dostępu do API (sandbox)'; -$_MODULE['<{paynow}prestashop>paynow_28a67914858c1ad4333046e878cdaff2'] = 'Niepoprawny format klucza obliczania podpisu (sandbox)'; -$_MODULE['<{paynow}prestashop>paynow_93b851b08ee6b549ccbed93252ba3e3c'] = 'Niepoprawny format klucza dostępu do API (produkcja)'; -$_MODULE['<{paynow}prestashop>paynow_f78db1f0dc7be32221b1e5a18f23ef8d'] = 'Niepoprawny format klucza obliczania podpisu (produkcja)'; -$_MODULE['<{paynow}prestashop>paynow_6adf97f83acf6453d4a6a4b1070f3754'] = 'Nie ukrywaj'; - diff --git a/modules/paynow/upgrade/upgrade-1.7.11.php b/modules/paynow/upgrade/upgrade-1.7.11.php new file mode 100644 index 00000000..8c0cc071 --- /dev/null +++ b/modules/paynow/upgrade/upgrade-1.7.11.php @@ -0,0 +1,53 @@ +executeS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "external_id"') == false) { + Db::getInstance()->execute('ALTER TABLE ' . _DB_PREFIX_ . 'paynow_payments ADD external_id VARCHAR(50) NOT NULL AFTER `order_reference`'); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "total"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `total` DECIMAL(20,6) NOT NULL DEFAULT '0.000000' AFTER `status`;"); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "locked"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `locked` TINYINT(1) NOT NULL DEFAULT 0 AFTER `total`;"); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "counter"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `counter` TINYINT(1) NOT NULL DEFAULT 0 AFTER `locked`;"); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "active"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `active` TINYINT(1) NOT NULL DEFAULT 0 AFTER `counter`;"); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "sent_at"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `sent_at` datetime NULL AFTER `active`;"); + } + + } catch (PrestaShopDatabaseException $exception) { + PaynowLogger::error('Fatal error on upgrade: ' . $exception->getMessage() . ' ' . $exception->getTraceAsString()); + } + + return true; +} diff --git a/modules/paynow/upgrade/upgrade-1.7.12.php b/modules/paynow/upgrade/upgrade-1.7.12.php new file mode 100644 index 00000000..cfc756a6 --- /dev/null +++ b/modules/paynow/upgrade/upgrade-1.7.12.php @@ -0,0 +1,64 @@ +executeS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "external_id"') == false) { + Db::getInstance()->execute('ALTER TABLE ' . _DB_PREFIX_ . 'paynow_payments ADD external_id VARCHAR(50) NOT NULL AFTER `order_reference`'); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "total"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `total` DECIMAL(20,6) NOT NULL DEFAULT '0.000000' AFTER `status`;"); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "locked"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `locked` TINYINT(1) NOT NULL DEFAULT 0 AFTER `total`;"); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "counter"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `counter` TINYINT(1) NOT NULL DEFAULT 0 AFTER `locked`;"); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "active"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `active` TINYINT(1) NOT NULL DEFAULT 0 AFTER `counter`;"); + } + + if (Db::getInstance()->ExecuteS('SHOW COLUMNS FROM ' . _DB_PREFIX_ . 'paynow_payments LIKE "sent_at"') == false) { + Db::getInstance()->Execute("ALTER TABLE `" . _DB_PREFIX_ . "paynow_payments` ADD `sent_at` datetime NULL AFTER `active`;"); + } + + Db::getInstance()->Execute('CREATE TABLE IF NOT EXISTS `' . _DB_PREFIX_ . 'paynow_payment_locks` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY , + `id_order` INT(10) UNSIGNED NOT NULL DEFAULT 0, + `id_cart` INT(10) UNSIGNED NOT NULL DEFAULT 0, + `counter` tinyint(1) NOT NULL DEFAULT 0, + `created_at` datetime, + `modified_at` datetime, + INDEX `index_payment_cart_reference` (`id_cart`), + INDEX `index_payment_order_reference` (`id_order`) + )'); + + } catch (PrestaShopDatabaseException $exception) { + PaynowLogger::error('Fatal error on upgrade: ' . $exception->getMessage() . ' ' . $exception->getTraceAsString()); + } + + return true; +} diff --git a/modules/paynow/vendor/.htaccess b/modules/paynow/vendor/.htaccess new file mode 100644 index 00000000..3de9e400 --- /dev/null +++ b/modules/paynow/vendor/.htaccess @@ -0,0 +1,10 @@ +# Apache 2.2 + + Order deny,allow + Deny from all + + +# Apache 2.4 + + Require all denied + diff --git a/modules/paynow/vendor/autoload.php b/modules/paynow/vendor/autoload.php index 9f534f6f..8d80506e 100644 --- a/modules/paynow/vendor/autoload.php +++ b/modules/paynow/vendor/autoload.php @@ -22,4 +22,4 @@ if (PHP_VERSION_ID < 50600) { require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInita3df77b4b522885b715a8fd38a5db444::getLoader(); +return ComposerAutoloaderInit93238e2dd576a8d3792c34ad274d581f::getLoader(); diff --git a/modules/paynow/vendor/clue/stream-filter/composer.json b/modules/paynow/vendor/clue/stream-filter/composer.json index 797fb536..2e744568 100644 --- a/modules/paynow/vendor/clue/stream-filter/composer.json +++ b/modules/paynow/vendor/clue/stream-filter/composer.json @@ -2,7 +2,7 @@ "name": "clue/stream-filter", "description": "A simple and modern approach to stream filtering in PHP", "keywords": ["stream", "callback", "filter", "php_user_filter", "stream_filter_append", "stream_filter_register", "bucket brigade"], - "homepage": "https://github.com/clue/php-stream-filter", + "homepage": "https://github.com/clue/stream-filter", "license": "MIT", "authors": [ { @@ -14,13 +14,19 @@ "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, "autoload": { - "psr-4": { "Clue\\StreamFilter\\": "src/" }, - "files": [ "src/functions_include.php" ] + "psr-4": { + "Clue\\StreamFilter\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] }, "autoload-dev": { - "psr-4": { "Clue\\Tests\\StreamFilter\\": "tests/" } + "psr-4": { + "Clue\\Tests\\StreamFilter\\": "tests/" + } } } diff --git a/modules/paynow/vendor/clue/stream-filter/src/functions.php b/modules/paynow/vendor/clue/stream-filter/src/functions.php index cad88a29..865f6b94 100644 --- a/modules/paynow/vendor/clue/stream-filter/src/functions.php +++ b/modules/paynow/vendor/clue/stream-filter/src/functions.php @@ -104,13 +104,27 @@ namespace Clue\StreamFilter; */ function append($stream, $callback, $read_write = STREAM_FILTER_ALL) { - $ret = @\stream_filter_append($stream, register(), $read_write, $callback); + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errstr) { + // Match errstr from PHP's warning message. + // stream_filter_append() expects parameter 1 to be resource,... + $errstr = $error; // @codeCoverageIgnore + }); + + try { + $ret = \stream_filter_append($stream, register(), $read_write, $callback); + } catch (\TypeError $e) { // @codeCoverageIgnoreStart + // Throws TypeError on PHP 8.0+ + \restore_error_handler(); + throw $e; + } // @codeCoverageIgnoreEnd + + \restore_error_handler(); // PHP 8 throws above on type errors, older PHP and memory issues can throw here // @codeCoverageIgnoreStart if ($ret === false) { - $error = \error_get_last() + array('message' => ''); - throw new \RuntimeException('Unable to append filter: ' . $error['message']); + throw new \RuntimeException('Unable to append filter: ' . $errstr); } // @codeCoverageIgnoreEnd @@ -147,13 +161,27 @@ function append($stream, $callback, $read_write = STREAM_FILTER_ALL) */ function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL) { - $ret = @\stream_filter_prepend($stream, register(), $read_write, $callback); + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errstr) { + // Match errstr from PHP's warning message. + // stream_filter_prepend() expects parameter 1 to be resource,... + $errstr = $error; // @codeCoverageIgnore + }); + + try { + $ret = \stream_filter_prepend($stream, register(), $read_write, $callback); + } catch (\TypeError $e) { // @codeCoverageIgnoreStart + // Throws TypeError on PHP 8.0+ + \restore_error_handler(); + throw $e; + } // @codeCoverageIgnoreEnd + + \restore_error_handler(); // PHP 8 throws above on type errors, older PHP and memory issues can throw here // @codeCoverageIgnoreStart if ($ret === false) { - $error = \error_get_last() + array('message' => ''); - throw new \RuntimeException('Unable to prepend filter: ' . $error['message']); + throw new \RuntimeException('Unable to prepend filter: ' . $errstr); } // @codeCoverageIgnoreEnd @@ -242,16 +270,25 @@ function prepend($stream, $callback, $read_write = STREAM_FILTER_ALL) function fun($filter, $parameters = null) { $fp = \fopen('php://memory', 'w'); + + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errstr) { + // Match errstr from PHP's warning message. + // stream_filter_append() expects parameter 1 to be resource,... + $errstr = $error; + }); + if (\func_num_args() === 1) { - $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE); + $filter = \stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE); } else { - $filter = @\stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE, $parameters); + $filter = \stream_filter_append($fp, $filter, \STREAM_FILTER_WRITE, $parameters); } + \restore_error_handler(); + if ($filter === false) { \fclose($fp); - $error = \error_get_last() + array('message' => ''); - throw new \RuntimeException('Unable to access built-in filter: ' . $error['message']); + throw new \RuntimeException('Unable to access built-in filter: ' . $errstr); } // append filter function which buffers internally @@ -301,10 +338,26 @@ function fun($filter, $parameters = null) */ function remove($filter) { - if (@\stream_filter_remove($filter) === false) { + $errstr = ''; + \set_error_handler(function ($_, $error) use (&$errstr) { + // Match errstr from PHP's warning message. + // stream_filter_remove() expects parameter 1 to be resource,... + $errstr = $error; + }); + + try { + $ret = \stream_filter_remove($filter); + } catch (\TypeError $e) { // @codeCoverageIgnoreStart + // Throws TypeError on PHP 8.0+ + \restore_error_handler(); + throw $e; + } // @codeCoverageIgnoreEnd + + \restore_error_handler(); + + if ($ret === false) { // PHP 8 throws above on type errors, older PHP and memory issues can throw here - $error = \error_get_last(); - throw new \RuntimeException('Unable to remove filter: ' . $error['message']); + throw new \RuntimeException('Unable to remove filter: ' . $errstr); } } diff --git a/modules/paynow/vendor/clue/stream-filter/src/functions_include.php b/modules/paynow/vendor/clue/stream-filter/src/functions_include.php index 4b315ae8..198b45f0 100644 --- a/modules/paynow/vendor/clue/stream-filter/src/functions_include.php +++ b/modules/paynow/vendor/clue/stream-filter/src/functions_include.php @@ -1,6 +1,9 @@ $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Clue\\StreamFilter\\CallbackFilter' => $vendorDir . '/clue/stream-filter/src/CallbackFilter.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'Http\\Client\\Curl\\Client' => $vendorDir . '/php-http/curl-client/src/Client.php', @@ -110,6 +111,7 @@ return array( 'Nyholm\\Psr7\\Response' => $vendorDir . '/nyholm/psr7/src/Response.php', 'Nyholm\\Psr7\\ServerRequest' => $vendorDir . '/nyholm/psr7/src/ServerRequest.php', 'Nyholm\\Psr7\\Stream' => $vendorDir . '/nyholm/psr7/src/Stream.php', + 'Nyholm\\Psr7\\StreamTrait' => $vendorDir . '/nyholm/psr7/src/StreamTrait.php', 'Nyholm\\Psr7\\UploadedFile' => $vendorDir . '/nyholm/psr7/src/UploadedFile.php', 'Nyholm\\Psr7\\Uri' => $vendorDir . '/nyholm/psr7/src/Uri.php', 'Paynow\\Client' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Client.php', @@ -127,6 +129,8 @@ return array( 'Paynow\\Model\\DataProcessing\\Notice' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Model/DataProcessing/Notice.php', 'Paynow\\Model\\PaymentMethods\\AuthorizationType' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/AuthorizationType.php', 'Paynow\\Model\\PaymentMethods\\PaymentMethod' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/PaymentMethod.php', + 'Paynow\\Model\\PaymentMethods\\SavedInstrument' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/SavedInstrument.php', + 'Paynow\\Model\\PaymentMethods\\SavedInstrument\\Status' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/SavedInstrument/Status.php', 'Paynow\\Model\\PaymentMethods\\Status' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/Status.php', 'Paynow\\Model\\PaymentMethods\\Type' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/Type.php', 'Paynow\\Model\\Payment\\Status' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Model/Payment/Status.php', @@ -150,8 +154,11 @@ return array( 'Paynow\\Tests\\Service\\ShopConfigurationTest' => $vendorDir . '/pay-now/paynow-php-sdk/tests/Service/ShopConfigurationTest.php', 'Paynow\\Tests\\TestCase' => $vendorDir . '/pay-now/paynow-php-sdk/tests/TestCase.php', 'Paynow\\Tests\\TestHttpClient' => $vendorDir . '/pay-now/paynow-php-sdk/tests/TestHttpClient.php', + 'Paynow\\Tests\\Util\\SavedInstrumentTest' => $vendorDir . '/pay-now/paynow-php-sdk/tests/Util/SavedInstrumentTest.php', 'Paynow\\Tests\\Util\\SignatureCalculatorTest' => $vendorDir . '/pay-now/paynow-php-sdk/tests/Util/SignatureCalculatorTest.php', + 'Paynow\\Util\\ClientExternalIdCalculator' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Util/ClientExternalIdCalculator.php', 'Paynow\\Util\\SignatureCalculator' => $vendorDir . '/pay-now/paynow-php-sdk/src/Paynow/Util/SignatureCalculator.php', + 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Psr\\Http\\Client\\ClientExceptionInterface' => $vendorDir . '/psr/http-client/src/ClientExceptionInterface.php', 'Psr\\Http\\Client\\ClientInterface' => $vendorDir . '/psr/http-client/src/ClientInterface.php', 'Psr\\Http\\Client\\NetworkExceptionInterface' => $vendorDir . '/psr/http-client/src/NetworkExceptionInterface.php', @@ -169,6 +176,7 @@ return array( 'Psr\\Http\\Message\\UploadedFileInterface' => $vendorDir . '/psr/http-message/src/UploadedFileInterface.php', 'Psr\\Http\\Message\\UriFactoryInterface' => $vendorDir . '/psr/http-factory/src/UriFactoryInterface.php', 'Psr\\Http\\Message\\UriInterface' => $vendorDir . '/psr/http-message/src/UriInterface.php', + 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'Symfony\\Component\\OptionsResolver\\Debug\\OptionsResolverIntrospector' => $vendorDir . '/symfony/options-resolver/Debug/OptionsResolverIntrospector.php', 'Symfony\\Component\\OptionsResolver\\Exception\\AccessException' => $vendorDir . '/symfony/options-resolver/Exception/AccessException.php', 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/options-resolver/Exception/ExceptionInterface.php', @@ -181,4 +189,11 @@ return array( 'Symfony\\Component\\OptionsResolver\\Exception\\UndefinedOptionsException' => $vendorDir . '/symfony/options-resolver/Exception/UndefinedOptionsException.php', 'Symfony\\Component\\OptionsResolver\\Options' => $vendorDir . '/symfony/options-resolver/Options.php', 'Symfony\\Component\\OptionsResolver\\OptionsResolver' => $vendorDir . '/symfony/options-resolver/OptionsResolver.php', + 'Symfony\\Polyfill\\Php80\\Php80' => $vendorDir . '/symfony/polyfill-php80/Php80.php', + 'Symfony\\Polyfill\\Php80\\PhpToken' => $vendorDir . '/symfony/polyfill-php80/PhpToken.php', + 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', + 'cweagans\\Composer\\PatchEvent' => $vendorDir . '/cweagans/composer-patches/src/PatchEvent.php', + 'cweagans\\Composer\\PatchEvents' => $vendorDir . '/cweagans/composer-patches/src/PatchEvents.php', + 'cweagans\\Composer\\Patches' => $vendorDir . '/cweagans/composer-patches/src/Patches.php', ); diff --git a/modules/paynow/vendor/composer/autoload_files.php b/modules/paynow/vendor/composer/autoload_files.php index c7328775..090faf6c 100644 --- a/modules/paynow/vendor/composer/autoload_files.php +++ b/modules/paynow/vendor/composer/autoload_files.php @@ -7,5 +7,6 @@ $baseDir = dirname($vendorDir); return array( '9c67151ae59aff4788964ce8eb2a0f43' => $vendorDir . '/clue/stream-filter/src/functions_include.php', + 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', '8cff32064859f4559445b89279f3199c' => $vendorDir . '/php-http/message/src/filters.php', ); diff --git a/modules/paynow/vendor/composer/autoload_psr4.php b/modules/paynow/vendor/composer/autoload_psr4.php index 24fef5ef..aa1b17b2 100644 --- a/modules/paynow/vendor/composer/autoload_psr4.php +++ b/modules/paynow/vendor/composer/autoload_psr4.php @@ -6,6 +6,8 @@ $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'cweagans\\Composer\\' => array($vendorDir . '/cweagans/composer-patches/src'), + 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), 'Symfony\\Component\\OptionsResolver\\' => array($vendorDir . '/symfony/options-resolver'), 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src', $vendorDir . '/psr/http-factory/src'), 'Psr\\Http\\Client\\' => array($vendorDir . '/psr/http-client/src'), diff --git a/modules/paynow/vendor/composer/autoload_real.php b/modules/paynow/vendor/composer/autoload_real.php index 6f48e4a2..2221b69a 100644 --- a/modules/paynow/vendor/composer/autoload_real.php +++ b/modules/paynow/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInita3df77b4b522885b715a8fd38a5db444 +class ComposerAutoloaderInit93238e2dd576a8d3792c34ad274d581f { private static $loader; @@ -24,16 +24,16 @@ class ComposerAutoloaderInita3df77b4b522885b715a8fd38a5db444 require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInita3df77b4b522885b715a8fd38a5db444', 'loadClassLoader'), true, false); + spl_autoload_register(array('ComposerAutoloaderInit93238e2dd576a8d3792c34ad274d581f', 'loadClassLoader'), true, false); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInita3df77b4b522885b715a8fd38a5db444', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit93238e2dd576a8d3792c34ad274d581f', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInita3df77b4b522885b715a8fd38a5db444::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit93238e2dd576a8d3792c34ad274d581f::getInitializer($loader)); $loader->register(false); - $filesToLoad = \Composer\Autoload\ComposerStaticInita3df77b4b522885b715a8fd38a5db444::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit93238e2dd576a8d3792c34ad274d581f::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/modules/paynow/vendor/composer/autoload_static.php b/modules/paynow/vendor/composer/autoload_static.php index c97357c3..2666baba 100644 --- a/modules/paynow/vendor/composer/autoload_static.php +++ b/modules/paynow/vendor/composer/autoload_static.php @@ -4,16 +4,22 @@ namespace Composer\Autoload; -class ComposerStaticInita3df77b4b522885b715a8fd38a5db444 +class ComposerStaticInit93238e2dd576a8d3792c34ad274d581f { public static $files = array ( '9c67151ae59aff4788964ce8eb2a0f43' => __DIR__ . '/..' . '/clue/stream-filter/src/functions_include.php', + 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', '8cff32064859f4559445b89279f3199c' => __DIR__ . '/..' . '/php-http/message/src/filters.php', ); public static $prefixLengthsPsr4 = array ( + 'c' => + array ( + 'cweagans\\Composer\\' => 18, + ), 'S' => array ( + 'Symfony\\Polyfill\\Php80\\' => 23, 'Symfony\\Component\\OptionsResolver\\' => 34, ), 'P' => @@ -42,6 +48,14 @@ class ComposerStaticInita3df77b4b522885b715a8fd38a5db444 ); public static $prefixDirsPsr4 = array ( + 'cweagans\\Composer\\' => + array ( + 0 => __DIR__ . '/..' . '/cweagans/composer-patches/src', + ), + 'Symfony\\Polyfill\\Php80\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', + ), 'Symfony\\Component\\OptionsResolver\\' => array ( 0 => __DIR__ . '/..' . '/symfony/options-resolver', @@ -95,6 +109,7 @@ class ComposerStaticInita3df77b4b522885b715a8fd38a5db444 ); public static $classMap = array ( + 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Clue\\StreamFilter\\CallbackFilter' => __DIR__ . '/..' . '/clue/stream-filter/src/CallbackFilter.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'Http\\Client\\Curl\\Client' => __DIR__ . '/..' . '/php-http/curl-client/src/Client.php', @@ -199,6 +214,7 @@ class ComposerStaticInita3df77b4b522885b715a8fd38a5db444 'Nyholm\\Psr7\\Response' => __DIR__ . '/..' . '/nyholm/psr7/src/Response.php', 'Nyholm\\Psr7\\ServerRequest' => __DIR__ . '/..' . '/nyholm/psr7/src/ServerRequest.php', 'Nyholm\\Psr7\\Stream' => __DIR__ . '/..' . '/nyholm/psr7/src/Stream.php', + 'Nyholm\\Psr7\\StreamTrait' => __DIR__ . '/..' . '/nyholm/psr7/src/StreamTrait.php', 'Nyholm\\Psr7\\UploadedFile' => __DIR__ . '/..' . '/nyholm/psr7/src/UploadedFile.php', 'Nyholm\\Psr7\\Uri' => __DIR__ . '/..' . '/nyholm/psr7/src/Uri.php', 'Paynow\\Client' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Client.php', @@ -216,6 +232,8 @@ class ComposerStaticInita3df77b4b522885b715a8fd38a5db444 'Paynow\\Model\\DataProcessing\\Notice' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Model/DataProcessing/Notice.php', 'Paynow\\Model\\PaymentMethods\\AuthorizationType' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/AuthorizationType.php', 'Paynow\\Model\\PaymentMethods\\PaymentMethod' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/PaymentMethod.php', + 'Paynow\\Model\\PaymentMethods\\SavedInstrument' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/SavedInstrument.php', + 'Paynow\\Model\\PaymentMethods\\SavedInstrument\\Status' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/SavedInstrument/Status.php', 'Paynow\\Model\\PaymentMethods\\Status' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/Status.php', 'Paynow\\Model\\PaymentMethods\\Type' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/Type.php', 'Paynow\\Model\\Payment\\Status' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Model/Payment/Status.php', @@ -239,8 +257,11 @@ class ComposerStaticInita3df77b4b522885b715a8fd38a5db444 'Paynow\\Tests\\Service\\ShopConfigurationTest' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/tests/Service/ShopConfigurationTest.php', 'Paynow\\Tests\\TestCase' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/tests/TestCase.php', 'Paynow\\Tests\\TestHttpClient' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/tests/TestHttpClient.php', + 'Paynow\\Tests\\Util\\SavedInstrumentTest' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/tests/Util/SavedInstrumentTest.php', 'Paynow\\Tests\\Util\\SignatureCalculatorTest' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/tests/Util/SignatureCalculatorTest.php', + 'Paynow\\Util\\ClientExternalIdCalculator' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Util/ClientExternalIdCalculator.php', 'Paynow\\Util\\SignatureCalculator' => __DIR__ . '/..' . '/pay-now/paynow-php-sdk/src/Paynow/Util/SignatureCalculator.php', + 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', 'Psr\\Http\\Client\\ClientExceptionInterface' => __DIR__ . '/..' . '/psr/http-client/src/ClientExceptionInterface.php', 'Psr\\Http\\Client\\ClientInterface' => __DIR__ . '/..' . '/psr/http-client/src/ClientInterface.php', 'Psr\\Http\\Client\\NetworkExceptionInterface' => __DIR__ . '/..' . '/psr/http-client/src/NetworkExceptionInterface.php', @@ -258,6 +279,7 @@ class ComposerStaticInita3df77b4b522885b715a8fd38a5db444 'Psr\\Http\\Message\\UploadedFileInterface' => __DIR__ . '/..' . '/psr/http-message/src/UploadedFileInterface.php', 'Psr\\Http\\Message\\UriFactoryInterface' => __DIR__ . '/..' . '/psr/http-factory/src/UriFactoryInterface.php', 'Psr\\Http\\Message\\UriInterface' => __DIR__ . '/..' . '/psr/http-message/src/UriInterface.php', + 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', 'Symfony\\Component\\OptionsResolver\\Debug\\OptionsResolverIntrospector' => __DIR__ . '/..' . '/symfony/options-resolver/Debug/OptionsResolverIntrospector.php', 'Symfony\\Component\\OptionsResolver\\Exception\\AccessException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/AccessException.php', 'Symfony\\Component\\OptionsResolver\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/ExceptionInterface.php', @@ -270,14 +292,21 @@ class ComposerStaticInita3df77b4b522885b715a8fd38a5db444 'Symfony\\Component\\OptionsResolver\\Exception\\UndefinedOptionsException' => __DIR__ . '/..' . '/symfony/options-resolver/Exception/UndefinedOptionsException.php', 'Symfony\\Component\\OptionsResolver\\Options' => __DIR__ . '/..' . '/symfony/options-resolver/Options.php', 'Symfony\\Component\\OptionsResolver\\OptionsResolver' => __DIR__ . '/..' . '/symfony/options-resolver/OptionsResolver.php', + 'Symfony\\Polyfill\\Php80\\Php80' => __DIR__ . '/..' . '/symfony/polyfill-php80/Php80.php', + 'Symfony\\Polyfill\\Php80\\PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/PhpToken.php', + 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', + 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', + 'cweagans\\Composer\\PatchEvent' => __DIR__ . '/..' . '/cweagans/composer-patches/src/PatchEvent.php', + 'cweagans\\Composer\\PatchEvents' => __DIR__ . '/..' . '/cweagans/composer-patches/src/PatchEvents.php', + 'cweagans\\Composer\\Patches' => __DIR__ . '/..' . '/cweagans/composer-patches/src/Patches.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInita3df77b4b522885b715a8fd38a5db444::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInita3df77b4b522885b715a8fd38a5db444::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInita3df77b4b522885b715a8fd38a5db444::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit93238e2dd576a8d3792c34ad274d581f::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit93238e2dd576a8d3792c34ad274d581f::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit93238e2dd576a8d3792c34ad274d581f::$classMap; }, null, ClassLoader::class); } diff --git a/modules/paynow/vendor/composer/installed.json b/modules/paynow/vendor/composer/installed.json index 6f16c521..6132be68 100644 --- a/modules/paynow/vendor/composer/installed.json +++ b/modules/paynow/vendor/composer/installed.json @@ -2,26 +2,26 @@ "packages": [ { "name": "clue/stream-filter", - "version": "v1.6.0", - "version_normalized": "1.6.0.0", + "version": "v1.7.0", + "version_normalized": "1.7.0.0", "source": { "type": "git", "url": "https://github.com/clue/stream-filter.git", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e" + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/clue/stream-filter/zipball/d6169430c7731d8509da7aecd0af756a5747b78e", - "reference": "d6169430c7731d8509da7aecd0af756a5747b78e", + "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7", + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7", "shasum": "" }, "require": { "php": ">=5.3" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, - "time": "2022-02-21T13:15:14+00:00", + "time": "2023-12-20T15:40:13+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -43,7 +43,7 @@ } ], "description": "A simple and modern approach to stream filtering in PHP", - "homepage": "https://github.com/clue/php-stream-filter", + "homepage": "https://github.com/clue/stream-filter", "keywords": [ "bucket brigade", "callback", @@ -55,7 +55,7 @@ ], "support": { "issues": "https://github.com/clue/stream-filter/issues", - "source": "https://github.com/clue/stream-filter/tree/v1.6.0" + "source": "https://github.com/clue/stream-filter/tree/v1.7.0" }, "funding": [ { @@ -70,25 +70,75 @@ "install-path": "../clue/stream-filter" }, { - "name": "nyholm/psr7", - "version": "1.6.1", - "version_normalized": "1.6.1.0", + "name": "cweagans/composer-patches", + "version": "1.7.3", + "version_normalized": "1.7.3.0", "source": { "type": "git", - "url": "https://github.com/Nyholm/psr7.git", - "reference": "e874c8c4286a1e010fb4f385f3a55ac56a05cc93" + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/e874c8c4286a1e010fb4f385f3a55ac56a05cc93", - "reference": "e874c8c4286a1e010fb4f385f3a55ac56a05cc93", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/e190d4466fe2b103a55467dfa83fc2fecfcaf2db", + "reference": "e190d4466fe2b103a55467dfa83fc2fecfcaf2db", "shasum": "" }, "require": { - "php": ">=7.1", - "php-http/message-factory": "^1.0", + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3.0" + }, + "require-dev": { + "composer/composer": "~1.0 || ~2.0", + "phpunit/phpunit": "~4.6" + }, + "time": "2022-12-20T22:53:13+00:00", + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "support": { + "issues": "https://github.com/cweagans/composer-patches/issues", + "source": "https://github.com/cweagans/composer-patches/tree/1.7.3" + }, + "install-path": "../cweagans/composer-patches" + }, + { + "name": "nyholm/psr7", + "version": "1.8.2", + "version_normalized": "1.8.2.0", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "shasum": "" + }, + "require": { + "php": ">=7.2", "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.1 || ^2.0" }, "provide": { "php-http/message-factory-implementation": "1.0", @@ -97,15 +147,16 @@ }, "require-dev": { "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", "php-http/psr7-integration-tests": "^1.0", - "phpunit/phpunit": "^7.5 || 8.5 || 9.4", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", "symfony/error-handler": "^4.4" }, - "time": "2023-04-17T16:03:48+00:00", + "time": "2024-09-09T07:06:30+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.8-dev" } }, "installation-source": "dist", @@ -136,7 +187,7 @@ ], "support": { "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.6.1" + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" }, "funding": [ { @@ -152,21 +203,21 @@ }, { "name": "pay-now/paynow-php-sdk", - "version": "2.2.2", - "version_normalized": "2.2.2.0", + "version": "2.4.4", + "version_normalized": "2.4.4.0", "source": { "type": "git", "url": "https://github.com/pay-now/paynow-php-sdk.git", - "reference": "33432ca177e937f3f5c6abb9f36c7f979baec67d" + "reference": "0b300739620fc6c838d9af14be50c561c27f50c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pay-now/paynow-php-sdk/zipball/33432ca177e937f3f5c6abb9f36c7f979baec67d", - "reference": "33432ca177e937f3f5c6abb9f36c7f979baec67d", + "url": "https://api.github.com/repos/pay-now/paynow-php-sdk/zipball/0b300739620fc6c838d9af14be50c561c27f50c9", + "reference": "0b300739620fc6c838d9af14be50c561c27f50c9", "shasum": "" }, "require": { - "php": ">=7.1", + "php": ">=7.2", "php-http/client-implementation": "^1.0 || ^2.0", "php-http/discovery": "^1.12", "php-http/httplug": "^2.2", @@ -181,14 +232,14 @@ "php-http/guzzle6-adapter": "^2.0", "php-http/mock-client": "^1.3", "phpcompatibility/php-compatibility": "^9.3", - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "^8.5.36", "squizlabs/php_codesniffer": "^3.4" }, "suggest": { "nyholm/psr7": "A super lightweight PSR-7 implementation", "php-http/curl-client": "PSR-18 and HTTPlug Async client with cURL" }, - "time": "2023-11-03T14:26:59+00:00", + "time": "2025-05-14T11:25:10+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -217,23 +268,23 @@ ], "support": { "issues": "https://github.com/pay-now/paynow-php-sdk/issues", - "source": "https://github.com/pay-now/paynow-php-sdk/tree/v2.2.2" + "source": "https://github.com/pay-now/paynow-php-sdk/tree/v2.4.4" }, "install-path": "../pay-now/paynow-php-sdk" }, { "name": "php-http/curl-client", - "version": "2.3.0", - "version_normalized": "2.3.0.0", + "version": "2.3.1", + "version_normalized": "2.3.1.0", "source": { "type": "git", "url": "https://github.com/php-http/curl-client.git", - "reference": "f7352c0796549949900d28fe991e19c90572386a" + "reference": "085570be588f7cbdc4601e78886eea5b7051ad71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/curl-client/zipball/f7352c0796549949900d28fe991e19c90572386a", - "reference": "f7352c0796549949900d28fe991e19c90572386a", + "url": "https://api.github.com/repos/php-http/curl-client/zipball/085570be588f7cbdc4601e78886eea5b7051ad71", + "reference": "085570be588f7cbdc4601e78886eea5b7051ad71", "shasum": "" }, "require": { @@ -244,7 +295,7 @@ "php-http/message": "^1.2", "psr/http-client": "^1.0", "psr/http-factory-implementation": "^1.0", - "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0" + "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "provide": { "php-http/async-client-implementation": "1.0", @@ -255,9 +306,10 @@ "guzzlehttp/psr7": "^1.0", "laminas/laminas-diactoros": "^2.0", "php-http/client-integration-tests": "^3.0", + "php-http/message-factory": "^1.1", "phpunit/phpunit": "^7.5 || ^9.4" }, - "time": "2023-04-28T14:56:41+00:00", + "time": "2023-11-03T15:32:00+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -284,23 +336,23 @@ ], "support": { "issues": "https://github.com/php-http/curl-client/issues", - "source": "https://github.com/php-http/curl-client/tree/2.3.0" + "source": "https://github.com/php-http/curl-client/tree/2.3.1" }, "install-path": "../php-http/curl-client" }, { "name": "php-http/discovery", - "version": "1.19.1", - "version_normalized": "1.19.1.0", + "version": "1.20.0", + "version_normalized": "1.20.0.0", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e" + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/57f3de01d32085fea20865f9b16fb0e69347c39e", - "reference": "57f3de01d32085fea20865f9b16fb0e69347c39e", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", "shasum": "" }, "require": { @@ -324,9 +376,10 @@ "php-http/httplug": "^1.0 || ^2.0", "php-http/message-factory": "^1.0", "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", - "symfony/phpunit-bridge": "^6.2" + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" }, - "time": "2023-07-11T07:02:26+00:00", + "time": "2024-10-02T11:20:13+00:00", "type": "composer-plugin", "extra": { "class": "Http\\Discovery\\Composer\\Plugin", @@ -365,23 +418,23 @@ ], "support": { "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.19.1" + "source": "https://github.com/php-http/discovery/tree/1.20.0" }, "install-path": "../php-http/discovery" }, { "name": "php-http/httplug", - "version": "2.4.0", - "version_normalized": "2.4.0.0", + "version": "2.4.1", + "version_normalized": "2.4.1.0", "source": { "type": "git", "url": "https://github.com/php-http/httplug.git", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67" + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/httplug/zipball/625ad742c360c8ac580fcc647a1541d29e257f67", - "reference": "625ad742c360c8ac580fcc647a1541d29e257f67", + "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", "shasum": "" }, "require": { @@ -394,7 +447,7 @@ "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" }, - "time": "2023-04-14T15:10:03+00:00", + "time": "2024-09-23T11:39:58+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -425,30 +478,29 @@ ], "support": { "issues": "https://github.com/php-http/httplug/issues", - "source": "https://github.com/php-http/httplug/tree/2.4.0" + "source": "https://github.com/php-http/httplug/tree/2.4.1" }, "install-path": "../php-http/httplug" }, { "name": "php-http/message", - "version": "1.14.0", - "version_normalized": "1.14.0.0", + "version": "1.16.2", + "version_normalized": "1.16.2.0", "source": { "type": "git", "url": "https://github.com/php-http/message.git", - "reference": "2ccee04a28c3d98eb3f2b85ce1e2fcff70c0e63b" + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/message/zipball/2ccee04a28c3d98eb3f2b85ce1e2fcff70c0e63b", - "reference": "2ccee04a28c3d98eb3f2b85ce1e2fcff70c0e63b", + "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", "shasum": "" }, "require": { "clue/stream-filter": "^1.5", - "php": "^7.1 || ^8.0", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0 || ^2.0" + "php": "^7.2 || ^8.0", + "psr/http-message": "^1.1 || ^2.0" }, "provide": { "php-http/message-factory-implementation": "1.0" @@ -456,8 +508,9 @@ "require-dev": { "ergebnis/composer-normalize": "^2.6", "ext-zlib": "*", - "guzzlehttp/psr7": "^1.0", - "laminas/laminas-diactoros": "^2.0", + "guzzlehttp/psr7": "^1.0 || ^2.0", + "laminas/laminas-diactoros": "^2.0 || ^3.0", + "php-http/message-factory": "^1.0.2", "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", "slim/slim": "^3.0" }, @@ -467,7 +520,7 @@ "laminas/laminas-diactoros": "Used with Diactoros Factories", "slim/slim": "Used with Slim Framework PSR-7 implementation" }, - "time": "2023-04-14T14:26:18+00:00", + "time": "2024-10-02T11:34:13+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -497,7 +550,7 @@ ], "support": { "issues": "https://github.com/php-http/message/issues", - "source": "https://github.com/php-http/message/tree/1.14.0" + "source": "https://github.com/php-http/message/tree/1.16.2" }, "install-path": "../php-http/message" }, @@ -561,17 +614,17 @@ }, { "name": "php-http/promise", - "version": "1.2.0", - "version_normalized": "1.2.0.0", + "version": "1.3.1", + "version_normalized": "1.3.1.0", "source": { "type": "git", "url": "https://github.com/php-http/promise.git", - "reference": "ef4905bfb492ff389eb7f12e26925a0f20073050" + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/promise/zipball/ef4905bfb492ff389eb7f12e26925a0f20073050", - "reference": "ef4905bfb492ff389eb7f12e26925a0f20073050", + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", "shasum": "" }, "require": { @@ -581,7 +634,7 @@ "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" }, - "time": "2023-10-24T09:20:26+00:00", + "time": "2024-03-15T13:55:21+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -610,7 +663,7 @@ ], "support": { "issues": "https://github.com/php-http/promise/issues", - "source": "https://github.com/php-http/promise/tree/1.2.0" + "source": "https://github.com/php-http/promise/tree/1.3.1" }, "install-path": "../php-http/promise" }, @@ -671,24 +724,24 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", - "version_normalized": "1.0.2.0", + "version": "1.1.0", + "version_normalized": "1.1.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, - "time": "2023-04-10T20:10:41+00:00", + "time": "2024-04-15T12:06:14+00:00", "type": "library", "extra": { "branch-alias": { @@ -711,7 +764,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -723,33 +776,33 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, "install-path": "../psr/http-factory" }, { "name": "psr/http-message", - "version": "1.0.1", - "version_normalized": "1.0.1.0", + "version": "2.0", + "version_normalized": "2.0.0.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, - "time": "2016-08-06T14:39:51+00:00", + "time": "2023-04-04T09:54:51+00:00", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } }, "installation-source": "dist", @@ -765,7 +818,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -779,29 +832,30 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, "install-path": "../psr/http-message" }, { "name": "symfony/options-resolver", - "version": "v3.4.47", - "version_normalized": "3.4.47.0", + "version": "v4.4.44", + "version_normalized": "4.4.44.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744" + "reference": "583f56160f716dd435f1cd721fd14b548f4bb510" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", - "reference": "c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/583f56160f716dd435f1cd721fd14b548f4bb510", + "reference": "583f56160f716dd435f1cd721fd14b548f4bb510", "shasum": "" }, "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.1.3", + "symfony/polyfill-php80": "^1.16" }, - "time": "2020-10-24T10:57:07+00:00", + "time": "2022-07-20T09:59:04+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -826,7 +880,7 @@ "homepage": "https://symfony.com/contributors" } ], - "description": "Symfony OptionsResolver Component", + "description": "Provides an improved replacement for the array_replace PHP function", "homepage": "https://symfony.com", "keywords": [ "config", @@ -834,7 +888,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v3.4.47" + "source": "https://github.com/symfony/options-resolver/tree/v4.4.44" }, "funding": [ { @@ -851,6 +905,89 @@ } ], "install-path": "../symfony/options-resolver" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.32.0", + "version_normalized": "1.32.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "time": "2025-01-02T08:10:11+00:00", + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.32.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" + } + ], + "install-path": "../symfony/polyfill-php80" } ], "dev": false, diff --git a/modules/paynow/vendor/composer/installed.php b/modules/paynow/vendor/composer/installed.php index 97c90675..3c10e887 100644 --- a/modules/paynow/vendor/composer/installed.php +++ b/modules/paynow/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'pay-now/paynow-prestashop', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'ae162451919441e986928aafb1996fab693c0159', + 'reference' => 'd907e1ebe7f0e3da69122c3391fd802221b9226d', 'type' => 'prestashop-module', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -11,27 +11,36 @@ ), 'versions' => array( 'clue/stream-filter' => array( - 'pretty_version' => 'v1.6.0', - 'version' => '1.6.0.0', - 'reference' => 'd6169430c7731d8509da7aecd0af756a5747b78e', + 'pretty_version' => 'v1.7.0', + 'version' => '1.7.0.0', + 'reference' => '049509fef80032cb3f051595029ab75b49a3c2f7', 'type' => 'library', 'install_path' => __DIR__ . '/../clue/stream-filter', 'aliases' => array(), 'dev_requirement' => false, ), + 'cweagans/composer-patches' => array( + 'pretty_version' => '1.7.3', + 'version' => '1.7.3.0', + 'reference' => 'e190d4466fe2b103a55467dfa83fc2fecfcaf2db', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/../cweagans/composer-patches', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'nyholm/psr7' => array( - 'pretty_version' => '1.6.1', - 'version' => '1.6.1.0', - 'reference' => 'e874c8c4286a1e010fb4f385f3a55ac56a05cc93', + 'pretty_version' => '1.8.2', + 'version' => '1.8.2.0', + 'reference' => 'a71f2b11690f4b24d099d6b16690a90ae14fc6f3', 'type' => 'library', 'install_path' => __DIR__ . '/../nyholm/psr7', 'aliases' => array(), 'dev_requirement' => false, ), 'pay-now/paynow-php-sdk' => array( - 'pretty_version' => '2.2.2', - 'version' => '2.2.2.0', - 'reference' => '33432ca177e937f3f5c6abb9f36c7f979baec67d', + 'pretty_version' => '2.4.4', + 'version' => '2.4.4.0', + 'reference' => '0b300739620fc6c838d9af14be50c561c27f50c9', 'type' => 'library', 'install_path' => __DIR__ . '/../pay-now/paynow-php-sdk', 'aliases' => array(), @@ -40,7 +49,7 @@ 'pay-now/paynow-prestashop' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => 'ae162451919441e986928aafb1996fab693c0159', + 'reference' => 'd907e1ebe7f0e3da69122c3391fd802221b9226d', 'type' => 'prestashop-module', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -61,36 +70,36 @@ ), ), 'php-http/curl-client' => array( - 'pretty_version' => '2.3.0', - 'version' => '2.3.0.0', - 'reference' => 'f7352c0796549949900d28fe991e19c90572386a', + 'pretty_version' => '2.3.1', + 'version' => '2.3.1.0', + 'reference' => '085570be588f7cbdc4601e78886eea5b7051ad71', 'type' => 'library', 'install_path' => __DIR__ . '/../php-http/curl-client', 'aliases' => array(), 'dev_requirement' => false, ), 'php-http/discovery' => array( - 'pretty_version' => '1.19.1', - 'version' => '1.19.1.0', - 'reference' => '57f3de01d32085fea20865f9b16fb0e69347c39e', + 'pretty_version' => '1.20.0', + 'version' => '1.20.0.0', + 'reference' => '82fe4c73ef3363caed49ff8dd1539ba06044910d', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../php-http/discovery', 'aliases' => array(), 'dev_requirement' => false, ), 'php-http/httplug' => array( - 'pretty_version' => '2.4.0', - 'version' => '2.4.0.0', - 'reference' => '625ad742c360c8ac580fcc647a1541d29e257f67', + 'pretty_version' => '2.4.1', + 'version' => '2.4.1.0', + 'reference' => '5cad731844891a4c282f3f3e1b582c46839d22f4', 'type' => 'library', 'install_path' => __DIR__ . '/../php-http/httplug', 'aliases' => array(), 'dev_requirement' => false, ), 'php-http/message' => array( - 'pretty_version' => '1.14.0', - 'version' => '1.14.0.0', - 'reference' => '2ccee04a28c3d98eb3f2b85ce1e2fcff70c0e63b', + 'pretty_version' => '1.16.2', + 'version' => '1.16.2.0', + 'reference' => '06dd5e8562f84e641bf929bfe699ee0f5ce8080a', 'type' => 'library', 'install_path' => __DIR__ . '/../php-http/message', 'aliases' => array(), @@ -112,9 +121,9 @@ ), ), 'php-http/promise' => array( - 'pretty_version' => '1.2.0', - 'version' => '1.2.0.0', - 'reference' => 'ef4905bfb492ff389eb7f12e26925a0f20073050', + 'pretty_version' => '1.3.1', + 'version' => '1.3.1.0', + 'reference' => 'fc85b1fba37c169a69a07ef0d5a8075770cc1f83', 'type' => 'library', 'install_path' => __DIR__ . '/../php-http/promise', 'aliases' => array(), @@ -137,9 +146,9 @@ ), ), 'psr/http-factory' => array( - 'pretty_version' => '1.0.2', - 'version' => '1.0.2.0', - 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'reference' => '2b4765fddfe3b508ac62f829e852b1501d3f6e8a', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-factory', 'aliases' => array(), @@ -153,9 +162,9 @@ ), ), 'psr/http-message' => array( - 'pretty_version' => '1.0.1', - 'version' => '1.0.1.0', - 'reference' => 'f6561bf28d520154e4b0ec72be95418abe6d9363', + 'pretty_version' => '2.0', + 'version' => '2.0.0.0', + 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', 'type' => 'library', 'install_path' => __DIR__ . '/../psr/http-message', 'aliases' => array(), @@ -169,13 +178,22 @@ ), ), 'symfony/options-resolver' => array( - 'pretty_version' => 'v3.4.47', - 'version' => '3.4.47.0', - 'reference' => 'c7efc97a47b2ebaabc19d5b6c6b50f5c37c92744', + 'pretty_version' => 'v4.4.44', + 'version' => '4.4.44.0', + 'reference' => '583f56160f716dd435f1cd721fd14b548f4bb510', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/options-resolver', 'aliases' => array(), 'dev_requirement' => false, ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.32.0', + 'version' => '1.32.0.0', + 'reference' => '0cc9dd0f17f61d8131e7df6b84bd344899fe2608', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'dev_requirement' => false, + ), ), ); diff --git a/modules/paynow/vendor/composer/platform_check.php b/modules/paynow/vendor/composer/platform_check.php index 6d3407db..589e9e77 100644 --- a/modules/paynow/vendor/composer/platform_check.php +++ b/modules/paynow/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70100)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 70200)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/modules/paynow/vendor/cweagans/composer-patches/composer.json b/modules/paynow/vendor/cweagans/composer-patches/composer.json new file mode 100644 index 00000000..1565b02f --- /dev/null +++ b/modules/paynow/vendor/cweagans/composer-patches/composer.json @@ -0,0 +1,30 @@ +{ + "name": "cweagans/composer-patches", + "description": "Provides a way to patch Composer packages.", + "minimum-stability": "dev", + "license": "BSD-3-Clause", + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "require": { + "php": ">=5.3.0", + "composer-plugin-api": "^1.0 || ^2.0" + }, + "require-dev": { + "composer/composer": "~1.0 || ~2.0", + "phpunit/phpunit": "~4.6" + }, + "autoload": { + "psr-4": {"cweagans\\Composer\\": "src"} + }, + "autoload-dev": { + "psr-4": {"cweagans\\Composer\\Tests\\": "tests"} + } +} diff --git a/modules/paynow/vendor/cweagans/composer-patches/composer.lock b/modules/paynow/vendor/cweagans/composer-patches/composer.lock new file mode 100644 index 00000000..d5fe1777 --- /dev/null +++ b/modules/paynow/vendor/cweagans/composer-patches/composer.lock @@ -0,0 +1,2568 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "4a5c841252204815536a37cad51d347b", + "packages": [], + "packages-dev": [ + { + "name": "composer/ca-bundle", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/composer/ca-bundle.git", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "reference": "95c63ab2117a72f48f5a55da9740a3273d45b7fd", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-pcre": "*", + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8", + "psr/log": "^1.0", + "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\CaBundle\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.", + "keywords": [ + "cabundle", + "cacert", + "certificate", + "ssl", + "tls" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-04-08T08:27:21+00:00" + }, + { + "name": "composer/composer", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/composer/composer.git", + "reference": "870fdc59dfcffe0bd2d43ca2de4235761d0dec7a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/composer/zipball/870fdc59dfcffe0bd2d43ca2de4235761d0dec7a", + "reference": "870fdc59dfcffe0bd2d43ca2de4235761d0dec7a", + "shasum": "" + }, + "require": { + "composer/ca-bundle": "^1.0", + "composer/semver": "^3.0", + "composer/spdx-licenses": "^1.2", + "composer/xdebug-handler": "^1.1", + "justinrainbow/json-schema": "^5.2.10", + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0", + "react/promise": "^1.2 || ^2.7", + "seld/jsonlint": "^1.4", + "seld/phar-utils": "^1.0", + "symfony/console": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/filesystem": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/finder": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0", + "symfony/process": "^2.8.52 || ^3.4.35 || ^4.4 || ^5.0" + }, + "require-dev": { + "phpspec/prophecy": "^1.10", + "symfony/phpunit-bridge": "^4.2 || ^5.0" + }, + "suggest": { + "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", + "ext-zip": "Enabling the zip extension allows you to unzip archives", + "ext-zlib": "Allow gzip compression of HTTP requests" + }, + "bin": [ + "bin/composer" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\": "src/Composer" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "https://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.", + "homepage": "https://getcomposer.org/", + "keywords": [ + "autoload", + "dependency", + "package" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-07-15T15:02:16+00:00" + }, + { + "name": "composer/semver", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "00915994bb1de62e750ae279669c9c5a57379957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/00915994bb1de62e750ae279669c9c5a57379957", + "reference": "00915994bb1de62e750ae279669c9c5a57379957", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.19", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-05-31T11:44:06+00:00" + }, + { + "name": "composer/spdx-licenses", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/composer/spdx-licenses.git", + "reference": "6946f785871e2314c60b4524851f3702ea4f2223" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/spdx-licenses/zipball/6946f785871e2314c60b4524851f3702ea4f2223", + "reference": "6946f785871e2314c60b4524851f3702ea4f2223", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Spdx\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "SPDX licenses list and validation library.", + "keywords": [ + "license", + "spdx", + "validator" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-07-15T15:35:07+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", + "reference": "fa2aaf99e2087f013a14f7432c1cd2dd7d8f1f51", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-06-04T11:16:35+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "justinrainbow/json-schema", + "version": "5.x-dev", + "source": { + "type": "git", + "url": "https://github.com/justinrainbow/json-schema.git", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "reference": "2ba9c8c862ecd5510ed16c6340aa9f6eadb4f31b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "json-schema/json-schema-test-suite": "1.2.0", + "phpunit/phpunit": "^4.8.35" + }, + "bin": [ + "bin/validate-json" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "JsonSchema\\": "src/JsonSchema/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bruno Prieto Reis", + "email": "bruno.p.reis@gmail.com" + }, + { + "name": "Justin Rainbow", + "email": "justin.rainbow@gmail.com" + }, + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + }, + { + "name": "Robert Schönthal", + "email": "seroscho@googlemail.com" + } + ], + "description": "A library to validate a json schema.", + "homepage": "https://github.com/justinrainbow/json-schema", + "keywords": [ + "json", + "schema" + ], + "time": "2020-05-27T16:41:55+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2015-02-03T12:10:50+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "4f9b1eaf0a7da77c362f8d91cbc68ab1f4718d62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4f9b1eaf0a7da77c362f8d91cbc68ab1f4718d62", + "reference": "4f9b1eaf0a7da77c362f8d91cbc68ab1f4718d62", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "phpdocumentor/reflection-docblock": "~2.0", + "sebastian/comparator": "~1.1" + }, + "require-dev": { + "phpspec/phpspec": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2015-09-22T14:49:23+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-10-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "reference": "6150bf2c35d3fc379e50c7602b75caceaa39dbf0", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2015-06-21T13:08:43+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2015-06-21T08:01:12+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "cab6c6fefee93d7b7c3a01292a0fe0884ea66644" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/cab6c6fefee93d7b7c3a01292a0fe0884ea66644", + "reference": "cab6c6fefee93d7b7c3a01292a0fe0884ea66644", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2015-09-23T14:46:55+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "be067d6105286b74272facefc2697038f8807b77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/264188ddf4d3586c80ea615f8ec8eaea34e652a1", + "reference": "be067d6105286b74272facefc2697038f8807b77", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": ">=1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2015-10-14T13:49:40+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "abandoned": true, + "time": "2015-10-02T06:51:40+00:00" + }, + { + "name": "psr/container", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "fc1bc363ecf887921e3897c7b1dad3587ae154eb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/fc1bc363ecf887921e3897c7b1dad3587ae154eb", + "reference": "fc1bc363ecf887921e3897c7b1dad3587ae154eb", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "time": "2019-10-04T14:07:35+00:00" + }, + { + "name": "psr/log", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2020-03-23T09:12:05+00:00" + }, + { + "name": "react/promise", + "version": "2.x-dev", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "reference": "f3cff96a19736714524ca0dd1d4130de73dbbbc4", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.0 || ^6.5 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "time": "2020-05-12T15:16:56+00:00" + }, + { + "name": "sebastian/comparator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", + "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-07-26T15:48:44+00:00" + }, + { + "name": "sebastian/diff", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "6899b3e33bfbd386d88b5eea5f65f563e8793051" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6899b3e33bfbd386d88b5eea5f65f563e8793051", + "reference": "6899b3e33bfbd386d88b5eea5f65f563e8793051", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-06-22T14:15:55+00:00" + }, + { + "name": "sebastian/environment", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", + "reference": "6324c907ce7a52478eeeaede764f48733ef5ae44", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2015-08-03T06:14:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "f88f8936517d54ae6d589166810877fb2015d0a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/f88f8936517d54ae6d589166810877fb2015d0a2", + "reference": "f88f8936517d54ae6d589166810877fb2015d0a2", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2015-08-09T04:23:41+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", + "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-06-21T08:04:50+00:00" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-06-21T13:59:46+00:00" + }, + { + "name": "seld/jsonlint", + "version": "1.8.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/jsonlint.git", + "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1", + "reference": "ff2aa5420bfbc296cf6a0bc785fa5b35736de7c1", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "bin": [ + "bin/jsonlint" + ], + "type": "library", + "autoload": { + "psr-4": { + "Seld\\JsonLint\\": "src/Seld/JsonLint/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "JSON Linter", + "keywords": [ + "json", + "linter", + "parser", + "validator" + ], + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/seld/jsonlint", + "type": "tidelift" + } + ], + "time": "2020-04-30T19:05:18+00:00" + }, + { + "name": "seld/phar-utils", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/phar-utils.git", + "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/phar-utils/zipball/8674b1d84ffb47cc59a101f5d5a3b61e87d23796", + "reference": "8674b1d84ffb47cc59a101f5d5a3b61e87d23796", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Seld\\PharUtils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "PHAR file format utilities, for when PHP phars you up", + "keywords": [ + "phar" + ], + "time": "2020-07-07T18:42:57+00:00" + }, + { + "name": "symfony/console", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "e4a70bd8c5a4382630197b7b87910b3fc0e6b526" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/e4a70bd8c5a4382630197b7b87910b3fc0e6b526", + "reference": "e4a70bd8c5a4382630197b7b87910b3fc0e6b526", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" + }, + "conflict": { + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "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": "2020-07-06T13:25:45+00:00" + }, + { + "name": "symfony/filesystem", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "e7550993849f986f01a9161b302d4aed8d4aab0a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/e7550993849f986f01a9161b302d4aed8d4aab0a", + "reference": "e7550993849f986f01a9161b302d4aed8d4aab0a", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Filesystem Component", + "homepage": "https://symfony.com", + "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": "2020-05-30T20:38:10+00:00" + }, + { + "name": "symfony/finder", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "2a63a45741144325f84d28ea1e67bc1b669b1748" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/2a63a45741144325f84d28ea1e67bc1b669b1748", + "reference": "2a63a45741144325f84d28ea1e67bc1b669b1748", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "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": "2020-05-20T17:44:07+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454", + "reference": "1c302646f6efc070cd46856e600e5e0684d6b454", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "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": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "reference": "b740103edbdcc39602239ee8860f0f45a8eb9aa5", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "reference": "37078a8dd4a2a1e9ab0231af7c6cb671b2ed5a7e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "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" + ], + "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": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/a6977d63bf9a0ad4c65cd352709e230876f9904a", + "reference": "a6977d63bf9a0ad4c65cd352709e230876f9904a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "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": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fffa1a52a023e782cdcc221d781fe1ec8f87fcca", + "reference": "fffa1a52a023e782cdcc221d781fe1ec8f87fcca", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "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 backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981", + "shasum": "" + }, + "require": { + "php": ">=7.0.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.18-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-07-14T12:35:20+00:00" + }, + { + "name": "symfony/process", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "d158a452d952049e0e55b7cfe5f360c973edc57c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/d158a452d952049e0e55b7cfe5f360c973edc57c", + "reference": "d158a452d952049e0e55b7cfe5f360c973edc57c", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-php80": "^1.15" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "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": "2020-07-06T13:25:45+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/58c7475e5457c5492c26cc740cc0ad7464be9442", + "reference": "58c7475e5457c5492c26cc740cc0ad7464be9442", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "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": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "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": "2020-07-06T13:23:11+00:00" + }, + { + "name": "symfony/string", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "b7914561c03f8d78f83eec3ec4502adbdc343c48" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/b7914561c03f8d78f83eec3ec4502adbdc343c48", + "reference": "b7914561c03f8d78f83eec3ec4502adbdc343c48", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "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 String component", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "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": "2020-07-08T08:28:10+00:00" + }, + { + "name": "symfony/yaml", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "8d32eb597b531eb915b4fee3dc582ade5ae1fe6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/ab0314f7544d600ea7917f02cdad774358b81113", + "reference": "8d32eb597b531eb915b4fee3dc582ade5ae1fe6a", + "shasum": "" + }, + "require": { + "php": ">=5.5.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2015-10-13T16:01:35+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.3.0", + "composer-plugin-api": "^1.0 || ^2.0" + }, + "platform-dev": [], + "plugin-api-version": "1.1.0" +} diff --git a/modules/paynow/vendor/cweagans/composer-patches/index.php b/modules/paynow/vendor/cweagans/composer-patches/index.php new file mode 100644 index 00000000..88355f61 --- /dev/null +++ b/modules/paynow/vendor/cweagans/composer-patches/index.php @@ -0,0 +1,11 @@ + + + + + + ./tests/ + + + + + + src/ + + + vendor/ + + + diff --git a/modules/paynow/vendor/cweagans/composer-patches/src/PatchEvent.php b/modules/paynow/vendor/cweagans/composer-patches/src/PatchEvent.php new file mode 100644 index 00000000..31d36f89 --- /dev/null +++ b/modules/paynow/vendor/cweagans/composer-patches/src/PatchEvent.php @@ -0,0 +1,70 @@ +package = $package; + $this->url = $url; + $this->description = $description; + } + + /** + * Returns the package that is patched. + * + * @return PackageInterface + */ + public function getPackage() { + return $this->package; + } + + /** + * Returns the url of the patch. + * + * @return string + */ + public function getUrl() { + return $this->url; + } + + /** + * Returns the description of the patch. + * + * @return string + */ + public function getDescription() { + return $this->description; + } + +} diff --git a/modules/paynow/vendor/cweagans/composer-patches/src/PatchEvents.php b/modules/paynow/vendor/cweagans/composer-patches/src/PatchEvents.php new file mode 100644 index 00000000..ecee9476 --- /dev/null +++ b/modules/paynow/vendor/cweagans/composer-patches/src/PatchEvents.php @@ -0,0 +1,30 @@ +composer = $composer; + $this->io = $io; + $this->eventDispatcher = $composer->getEventDispatcher(); + $this->executor = new ProcessExecutor($this->io); + $this->patches = array(); + $this->installedPatches = array(); + } + + /** + * Returns an array of event names this subscriber wants to listen to. + */ + public static function getSubscribedEvents() { + return array( + ScriptEvents::PRE_INSTALL_CMD => array('checkPatches'), + ScriptEvents::PRE_UPDATE_CMD => array('checkPatches'), + PackageEvents::PRE_PACKAGE_INSTALL => array('gatherPatches'), + PackageEvents::PRE_PACKAGE_UPDATE => array('gatherPatches'), + // The following is a higher weight for compatibility with + // https://github.com/AydinHassan/magento-core-composer-installer and more generally for compatibility with + // every Composer plugin which deploys downloaded packages to other locations. + // In such cases you want that those plugins deploy patched files so they have to run after + // the "composer-patches" plugin. + // @see: https://github.com/cweagans/composer-patches/pull/153 + PackageEvents::POST_PACKAGE_INSTALL => array('postInstall', 10), + PackageEvents::POST_PACKAGE_UPDATE => array('postInstall', 10), + ); + } + + /** + * Before running composer install, + * @param Event $event + */ + public function checkPatches(Event $event) { + if (!$this->isPatchingEnabled()) { + return; + } + + try { + $repositoryManager = $this->composer->getRepositoryManager(); + $localRepository = $repositoryManager->getLocalRepository(); + $installationManager = $this->composer->getInstallationManager(); + $packages = $localRepository->getPackages(); + + $extra = $this->composer->getPackage()->getExtra(); + $patches_ignore = isset($extra['patches-ignore']) ? $extra['patches-ignore'] : array(); + + $tmp_patches = $this->grabPatches(); + foreach ($packages as $package) { + $extra = $package->getExtra(); + if (isset($extra['patches'])) { + if (isset($patches_ignore[$package->getName()])) { + foreach ($patches_ignore[$package->getName()] as $package_name => $patches) { + if (isset($extra['patches'][$package_name])) { + $extra['patches'][$package_name] = array_diff($extra['patches'][$package_name], $patches); + } + } + } + $this->installedPatches[$package->getName()] = $extra['patches']; + } + $patches = isset($extra['patches']) ? $extra['patches'] : array(); + $tmp_patches = $this->arrayMergeRecursiveDistinct($tmp_patches, $patches); + } + + if ($tmp_patches == FALSE) { + $this->io->write('No patches supplied.'); + return; + } + + // Remove packages for which the patch set has changed. + $promises = array(); + foreach ($packages as $package) { + if (!($package instanceof AliasPackage)) { + $package_name = $package->getName(); + $extra = $package->getExtra(); + $has_patches = isset($tmp_patches[$package_name]); + $has_applied_patches = isset($extra['patches_applied']) && count($extra['patches_applied']) > 0; + if (($has_patches && !$has_applied_patches) + || (!$has_patches && $has_applied_patches) + || ($has_patches && $has_applied_patches && $tmp_patches[$package_name] !== $extra['patches_applied'])) { + $uninstallOperation = new UninstallOperation($package, 'Removing package so it can be re-installed and re-patched.'); + $this->io->write('Removing package ' . $package_name . ' so that it can be re-installed and re-patched.'); + $promises[] = $installationManager->uninstall($localRepository, $uninstallOperation); + } + } + } + $promises = array_filter($promises); + if ($promises) { + $this->composer->getLoop()->wait($promises); + } + } + // If the Locker isn't available, then we don't need to do this. + // It's the first time packages have been installed. + catch (\LogicException $e) { + return; + } + } + + /** + * Gather patches from dependencies and store them for later use. + * + * @param PackageEvent $event + */ + public function gatherPatches(PackageEvent $event) { + // If we've already done this, then don't do it again. + if (isset($this->patches['_patchesGathered'])) { + $this->io->write('Patches already gathered. Skipping', TRUE, IOInterface::VERBOSE); + return; + } + // If patching has been disabled, bail out here. + elseif (!$this->isPatchingEnabled()) { + $this->io->write('Patching is disabled. Skipping.', TRUE, IOInterface::VERBOSE); + return; + } + + $this->patches = $this->grabPatches(); + if (empty($this->patches)) { + $this->io->write('No patches supplied.'); + } + + $extra = $this->composer->getPackage()->getExtra(); + $patches_ignore = isset($extra['patches-ignore']) ? $extra['patches-ignore'] : array(); + + // Now add all the patches from dependencies that will be installed. + $operations = $event->getOperations(); + $this->io->write('Gathering patches for dependencies. This might take a minute.'); + foreach ($operations as $operation) { + if ($operation instanceof InstallOperation || $operation instanceof UpdateOperation) { + $package = $this->getPackageFromOperation($operation); + $extra = $package->getExtra(); + if (isset($extra['patches'])) { + if (isset($patches_ignore[$package->getName()])) { + foreach ($patches_ignore[$package->getName()] as $package_name => $patches) { + if (isset($extra['patches'][$package_name])) { + $extra['patches'][$package_name] = array_diff($extra['patches'][$package_name], $patches); + } + } + } + $this->patches = $this->arrayMergeRecursiveDistinct($this->patches, $extra['patches']); + } + // Unset installed patches for this package + if(isset($this->installedPatches[$package->getName()])) { + unset($this->installedPatches[$package->getName()]); + } + } + } + + // Merge installed patches from dependencies that did not receive an update. + foreach ($this->installedPatches as $patches) { + $this->patches = $this->arrayMergeRecursiveDistinct($this->patches, $patches); + } + + // If we're in verbose mode, list the projects we're going to patch. + if ($this->io->isVerbose()) { + foreach ($this->patches as $package => $patches) { + $number = count($patches); + $this->io->write('Found ' . $number . ' patches for ' . $package . '.'); + } + } + + // Make sure we don't gather patches again. Extra keys in $this->patches + // won't hurt anything, so we'll just stash it there. + $this->patches['_patchesGathered'] = TRUE; + } + + /** + * Get the patches from root composer or external file + * @return Patches + * @throws \Exception + */ + public function grabPatches() { + // First, try to get the patches from the root composer.json. + $extra = $this->composer->getPackage()->getExtra(); + if (isset($extra['patches'])) { + $this->io->write('Gathering patches for root package.'); + $patches = $extra['patches']; + return $patches; + } + // If it's not specified there, look for a patches-file definition. + elseif (isset($extra['patches-file'])) { + $this->io->write('Gathering patches from patch file.'); + $patches = file_get_contents($extra['patches-file']); + $patches = json_decode($patches, TRUE); + $error = json_last_error(); + if ($error != 0) { + switch ($error) { + case JSON_ERROR_DEPTH: + $msg = ' - Maximum stack depth exceeded'; + break; + case JSON_ERROR_STATE_MISMATCH: + $msg = ' - Underflow or the modes mismatch'; + break; + case JSON_ERROR_CTRL_CHAR: + $msg = ' - Unexpected control character found'; + break; + case JSON_ERROR_SYNTAX: + $msg = ' - Syntax error, malformed JSON'; + break; + case JSON_ERROR_UTF8: + $msg = ' - Malformed UTF-8 characters, possibly incorrectly encoded'; + break; + default: + $msg = ' - Unknown error'; + break; + } + throw new \Exception('There was an error in the supplied patches file:' . $msg); + } + if (isset($patches['patches'])) { + $patches = $patches['patches']; + return $patches; + } + elseif(!$patches) { + throw new \Exception('There was an error in the supplied patch file'); + } + } + else { + return array(); + } + } + + /** + * @param PackageEvent $event + * @throws \Exception + */ + public function postInstall(PackageEvent $event) { + + // Check if we should exit in failure. + $extra = $this->composer->getPackage()->getExtra(); + $exitOnFailure = getenv('COMPOSER_EXIT_ON_PATCH_FAILURE') || !empty($extra['composer-exit-on-patch-failure']); + $skipReporting = getenv('COMPOSER_PATCHES_SKIP_REPORTING') || !empty($extra['composer-patches-skip-reporting']); + + // Get the package object for the current operation. + $operation = $event->getOperation(); + /** @var PackageInterface $package */ + $package = $this->getPackageFromOperation($operation); + $package_name = $package->getName(); + + if (!isset($this->patches[$package_name])) { + if ($this->io->isVerbose()) { + $this->io->write('No patches found for ' . $package_name . '.'); + } + return; + } + $this->io->write(' - Applying patches for ' . $package_name . ''); + + // Get the install path from the package object. + $manager = $event->getComposer()->getInstallationManager(); + $install_path = $manager->getInstaller($package->getType())->getInstallPath($package); + + // Set up a downloader. + $downloader = new RemoteFilesystem($this->io, $this->composer->getConfig()); + + // Track applied patches in the package info in installed.json + $localRepository = $this->composer->getRepositoryManager()->getLocalRepository(); + $localPackage = $localRepository->findPackage($package_name, $package->getVersion()); + $extra = $localPackage->getExtra(); + $extra['patches_applied'] = array(); + + foreach ($this->patches[$package_name] as $description => $url) { + $this->io->write(' ' . $url . ' (' . $description. ')'); + try { + $this->eventDispatcher->dispatch(NULL, new PatchEvent(PatchEvents::PRE_PATCH_APPLY, $package, $url, $description)); + $this->getAndApplyPatch($downloader, $install_path, $url, $package); + $this->eventDispatcher->dispatch(NULL, new PatchEvent(PatchEvents::POST_PATCH_APPLY, $package, $url, $description)); + $extra['patches_applied'][$description] = $url; + } + catch (\Exception $e) { + $this->io->write(' Could not apply patch! Skipping. The error was: ' . $e->getMessage() . ''); + if ($exitOnFailure) { + throw new \Exception("Cannot apply patch $description ($url)!"); + } + } + } + $localPackage->setExtra($extra); + + $this->io->write(''); + + if (true !== $skipReporting) { + $this->writePatchReport($this->patches[$package_name], $install_path); + } + } + + /** + * Get a Package object from an OperationInterface object. + * + * @param OperationInterface $operation + * @return PackageInterface + * @throws \Exception + */ + protected function getPackageFromOperation(OperationInterface $operation) { + if ($operation instanceof InstallOperation) { + $package = $operation->getPackage(); + } + elseif ($operation instanceof UpdateOperation) { + $package = $operation->getTargetPackage(); + } + else { + throw new \Exception('Unknown operation: ' . get_class($operation)); + } + + return $package; + } + + /** + * Apply a patch on code in the specified directory. + * + * @param RemoteFilesystem $downloader + * @param $install_path + * @param $patch_url + * @param PackageInterface $package + * @throws \Exception + */ + protected function getAndApplyPatch(RemoteFilesystem $downloader, $install_path, $patch_url, PackageInterface $package) { + + // Local patch file. + if (file_exists($patch_url)) { + $filename = realpath($patch_url); + } + else { + // Generate random (but not cryptographically so) filename. + $filename = uniqid(sys_get_temp_dir().'/') . ".patch"; + + // Download file from remote filesystem to this location. + $hostname = parse_url($patch_url, PHP_URL_HOST); + + try { + $downloader->copy($hostname, $patch_url, $filename, false); + } catch (\Exception $e) { + // In case of an exception, retry once as the download might + // have failed due to intermittent network issues. + $downloader->copy($hostname, $patch_url, $filename, false); + } + } + + // The order here is intentional. p1 is most likely to apply with git apply. + // p0 is next likely. p2 is extremely unlikely, but for some special cases, + // it might be useful. p4 is useful for Magento 2 patches + $patch_levels = array('-p1', '-p0', '-p2', '-p4'); + + // Check for specified patch level for this package. + $extra = $this->composer->getPackage()->getExtra(); + if (!empty($extra['patchLevel'][$package->getName()])){ + $patch_levels = array($extra['patchLevel'][$package->getName()]); + } + // Attempt to apply with git apply. + $patched = $this->applyPatchWithGit($install_path, $patch_levels, $filename); + + // In some rare cases, git will fail to apply a patch, fallback to using + // the 'patch' command. + if (!$patched) { + foreach ($patch_levels as $patch_level) { + // --no-backup-if-mismatch here is a hack that fixes some + // differences between how patch works on windows and unix. + if ($patched = $this->executeCommand("patch %s --no-backup-if-mismatch -d %s < %s", $patch_level, $install_path, $filename)) { + break; + } + } + } + + // Clean up the temporary patch file. + if (isset($hostname)) { + unlink($filename); + } + // If the patch *still* isn't applied, then give up and throw an Exception. + // Otherwise, let the user know it worked. + if (!$patched) { + throw new \Exception("Cannot apply patch $patch_url"); + } + } + + /** + * Checks if the root package enables patching. + * + * @return bool + * Whether patching is enabled. Defaults to TRUE. + */ + protected function isPatchingEnabled() { + $extra = $this->composer->getPackage()->getExtra(); + + if (empty($extra['patches']) && empty($extra['patches-ignore']) && !isset($extra['patches-file'])) { + // The root package has no patches of its own, so only allow patching if + // it has specifically opted in. + return isset($extra['enable-patching']) ? $extra['enable-patching'] : FALSE; + } + else { + return TRUE; + } + } + + /** + * Writes a patch report to the target directory. + * + * @param array $patches + * @param string $directory + */ + protected function writePatchReport($patches, $directory) { + $output = "This file was automatically generated by Composer Patches (https://github.com/cweagans/composer-patches)\n"; + $output .= "Patches applied to this directory:\n\n"; + foreach ($patches as $description => $url) { + $output .= $description . "\n"; + $output .= 'Source: ' . $url . "\n\n\n"; + } + file_put_contents($directory . "/PATCHES.txt", $output); + } + + /** + * Executes a shell command with escaping. + * + * @param string $cmd + * @return bool + */ + protected function executeCommand($cmd) { + // Shell-escape all arguments except the command. + $args = func_get_args(); + foreach ($args as $index => $arg) { + if ($index !== 0) { + $args[$index] = escapeshellarg($arg); + } + } + + // And replace the arguments. + $command = call_user_func_array('sprintf', $args); + $output = ''; + if ($this->io->isVerbose()) { + $this->io->write('' . $command . ''); + $io = $this->io; + $output = function ($type, $data) use ($io) { + if ($type == Process::ERR) { + $io->write('' . $data . ''); + } + else { + $io->write('' . $data . ''); + } + }; + } + return ($this->executor->execute($command, $output) == 0); + } + + /** + * Recursively merge arrays without changing data types of values. + * + * Does not change the data types of the values in the arrays. Matching keys' + * values in the second array overwrite those in the first array, as is the + * case with array_merge. + * + * @param array $array1 + * The first array. + * @param array $array2 + * The second array. + * @return array + * The merged array. + * + * @see http://php.net/manual/en/function.array-merge-recursive.php#92195 + */ + protected function arrayMergeRecursiveDistinct(array $array1, array $array2) { + $merged = $array1; + + foreach ($array2 as $key => &$value) { + if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { + $merged[$key] = $this->arrayMergeRecursiveDistinct($merged[$key], $value); + } + else { + $merged[$key] = $value; + } + } + + return $merged; + } + + /** + * Attempts to apply a patch with git apply. + * + * @param $install_path + * @param $patch_levels + * @param $filename + * + * @return bool + * TRUE if patch was applied, FALSE otherwise. + */ + protected function applyPatchWithGit($install_path, $patch_levels, $filename) { + // Do not use git apply unless the install path is itself a git repo + // @see https://stackoverflow.com/a/27283285 + if (!is_dir($install_path . '/.git')) { + return FALSE; + } + + $patched = FALSE; + foreach ($patch_levels as $patch_level) { + if ($this->io->isVerbose()) { + $comment = 'Testing ability to patch with git apply.'; + $comment .= ' This command may produce errors that can be safely ignored.'; + $this->io->write('' . $comment . ''); + } + $checked = $this->executeCommand('git -C %s apply --check -v %s %s', $install_path, $patch_level, $filename); + $output = $this->executor->getErrorOutput(); + if (substr($output, 0, 7) == 'Skipped') { + // Git will indicate success but silently skip patches in some scenarios. + // + // @see https://github.com/cweagans/composer-patches/pull/165 + $checked = FALSE; + } + if ($checked) { + // Apply the first successful style. + $patched = $this->executeCommand('git -C %s apply %s %s', $install_path, $patch_level, $filename); + break; + } + } + return $patched; + } + + /** + * Indicates if a package has been patched. + * + * @param \Composer\Package\PackageInterface $package + * The package to check. + * + * @return bool + * TRUE if the package has been patched. + */ + public static function isPackagePatched(PackageInterface $package) { + return array_key_exists('patches_applied', $package->getExtra()); + } + + /** + * {@inheritDoc} + */ + public function deactivate(Composer $composer, IOInterface $io) + { + } + + /** + * {@inheritDoc} + */ + public function uninstall(Composer $composer, IOInterface $io) + { + } + +} diff --git a/modules/paynow/vendor/cweagans/composer-patches/src/index.php b/modules/paynow/vendor/cweagans/composer-patches/src/index.php new file mode 100644 index 00000000..88355f61 --- /dev/null +++ b/modules/paynow/vendor/cweagans/composer-patches/src/index.php @@ -0,0 +1,11 @@ +assertEquals($event_name, $patch_event->getName()); + $this->assertEquals($package, $patch_event->getPackage()); + $this->assertEquals($url, $patch_event->getUrl()); + $this->assertEquals($description, $patch_event->getDescription()); + } + + public function patchEventDataProvider() { + $prophecy = $this->prophesize('Composer\Package\PackageInterface'); + $package = $prophecy->reveal(); + + return array( + array(PatchEvents::PRE_PATCH_APPLY, $package, 'https://www.drupal.org', 'A test patch'), + array(PatchEvents::POST_PATCH_APPLY, $package, 'https://www.drupal.org', 'A test patch'), + ); + } + +} diff --git a/modules/paynow/vendor/cweagans/composer-patches/tests/index.php b/modules/paynow/vendor/cweagans/composer-patches/tests/index.php new file mode 100644 index 00000000..88355f61 --- /dev/null +++ b/modules/paynow/vendor/cweagans/composer-patches/tests/index.php @@ -0,0 +1,11 @@ +=7.1", - "psr/http-message": "^1.0", - "php-http/message-factory": "^1.0", + "php": ">=7.2", + "psr/http-message": "^1.1 || ^2.0", "psr/http-factory": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^7.5 || 8.5 || 9.4", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "php-http/message-factory": "^1.0", "php-http/psr7-integration-tests": "^1.0", "http-interop/http-factory-tests": "^0.9", "symfony/error-handler": "^4.4" @@ -43,7 +43,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.6-dev" + "dev-master": "1.8-dev" } } } diff --git a/modules/paynow/vendor/nyholm/psr7/src/Factory/HttplugFactory.php b/modules/paynow/vendor/nyholm/psr7/src/Factory/HttplugFactory.php index 4cf8e27e..cc9285dd 100644 --- a/modules/paynow/vendor/nyholm/psr7/src/Factory/HttplugFactory.php +++ b/modules/paynow/vendor/nyholm/psr7/src/Factory/HttplugFactory.php @@ -11,11 +11,19 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UriInterface; +if (!\interface_exists(MessageFactory::class)) { + throw new \LogicException('You cannot use "Nyholm\Psr7\Factory\HttplugFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + +@\trigger_error('Class "Nyholm\Psr7\Factory\HttplugFactory" is deprecated since version 1.8, use "Nyholm\Psr7\Factory\Psr17Factory" instead.', \E_USER_DEPRECATED); + /** * @author Tobias Nyholm * @author Martijn van der Ven * * @final This class should never be extended. See https://github.com/Nyholm/psr7/blob/master/doc/final.md + * + * @deprecated since version 1.8, use Psr17Factory instead */ class HttplugFactory implements MessageFactory, StreamFactory, UriFactory { diff --git a/modules/paynow/vendor/nyholm/psr7/src/Factory/Psr17Factory.php b/modules/paynow/vendor/nyholm/psr7/src/Factory/Psr17Factory.php index 440bec34..2fa98bee 100644 --- a/modules/paynow/vendor/nyholm/psr7/src/Factory/Psr17Factory.php +++ b/modules/paynow/vendor/nyholm/psr7/src/Factory/Psr17Factory.php @@ -57,7 +57,7 @@ class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, return Stream::create($resource); } - public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null): UploadedFileInterface + public function createUploadedFile(StreamInterface $stream, ?int $size = null, int $error = \UPLOAD_ERR_OK, ?string $clientFilename = null, ?string $clientMediaType = null): UploadedFileInterface { if (null === $size) { $size = $stream->getSize(); diff --git a/modules/paynow/vendor/nyholm/psr7/src/MessageTrait.php b/modules/paynow/vendor/nyholm/psr7/src/MessageTrait.php index da34e58b..7d02383b 100644 --- a/modules/paynow/vendor/nyholm/psr7/src/MessageTrait.php +++ b/modules/paynow/vendor/nyholm/psr7/src/MessageTrait.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Nyholm\Psr7; +use Psr\Http\Message\MessageInterface; use Psr\Http\Message\StreamInterface; /** @@ -34,7 +35,10 @@ trait MessageTrait return $this->protocol; } - public function withProtocolVersion($version): self + /** + * @return static + */ + public function withProtocolVersion($version): MessageInterface { if (!\is_scalar($version)) { throw new \InvalidArgumentException('Protocol version must be a string'); @@ -81,7 +85,10 @@ trait MessageTrait return \implode(', ', $this->getHeader($header)); } - public function withHeader($header, $value): self + /** + * @return static + */ + public function withHeader($header, $value): MessageInterface { $value = $this->validateAndTrimHeader($header, $value); $normalized = \strtr($header, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); @@ -96,7 +103,10 @@ trait MessageTrait return $new; } - public function withAddedHeader($header, $value): self + /** + * @return static + */ + public function withAddedHeader($header, $value): MessageInterface { if (!\is_string($header) || '' === $header) { throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); @@ -108,7 +118,10 @@ trait MessageTrait return $new; } - public function withoutHeader($header): self + /** + * @return static + */ + public function withoutHeader($header): MessageInterface { if (!\is_string($header)) { throw new \InvalidArgumentException('Header name must be an RFC 7230 compatible string'); @@ -135,7 +148,10 @@ trait MessageTrait return $this->stream; } - public function withBody(StreamInterface $body): self + /** + * @return static + */ + public function withBody(StreamInterface $body): MessageInterface { if ($body === $this->stream) { return $this; diff --git a/modules/paynow/vendor/nyholm/psr7/src/RequestTrait.php b/modules/paynow/vendor/nyholm/psr7/src/RequestTrait.php index 7c39bbb6..2dbb3abf 100644 --- a/modules/paynow/vendor/nyholm/psr7/src/RequestTrait.php +++ b/modules/paynow/vendor/nyholm/psr7/src/RequestTrait.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Nyholm\Psr7; +use Psr\Http\Message\RequestInterface; use Psr\Http\Message\UriInterface; /** @@ -40,7 +41,10 @@ trait RequestTrait return $target; } - public function withRequestTarget($requestTarget): self + /** + * @return static + */ + public function withRequestTarget($requestTarget): RequestInterface { if (!\is_string($requestTarget)) { throw new \InvalidArgumentException('Request target must be a string'); @@ -61,7 +65,10 @@ trait RequestTrait return $this->method; } - public function withMethod($method): self + /** + * @return static + */ + public function withMethod($method): RequestInterface { if (!\is_string($method)) { throw new \InvalidArgumentException('Method must be a string'); @@ -78,7 +85,10 @@ trait RequestTrait return $this->uri; } - public function withUri(UriInterface $uri, $preserveHost = false): self + /** + * @return static + */ + public function withUri(UriInterface $uri, $preserveHost = false): RequestInterface { if ($uri === $this->uri) { return $this; diff --git a/modules/paynow/vendor/nyholm/psr7/src/Response.php b/modules/paynow/vendor/nyholm/psr7/src/Response.php index 9a26d2cb..71eb2fa4 100644 --- a/modules/paynow/vendor/nyholm/psr7/src/Response.php +++ b/modules/paynow/vendor/nyholm/psr7/src/Response.php @@ -39,7 +39,7 @@ class Response implements ResponseInterface * @param string $version Protocol version * @param string|null $reason Reason phrase (when empty a default will be used based on the status code) */ - public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null) + public function __construct(int $status = 200, array $headers = [], $body = null, string $version = '1.1', ?string $reason = null) { // If we got no body, defer initialization of the stream until Response::getBody() if ('' !== $body && null !== $body) { @@ -67,7 +67,10 @@ class Response implements ResponseInterface return $this->reasonPhrase; } - public function withStatus($code, $reasonPhrase = ''): self + /** + * @return static + */ + public function withStatus($code, $reasonPhrase = ''): ResponseInterface { if (!\is_int($code) && !\is_string($code)) { throw new \InvalidArgumentException('Status code has to be an integer'); diff --git a/modules/paynow/vendor/nyholm/psr7/src/ServerRequest.php b/modules/paynow/vendor/nyholm/psr7/src/ServerRequest.php index 7f5022e4..a3c5ba90 100644 --- a/modules/paynow/vendor/nyholm/psr7/src/ServerRequest.php +++ b/modules/paynow/vendor/nyholm/psr7/src/ServerRequest.php @@ -81,7 +81,7 @@ class ServerRequest implements ServerRequestInterface /** * @return static */ - public function withUploadedFiles(array $uploadedFiles) + public function withUploadedFiles(array $uploadedFiles): ServerRequestInterface { $new = clone $this; $new->uploadedFiles = $uploadedFiles; @@ -97,7 +97,7 @@ class ServerRequest implements ServerRequestInterface /** * @return static */ - public function withCookieParams(array $cookies) + public function withCookieParams(array $cookies): ServerRequestInterface { $new = clone $this; $new->cookieParams = $cookies; @@ -113,7 +113,7 @@ class ServerRequest implements ServerRequestInterface /** * @return static */ - public function withQueryParams(array $query) + public function withQueryParams(array $query): ServerRequestInterface { $new = clone $this; $new->queryParams = $query; @@ -132,7 +132,7 @@ class ServerRequest implements ServerRequestInterface /** * @return static */ - public function withParsedBody($data) + public function withParsedBody($data): ServerRequestInterface { if (!\is_array($data) && !\is_object($data) && null !== $data) { throw new \InvalidArgumentException('First parameter to withParsedBody MUST be object, array or null'); @@ -165,7 +165,10 @@ class ServerRequest implements ServerRequestInterface return $this->attributes[$attribute]; } - public function withAttribute($attribute, $value): self + /** + * @return static + */ + public function withAttribute($attribute, $value): ServerRequestInterface { if (!\is_string($attribute)) { throw new \InvalidArgumentException('Attribute name must be a string'); @@ -177,7 +180,10 @@ class ServerRequest implements ServerRequestInterface return $new; } - public function withoutAttribute($attribute): self + /** + * @return static + */ + public function withoutAttribute($attribute): ServerRequestInterface { if (!\is_string($attribute)) { throw new \InvalidArgumentException('Attribute name must be a string'); diff --git a/modules/paynow/vendor/nyholm/psr7/src/Stream.php b/modules/paynow/vendor/nyholm/psr7/src/Stream.php index d173f356..63b7d6dd 100644 --- a/modules/paynow/vendor/nyholm/psr7/src/Stream.php +++ b/modules/paynow/vendor/nyholm/psr7/src/Stream.php @@ -5,8 +5,6 @@ declare(strict_types=1); namespace Nyholm\Psr7; use Psr\Http\Message\StreamInterface; -use Symfony\Component\Debug\ErrorHandler as SymfonyLegacyErrorHandler; -use Symfony\Component\ErrorHandler\ErrorHandler as SymfonyErrorHandler; /** * @author Michael Dowling and contributors to guzzlehttp/psr7 @@ -17,6 +15,8 @@ use Symfony\Component\ErrorHandler\ErrorHandler as SymfonyErrorHandler; */ class Stream implements StreamInterface { + use StreamTrait; + /** @var resource|null A resource reference */ private $stream; @@ -81,10 +81,14 @@ class Stream implements StreamInterface } if (\is_string($body)) { - $resource = \fopen('php://temp', 'rw+'); - \fwrite($resource, $body); - \fseek($resource, 0); - $body = $resource; + if (200000 <= \strlen($body)) { + $body = self::openZvalStream($body); + } else { + $resource = \fopen('php://memory', 'r+'); + \fwrite($resource, $body); + \fseek($resource, 0); + $body = $resource; + } } if (!\is_resource($body)) { @@ -102,35 +106,6 @@ class Stream implements StreamInterface $this->close(); } - /** - * @return string - */ - public function __toString() - { - try { - if ($this->isSeekable()) { - $this->seek(0); - } - - return $this->getContents(); - } catch (\Throwable $e) { - if (\PHP_VERSION_ID >= 70400) { - throw $e; - } - - if (\is_array($errorHandler = \set_error_handler('var_dump'))) { - $errorHandler = $errorHandler[0] ?? null; - } - \restore_error_handler(); - - if ($e instanceof \Error || $errorHandler instanceof SymfonyErrorHandler || $errorHandler instanceof SymfonyLegacyErrorHandler) { - return \trigger_error((string) $e, \E_USER_ERROR); - } - - return ''; - } - } - public function close(): void { if (isset($this->stream)) { @@ -285,11 +260,19 @@ class Stream implements StreamInterface throw new \RuntimeException('Stream is detached'); } - if (false === $contents = @\stream_get_contents($this->stream)) { - throw new \RuntimeException('Unable to read stream contents: ' . (\error_get_last()['message'] ?? '')); - } + $exception = null; - return $contents; + \set_error_handler(static function ($type, $message) use (&$exception) { + throw $exception = new \RuntimeException('Unable to read stream contents: ' . $message); + }); + + try { + return \stream_get_contents($this->stream); + } catch (\Throwable $e) { + throw $e === $exception ? $e : new \RuntimeException('Unable to read stream contents: ' . $e->getMessage(), 0, $e); + } finally { + \restore_error_handler(); + } } /** @@ -313,4 +296,104 @@ class Stream implements StreamInterface return $meta[$key] ?? null; } + + private static function openZvalStream(string $body) + { + static $wrapper; + + $wrapper ?? \stream_wrapper_register('Nyholm-Psr7-Zval', $wrapper = \get_class(new class() { + public $context; + + private $data; + private $position = 0; + + public function stream_open(): bool + { + $this->data = \stream_context_get_options($this->context)['Nyholm-Psr7-Zval']['data']; + \stream_context_set_option($this->context, 'Nyholm-Psr7-Zval', 'data', null); + + return true; + } + + public function stream_read(int $count): string + { + $result = \substr($this->data, $this->position, $count); + $this->position += \strlen($result); + + return $result; + } + + public function stream_write(string $data): int + { + $this->data = \substr_replace($this->data, $data, $this->position, \strlen($data)); + $this->position += \strlen($data); + + return \strlen($data); + } + + public function stream_tell(): int + { + return $this->position; + } + + public function stream_eof(): bool + { + return \strlen($this->data) <= $this->position; + } + + public function stream_stat(): array + { + return [ + 'mode' => 33206, // POSIX_S_IFREG | 0666 + 'nlink' => 1, + 'rdev' => -1, + 'size' => \strlen($this->data), + 'blksize' => -1, + 'blocks' => -1, + ]; + } + + public function stream_seek(int $offset, int $whence): bool + { + if (\SEEK_SET === $whence && (0 <= $offset && \strlen($this->data) >= $offset)) { + $this->position = $offset; + } elseif (\SEEK_CUR === $whence && 0 <= $offset) { + $this->position += $offset; + } elseif (\SEEK_END === $whence && (0 > $offset && 0 <= $offset = \strlen($this->data) + $offset)) { + $this->position = $offset; + } else { + return false; + } + + return true; + } + + public function stream_set_option(): bool + { + return true; + } + + public function stream_truncate(int $new_size): bool + { + if ($new_size) { + $this->data = \substr($this->data, 0, $new_size); + $this->position = \min($this->position, $new_size); + } else { + $this->data = ''; + $this->position = 0; + } + + return true; + } + })); + + $context = \stream_context_create(['Nyholm-Psr7-Zval' => ['data' => $body]]); + + if (!$stream = @\fopen('Nyholm-Psr7-Zval://', 'r+', false, $context)) { + \stream_wrapper_register('Nyholm-Psr7-Zval', $wrapper); + $stream = \fopen('Nyholm-Psr7-Zval://', 'r+', false, $context); + } + + return $stream; + } } diff --git a/modules/paynow/vendor/nyholm/psr7/src/StreamTrait.php b/modules/paynow/vendor/nyholm/psr7/src/StreamTrait.php new file mode 100644 index 00000000..41a3f9d7 --- /dev/null +++ b/modules/paynow/vendor/nyholm/psr7/src/StreamTrait.php @@ -0,0 +1,57 @@ += 70400 || (new \ReflectionMethod(StreamInterface::class, '__toString'))->hasReturnType()) { + /** + * @internal + */ + trait StreamTrait + { + public function __toString(): string + { + if ($this->isSeekable()) { + $this->seek(0); + } + + return $this->getContents(); + } + } +} else { + /** + * @internal + */ + trait StreamTrait + { + /** + * @return string + */ + public function __toString() + { + try { + if ($this->isSeekable()) { + $this->seek(0); + } + + return $this->getContents(); + } catch (\Throwable $e) { + if (\is_array($errorHandler = \set_error_handler('var_dump'))) { + $errorHandler = $errorHandler[0] ?? null; + } + \restore_error_handler(); + + if ($e instanceof \Error || $errorHandler instanceof SymfonyErrorHandler || $errorHandler instanceof SymfonyLegacyErrorHandler) { + return \trigger_error((string) $e, \E_USER_ERROR); + } + + return ''; + } + } + } +} diff --git a/modules/paynow/vendor/nyholm/psr7/src/Uri.php b/modules/paynow/vendor/nyholm/psr7/src/Uri.php index 0d2c9754..621e2e72 100644 --- a/modules/paynow/vendor/nyholm/psr7/src/Uri.php +++ b/modules/paynow/vendor/nyholm/psr7/src/Uri.php @@ -140,7 +140,10 @@ class Uri implements UriInterface return $this->fragment; } - public function withScheme($scheme): self + /** + * @return static + */ + public function withScheme($scheme): UriInterface { if (!\is_string($scheme)) { throw new \InvalidArgumentException('Scheme must be a string'); @@ -157,7 +160,10 @@ class Uri implements UriInterface return $new; } - public function withUserInfo($user, $password = null): self + /** + * @return static + */ + public function withUserInfo($user, $password = null): UriInterface { if (!\is_string($user)) { throw new \InvalidArgumentException('User must be a string'); @@ -182,7 +188,10 @@ class Uri implements UriInterface return $new; } - public function withHost($host): self + /** + * @return static + */ + public function withHost($host): UriInterface { if (!\is_string($host)) { throw new \InvalidArgumentException('Host must be a string'); @@ -198,7 +207,10 @@ class Uri implements UriInterface return $new; } - public function withPort($port): self + /** + * @return static + */ + public function withPort($port): UriInterface { if ($this->port === $port = $this->filterPort($port)) { return $this; @@ -210,7 +222,10 @@ class Uri implements UriInterface return $new; } - public function withPath($path): self + /** + * @return static + */ + public function withPath($path): UriInterface { if ($this->path === $path = $this->filterPath($path)) { return $this; @@ -222,7 +237,10 @@ class Uri implements UriInterface return $new; } - public function withQuery($query): self + /** + * @return static + */ + public function withQuery($query): UriInterface { if ($this->query === $query = $this->filterQueryAndFragment($query)) { return $this; @@ -234,7 +252,10 @@ class Uri implements UriInterface return $new; } - public function withFragment($fragment): self + /** + * @return static + */ + public function withFragment($fragment): UriInterface { if ($this->fragment === $fragment = $this->filterQueryAndFragment($fragment)) { return $this; diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/composer.json b/modules/paynow/vendor/pay-now/paynow-php-sdk/composer.json index 1e86dec3..7f1404a1 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/composer.json +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/composer.json @@ -1,7 +1,7 @@ { "name": "pay-now/paynow-php-sdk", "description": "PHP client library for accessing Paynow API", - "version": "2.2.2", + "version": "2.4.4", "keywords": [ "paynow", "mbank", @@ -20,7 +20,7 @@ "minimum-stability": "stable", "prefer-stable": true, "require": { - "php": ">=7.1", + "php": ">=7.2", "psr/http-message": "^1.0 || ^2.0", "php-http/client-implementation": "^1.0 || ^2.0", "php-http/message-factory": "^1.0 || ^2.0", @@ -28,7 +28,7 @@ "php-http/httplug": "^2.2" }, "require-dev": { - "phpunit/phpunit": "^7.0", + "phpunit/phpunit": "^8.5.36", "php-http/mock-client": "^1.3", "squizlabs/php_codesniffer": "^3.4", "friendsofphp/php-cs-fixer": "^2.15", @@ -52,5 +52,11 @@ "test": "vendor/bin/phpunit", "cs-check": "php-cs-fixer fix --no-interaction --dry-run --diff", "cs-fix": "php-cs-fixer fix -v --diff" + }, + "config": { + "allow-plugins": { + "php-http/discovery": true, + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Configuration.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Configuration.php index 0803169e..db20508e 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Configuration.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Configuration.php @@ -6,6 +6,8 @@ class Configuration implements ConfigurationInterface { public const API_VERSION = 'v1'; public const API_VERSION_V2 = 'v2'; + public const API_VERSION_V3 = 'v3'; + public const API_PRODUCTION_URL = 'https://api.paynow.pl'; public const API_SANDBOX_URL = 'https://api.sandbox.paynow.pl'; public const USER_AGENT = 'paynow-php-sdk'; @@ -32,7 +34,7 @@ class Configuration implements ConfigurationInterface */ private function get($key) { - return isset($this->data[$key]) ? $this->data[$key] : null; + return $this->data[$key] ?? null; } /** diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Exception/PaynowException.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Exception/PaynowException.php index f6facd19..c4dd0349 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Exception/PaynowException.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Exception/PaynowException.php @@ -13,11 +13,11 @@ class PaynowException extends Exception /** * PaynowException constructor. * @param string $message - * @param int $code + * @param int|null $code * @param string|null $body * @param Throwable|null $previous */ - public function __construct(string $message, int $code = 0, ?string $body = null, Throwable $previous = null) + public function __construct(string $message, ?int $code = 0, ?string $body = null, Throwable $previous = null) { parent::__construct($message, $code, $previous); diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/ApiResponse.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/ApiResponse.php index d4b95b7c..81682aa3 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/ApiResponse.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/ApiResponse.php @@ -3,13 +3,14 @@ namespace Paynow\HttpClient; use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamInterface; class ApiResponse { /** * Body content * - * @var string + * @var StreamInterface */ public $body; diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/HttpClient.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/HttpClient.php index ef48d5be..28889626 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/HttpClient.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/HttpClient.php @@ -43,7 +43,7 @@ class HttpClient implements HttpClientInterface } catch (NotFoundException $exception) { $this->client = HttpClientDiscovery::find(); } - $this->url = Psr17FactoryDiscovery::findUrlFactory()->createUri((string)$config->getUrl()); + $this->url = Psr17FactoryDiscovery::findUriFactory()->createUri((string)$config->getUrl()); } /** @@ -60,8 +60,8 @@ class HttpClient implements HttpClientInterface /** * @param RequestInterface $request - * @throws HttpClientException * @return ApiResponse + * @throws HttpClientException */ private function send(RequestInterface $request): ApiResponse { @@ -76,16 +76,17 @@ class HttpClient implements HttpClientInterface * @param string $url * @param array $data * @param string|null $idempotencyKey - * @throws HttpClientException * @return ApiResponse + * @throws HttpClientException */ public function post(string $url, array $data, ?string $idempotencyKey = null): ApiResponse { - $headers = $this->prepareHeaders($data); + $isv3 = strpos($url, Configuration::API_VERSION_V3) !== false; + $headers = $this->prepareHeaders($data, [], $idempotencyKey, $isv3); - if ($idempotencyKey) { - $headers['Idempotency-Key'] = $idempotencyKey; - } + if ($idempotencyKey && !$isv3) { + $headers['Idempotency-Key'] = $idempotencyKey; + } $request = $this->messageFactory->createRequest( 'POST', @@ -104,12 +105,13 @@ class HttpClient implements HttpClientInterface /** * @param string $url * @param array $data - * @throws HttpClientException + * @param string|null $idempotencyKey * @return ApiResponse + * @throws HttpClientException */ - public function patch(string $url, array $data): ApiResponse + public function patch(string $url, array $data, ?string $idempotencyKey = null): ApiResponse { - $headers = $this->prepareHeaders($data); + $headers = $this->prepareHeaders($data, [], $idempotencyKey, strpos($url, Configuration::API_VERSION_V3) !== false); $request = $this->messageFactory->createRequest( 'PATCH', $this->url->withPath($url) @@ -127,17 +129,49 @@ class HttpClient implements HttpClientInterface /** * @param string $url * @param string|null $query - * @throws HttpClientException + * @param string|null $idempotencyKey * @return ApiResponse + * @throws HttpClientException */ - public function get(string $url, string $query = null): ApiResponse + public function get(string $url, ?string $query = null, ?string $idempotencyKey = null): ApiResponse { $request = $this->messageFactory->createRequest( 'GET', $query ? $this->url->withPath($url)->withQuery($query) : $this->url->withPath($url) ); - foreach ($this->prepareHeaders() as $name => $value) { + $parameters = []; + if ($query) { + parse_str(urldecode($query), $parameters); + } + + foreach ($this->prepareHeaders(null, $parameters, $idempotencyKey, strpos($url, Configuration::API_VERSION_V3) !== false) as $name => $value) { + $request = $request->withHeader($name, $value); + } + + return $this->send($request); + } + + /** + * @param string $url + * @param string $idempotencyKey + * @param string|null $query + * @return ApiResponse + * @throws HttpClientException + */ + public function delete(string $url, string $idempotencyKey, ?string $query = null): ApiResponse + { + $request = $this->messageFactory->createRequest( + 'DELETE', + $query ? $this->url->withPath($url)->withQuery($query) : $this->url->withPath($url) + ); + + $parameters = []; + if ($query) { + parse_str(urldecode($query), $parameters); + } + + foreach ($this->prepareHeaders(null, $parameters, $idempotencyKey, strpos($url, Configuration::API_VERSION_V3) !== false) as $name => $value) { $request = $request->withHeader($name, $value); } @@ -150,24 +184,40 @@ class HttpClient implements HttpClientInterface */ private function arrayAsJson(array $data): string { - return json_encode($data); + return json_encode($data, JSON_UNESCAPED_SLASHES); } /** - * @param null|array $data + * @param array|null $body + * @param array $query + * @param string|null $idempotencyKey + * @param bool $isv3 * @return array */ - private function prepareHeaders(?array $data = null) + private function prepareHeaders(?array $body = null, array $query = [], ?string $idempotencyKey = '', bool $isv3 = true): array { $headers = [ 'Api-Key' => $this->config->getApiKey(), 'User-Agent' => $this->getUserAgent(), - 'Accept' => 'application/json' + 'Accept' => 'application/json', ]; - if ($data) { + if ($isv3) { + $headers['Idempotency-Key'] = $idempotencyKey; + $headers['Signature'] = SignatureCalculator::generateV3( + $this->config->getApiKey(), + $this->config->getSignatureKey(), + $idempotencyKey, + $body ? json_encode($body, JSON_UNESCAPED_SLASHES) : '', + $query + ); + } + + if (!is_null($body)) { $headers['Content-Type'] = 'application/json'; - $headers['Signature'] = (string)new SignatureCalculator($this->config->getSignatureKey(), json_encode($data)); + if (!$isv3) { + $headers['Signature'] = SignatureCalculator::generate($this->config->getSignatureKey(), json_encode($body, JSON_UNESCAPED_SLASHES)); + } } return $headers; diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/HttpClientInterface.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/HttpClientInterface.php index 9608786d..a6e64161 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/HttpClientInterface.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/HttpClient/HttpClientInterface.php @@ -6,7 +6,9 @@ interface HttpClientInterface { public function post(string $url, array $data, ?string $idempotencyKey = null): ApiResponse; - public function patch(string $url, array $data): ApiResponse; + public function patch(string $url, array $data, ?string $idempotencyKey = null): ApiResponse; - public function get(string $url, ?string $query = null): ApiResponse; + public function get(string $url, ?string $query = null, ?string $idempotencyKey = null): ApiResponse; + + public function delete(string $url, string $idempotencyKey, ?string $query = null): ApiResponse; } diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/PaymentMethod.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/PaymentMethod.php index 00301db7..fd1bf9ed 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/PaymentMethod.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/PaymentMethod.php @@ -11,8 +11,12 @@ class PaymentMethod private $image; private $status; private $authorizationType; + /** + * @var SavedInstrument[] + */ + private $savedInstruments = []; - public function __construct($id, $type, $name, $description, $image, $status, $authorizationType) + public function __construct($id, $type, $name, $description, $image, $status, $authorizationType, $savedInstruments = []) { $this->id = $id; $this->type = $type; @@ -21,6 +25,18 @@ class PaymentMethod $this->image = $image; $this->status = $status; $this->authorizationType = $authorizationType; + if (!empty($savedInstruments)) { + foreach ($savedInstruments as $savedInstrument) { + $this->savedInstruments[] = new SavedInstrument( + $savedInstrument->name, + $savedInstrument->expirationDate, + $savedInstrument->brand, + $savedInstrument->image, + $savedInstrument->token, + $savedInstrument->status + ); + } + } } public function getId() @@ -65,4 +81,12 @@ class PaymentMethod { return $this->authorizationType; } + + /** + * @return SavedInstrument[] + */ + public function getSavedInstruments() + { + return $this->savedInstruments; + } } diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/Type.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/Type.php index 57bc5af4..d5e98a88 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/Type.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Model/PaymentMethods/Type.php @@ -9,4 +9,6 @@ class Type public const GOOGLE_PAY = 'GOOGLE_PAY'; public const APPLE_PAY = 'APPLE_PAY'; public const PBL = 'PBL'; + public const PAYPO = 'PAYPO'; + public const CLICK_TO_PAY = 'CLICK_TO_PAY'; } diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Response/PaymentMethods/PaymentMethods.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Response/PaymentMethods/PaymentMethods.php index d2273ce5..cd1b4e33 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Response/PaymentMethods/PaymentMethods.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Response/PaymentMethods/PaymentMethods.php @@ -10,7 +10,7 @@ class PaymentMethods /** * @var PaymentMethod[] */ - private $list; + private $list = []; public function __construct($body) { @@ -25,7 +25,8 @@ class PaymentMethods $item->description, $item->image, $item->status, - $item->authorizationType ?? null + $item->authorizationType ?? null, + $item->savedInstruments ?? [] ); } } diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/DataProcessing.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/DataProcessing.php index 0f5a4c0d..407d03c6 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/DataProcessing.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/DataProcessing.php @@ -13,25 +13,30 @@ class DataProcessing extends Service * Retrieve data processing notice * * @param string|null $locale - * - * @throws PaynowException + * @param string|null $idempotencyKey * @return Notices + * @throws PaynowException */ - public function getNotices(?string $locale): Notices + public function getNotices(?string $locale, ?string $idempotencyKey = null): Notices { $parameters = []; - if (! empty($locale)) { + if (!empty($locale)) { $parameters['locale'] = $locale; } try { + if (empty($idempotencyKey)) { + $idempotencyKey = md5(($locale ?? '') . '_' . $this->getClient()->getConfiguration()->getApiKey()); + } + $decodedApiResponse = $this->getClient() - ->getHttpClient() - ->get( - Configuration::API_VERSION . "/payments/dataprocessing/notices", - http_build_query($parameters, '', '&') - ) - ->decode(); + ->getHttpClient() + ->get( + Configuration::API_VERSION_V3 . "/payments/dataprocessing/notices", + http_build_query($parameters, '', '&'), + $idempotencyKey + ) + ->decode(); return new Notices($decodedApiResponse); } catch (HttpClientException $exception) { diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/Payment.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/Payment.php index fbc221e7..018e6309 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/Payment.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/Payment.php @@ -16,25 +16,29 @@ class Payment extends Service * * @param array $data * @param string|null $idempotencyKey - * @throws PaynowException * @return Authorize + * @throws PaynowException */ public function authorize(array $data, ?string $idempotencyKey = null): Authorize { try { + if (empty($idempotencyKey)) { + $idempotencyKey = ($data['externalId'] ?? null) ? md5($data['externalId']) : md5('_' . $this->getClient()->getConfiguration()->getApiKey()); + } + $decodedApiResponse = $this->getClient() ->getHttpClient() ->post( - '/' . Configuration::API_VERSION . '/payments', + '/' . Configuration::API_VERSION_V3 . '/payments', $data, - $idempotencyKey ?? $data['externalId'] + $idempotencyKey ) ->decode(); return new Authorize( $decodedApiResponse->paymentId, $decodedApiResponse->status, - ! empty($decodedApiResponse->redirectUrl) ? $decodedApiResponse->redirectUrl : null + !empty($decodedApiResponse->redirectUrl) ? $decodedApiResponse->redirectUrl : null ); } catch (HttpClientException $exception) { throw new PaynowException( @@ -52,30 +56,42 @@ class Payment extends Service * @param string|null $currency * @param int|null $amount * @param bool $applePayEnabled + * @param string|null $idempotencyKey + * @param string|null $buyerExternalId * @return PaymentMethods * @throws PaynowException */ - public function getPaymentMethods(?string $currency = null, ?int $amount = 0, bool $applePayEnabled = true): PaymentMethods + public function getPaymentMethods(?string $currency = null, ?int $amount = 0, bool $applePayEnabled = true, ?string $idempotencyKey = null, ?string $buyerExternalId = null): PaymentMethods { - $parameters = [ - 'applePayEnabled' => $applePayEnabled, - ]; - if (! empty($currency)) { - $parameters['currency'] = $currency; - } + $parameters = []; if ($amount > 0) { $parameters['amount'] = $amount; } + $parameters['applePayEnabled'] = $applePayEnabled; + + if (!empty($currency)) { + $parameters['currency'] = $currency; + } + + if (!empty($buyerExternalId)) { + $parameters['externalBuyerId'] = $buyerExternalId; + } + try { + if (empty($idempotencyKey)) { + $idempotencyKey = md5($currency . '_' . $amount . '_' . $this->getClient()->getConfiguration()->getApiKey()); + } + $decodedApiResponse = $this->getClient() - ->getHttpClient() - ->get( - Configuration::API_VERSION_V2 . '/payments/paymentmethods', - http_build_query($parameters, '', '&') - ) - ->decode(); + ->getHttpClient() + ->get( + Configuration::API_VERSION_V3 . '/payments/paymentmethods', + http_build_query($parameters, '', '&'), + $idempotencyKey + ) + ->decode(); return new PaymentMethods($decodedApiResponse); } catch (HttpClientException $exception) { throw new PaynowException( @@ -87,19 +103,59 @@ class Payment extends Service } } + /** + * @param string $externalBuyerId + * @param string $token + * @param string $idempotencyKey + * @throws PaynowException + */ + public function removeSavedInstrument(string $externalBuyerId, string $token, string $idempotencyKey): void + { + $parameters = [ + 'externalBuyerId' => $externalBuyerId, + 'token' => $token, + ]; + + try { + $this->getClient() + ->getHttpClient() + ->delete( + Configuration::API_VERSION_V3 . '/payments/paymentmethods/saved', + $idempotencyKey, + http_build_query($parameters, '', '&') + ); + } catch (HttpClientException $exception) { + throw new PaynowException( + $exception->getMessage(), + $exception->getStatus(), + $exception->getBody(), + $exception + ); + } + } + /** * Retrieve payment status * * @param string $paymentId - * @throws PaynowException + * @param string|null $idempotencyKey * @return Status + * @throws PaynowException */ - public function status(string $paymentId): Status + public function status(string $paymentId, ?string $idempotencyKey = null): Status { try { + if (empty($idempotencyKey)) { + $idempotencyKey = md5($paymentId); + } + $decodedApiResponse = $this->getClient() ->getHttpClient() - ->get(Configuration::API_VERSION . "/payments/$paymentId/status") + ->get( + Configuration::API_VERSION_V3 . "/payments/$paymentId/status", + null, + $idempotencyKey + ) ->decode(); return new Status($decodedApiResponse->paymentId, $decodedApiResponse->status); diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/Refund.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/Refund.php index a9f347f5..ac0c3f89 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/Refund.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/Refund.php @@ -16,8 +16,8 @@ class Refund extends Service * @param string $idempotencyKey * @param int $amount * @param null $reason - * @throws PaynowException * @return Status + * @throws PaynowException */ public function create(string $paymentId, string $idempotencyKey, int $amount, $reason = null): Status { @@ -25,7 +25,7 @@ class Refund extends Service $decodedApiResponse = $this->getClient() ->getHttpClient() ->post( - '/' . Configuration::API_VERSION . '/payments/' . $paymentId . '/refunds', + '/' . Configuration::API_VERSION_V3 . '/payments/' . $paymentId . '/refunds', [ 'amount' => $amount, 'reason' => $reason @@ -45,17 +45,25 @@ class Refund extends Service } /** - * Retrieve refund status * @param $refundId - * @throws PaynowException + * @param string|null $idempotencyKey * @return Status + * @throws PaynowException */ - public function status($refundId): Status + public function status($refundId, ?string $idempotencyKey = null): Status { try { + if (empty($idempotencyKey)) { + $idempotencyKey = md5($refundId); + } + $decodedApiResponse = $this->getClient() ->getHttpClient() - ->get(Configuration::API_VERSION . "/refunds/$refundId/status") + ->get( + Configuration::API_VERSION_V3 . "/refunds/$refundId/status", + null, + $idempotencyKey + ) ->decode(); return new Status($decodedApiResponse->refundId, $decodedApiResponse->status); diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/ShopConfiguration.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/ShopConfiguration.php index f4aaa1ed..4f996ba6 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/ShopConfiguration.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Service/ShopConfiguration.php @@ -9,24 +9,35 @@ use Paynow\HttpClient\HttpClientException; class ShopConfiguration extends Service { - /** - * @param string $continueUrl - * @param string $notificationUrl - * @throws PaynowException - * @return ApiResponse - */ - public function changeUrls(string $continueUrl, string $notificationUrl) + public const STATUS_ENABLED = 'ENABLED'; + public const STATUS_DISABLED = 'DISABLED'; + public const STATUS_UNINSTALLED = 'UNINSTALLED'; + public const STATUS_UPDATED = 'UPDATED'; + + /** + * @param string $continueUrl + * @param string $notificationUrl + * @param string|null $idempotencyKey + * @return ApiResponse + * @throws PaynowException + */ + public function changeUrls(string $continueUrl, string $notificationUrl, ?string $idempotencyKey = null): ApiResponse { $data = [ 'continueUrl' => $continueUrl, 'notificationUrl' => $notificationUrl, ]; try { + if (empty($idempotencyKey)) { + $idempotencyKey = md5($this->getClient()->getConfiguration()->getApiKey()); + } + return $this->getClient() ->getHttpClient() ->patch( - '/' . Configuration::API_VERSION.'/configuration/shop/urls', - $data + '/' . Configuration::API_VERSION_V3 . '/configuration/shop/urls', + $data, + $idempotencyKey ); } catch (HttpClientException $exception) { throw new PaynowException( @@ -37,4 +48,31 @@ class ShopConfiguration extends Service ); } } + + /** + * @param array $statuses + * @return ApiResponse + * @throws PaynowException + */ + public function status(array $statuses): ApiResponse + { + try { + $idempotencyKey = md5($this->getClient()->getConfiguration()->getApiKey()); + + return $this->getClient() + ->getHttpClient() + ->post( + '/' . Configuration::API_VERSION_V3 . '/configuration/shop/plugin/status', + $statuses, + $idempotencyKey + ); + } catch (HttpClientException $exception) { + throw new PaynowException( + $exception->getMessage(), + $exception->getStatus(), + $exception->getBody(), + $exception + ); + } + } } diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Util/SignatureCalculator.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Util/SignatureCalculator.php index 2871a386..6a901adf 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Util/SignatureCalculator.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/src/Paynow/Util/SignatureCalculator.php @@ -15,6 +15,56 @@ class SignatureCalculator * @throws InvalidArgumentException */ public function __construct(string $signatureKey, string $data) + { + $this->hash = self::generate($signatureKey, $data); + } + + /** + * @param string $apiKey + * @param string $signatureKey + * @param string $idempotencyKey + * @param string $data + * @param array $parameters + * @return string + */ + public static function generateV3(string $apiKey, string $signatureKey, string $idempotencyKey, string $data = '', array $parameters = []): string + { + if (empty($apiKey)) { + throw new InvalidArgumentException('You did not provide a api key'); + } + + if (empty($signatureKey)) { + throw new InvalidArgumentException('You did not provide a Signature key'); + } + + if (empty($idempotencyKey)) { + throw new InvalidArgumentException('You did not provide a idempotency key'); + } + + $parsedParameters = []; + + foreach ($parameters as $key => $value) { + $parsedParameters[$key] = is_array($value) ? $value : [$value]; + } + + $signatureBody = [ + 'headers' => [ + 'Api-Key' => $apiKey, + 'Idempotency-Key' => $idempotencyKey, + ], + 'parameters' => $parsedParameters ?: new \stdClass(), + 'body' => $data, + ]; + + return base64_encode(hash_hmac('sha256', json_encode($signatureBody, JSON_UNESCAPED_SLASHES), $signatureKey, true)); + } + + /** + * @param string $signatureKey + * @param string $data + * @return string + */ + public static function generate(string $signatureKey, string $data): string { if (empty($signatureKey)) { throw new InvalidArgumentException('You did not provide a Signature key'); @@ -23,7 +73,8 @@ class SignatureCalculator if (empty($data)) { throw new InvalidArgumentException('You did not provide any data'); } - $this->hash = base64_encode(hash_hmac('sha256', $data, $signatureKey, true)); + + return base64_encode(hash_hmac('sha256', $data, $signatureKey, true)); } /** diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/tests/NotificationTest.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/tests/NotificationTest.php index 7738b7e2..3a4087d3 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/tests/NotificationTest.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/tests/NotificationTest.php @@ -13,6 +13,7 @@ class NotificationTest extends TestCase * @param $payload * @param $headers * @throws SignatureVerificationException + * @suppress PhanNoopNew */ public function testVerifyPayloadSuccessfully($payload, $headers) { @@ -40,6 +41,11 @@ class NotificationTest extends TestCase ]; } + /** + * @return void + * @throws SignatureVerificationException + * @suppress PhanNoopNew + */ public function testShouldThrowExceptionOnIncorrectSignature() { // given @@ -53,12 +59,14 @@ class NotificationTest extends TestCase // then } + /** + * @suppress PhanNoopNew + * @return void + */ public function testShouldThrowExceptionOnMissingPayload() { // given $this->expectException(InvalidArgumentException::class); - $payload = null; - $headers = []; // when new Notification('s3ecret-k3y', null, null); @@ -66,12 +74,16 @@ class NotificationTest extends TestCase // then } + /** + * @return void + * @throws SignatureVerificationException + * @suppress PhanNoopNew + */ public function testShouldThrowExceptionOnMissingPayloadHeaders() { // given $this->expectException(InvalidArgumentException::class); $payload = $this->loadData('notification.json', true); - $headers = null; // when new Notification('s3ecret-k3y', $payload, null); diff --git a/modules/paynow/vendor/pay-now/paynow-php-sdk/tests/TestCase.php b/modules/paynow/vendor/pay-now/paynow-php-sdk/tests/TestCase.php index e781f10a..1957e1af 100644 --- a/modules/paynow/vendor/pay-now/paynow-php-sdk/tests/TestCase.php +++ b/modules/paynow/vendor/pay-now/paynow-php-sdk/tests/TestCase.php @@ -12,6 +12,9 @@ class TestCase extends BaseTestCase protected $client; + /** + * @suppress PhanAccessMethodInternal + */ public function __construct($name = null, array $data = [], $dataName = '') { $this->client = new Client( diff --git a/modules/paynow/vendor/php-http/curl-client/composer.json b/modules/paynow/vendor/php-http/curl-client/composer.json index 78b4a460..f332007c 100644 --- a/modules/paynow/vendor/php-http/curl-client/composer.json +++ b/modules/paynow/vendor/php-http/curl-client/composer.json @@ -22,13 +22,14 @@ "php-http/message": "^1.2", "psr/http-client": "^1.0", "psr/http-factory-implementation": "^1.0", - "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0" + "symfony/options-resolver": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { "guzzlehttp/psr7": "^1.0", "php-http/client-integration-tests": "^3.0", "phpunit/phpunit": "^7.5 || ^9.4", - "laminas/laminas-diactoros": "^2.0" + "laminas/laminas-diactoros": "^2.0", + "php-http/message-factory": "^1.1" }, "autoload": { "psr-4": { @@ -48,5 +49,10 @@ "scripts": { "test": "vendor/bin/phpunit", "test-ci": "vendor/bin/phpunit --coverage-clover build/coverage.xml" + }, + "config": { + "allow-plugins": { + "php-http/discovery": false + } } } diff --git a/modules/paynow/vendor/php-http/discovery/composer.json b/modules/paynow/vendor/php-http/discovery/composer.json index d38ab83b..9d718bba 100644 --- a/modules/paynow/vendor/php-http/discovery/composer.json +++ b/modules/paynow/vendor/php-http/discovery/composer.json @@ -28,7 +28,8 @@ "php-http/httplug": "^1.0 || ^2.0", "php-http/message-factory": "^1.0", "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", - "symfony/phpunit-bridge": "^6.2" + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1", + "sebastian/comparator": "^3.0.5 || ^4.0.8" }, "autoload": { "psr-4": { diff --git a/modules/paynow/vendor/php-http/discovery/src/Composer/Plugin.php b/modules/paynow/vendor/php-http/discovery/src/Composer/Plugin.php index 32ef401e..9339f8b5 100644 --- a/modules/paynow/vendor/php-http/discovery/src/Composer/Plugin.php +++ b/modules/paynow/vendor/php-http/discovery/src/Composer/Plugin.php @@ -452,12 +452,21 @@ EOPHP private function updateComposerLock(Composer $composer, IOInterface $io) { + if (false === $composer->getConfig()->get('lock')) { + return; + } + $lock = substr(Factory::getComposerFile(), 0, -4).'lock'; $composerJson = file_get_contents(Factory::getComposerFile()); $lockFile = new JsonFile($lock, null, $io); $locker = ClassDiscovery::safeClassExists(RepositorySet::class) ? new Locker($io, $lockFile, $composer->getInstallationManager(), $composerJson) : new Locker($io, $lockFile, $composer->getRepositoryManager(), $composer->getInstallationManager(), $composerJson); + + if (!$locker->isLocked()) { + return; + } + $lockData = $locker->getLockData(); $lockData['content-hash'] = Locker::getContentHash($composerJson); $lockFile->write($lockData); diff --git a/modules/paynow/vendor/php-http/discovery/src/NotFoundException.php b/modules/paynow/vendor/php-http/discovery/src/NotFoundException.php index d59dadbf..559afac7 100644 --- a/modules/paynow/vendor/php-http/discovery/src/NotFoundException.php +++ b/modules/paynow/vendor/php-http/discovery/src/NotFoundException.php @@ -2,6 +2,8 @@ namespace Http\Discovery; +use Http\Discovery\Exception\NotFoundException as RealNotFoundException; + /** * Thrown when a discovery does not find any matches. * @@ -9,6 +11,6 @@ namespace Http\Discovery; * * @deprecated since since version 1.0, and will be removed in 2.0. Use {@link \Http\Discovery\Exception\NotFoundException} instead. */ -final class NotFoundException extends \Http\Discovery\Exception\NotFoundException +final class NotFoundException extends RealNotFoundException { } diff --git a/modules/paynow/vendor/php-http/discovery/src/Psr17Factory.php b/modules/paynow/vendor/php-http/discovery/src/Psr17Factory.php index 5d3ab927..f8fbfd13 100644 --- a/modules/paynow/vendor/php-http/discovery/src/Psr17Factory.php +++ b/modules/paynow/vendor/php-http/discovery/src/Psr17Factory.php @@ -49,12 +49,12 @@ class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, private $uriFactory; public function __construct( - RequestFactoryInterface $requestFactory = null, - ResponseFactoryInterface $responseFactory = null, - ServerRequestFactoryInterface $serverRequestFactory = null, - StreamFactoryInterface $streamFactory = null, - UploadedFileFactoryInterface $uploadedFileFactory = null, - UriFactoryInterface $uriFactory = null + ?RequestFactoryInterface $requestFactory = null, + ?ResponseFactoryInterface $responseFactory = null, + ?ServerRequestFactoryInterface $serverRequestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?UploadedFileFactoryInterface $uploadedFileFactory = null, + ?UriFactoryInterface $uriFactory = null ) { $this->requestFactory = $requestFactory; $this->responseFactory = $responseFactory; @@ -98,7 +98,7 @@ class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, return $factory->createServerRequest(...\func_get_args()); } - public function createServerRequestFromGlobals(array $server = null, array $get = null, array $post = null, array $cookie = null, array $files = null, StreamInterface $body = null): ServerRequestInterface + public function createServerRequestFromGlobals(?array $server = null, ?array $get = null, ?array $post = null, ?array $cookie = null, ?array $files = null, ?StreamInterface $body = null): ServerRequestInterface { $server = $server ?? $_SERVER; $request = $this->createServerRequest($server['REQUEST_METHOD'] ?? 'GET', $this->createUriFromGlobals($server), $server); @@ -134,7 +134,7 @@ class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, return $factory->createStreamFromResource($resource); } - public function createUploadedFile(StreamInterface $stream, int $size = null, int $error = \UPLOAD_ERR_OK, string $clientFilename = null, string $clientMediaType = null): UploadedFileInterface + public function createUploadedFile(StreamInterface $stream, ?int $size = null, int $error = \UPLOAD_ERR_OK, ?string $clientFilename = null, ?string $clientMediaType = null): UploadedFileInterface { $factory = $this->uploadedFileFactory ?? $this->setFactory(Psr17FactoryDiscovery::findUploadedFileFactory()); @@ -148,7 +148,7 @@ class Psr17Factory implements RequestFactoryInterface, ResponseFactoryInterface, return $factory->createUri(...\func_get_args()); } - public function createUriFromGlobals(array $server = null): UriInterface + public function createUriFromGlobals(?array $server = null): UriInterface { return $this->buildUriFromGlobals($this->createUri(''), $server ?? $_SERVER); } diff --git a/modules/paynow/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php b/modules/paynow/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php index a73c6414..e4348b45 100644 --- a/modules/paynow/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php +++ b/modules/paynow/vendor/php-http/discovery/src/Psr17FactoryDiscovery.php @@ -3,6 +3,7 @@ namespace Http\Discovery; use Http\Discovery\Exception\DiscoveryFailedException; +use Http\Discovery\Exception\NotFoundException as RealNotFoundException; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\ServerRequestFactoryInterface; @@ -19,7 +20,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery { private static function createException($type, Exception $e) { - return new \Http\Discovery\Exception\NotFoundException( + return new RealNotFoundException( 'No PSR-17 '.$type.' found. Install a package from this list: https://packagist.org/providers/psr/http-factory-implementation', 0, $e @@ -29,7 +30,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery /** * @return RequestFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findRequestFactory() { @@ -45,7 +46,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery /** * @return ResponseFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findResponseFactory() { @@ -61,7 +62,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery /** * @return ServerRequestFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findServerRequestFactory() { @@ -77,7 +78,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery /** * @return StreamFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findStreamFactory() { @@ -93,7 +94,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery /** * @return UploadedFileFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findUploadedFileFactory() { @@ -109,7 +110,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery /** * @return UriFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function findUriFactory() { @@ -125,7 +126,7 @@ final class Psr17FactoryDiscovery extends ClassDiscovery /** * @return UriFactoryInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException * * @deprecated This will be removed in 2.0. Consider using the findUriFactory() method. */ diff --git a/modules/paynow/vendor/php-http/discovery/src/Psr18Client.php b/modules/paynow/vendor/php-http/discovery/src/Psr18Client.php index c47780ec..48df7836 100644 --- a/modules/paynow/vendor/php-http/discovery/src/Psr18Client.php +++ b/modules/paynow/vendor/php-http/discovery/src/Psr18Client.php @@ -25,14 +25,21 @@ class Psr18Client extends Psr17Factory implements ClientInterface private $client; public function __construct( - ClientInterface $client = null, - RequestFactoryInterface $requestFactory = null, - ResponseFactoryInterface $responseFactory = null, - ServerRequestFactoryInterface $serverRequestFactory = null, - StreamFactoryInterface $streamFactory = null, - UploadedFileFactoryInterface $uploadedFileFactory = null, - UriFactoryInterface $uriFactory = null + ?ClientInterface $client = null, + ?RequestFactoryInterface $requestFactory = null, + ?ResponseFactoryInterface $responseFactory = null, + ?ServerRequestFactoryInterface $serverRequestFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?UploadedFileFactoryInterface $uploadedFileFactory = null, + ?UriFactoryInterface $uriFactory = null ) { + $requestFactory ?? $requestFactory = $client instanceof RequestFactoryInterface ? $client : null; + $responseFactory ?? $responseFactory = $client instanceof ResponseFactoryInterface ? $client : null; + $serverRequestFactory ?? $serverRequestFactory = $client instanceof ServerRequestFactoryInterface ? $client : null; + $streamFactory ?? $streamFactory = $client instanceof StreamFactoryInterface ? $client : null; + $uploadedFileFactory ?? $uploadedFileFactory = $client instanceof UploadedFileFactoryInterface ? $client : null; + $uriFactory ?? $uriFactory = $client instanceof UriFactoryInterface ? $client : null; + parent::__construct($requestFactory, $responseFactory, $serverRequestFactory, $streamFactory, $uploadedFileFactory, $uriFactory); $this->client = $client ?? Psr18ClientDiscovery::find(); diff --git a/modules/paynow/vendor/php-http/discovery/src/Psr18ClientDiscovery.php b/modules/paynow/vendor/php-http/discovery/src/Psr18ClientDiscovery.php index dfd2dd1e..3f95418c 100644 --- a/modules/paynow/vendor/php-http/discovery/src/Psr18ClientDiscovery.php +++ b/modules/paynow/vendor/php-http/discovery/src/Psr18ClientDiscovery.php @@ -3,6 +3,7 @@ namespace Http\Discovery; use Http\Discovery\Exception\DiscoveryFailedException; +use Http\Discovery\Exception\NotFoundException as RealNotFoundException; use Psr\Http\Client\ClientInterface; /** @@ -17,14 +18,14 @@ final class Psr18ClientDiscovery extends ClassDiscovery * * @return ClientInterface * - * @throws Exception\NotFoundException + * @throws RealNotFoundException */ public static function find() { try { $client = static::findOneByType(ClientInterface::class); } catch (DiscoveryFailedException $e) { - throw new \Http\Discovery\Exception\NotFoundException('No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle7-adapter".', 0, $e); + throw new RealNotFoundException('No PSR-18 clients found. Make sure to install a package providing "psr/http-client-implementation". Example: "php-http/guzzle7-adapter".', 0, $e); } return static::instantiateClass($client); diff --git a/modules/paynow/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php b/modules/paynow/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php index ae0b0d84..0fa4240b 100644 --- a/modules/paynow/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php +++ b/modules/paynow/vendor/php-http/discovery/src/Strategy/CommonClassesStrategy.php @@ -78,7 +78,7 @@ final class CommonClassesStrategy implements DiscoveryStrategy ['class' => React::class, 'condition' => React::class], ], HttpClient::class => [ - ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, [self::class, 'isPsr17FactoryInstalled']]], + ['class' => SymfonyHttplug::class, 'condition' => [SymfonyHttplug::class, [self::class, 'isPsr17FactoryInstalled'], [self::class, 'isSymfonyImplementingHttpClient']]], ['class' => Guzzle7::class, 'condition' => Guzzle7::class], ['class' => Guzzle6::class, 'condition' => Guzzle6::class], ['class' => Guzzle5::class, 'condition' => Guzzle5::class], @@ -158,6 +158,11 @@ final class CommonClassesStrategy implements DiscoveryStrategy return defined('GuzzleHttp\ClientInterface::MAJOR_VERSION'); } + public static function isSymfonyImplementingHttpClient() + { + return is_subclass_of(SymfonyHttplug::class, HttpClient::class); + } + /** * Can be used as a condition. * diff --git a/modules/paynow/vendor/php-http/httplug/src/Exception/HttpException.php b/modules/paynow/vendor/php-http/httplug/src/Exception/HttpException.php index 6c2a007a..8af32f12 100644 --- a/modules/paynow/vendor/php-http/httplug/src/Exception/HttpException.php +++ b/modules/paynow/vendor/php-http/httplug/src/Exception/HttpException.php @@ -26,7 +26,7 @@ class HttpException extends RequestException $message, RequestInterface $request, ResponseInterface $response, - \Exception $previous = null + ?\Exception $previous = null ) { parent::__construct($message, $request, $previous); @@ -50,7 +50,7 @@ class HttpException extends RequestException public static function create( RequestInterface $request, ResponseInterface $response, - \Exception $previous = null + ?\Exception $previous = null ) { $message = sprintf( '[url] %s [http method] %s [status code] %s [reason phrase] %s', diff --git a/modules/paynow/vendor/php-http/httplug/src/Exception/NetworkException.php b/modules/paynow/vendor/php-http/httplug/src/Exception/NetworkException.php index 9b4f1e8f..ce5f4d7a 100644 --- a/modules/paynow/vendor/php-http/httplug/src/Exception/NetworkException.php +++ b/modules/paynow/vendor/php-http/httplug/src/Exception/NetworkException.php @@ -19,7 +19,7 @@ class NetworkException extends TransferException implements PsrNetworkException /** * @param string $message */ - public function __construct($message, RequestInterface $request, \Exception $previous = null) + public function __construct($message, RequestInterface $request, ?\Exception $previous = null) { $this->setRequest($request); diff --git a/modules/paynow/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php b/modules/paynow/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php index 71b4bb8c..f507982a 100644 --- a/modules/paynow/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php +++ b/modules/paynow/vendor/php-http/httplug/src/Exception/RequestAwareTrait.php @@ -16,9 +16,6 @@ trait RequestAwareTrait $this->request = $request; } - /** - * {@inheritdoc} - */ public function getRequest(): RequestInterface { return $this->request; diff --git a/modules/paynow/vendor/php-http/httplug/src/Exception/RequestException.php b/modules/paynow/vendor/php-http/httplug/src/Exception/RequestException.php index f6c60ce5..dbed296a 100644 --- a/modules/paynow/vendor/php-http/httplug/src/Exception/RequestException.php +++ b/modules/paynow/vendor/php-http/httplug/src/Exception/RequestException.php @@ -20,7 +20,7 @@ class RequestException extends TransferException implements PsrRequestException /** * @param string $message */ - public function __construct($message, RequestInterface $request, \Exception $previous = null) + public function __construct($message, RequestInterface $request, ?\Exception $previous = null) { $this->setRequest($request); diff --git a/modules/paynow/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php b/modules/paynow/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php index 1ad32cd5..ccdf48ed 100644 --- a/modules/paynow/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php +++ b/modules/paynow/vendor/php-http/httplug/src/Promise/HttpFulfilledPromise.php @@ -18,10 +18,7 @@ final class HttpFulfilledPromise implements Promise $this->response = $response; } - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onFulfilled) { return $this; @@ -34,17 +31,11 @@ final class HttpFulfilledPromise implements Promise } } - /** - * {@inheritdoc} - */ public function getState() { return Promise::FULFILLED; } - /** - * {@inheritdoc} - */ public function wait($unwrap = true) { if ($unwrap) { diff --git a/modules/paynow/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php b/modules/paynow/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php index 624cc8a9..a489ad4f 100644 --- a/modules/paynow/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php +++ b/modules/paynow/vendor/php-http/httplug/src/Promise/HttpRejectedPromise.php @@ -17,10 +17,7 @@ final class HttpRejectedPromise implements Promise $this->exception = $exception; } - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onRejected) { return $this; @@ -38,17 +35,11 @@ final class HttpRejectedPromise implements Promise } } - /** - * {@inheritdoc} - */ public function getState() { return Promise::REJECTED; } - /** - * {@inheritdoc} - */ public function wait($unwrap = true) { if ($unwrap) { diff --git a/modules/paynow/vendor/php-http/message/composer.json b/modules/paynow/vendor/php-http/message/composer.json index 0ecaad9f..37a86a70 100644 --- a/modules/paynow/vendor/php-http/message/composer.json +++ b/modules/paynow/vendor/php-http/message/composer.json @@ -15,10 +15,9 @@ } ], "require": { - "php": "^7.1 || ^8.0", + "php": "^7.2 || ^8.0", "clue/stream-filter": "^1.5", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0 || ^2.0" + "psr/http-message": "^1.1 || ^2.0" }, "provide": { "php-http/message-factory-implementation": "1.0" @@ -26,10 +25,11 @@ "require-dev": { "ext-zlib": "*", "ergebnis/composer-normalize": "^2.6", - "guzzlehttp/psr7": "^1.0", + "guzzlehttp/psr7": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0.2", "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", "slim/slim": "^3.0", - "laminas/laminas-diactoros": "^2.0" + "laminas/laminas-diactoros": "^2.0 || ^3.0" }, "suggest": { "ext-zlib": "Used with compressor/decompressor streams", diff --git a/modules/paynow/vendor/php-http/message/src/Authentication/AutoBasicAuth.php b/modules/paynow/vendor/php-http/message/src/Authentication/AutoBasicAuth.php index 7b6a4294..6120016f 100644 --- a/modules/paynow/vendor/php-http/message/src/Authentication/AutoBasicAuth.php +++ b/modules/paynow/vendor/php-http/message/src/Authentication/AutoBasicAuth.php @@ -27,9 +27,6 @@ final class AutoBasicAuth implements Authentication $this->shouldRemoveUserInfo = (bool) $shouldRremoveUserInfo; } - /** - * {@inheritdoc} - */ public function authenticate(RequestInterface $request) { $uri = $request->getUri(); diff --git a/modules/paynow/vendor/php-http/message/src/Authentication/BasicAuth.php b/modules/paynow/vendor/php-http/message/src/Authentication/BasicAuth.php index 23618a53..85b13a2e 100644 --- a/modules/paynow/vendor/php-http/message/src/Authentication/BasicAuth.php +++ b/modules/paynow/vendor/php-http/message/src/Authentication/BasicAuth.php @@ -32,9 +32,6 @@ final class BasicAuth implements Authentication $this->password = $password; } - /** - * {@inheritdoc} - */ public function authenticate(RequestInterface $request) { $header = sprintf('Basic %s', base64_encode(sprintf('%s:%s', $this->username, $this->password))); diff --git a/modules/paynow/vendor/php-http/message/src/Authentication/Bearer.php b/modules/paynow/vendor/php-http/message/src/Authentication/Bearer.php index a8fb21a1..287de2d5 100644 --- a/modules/paynow/vendor/php-http/message/src/Authentication/Bearer.php +++ b/modules/paynow/vendor/php-http/message/src/Authentication/Bearer.php @@ -25,9 +25,6 @@ final class Bearer implements Authentication $this->token = $token; } - /** - * {@inheritdoc} - */ public function authenticate(RequestInterface $request) { $header = sprintf('Bearer %s', $this->token); diff --git a/modules/paynow/vendor/php-http/message/src/Authentication/Chain.php b/modules/paynow/vendor/php-http/message/src/Authentication/Chain.php index 71002bb1..d1d36d52 100644 --- a/modules/paynow/vendor/php-http/message/src/Authentication/Chain.php +++ b/modules/paynow/vendor/php-http/message/src/Authentication/Chain.php @@ -33,9 +33,6 @@ final class Chain implements Authentication $this->authenticationChain = $authenticationChain; } - /** - * {@inheritdoc} - */ public function authenticate(RequestInterface $request) { foreach ($this->authenticationChain as $authentication) { diff --git a/modules/paynow/vendor/php-http/message/src/Authentication/Header.php b/modules/paynow/vendor/php-http/message/src/Authentication/Header.php index 77f63827..5b1b2e09 100644 --- a/modules/paynow/vendor/php-http/message/src/Authentication/Header.php +++ b/modules/paynow/vendor/php-http/message/src/Authentication/Header.php @@ -26,9 +26,6 @@ class Header implements Authentication $this->value = $value; } - /** - * {@inheritdoc} - */ public function authenticate(RequestInterface $request) { return $request->withHeader($this->name, $this->value); diff --git a/modules/paynow/vendor/php-http/message/src/Authentication/Matching.php b/modules/paynow/vendor/php-http/message/src/Authentication/Matching.php index 7a5c247b..cbef52ef 100644 --- a/modules/paynow/vendor/php-http/message/src/Authentication/Matching.php +++ b/modules/paynow/vendor/php-http/message/src/Authentication/Matching.php @@ -27,7 +27,7 @@ final class Matching implements Authentication */ private $matcher; - public function __construct(Authentication $authentication, callable $matcher = null) + public function __construct(Authentication $authentication, ?callable $matcher = null) { if (is_null($matcher)) { $matcher = function () { @@ -39,9 +39,6 @@ final class Matching implements Authentication $this->matcher = new CallbackRequestMatcher($matcher); } - /** - * {@inheritdoc} - */ public function authenticate(RequestInterface $request) { if ($this->matcher->matches($request)) { diff --git a/modules/paynow/vendor/php-http/message/src/Authentication/QueryParam.php b/modules/paynow/vendor/php-http/message/src/Authentication/QueryParam.php index 243efef3..bc7b0208 100644 --- a/modules/paynow/vendor/php-http/message/src/Authentication/QueryParam.php +++ b/modules/paynow/vendor/php-http/message/src/Authentication/QueryParam.php @@ -25,9 +25,6 @@ final class QueryParam implements Authentication $this->params = $params; } - /** - * {@inheritdoc} - */ public function authenticate(RequestInterface $request) { $uri = $request->getUri(); diff --git a/modules/paynow/vendor/php-http/message/src/Authentication/RequestConditional.php b/modules/paynow/vendor/php-http/message/src/Authentication/RequestConditional.php index 01062cf6..fefe44e7 100644 --- a/modules/paynow/vendor/php-http/message/src/Authentication/RequestConditional.php +++ b/modules/paynow/vendor/php-http/message/src/Authentication/RequestConditional.php @@ -29,9 +29,6 @@ final class RequestConditional implements Authentication $this->authentication = $authentication; } - /** - * {@inheritdoc} - */ public function authenticate(RequestInterface $request) { if ($this->requestMatcher->matches($request)) { diff --git a/modules/paynow/vendor/php-http/message/src/Authentication/Wsse.php b/modules/paynow/vendor/php-http/message/src/Authentication/Wsse.php index 88c266b8..9191efe9 100644 --- a/modules/paynow/vendor/php-http/message/src/Authentication/Wsse.php +++ b/modules/paynow/vendor/php-http/message/src/Authentication/Wsse.php @@ -42,9 +42,6 @@ final class Wsse implements Authentication $this->hashAlgorithm = $hashAlgorithm; } - /** - * {@inheritdoc} - */ public function authenticate(RequestInterface $request) { $nonce = substr(md5(uniqid(uniqid().'_', true)), 0, 16); diff --git a/modules/paynow/vendor/php-http/message/src/Cookie.php b/modules/paynow/vendor/php-http/message/src/Cookie.php index c6eaf51a..b79fe0ac 100644 --- a/modules/paynow/vendor/php-http/message/src/Cookie.php +++ b/modules/paynow/vendor/php-http/message/src/Cookie.php @@ -73,7 +73,7 @@ final class Cookie $path = null, $secure = false, $httpOnly = false, - \DateTime $expires = null + ?\DateTime $expires = null ) { $this->validateName($name); $this->validateValue($value); @@ -109,7 +109,7 @@ final class Cookie $path = null, $secure = false, $httpOnly = false, - \DateTime $expires = null + ?\DateTime $expires = null ) { $cookie = new self('name', null, null, $domain, $path, $secure, $httpOnly, $expires); $cookie->name = $name; @@ -228,7 +228,7 @@ final class Cookie * * @return Cookie */ - public function withExpires(\DateTime $expires = null) + public function withExpires(?\DateTime $expires = null) { $new = clone $this; $new->expires = $expires; @@ -511,7 +511,9 @@ final class Cookie */ private function normalizePath($path) { - $path = rtrim($path, '/'); + if (null !== $path) { + $path = rtrim($path, '/'); + } if (empty($path) or '/' !== substr($path, 0, 1)) { $path = '/'; diff --git a/modules/paynow/vendor/php-http/message/src/CookieJar.php b/modules/paynow/vendor/php-http/message/src/CookieJar.php index 165084d5..159a99f0 100644 --- a/modules/paynow/vendor/php-http/message/src/CookieJar.php +++ b/modules/paynow/vendor/php-http/message/src/CookieJar.php @@ -192,18 +192,12 @@ final class CookieJar implements \Countable, \IteratorAggregate $this->cookies = new \SplObjectStorage(); } - /** - * {@inheritdoc} - */ #[\ReturnTypeWillChange] public function count() { return $this->cookies->count(); } - /** - * {@inheritdoc} - */ #[\ReturnTypeWillChange] public function getIterator() { diff --git a/modules/paynow/vendor/php-http/message/src/Decorator/MessageDecorator.php b/modules/paynow/vendor/php-http/message/src/Decorator/MessageDecorator.php index 0ffc7caf..4ec46909 100644 --- a/modules/paynow/vendor/php-http/message/src/Decorator/MessageDecorator.php +++ b/modules/paynow/vendor/php-http/message/src/Decorator/MessageDecorator.php @@ -20,26 +20,18 @@ trait MessageDecorator * * Since the underlying Message is immutable as well * exposing it is not an issue, because it's state cannot be altered - * - * @return MessageInterface */ - public function getMessage() + public function getMessage(): MessageInterface { return $this->message; } - /** - * {@inheritdoc} - */ - public function getProtocolVersion() + public function getProtocolVersion(): string { return $this->message->getProtocolVersion(); } - /** - * {@inheritdoc} - */ - public function withProtocolVersion($version) + public function withProtocolVersion(string $version): MessageInterface { $new = clone $this; $new->message = $this->message->withProtocolVersion($version); @@ -47,42 +39,27 @@ trait MessageDecorator return $new; } - /** - * {@inheritdoc} - */ - public function getHeaders() + public function getHeaders(): array { return $this->message->getHeaders(); } - /** - * {@inheritdoc} - */ - public function hasHeader($header) + public function hasHeader(string $header): bool { return $this->message->hasHeader($header); } - /** - * {@inheritdoc} - */ - public function getHeader($header) + public function getHeader(string $header): array { return $this->message->getHeader($header); } - /** - * {@inheritdoc} - */ - public function getHeaderLine($header) + public function getHeaderLine(string $header): string { return $this->message->getHeaderLine($header); } - /** - * {@inheritdoc} - */ - public function withHeader($header, $value) + public function withHeader(string $header, $value): MessageInterface { $new = clone $this; $new->message = $this->message->withHeader($header, $value); @@ -90,10 +67,7 @@ trait MessageDecorator return $new; } - /** - * {@inheritdoc} - */ - public function withAddedHeader($header, $value) + public function withAddedHeader(string $header, $value): MessageInterface { $new = clone $this; $new->message = $this->message->withAddedHeader($header, $value); @@ -101,10 +75,7 @@ trait MessageDecorator return $new; } - /** - * {@inheritdoc} - */ - public function withoutHeader($header) + public function withoutHeader(string $header): MessageInterface { $new = clone $this; $new->message = $this->message->withoutHeader($header); @@ -112,18 +83,12 @@ trait MessageDecorator return $new; } - /** - * {@inheritdoc} - */ - public function getBody() + public function getBody(): StreamInterface { return $this->message->getBody(); } - /** - * {@inheritdoc} - */ - public function withBody(StreamInterface $body) + public function withBody(StreamInterface $body): MessageInterface { $new = clone $this; $new->message = $this->message->withBody($body); diff --git a/modules/paynow/vendor/php-http/message/src/Decorator/RequestDecorator.php b/modules/paynow/vendor/php-http/message/src/Decorator/RequestDecorator.php index bd254a8f..1392a760 100644 --- a/modules/paynow/vendor/php-http/message/src/Decorator/RequestDecorator.php +++ b/modules/paynow/vendor/php-http/message/src/Decorator/RequestDecorator.php @@ -16,10 +16,8 @@ trait RequestDecorator /** * Exchanges the underlying request with another. - * - * @return self */ - public function withRequest(RequestInterface $request) + public function withRequest(RequestInterface $request): RequestInterface { $new = clone $this; $new->message = $request; @@ -27,18 +25,12 @@ trait RequestDecorator return $new; } - /** - * {@inheritdoc} - */ - public function getRequestTarget() + public function getRequestTarget(): string { return $this->message->getRequestTarget(); } - /** - * {@inheritdoc} - */ - public function withRequestTarget($requestTarget) + public function withRequestTarget(string $requestTarget): RequestInterface { $new = clone $this; $new->message = $this->message->withRequestTarget($requestTarget); @@ -46,18 +38,12 @@ trait RequestDecorator return $new; } - /** - * {@inheritdoc} - */ - public function getMethod() + public function getMethod(): string { return $this->message->getMethod(); } - /** - * {@inheritdoc} - */ - public function withMethod($method) + public function withMethod(string $method): RequestInterface { $new = clone $this; $new->message = $this->message->withMethod($method); @@ -65,18 +51,12 @@ trait RequestDecorator return $new; } - /** - * {@inheritdoc} - */ - public function getUri() + public function getUri(): UriInterface { return $this->message->getUri(); } - /** - * {@inheritdoc} - */ - public function withUri(UriInterface $uri, $preserveHost = false) + public function withUri(UriInterface $uri, bool $preserveHost = false): RequestInterface { $new = clone $this; $new->message = $this->message->withUri($uri, $preserveHost); diff --git a/modules/paynow/vendor/php-http/message/src/Decorator/ResponseDecorator.php b/modules/paynow/vendor/php-http/message/src/Decorator/ResponseDecorator.php index 20319ed3..0b75438d 100644 --- a/modules/paynow/vendor/php-http/message/src/Decorator/ResponseDecorator.php +++ b/modules/paynow/vendor/php-http/message/src/Decorator/ResponseDecorator.php @@ -15,10 +15,8 @@ trait ResponseDecorator /** * Exchanges the underlying response with another. - * - * @return self */ - public function withResponse(ResponseInterface $response) + public function withResponse(ResponseInterface $response): ResponseInterface { $new = clone $this; $new->message = $response; @@ -26,18 +24,12 @@ trait ResponseDecorator return $new; } - /** - * {@inheritdoc} - */ - public function getStatusCode() + public function getStatusCode(): int { return $this->message->getStatusCode(); } - /** - * {@inheritdoc} - */ - public function withStatus($code, $reasonPhrase = '') + public function withStatus(int $code, string $reasonPhrase = ''): ResponseInterface { $new = clone $this; $new->message = $this->message->withStatus($code, $reasonPhrase); @@ -45,10 +37,7 @@ trait ResponseDecorator return $new; } - /** - * {@inheritdoc} - */ - public function getReasonPhrase() + public function getReasonPhrase(): string { return $this->message->getReasonPhrase(); } diff --git a/modules/paynow/vendor/php-http/message/src/Decorator/StreamDecorator.php b/modules/paynow/vendor/php-http/message/src/Decorator/StreamDecorator.php index f405c7af..90d93b4d 100644 --- a/modules/paynow/vendor/php-http/message/src/Decorator/StreamDecorator.php +++ b/modules/paynow/vendor/php-http/message/src/Decorator/StreamDecorator.php @@ -16,122 +16,77 @@ trait StreamDecorator */ protected $stream; - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return $this->stream->__toString(); } - /** - * {@inheritdoc} - */ - public function close() + public function close(): void { $this->stream->close(); } - /** - * {@inheritdoc} - */ public function detach() { return $this->stream->detach(); } - /** - * {@inheritdoc} - */ - public function getSize() + public function getSize(): ?int { return $this->stream->getSize(); } - /** - * {@inheritdoc} - */ - public function tell() + public function tell(): int { return $this->stream->tell(); } - /** - * {@inheritdoc} - */ - public function eof() + public function eof(): bool { return $this->stream->eof(); } - /** - * {@inheritdoc} - */ - public function isSeekable() + public function isSeekable(): bool { return $this->stream->isSeekable(); } - /** - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) + public function seek(int $offset, int $whence = SEEK_SET): void { $this->stream->seek($offset, $whence); } - /** - * {@inheritdoc} - */ - public function rewind() + public function rewind(): void { $this->stream->rewind(); } - /** - * {@inheritdoc} - */ - public function isWritable() + public function isWritable(): bool { return $this->stream->isWritable(); } - /** - * {@inheritdoc} - */ - public function write($string) + public function write(string $string): int { return $this->stream->write($string); } - /** - * {@inheritdoc} - */ - public function isReadable() + public function isReadable(): bool { return $this->stream->isReadable(); } - /** - * {@inheritdoc} - */ - public function read($length) + public function read(int $length): string { return $this->stream->read($length); } - /** - * {@inheritdoc} - */ - public function getContents() + public function getContents(): string { return $this->stream->getContents(); } - /** - * {@inheritdoc} - */ - public function getMetadata($key = null) + public function getMetadata(?string $key = null) { return $this->stream->getMetadata($key); } diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/ChunkStream.php b/modules/paynow/vendor/php-http/message/src/Encoding/ChunkStream.php index 74c2fbd0..362ed780 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/ChunkStream.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/ChunkStream.php @@ -9,26 +9,17 @@ namespace Http\Message\Encoding; */ class ChunkStream extends FilteredStream { - /** - * {@inheritdoc} - */ - protected function readFilter() + protected function readFilter(): string { return 'chunk'; } - /** - * {@inheritdoc} - */ - protected function writeFilter() + protected function writeFilter(): string { return 'dechunk'; } - /** - * {@inheritdoc} - */ - protected function fill() + protected function fill(): void { parent::fill(); diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/CompressStream.php b/modules/paynow/vendor/php-http/message/src/Encoding/CompressStream.php index bdb740a9..7e893887 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/CompressStream.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/CompressStream.php @@ -27,18 +27,12 @@ class CompressStream extends FilteredStream $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 15]); } - /** - * {@inheritdoc} - */ - protected function readFilter() + protected function readFilter(): string { return 'zlib.deflate'; } - /** - * {@inheritdoc} - */ - protected function writeFilter() + protected function writeFilter(): string { return 'zlib.inflate'; } diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/DechunkStream.php b/modules/paynow/vendor/php-http/message/src/Encoding/DechunkStream.php index 4cade835..c1fe3a62 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/DechunkStream.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/DechunkStream.php @@ -11,18 +11,12 @@ namespace Http\Message\Encoding; */ class DechunkStream extends FilteredStream { - /** - * {@inheritdoc} - */ - protected function readFilter() + protected function readFilter(): string { return 'dechunk'; } - /** - * {@inheritdoc} - */ - protected function writeFilter() + protected function writeFilter(): string { return 'chunk'; } diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/DecompressStream.php b/modules/paynow/vendor/php-http/message/src/Encoding/DecompressStream.php index ab3a3454..aa3fdf0f 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/DecompressStream.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/DecompressStream.php @@ -27,18 +27,12 @@ class DecompressStream extends FilteredStream $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 15, 'level' => $level]); } - /** - * {@inheritdoc} - */ - protected function readFilter() + protected function readFilter(): string { return 'zlib.inflate'; } - /** - * {@inheritdoc} - */ - protected function writeFilter() + protected function writeFilter(): string { return 'zlib.deflate'; } diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/DeflateStream.php b/modules/paynow/vendor/php-http/message/src/Encoding/DeflateStream.php index 2ab3e003..d8d8a8a1 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/DeflateStream.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/DeflateStream.php @@ -23,18 +23,12 @@ class DeflateStream extends FilteredStream $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15]); } - /** - * {@inheritdoc} - */ - protected function readFilter() + protected function readFilter(): string { return 'zlib.deflate'; } - /** - * {@inheritdoc} - */ - protected function writeFilter() + protected function writeFilter(): string { return 'zlib.inflate'; } diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/Filter/Chunk.php b/modules/paynow/vendor/php-http/message/src/Encoding/Filter/Chunk.php index 538e2700..7a9e18f5 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/Filter/Chunk.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/Filter/Chunk.php @@ -9,11 +9,7 @@ namespace Http\Message\Encoding\Filter; */ class Chunk extends \php_user_filter { - /** - * {@inheritdoc} - */ - #[\ReturnTypeWillChange] - public function filter($in, $out, &$consumed, $closing) + public function filter($in, $out, &$consumed, $closing): int { while ($bucket = stream_bucket_make_writeable($in)) { $lenbucket = stream_bucket_new($this->stream, dechex($bucket->datalen)."\r\n"); diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/FilteredStream.php b/modules/paynow/vendor/php-http/message/src/Encoding/FilteredStream.php index a6aec259..4bc44a6e 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/FilteredStream.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/FilteredStream.php @@ -75,10 +75,7 @@ abstract class FilteredStream implements StreamInterface $this->stream = $stream; } - /** - * {@inheritdoc} - */ - public function read($length) + public function read(int $length): string { if (strlen($this->buffer) >= $length) { $read = substr($this->buffer, 0, $length); @@ -101,10 +98,7 @@ abstract class FilteredStream implements StreamInterface return $read.$this->read($length - strlen($read)); } - /** - * {@inheritdoc} - */ - public function eof() + public function eof(): bool { return $this->stream->eof() && '' === $this->buffer; } @@ -116,7 +110,7 @@ abstract class FilteredStream implements StreamInterface * This allow to get last data in the PHP buffer otherwise this * bug is present : https://bugs.php.net/bug.php?id=48725 */ - protected function fill() + protected function fill(): void { $readFilterCallback = $this->readFilterCallback; $this->buffer .= $readFilterCallback($this->stream->read(self::BUFFER_SIZE)); @@ -126,10 +120,7 @@ abstract class FilteredStream implements StreamInterface } } - /** - * {@inheritdoc} - */ - public function getContents() + public function getContents(): string { $buffer = ''; @@ -149,15 +140,12 @@ abstract class FilteredStream implements StreamInterface /** * Always returns null because we can't tell the size of a stream when we filter. */ - public function getSize() + public function getSize(): ?int { return null; } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { return $this->getContents(); } @@ -167,24 +155,24 @@ abstract class FilteredStream implements StreamInterface * * We would need to buffer and process everything to allow seeking. */ - public function isSeekable() + public function isSeekable(): bool { return false; } /** - * {@inheritdoc} + * Filtered streams are not seekable and can thus not be rewound. */ - public function rewind() + public function rewind(): void { @trigger_error('Filtered streams are not seekable. This method will start raising an exception in the next major version', E_USER_DEPRECATED); $this->doRewind(); } /** - * {@inheritdoc} + * Filtered streams are not seekable. */ - public function seek($offset, $whence = SEEK_SET) + public function seek(int $offset, int $whence = SEEK_SET): void { @trigger_error('Filtered streams are not seekable. This method will start raising an exception in the next major version', E_USER_DEPRECATED); $this->doSeek($offset, $whence); @@ -193,11 +181,9 @@ abstract class FilteredStream implements StreamInterface /** * Returns the read filter name. * - * @return string - * * @deprecated since version 1.5, will be removed in 2.0 */ - public function getReadFilter() + public function getReadFilter(): string { @trigger_error('The '.__CLASS__.'::'.__METHOD__.' method is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); @@ -206,19 +192,15 @@ abstract class FilteredStream implements StreamInterface /** * Returns the write filter name. - * - * @return string */ - abstract protected function readFilter(); + abstract protected function readFilter(): string; /** * Returns the write filter name. * - * @return string - * * @deprecated since version 1.5, will be removed in 2.0 */ - public function getWriteFilter() + public function getWriteFilter(): string { @trigger_error('The '.__CLASS__.'::'.__METHOD__.' method is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); @@ -227,8 +209,6 @@ abstract class FilteredStream implements StreamInterface /** * Returns the write filter name. - * - * @return string */ - abstract protected function writeFilter(); + abstract protected function writeFilter(): string; } diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/GzipDecodeStream.php b/modules/paynow/vendor/php-http/message/src/Encoding/GzipDecodeStream.php index 92b5dad5..78ecc840 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/GzipDecodeStream.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/GzipDecodeStream.php @@ -27,18 +27,12 @@ class GzipDecodeStream extends FilteredStream $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 31, 'level' => $level]); } - /** - * {@inheritdoc} - */ - protected function readFilter() + protected function readFilter(): string { return 'zlib.inflate'; } - /** - * {@inheritdoc} - */ - protected function writeFilter() + protected function writeFilter(): string { return 'zlib.deflate'; } diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/GzipEncodeStream.php b/modules/paynow/vendor/php-http/message/src/Encoding/GzipEncodeStream.php index 13f097a8..7ffa4999 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/GzipEncodeStream.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/GzipEncodeStream.php @@ -27,18 +27,12 @@ class GzipEncodeStream extends FilteredStream $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => 31]); } - /** - * {@inheritdoc} - */ - protected function readFilter() + protected function readFilter(): string { return 'zlib.deflate'; } - /** - * {@inheritdoc} - */ - protected function writeFilter() + protected function writeFilter(): string { return 'zlib.inflate'; } diff --git a/modules/paynow/vendor/php-http/message/src/Encoding/InflateStream.php b/modules/paynow/vendor/php-http/message/src/Encoding/InflateStream.php index 06c51875..1abe88e2 100644 --- a/modules/paynow/vendor/php-http/message/src/Encoding/InflateStream.php +++ b/modules/paynow/vendor/php-http/message/src/Encoding/InflateStream.php @@ -27,18 +27,12 @@ class InflateStream extends FilteredStream $this->writeFilterCallback = Filter\fun($this->writeFilter(), ['window' => -15, 'level' => $level]); } - /** - * {@inheritdoc} - */ - protected function readFilter() + protected function readFilter(): string { return 'zlib.inflate'; } - /** - * {@inheritdoc} - */ - protected function writeFilter() + protected function writeFilter(): string { return 'zlib.deflate'; } diff --git a/modules/paynow/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php b/modules/paynow/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php index 80d2971c..1878cadc 100644 --- a/modules/paynow/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php +++ b/modules/paynow/vendor/php-http/message/src/Formatter/CurlCommandFormatter.php @@ -13,9 +13,6 @@ use Psr\Http\Message\ResponseInterface; */ class CurlCommandFormatter implements Formatter { - /** - * {@inheritdoc} - */ public function formatRequest(RequestInterface $request) { $command = sprintf('curl %s', escapeshellarg((string) $request->getUri()->withFragment(''))); @@ -60,9 +57,6 @@ class CurlCommandFormatter implements Formatter return $command; } - /** - * {@inheritdoc} - */ public function formatResponse(ResponseInterface $response) { return ''; diff --git a/modules/paynow/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php b/modules/paynow/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php index 8b9b1264..116b2dd8 100644 --- a/modules/paynow/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php +++ b/modules/paynow/vendor/php-http/message/src/Formatter/FullHttpMessageFormatter.php @@ -36,9 +36,6 @@ class FullHttpMessageFormatter implements Formatter $this->binaryDetectionRegex = $binaryDetectionRegex; } - /** - * {@inheritdoc} - */ public function formatRequest(RequestInterface $request) { $message = sprintf( @@ -55,9 +52,6 @@ class FullHttpMessageFormatter implements Formatter return $this->addBody($request, $message); } - /** - * {@inheritdoc} - */ public function formatResponse(ResponseInterface $response) { $message = sprintf( diff --git a/modules/paynow/vendor/php-http/message/src/Formatter/SimpleFormatter.php b/modules/paynow/vendor/php-http/message/src/Formatter/SimpleFormatter.php index ee99ae3f..c8b04500 100644 --- a/modules/paynow/vendor/php-http/message/src/Formatter/SimpleFormatter.php +++ b/modules/paynow/vendor/php-http/message/src/Formatter/SimpleFormatter.php @@ -14,9 +14,6 @@ use Psr\Http\Message\ResponseInterface; */ class SimpleFormatter implements Formatter { - /** - * {@inheritdoc} - */ public function formatRequest(RequestInterface $request) { return sprintf( @@ -27,9 +24,6 @@ class SimpleFormatter implements Formatter ); } - /** - * {@inheritdoc} - */ public function formatResponse(ResponseInterface $response) { return sprintf( diff --git a/modules/paynow/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php b/modules/paynow/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php index 6d54d351..c13f5738 100644 --- a/modules/paynow/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php +++ b/modules/paynow/vendor/php-http/message/src/MessageFactory/DiactorosMessageFactory.php @@ -9,6 +9,10 @@ use Laminas\Diactoros\Response as LaminasResponse; use Zend\Diactoros\Request as ZendRequest; use Zend\Diactoros\Response as ZendResponse; +if (!interface_exists(MessageFactory::class)) { + throw new \LogicException('You cannot use "Http\Message\MessageFactory\DiactorosMessageFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + /** * Creates Diactoros messages. * @@ -28,9 +32,6 @@ final class DiactorosMessageFactory implements MessageFactory $this->streamFactory = new DiactorosStreamFactory(); } - /** - * {@inheritdoc} - */ public function createRequest( $method, $uri, @@ -55,9 +56,6 @@ final class DiactorosMessageFactory implements MessageFactory ))->withProtocolVersion($protocolVersion); } - /** - * {@inheritdoc} - */ public function createResponse( $statusCode = 200, $reasonPhrase = null, diff --git a/modules/paynow/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php b/modules/paynow/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php index 02989d9f..8844f748 100644 --- a/modules/paynow/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php +++ b/modules/paynow/vendor/php-http/message/src/MessageFactory/GuzzleMessageFactory.php @@ -6,6 +6,10 @@ use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; use Http\Message\MessageFactory; +if (!interface_exists(MessageFactory::class)) { + throw new \LogicException('You cannot use "Http\Message\MessageFactory\GuzzleMessageFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + /** * Creates Guzzle messages. * @@ -15,9 +19,6 @@ use Http\Message\MessageFactory; */ final class GuzzleMessageFactory implements MessageFactory { - /** - * {@inheritdoc} - */ public function createRequest( $method, $uri, @@ -34,9 +35,6 @@ final class GuzzleMessageFactory implements MessageFactory ); } - /** - * {@inheritdoc} - */ public function createResponse( $statusCode = 200, $reasonPhrase = null, diff --git a/modules/paynow/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php b/modules/paynow/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php index bee93228..118799c0 100644 --- a/modules/paynow/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php +++ b/modules/paynow/vendor/php-http/message/src/MessageFactory/SlimMessageFactory.php @@ -9,6 +9,10 @@ use Slim\Http\Headers; use Slim\Http\Request; use Slim\Http\Response; +if (!interface_exists(MessageFactory::class)) { + throw new \LogicException('You cannot use "Http\Message\MessageFactory\SlimMessageFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + /** * Creates Slim 3 messages. * @@ -34,9 +38,6 @@ final class SlimMessageFactory implements MessageFactory $this->uriFactory = new SlimUriFactory(); } - /** - * {@inheritdoc} - */ public function createRequest( $method, $uri, @@ -55,9 +56,6 @@ final class SlimMessageFactory implements MessageFactory ))->withProtocolVersion($protocolVersion); } - /** - * {@inheritdoc} - */ public function createResponse( $statusCode = 200, $reasonPhrase = null, diff --git a/modules/paynow/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php b/modules/paynow/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php index 1197dd95..659e6e31 100644 --- a/modules/paynow/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php +++ b/modules/paynow/vendor/php-http/message/src/RequestMatcher/CallbackRequestMatcher.php @@ -22,9 +22,6 @@ final class CallbackRequestMatcher implements RequestMatcher $this->callback = $callback; } - /** - * {@inheritdoc} - */ public function matches(RequestInterface $request) { return (bool) call_user_func($this->callback, $request); diff --git a/modules/paynow/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php b/modules/paynow/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php index 91f3729e..253d9bce 100644 --- a/modules/paynow/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php +++ b/modules/paynow/vendor/php-http/message/src/RequestMatcher/RegexRequestMatcher.php @@ -31,9 +31,6 @@ final class RegexRequestMatcher implements RequestMatcher $this->regex = $regex; } - /** - * {@inheritdoc} - */ public function matches(RequestInterface $request) { return (bool) preg_match($this->regex, (string) $request->getUri()); diff --git a/modules/paynow/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php b/modules/paynow/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php index e2aa0212..4b28cccd 100644 --- a/modules/paynow/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php +++ b/modules/paynow/vendor/php-http/message/src/RequestMatcher/RequestMatcher.php @@ -51,8 +51,6 @@ final class RequestMatcher implements RequestMatcherInterface } /** - * {@inheritdoc} - * * @api */ public function matches(RequestInterface $request) diff --git a/modules/paynow/vendor/php-http/message/src/Stream/BufferedStream.php b/modules/paynow/vendor/php-http/message/src/Stream/BufferedStream.php index 3d38731d..289ff8cf 100644 --- a/modules/paynow/vendor/php-http/message/src/Stream/BufferedStream.php +++ b/modules/paynow/vendor/php-http/message/src/Stream/BufferedStream.php @@ -17,7 +17,7 @@ class BufferedStream implements StreamInterface /** @var resource The buffered resource used to seek previous data */ private $resource; - /** @var int size of the stream if available */ + /** @var int|null size of the stream if available */ private $size; /** @var StreamInterface The underlying stream decorated by this class */ @@ -49,10 +49,7 @@ class BufferedStream implements StreamInterface } } - /** - * {@inheritdoc} - */ - public function __toString() + public function __toString(): string { try { $this->rewind(); @@ -60,15 +57,10 @@ class BufferedStream implements StreamInterface return $this->getContents(); } catch (\Throwable $throwable) { return ''; - } catch (\Exception $exception) { // Layer to be BC with PHP 5, remove this when we only support PHP 7+ - return ''; } } - /** - * {@inheritdoc} - */ - public function close() + public function close(): void { if (null === $this->resource) { throw new \RuntimeException('Cannot close on a detached stream'); @@ -78,13 +70,10 @@ class BufferedStream implements StreamInterface fclose($this->resource); } - /** - * {@inheritdoc} - */ public function detach() { if (null === $this->resource) { - return; + return null; } // Force reading the remaining data of the stream @@ -98,13 +87,10 @@ class BufferedStream implements StreamInterface return $resource; } - /** - * {@inheritdoc} - */ - public function getSize() + public function getSize(): ?int { if (null === $this->resource) { - return; + return null; } if (null === $this->size && $this->stream->eof()) { @@ -114,22 +100,21 @@ class BufferedStream implements StreamInterface return $this->size; } - /** - * {@inheritdoc} - */ - public function tell() + public function tell(): int { if (null === $this->resource) { throw new \RuntimeException('Cannot tell on a detached stream'); } - return ftell($this->resource); + $tell = ftell($this->resource); + if (false === $tell) { + throw new \RuntimeException('ftell failed'); + } + + return $tell; } - /** - * {@inheritdoc} - */ - public function eof() + public function eof(): bool { if (null === $this->resource) { throw new \RuntimeException('Cannot call eof on a detached stream'); @@ -139,18 +124,12 @@ class BufferedStream implements StreamInterface return $this->stream->eof() && (ftell($this->resource) === $this->written); } - /** - * {@inheritdoc} - */ - public function isSeekable() + public function isSeekable(): bool { return null !== $this->resource; } - /** - * {@inheritdoc} - */ - public function seek($offset, $whence = SEEK_SET) + public function seek(int $offset, int $whence = SEEK_SET): void { if (null === $this->resource) { throw new \RuntimeException('Cannot seek on a detached stream'); @@ -159,10 +138,7 @@ class BufferedStream implements StreamInterface fseek($this->resource, $offset, $whence); } - /** - * {@inheritdoc} - */ - public function rewind() + public function rewind(): void { if (null === $this->resource) { throw new \RuntimeException('Cannot rewind on a detached stream'); @@ -171,34 +147,22 @@ class BufferedStream implements StreamInterface rewind($this->resource); } - /** - * {@inheritdoc} - */ - public function isWritable() + public function isWritable(): bool { return false; } - /** - * {@inheritdoc} - */ - public function write($string) + public function write(string $string): int { throw new \RuntimeException('Cannot write on this stream'); } - /** - * {@inheritdoc} - */ - public function isReadable() + public function isReadable(): bool { return null !== $this->resource; } - /** - * {@inheritdoc} - */ - public function read($length) + public function read(int $length): string { if (null === $this->resource) { throw new \RuntimeException('Cannot read on a detached stream'); @@ -206,6 +170,9 @@ class BufferedStream implements StreamInterface if ($length < 0) { throw new \InvalidArgumentException('Can not read a negative amount of bytes'); } + if (0 === $length) { + return ''; + } $read = ''; @@ -213,6 +180,9 @@ class BufferedStream implements StreamInterface if (ftell($this->resource) !== $this->written) { $read = fread($this->resource, $length); } + if (false === $read) { + throw new \RuntimeException('Failed to read from resource'); + } $bytesRead = strlen($read); @@ -227,10 +197,7 @@ class BufferedStream implements StreamInterface return $read; } - /** - * {@inheritdoc} - */ - public function getContents() + public function getContents(): string { if (null === $this->resource) { throw new \RuntimeException('Cannot read on a detached stream'); @@ -245,17 +212,14 @@ class BufferedStream implements StreamInterface return $read; } - /** - * {@inheritdoc} - */ - public function getMetadata($key = null) + public function getMetadata(?string $key = null) { if (null === $this->resource) { if (null === $key) { return []; } - return; + return null; } $metadata = stream_get_meta_data($this->resource); @@ -265,7 +229,7 @@ class BufferedStream implements StreamInterface } if (!array_key_exists($key, $metadata)) { - return; + return null; } return $metadata[$key]; diff --git a/modules/paynow/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php b/modules/paynow/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php index 8ae2b288..1b8c6f49 100644 --- a/modules/paynow/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php +++ b/modules/paynow/vendor/php-http/message/src/StreamFactory/DiactorosStreamFactory.php @@ -7,6 +7,10 @@ use Laminas\Diactoros\Stream as LaminasStream; use Psr\Http\Message\StreamInterface; use Zend\Diactoros\Stream as ZendStream; +if (!interface_exists(StreamFactory::class)) { + throw new \LogicException('You cannot use "Http\Message\MessageFactory\DiactorosStreamFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + /** * Creates Diactoros streams. * @@ -16,9 +20,6 @@ use Zend\Diactoros\Stream as ZendStream; */ final class DiactorosStreamFactory implements StreamFactory { - /** - * {@inheritdoc} - */ public function createStream($body = null) { if ($body instanceof StreamInterface) { diff --git a/modules/paynow/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php b/modules/paynow/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php index 14d83e94..f74bc5bb 100644 --- a/modules/paynow/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php +++ b/modules/paynow/vendor/php-http/message/src/StreamFactory/GuzzleStreamFactory.php @@ -5,6 +5,10 @@ namespace Http\Message\StreamFactory; use GuzzleHttp\Psr7\Utils; use Http\Message\StreamFactory; +if (!interface_exists(StreamFactory::class)) { + throw new \LogicException('You cannot use "Http\Message\MessageFactory\GuzzleStreamFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + /** * Creates Guzzle streams. * @@ -14,15 +18,13 @@ use Http\Message\StreamFactory; */ final class GuzzleStreamFactory implements StreamFactory { - /** - * {@inheritdoc} - */ public function createStream($body = null) { if (class_exists(Utils::class)) { return Utils::streamFor($body); } + // legacy support for guzzle/psr7 1.* return \GuzzleHttp\Psr7\stream_for($body); } } diff --git a/modules/paynow/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php b/modules/paynow/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php index 9274aaee..4cfa9ae4 100644 --- a/modules/paynow/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php +++ b/modules/paynow/vendor/php-http/message/src/StreamFactory/SlimStreamFactory.php @@ -6,6 +6,10 @@ use Http\Message\StreamFactory; use Psr\Http\Message\StreamInterface; use Slim\Http\Stream; +if (!interface_exists(StreamFactory::class)) { + throw new \LogicException('You cannot use "Http\Message\MessageFactory\SlimStreamFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + /** * Creates Slim 3 streams. * @@ -15,9 +19,6 @@ use Slim\Http\Stream; */ final class SlimStreamFactory implements StreamFactory { - /** - * {@inheritdoc} - */ public function createStream($body = null) { if ($body instanceof StreamInterface) { diff --git a/modules/paynow/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php b/modules/paynow/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php index be883def..84d5397c 100644 --- a/modules/paynow/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php +++ b/modules/paynow/vendor/php-http/message/src/UriFactory/DiactorosUriFactory.php @@ -7,6 +7,10 @@ use Laminas\Diactoros\Uri as LaminasUri; use Psr\Http\Message\UriInterface; use Zend\Diactoros\Uri as ZendUri; +if (!interface_exists(UriFactory::class)) { + throw new \LogicException('You cannot use "Http\Message\MessageFactory\DiactorosUriFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + /** * Creates Diactoros URI. * @@ -16,9 +20,6 @@ use Zend\Diactoros\Uri as ZendUri; */ final class DiactorosUriFactory implements UriFactory { - /** - * {@inheritdoc} - */ public function createUri($uri) { if ($uri instanceof UriInterface) { diff --git a/modules/paynow/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php b/modules/paynow/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php index 77989afe..deac2307 100644 --- a/modules/paynow/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php +++ b/modules/paynow/vendor/php-http/message/src/UriFactory/GuzzleUriFactory.php @@ -7,6 +7,10 @@ use Http\Message\UriFactory; use function GuzzleHttp\Psr7\uri_for; +if (!interface_exists(UriFactory::class)) { + throw new \LogicException('You cannot use "Http\Message\MessageFactory\GuzzleUriFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + /** * Creates Guzzle URI. * @@ -16,9 +20,6 @@ use function GuzzleHttp\Psr7\uri_for; */ final class GuzzleUriFactory implements UriFactory { - /** - * {@inheritdoc} - */ public function createUri($uri) { if (class_exists(Utils::class)) { diff --git a/modules/paynow/vendor/php-http/message/src/UriFactory/SlimUriFactory.php b/modules/paynow/vendor/php-http/message/src/UriFactory/SlimUriFactory.php index e5bef036..e4ff079b 100644 --- a/modules/paynow/vendor/php-http/message/src/UriFactory/SlimUriFactory.php +++ b/modules/paynow/vendor/php-http/message/src/UriFactory/SlimUriFactory.php @@ -6,6 +6,10 @@ use Http\Message\UriFactory; use Psr\Http\Message\UriInterface; use Slim\Http\Uri; +if (!interface_exists(UriFactory::class)) { + throw new \LogicException('You cannot use "Http\Message\MessageFactory\SlimUriFactory" as the "php-http/message-factory" package is not installed. Try running "composer require php-http/message-factory". Note that this package is deprecated, use "psr/http-factory" instead'); +} + /** * Creates Slim 3 URI. * @@ -15,9 +19,6 @@ use Slim\Http\Uri; */ final class SlimUriFactory implements UriFactory { - /** - * {@inheritdoc} - */ public function createUri($uri) { if ($uri instanceof UriInterface) { diff --git a/modules/paynow/vendor/php-http/promise/src/FulfilledPromise.php b/modules/paynow/vendor/php-http/promise/src/FulfilledPromise.php index dce04310..ed77d469 100644 --- a/modules/paynow/vendor/php-http/promise/src/FulfilledPromise.php +++ b/modules/paynow/vendor/php-http/promise/src/FulfilledPromise.php @@ -6,30 +6,23 @@ namespace Http\Promise; * A promise already fulfilled. * * @author Joel Wurtz - * - * @template-covariant T - * - * @implements Promise */ final class FulfilledPromise implements Promise { /** - * @var T + * @var mixed */ private $result; /** - * @param T $result + * @param mixed $result */ public function __construct($result) { $this->result = $result; } - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onFulfilled) { return $this; @@ -42,21 +35,17 @@ final class FulfilledPromise implements Promise } } - /** - * {@inheritdoc} - */ public function getState() { return Promise::FULFILLED; } - /** - * {@inheritdoc} - */ public function wait($unwrap = true) { if ($unwrap) { return $this->result; } + + return null; } } diff --git a/modules/paynow/vendor/php-http/promise/src/Promise.php b/modules/paynow/vendor/php-http/promise/src/Promise.php index 93837266..e2403114 100644 --- a/modules/paynow/vendor/php-http/promise/src/Promise.php +++ b/modules/paynow/vendor/php-http/promise/src/Promise.php @@ -12,8 +12,6 @@ namespace Http\Promise; * * @author Joel Wurtz * @author Márk Sági-Kazár - * - * @template-covariant T */ interface Promise { @@ -38,14 +36,12 @@ interface Promise * If you do not care about one of the cases, you can set the corresponding callable to null * The callback will be called when the value arrived and never more than once. * - * @param callable(T): V|null $onFulfilled called when a response will be available - * @param callable(\Exception): V|null $onRejected called when an exception occurs + * @param callable|null $onFulfilled called when a response will be available + * @param callable|null $onRejected called when an exception occurs * - * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected) - * - * @template V + * @return Promise a new resolved promise with value of the executed callback (onFulfilled / onRejected) */ - public function then(callable $onFulfilled = null, callable $onRejected = null); + public function then(?callable $onFulfilled = null, ?callable $onRejected = null); /** * Returns the state of the promise, one of PENDING, FULFILLED or REJECTED. @@ -65,9 +61,9 @@ interface Promise * * @param bool $unwrap Whether to return resolved value / throw reason or not * - * @return T Resolved value, null if $unwrap is set to false + * @return ($unwrap is true ? mixed : null) Resolved value, null if $unwrap is set to false * - * @throws \Exception the rejection reason if $unwrap is set to true and the request failed + * @throws \Throwable the rejection reason if $unwrap is set to true and the request failed */ public function wait($unwrap = true); } diff --git a/modules/paynow/vendor/php-http/promise/src/RejectedPromise.php b/modules/paynow/vendor/php-http/promise/src/RejectedPromise.php index 2cbefece..8c046ce2 100644 --- a/modules/paynow/vendor/php-http/promise/src/RejectedPromise.php +++ b/modules/paynow/vendor/php-http/promise/src/RejectedPromise.php @@ -6,27 +6,20 @@ namespace Http\Promise; * A rejected promise. * * @author Joel Wurtz - * - * @template-covariant T - * - * @implements Promise */ final class RejectedPromise implements Promise { /** - * @var \Exception + * @var \Throwable */ private $exception; - public function __construct(\Exception $exception) + public function __construct(\Throwable $exception) { $this->exception = $exception; } - /** - * {@inheritdoc} - */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onRejected) { return $this; @@ -39,21 +32,17 @@ final class RejectedPromise implements Promise } } - /** - * {@inheritdoc} - */ public function getState() { return Promise::REJECTED; } - /** - * {@inheritdoc} - */ public function wait($unwrap = true) { if ($unwrap) { throw $this->exception; } + + return null; } } diff --git a/modules/paynow/vendor/psr/http-factory/composer.json b/modules/paynow/vendor/psr/http-factory/composer.json index d1bbddee..82a1d326 100644 --- a/modules/paynow/vendor/psr/http-factory/composer.json +++ b/modules/paynow/vendor/psr/http-factory/composer.json @@ -1,6 +1,6 @@ { "name": "psr/http-factory", - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "psr", "psr-7", @@ -18,8 +18,11 @@ "homepage": "https://www.php-fig.org/" } ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "autoload": { diff --git a/modules/paynow/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php b/modules/paynow/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php index 7db4e30a..d7adbf0e 100644 --- a/modules/paynow/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php +++ b/modules/paynow/vendor/psr/http-factory/src/UploadedFileFactoryInterface.php @@ -15,10 +15,10 @@ interface UploadedFileFactoryInterface * * @param StreamInterface $stream Underlying stream representing the * uploaded file content. - * @param int $size in bytes + * @param int|null $size in bytes * @param int $error PHP file upload error - * @param string $clientFilename Filename as provided by the client, if any. - * @param string $clientMediaType Media type as provided by the client, if any. + * @param string|null $clientFilename Filename as provided by the client, if any. + * @param string|null $clientMediaType Media type as provided by the client, if any. * * @return UploadedFileInterface * @@ -26,9 +26,9 @@ interface UploadedFileFactoryInterface */ public function createUploadedFile( StreamInterface $stream, - int $size = null, + ?int $size = null, int $error = \UPLOAD_ERR_OK, - string $clientFilename = null, - string $clientMediaType = null + ?string $clientFilename = null, + ?string $clientMediaType = null ): UploadedFileInterface; } diff --git a/modules/paynow/vendor/psr/http-message/composer.json b/modules/paynow/vendor/psr/http-message/composer.json index b0d2937a..c66e5aba 100644 --- a/modules/paynow/vendor/psr/http-message/composer.json +++ b/modules/paynow/vendor/psr/http-message/composer.json @@ -7,11 +7,11 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "autoload": { "psr-4": { @@ -20,7 +20,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0.x-dev" } } } diff --git a/modules/paynow/vendor/psr/http-message/docs/index.php b/modules/paynow/vendor/psr/http-message/docs/index.php new file mode 100644 index 00000000..88355f61 --- /dev/null +++ b/modules/paynow/vendor/psr/http-message/docs/index.php @@ -0,0 +1,11 @@ +get, 'defaults', $option, sprintf('No default value was set for the "%s" option.', $option)); + return ($this->get)('defaults', $option, sprintf('No default value was set for the "%s" option.', $option)); } /** - * @param string $option - * * @return \Closure[] * * @throws NoConfigurationException on no configured closures */ - public function getLazyClosures($option) + public function getLazyClosures(string $option): array { - return \call_user_func($this->get, 'lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option)); + return ($this->get)('lazy', $option, sprintf('No lazy closures were set for the "%s" option.', $option)); } /** - * @param string $option - * * @return string[] * * @throws NoConfigurationException on no configured types */ - public function getAllowedTypes($option) + public function getAllowedTypes(string $option): array { - return \call_user_func($this->get, 'allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option)); + return ($this->get)('allowedTypes', $option, sprintf('No allowed types were set for the "%s" option.', $option)); } /** - * @param string $option - * * @return mixed[] * * @throws NoConfigurationException on no configured values */ - public function getAllowedValues($option) + public function getAllowedValues(string $option): array { - return \call_user_func($this->get, 'allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option)); + return ($this->get)('allowedValues', $option, sprintf('No allowed values were set for the "%s" option.', $option)); } /** - * @param string $option - * - * @return \Closure - * * @throws NoConfigurationException on no configured normalizer */ - public function getNormalizer($option) + public function getNormalizer(string $option): \Closure { - return \call_user_func($this->get, 'normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option)); + return current($this->getNormalizers($option)); + } + + /** + * @throws NoConfigurationException when no normalizer is configured + */ + public function getNormalizers(string $option): array + { + return ($this->get)('normalizers', $option, sprintf('No normalizer was set for the "%s" option.', $option)); + } + + /** + * @return string|\Closure + * + * @throws NoConfigurationException on no configured deprecation + */ + public function getDeprecationMessage(string $option) + { + return ($this->get)('deprecated', $option, sprintf('No deprecation was set for the "%s" option.', $option)); } } diff --git a/modules/paynow/vendor/symfony/options-resolver/Exception/ExceptionInterface.php b/modules/paynow/vendor/symfony/options-resolver/Exception/ExceptionInterface.php index b62bb51d..ea99d050 100644 --- a/modules/paynow/vendor/symfony/options-resolver/Exception/ExceptionInterface.php +++ b/modules/paynow/vendor/symfony/options-resolver/Exception/ExceptionInterface.php @@ -16,6 +16,6 @@ namespace Symfony\Component\OptionsResolver\Exception; * * @author Bernhard Schussek */ -interface ExceptionInterface +interface ExceptionInterface extends \Throwable { } diff --git a/modules/paynow/vendor/symfony/options-resolver/LICENSE b/modules/paynow/vendor/symfony/options-resolver/LICENSE index 9e936ec0..88bf75bb 100644 --- a/modules/paynow/vendor/symfony/options-resolver/LICENSE +++ b/modules/paynow/vendor/symfony/options-resolver/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2020 Fabien Potencier +Copyright (c) 2004-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/modules/paynow/vendor/symfony/options-resolver/OptionsResolver.php b/modules/paynow/vendor/symfony/options-resolver/OptionsResolver.php index cf8c3664..3c9e16c9 100644 --- a/modules/paynow/vendor/symfony/options-resolver/OptionsResolver.php +++ b/modules/paynow/vendor/symfony/options-resolver/OptionsResolver.php @@ -12,6 +12,7 @@ namespace Symfony\Component\OptionsResolver; use Symfony\Component\OptionsResolver\Exception\AccessException; +use Symfony\Component\OptionsResolver\Exception\InvalidArgumentException; use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException; use Symfony\Component\OptionsResolver\Exception\MissingOptionsException; use Symfony\Component\OptionsResolver\Exception\NoSuchOptionException; @@ -36,6 +37,13 @@ class OptionsResolver implements Options */ private $defaults = []; + /** + * A list of closure for nested options. + * + * @var \Closure[][] + */ + private $nested = []; + /** * The names of required options. */ @@ -49,7 +57,7 @@ class OptionsResolver implements Options /** * A list of normalizer closures. * - * @var \Closure[] + * @var \Closure[][] */ private $normalizers = []; @@ -75,6 +83,16 @@ class OptionsResolver implements Options */ private $calling = []; + /** + * A list of deprecated options. + */ + private $deprecated = []; + + /** + * The list of options provided by the user. + */ + private $given = []; + /** * Whether the instance is locked for reading. * @@ -85,7 +103,9 @@ class OptionsResolver implements Options */ private $locked = false; - private static $typeAliases = [ + private $parentsOptions = []; + + private const TYPE_ALIASES = [ 'boolean' => 'bool', 'integer' => 'int', 'double' => 'float', @@ -124,6 +144,20 @@ class OptionsResolver implements Options * is spread across different locations of your code, such as base and * sub-classes. * + * If you want to define nested options, you can pass a closure with the + * following signature: + * + * $options->setDefault('database', function (OptionsResolver $resolver) { + * $resolver->setDefined(['dbname', 'host', 'port', 'user', 'pass']); + * } + * + * To get access to the parent options, add a second argument to the closure's + * signature: + * + * function (OptionsResolver $resolver, Options $parent) { + * // 'default' === $parent['connection'] + * } + * * @param string $option The name of the option * @param mixed $value The default value of the option * @@ -161,15 +195,27 @@ class OptionsResolver implements Options $this->lazy[$option][] = $value; $this->defined[$option] = true; - // Make sure the option is processed - unset($this->resolved[$option]); + // Make sure the option is processed and is not nested anymore + unset($this->resolved[$option], $this->nested[$option]); + + return $this; + } + + if (isset($params[0]) && null !== ($type = $params[0]->getType()) && self::class === $type->getName() && (!isset($params[1]) || (($type = $params[1]->getType()) instanceof \ReflectionNamedType && Options::class === $type->getName()))) { + // Store closure for later evaluation + $this->nested[$option][] = $value; + $this->defaults[$option] = []; + $this->defined[$option] = true; + + // Make sure the option is processed and is not lazy anymore + unset($this->resolved[$option], $this->lazy[$option]); return $this; } } - // This option is not lazy anymore - unset($this->lazy[$option]); + // This option is not lazy nor nested anymore + unset($this->lazy[$option], $this->nested[$option]); // Yet undefined options can be marked as resolved, because we only need // to resolve options with lazy closures, normalizers or validation @@ -186,10 +232,6 @@ class OptionsResolver implements Options } /** - * Sets a list of default values. - * - * @param array $defaults The default values to set - * * @return $this * * @throws AccessException If called from a lazy option or normalizer @@ -348,6 +390,62 @@ class OptionsResolver implements Options return array_keys($this->defined); } + public function isNested(string $option): bool + { + return isset($this->nested[$option]); + } + + /** + * Deprecates an option, allowed types or values. + * + * Instead of passing the message, you may also pass a closure with the + * following signature: + * + * function (Options $options, $value): string { + * // ... + * } + * + * The closure receives the value as argument and should return a string. + * Return an empty string to ignore the option deprecation. + * + * The closure is invoked when {@link resolve()} is called. The parameter + * passed to the closure is the value of the option after validating it + * and before normalizing it. + * + * @param string|\Closure $deprecationMessage + */ + public function setDeprecated(string $option, $deprecationMessage = 'The option "%name%" is deprecated.'): self + { + if ($this->locked) { + throw new AccessException('Options cannot be deprecated from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist, defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + if (!\is_string($deprecationMessage) && !$deprecationMessage instanceof \Closure) { + throw new InvalidArgumentException(sprintf('Invalid type for deprecation message argument, expected string or \Closure, but got "%s".', \gettype($deprecationMessage))); + } + + // ignore if empty string + if ('' === $deprecationMessage) { + return $this; + } + + $this->deprecated[$option] = $deprecationMessage; + + // Make sure the option is processed + unset($this->resolved[$option]); + + return $this; + } + + public function isDeprecated(string $option): bool + { + return isset($this->deprecated[$option]); + } + /** * Sets the normalizer for an option. * @@ -366,8 +464,7 @@ class OptionsResolver implements Options * * The resolved option value is set to the return value of the closure. * - * @param string $option The option name - * @param \Closure $normalizer The normalizer + * @param string $option The option name * * @return $this * @@ -381,10 +478,56 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } - $this->normalizers[$option] = $normalizer; + $this->normalizers[$option] = [$normalizer]; + + // Make sure the option is processed + unset($this->resolved[$option]); + + return $this; + } + + /** + * Adds a normalizer for an option. + * + * The normalizer should be a closure with the following signature: + * + * function (Options $options, $value): mixed { + * // ... + * } + * + * The closure is invoked when {@link resolve()} is called. The closure + * has access to the resolved values of other options through the passed + * {@link Options} instance. + * + * The second parameter passed to the closure is the value of + * the option. + * + * The resolved option value is set to the return value of the closure. + * + * @return $this + * + * @throws UndefinedOptionsException If the option is undefined + * @throws AccessException If called from a lazy option or normalizer + */ + public function addNormalizer(string $option, \Closure $normalizer, bool $forcePrepend = false): self + { + if ($this->locked) { + throw new AccessException('Normalizers cannot be set from a lazy option or normalizer.'); + } + + if (!isset($this->defined[$option])) { + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); + } + + if ($forcePrepend) { + $this->normalizers[$option] = $this->normalizers[$option] ?? []; + array_unshift($this->normalizers[$option], $normalizer); + } else { + $this->normalizers[$option][] = $normalizer; + } // Make sure the option is processed unset($this->resolved[$option]); @@ -420,7 +563,7 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } $this->allowedValues[$option] = \is_array($allowedValues) ? $allowedValues : [$allowedValues]; @@ -461,7 +604,7 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } if (!\is_array($allowedValues)) { @@ -502,7 +645,7 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } $this->allowedTypes[$option] = (array) $allowedTypes; @@ -537,7 +680,7 @@ class OptionsResolver implements Options } if (!isset($this->defined[$option])) { - throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); + throw new UndefinedOptionsException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } if (!isset($this->allowedTypes[$option])) { @@ -592,12 +735,14 @@ class OptionsResolver implements Options $this->defined = []; $this->defaults = []; + $this->nested = []; $this->required = []; $this->resolved = []; $this->lazy = []; $this->normalizers = []; $this->allowedTypes = []; $this->allowedValues = []; + $this->deprecated = []; return $this; } @@ -613,8 +758,6 @@ class OptionsResolver implements Options * - Options have invalid types; * - Options have invalid values. * - * @param array $options A map of option names to values - * * @return array The merged and validated options * * @throws UndefinedOptionsException If an option name is undefined @@ -642,11 +785,12 @@ class OptionsResolver implements Options ksort($clone->defined); ksort($diff); - throw new UndefinedOptionsException(sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', implode('", "', array_keys($diff)), implode('", "', array_keys($clone->defined)))); + throw new UndefinedOptionsException(sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', $this->formatOptions(array_keys($diff)), implode('", "', array_keys($clone->defined)))); } // Override options set by the user foreach ($options as $option => $value) { + $clone->given[$option] = true; $clone->defaults[$option] = $value; unset($clone->resolved[$option], $clone->lazy[$option]); } @@ -657,7 +801,7 @@ class OptionsResolver implements Options if (\count($diff) > 0) { ksort($diff); - throw new MissingOptionsException(sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', implode('", "', array_keys($diff)))); + throw new MissingOptionsException(sprintf(\count($diff) > 1 ? 'The required options "%s" are missing.' : 'The required option "%s" is missing.', $this->formatOptions(array_keys($diff)))); } // Lock the container @@ -675,7 +819,8 @@ class OptionsResolver implements Options /** * Returns the resolved value of an option. * - * @param string $option The option name + * @param string $option The option name + * @param bool $triggerDeprecation Whether to trigger the deprecation or not (true by default) * * @return mixed The option value * @@ -687,34 +832,67 @@ class OptionsResolver implements Options * @throws OptionDefinitionException If there is a cyclic dependency between * lazy options and/or normalizers */ - public function offsetGet($option) + #[\ReturnTypeWillChange] + public function offsetGet($option/* , bool $triggerDeprecation = true */) { if (!$this->locked) { throw new AccessException('Array access is only supported within closures of lazy options and normalizers.'); } + $triggerDeprecation = 1 === \func_num_args() || func_get_arg(1); + // Shortcut for resolved options - if (\array_key_exists($option, $this->resolved)) { + if (isset($this->resolved[$option]) || \array_key_exists($option, $this->resolved)) { + if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || $this->calling) && \is_string($this->deprecated[$option])) { + @trigger_error(strtr($this->deprecated[$option], ['%name%' => $option]), \E_USER_DEPRECATED); + } + return $this->resolved[$option]; } // Check whether the option is set at all - if (!\array_key_exists($option, $this->defaults)) { + if (!isset($this->defaults[$option]) && !\array_key_exists($option, $this->defaults)) { if (!isset($this->defined[$option])) { - throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $option, implode('", "', array_keys($this->defined)))); + throw new NoSuchOptionException(sprintf('The option "%s" does not exist. Defined options are: "%s".', $this->formatOptions([$option]), implode('", "', array_keys($this->defined)))); } - throw new NoSuchOptionException(sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $option)); + throw new NoSuchOptionException(sprintf('The optional option "%s" has no value set. You should make sure it is set with "isset" before reading it.', $this->formatOptions([$option]))); } $value = $this->defaults[$option]; + // Resolve the option if it is a nested definition + if (isset($this->nested[$option])) { + // If the closure is already being called, we have a cyclic dependency + if (isset($this->calling[$option])) { + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + } + + if (!\is_array($value)) { + throw new InvalidOptionsException(sprintf('The nested option "%s" with value %s is expected to be of type array, but is of type "%s".', $this->formatOptions([$option]), $this->formatValue($value), $this->formatTypeOf($value))); + } + + // The following section must be protected from cyclic calls. + $this->calling[$option] = true; + try { + $resolver = new self(); + $resolver->parentsOptions = $this->parentsOptions; + $resolver->parentsOptions[] = $option; + foreach ($this->nested[$option] as $closure) { + $closure($resolver, $this); + } + $value = $resolver->resolve($value); + } finally { + unset($this->calling[$option]); + } + } + // Resolve the option if the default value is lazily evaluated if (isset($this->lazy[$option])) { // If the closure is already being called, we have a cyclic // dependency if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling)))); + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); } // The following section must be protected from cyclic @@ -738,7 +916,7 @@ class OptionsResolver implements Options $invalidTypes = []; foreach ($this->allowedTypes[$option] as $type) { - $type = isset(self::$typeAliases[$type]) ? self::$typeAliases[$type] : $type; + $type = self::TYPE_ALIASES[$type] ?? $type; if ($valid = $this->verifyTypes($type, $value, $invalidTypes)) { break; @@ -749,19 +927,15 @@ class OptionsResolver implements Options $fmtActualValue = $this->formatValue($value); $fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]); $fmtProvidedTypes = implode('|', array_keys($invalidTypes)); - - $allowedContainsArrayType = \count(array_filter( - $this->allowedTypes[$option], - function ($item) { - return '[]' === substr(isset(self::$typeAliases[$item]) ? self::$typeAliases[$item] : $item, -2); - } - )) > 0; + $allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static function ($item) { + return str_ends_with(self::TYPE_ALIASES[$item] ?? $item, '[]'); + })) > 0; if (\is_array($value) && $allowedContainsArrayType) { - throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $option, $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); + throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but one of the elements is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); } - throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $option, $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); + throw new InvalidOptionsException(sprintf('The option "%s" with value %s is expected to be of type "%s", but is of type "%s".', $this->formatOptions([$option]), $fmtActualValue, $fmtAllowedTypes, $fmtProvidedTypes)); } } @@ -807,23 +981,49 @@ class OptionsResolver implements Options } } + // Check whether the option is deprecated + // and it is provided by the user or is being called from a lazy evaluation + if ($triggerDeprecation && isset($this->deprecated[$option]) && (isset($this->given[$option]) || ($this->calling && \is_string($this->deprecated[$option])))) { + $deprecationMessage = $this->deprecated[$option]; + + if ($deprecationMessage instanceof \Closure) { + // If the closure is already being called, we have a cyclic dependency + if (isset($this->calling[$option])) { + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); + } + + $this->calling[$option] = true; + try { + if (!\is_string($deprecationMessage = $deprecationMessage($this, $value))) { + throw new InvalidOptionsException(sprintf('Invalid type for deprecation message, expected string but got "%s", return an empty string to ignore.', \gettype($deprecationMessage))); + } + } finally { + unset($this->calling[$option]); + } + } + + if ('' !== $deprecationMessage) { + @trigger_error(strtr($deprecationMessage, ['%name%' => $option]), \E_USER_DEPRECATED); + } + } + // Normalize the validated option if (isset($this->normalizers[$option])) { // If the closure is already being called, we have a cyclic // dependency if (isset($this->calling[$option])) { - throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', implode('", "', array_keys($this->calling)))); + throw new OptionDefinitionException(sprintf('The options "%s" have a cyclic dependency.', $this->formatOptions(array_keys($this->calling)))); } - $normalizer = $this->normalizers[$option]; - // The following section must be protected from cyclic // calls. Set $calling for the current $option to detect a cyclic // dependency // BEGIN $this->calling[$option] = true; try { - $value = $normalizer($this, $value); + foreach ($this->normalizers[$option] as $normalizer) { + $value = $normalizer($this, $value); + } } finally { unset($this->calling[$option]); } @@ -836,63 +1036,30 @@ class OptionsResolver implements Options return $value; } - /** - * @param string $type - * @param mixed $value - * @param array &$invalidTypes - * - * @return bool - */ - private function verifyTypes($type, $value, array &$invalidTypes) + private function verifyTypes(string $type, $value, array &$invalidTypes, int $level = 0): bool { if (\is_array($value) && '[]' === substr($type, -2)) { - return $this->verifyArrayType($type, $value, $invalidTypes); - } + $type = substr($type, 0, -2); + $valid = true; - if (self::isValueValidType($type, $value)) { - return true; - } - - if (!$invalidTypes) { - $invalidTypes[$this->formatTypeOf($value, null)] = true; - } - - return false; - } - - /** - * @return bool - */ - private function verifyArrayType($type, array $value, array &$invalidTypes, $level = 0) - { - $type = substr($type, 0, -2); - - if ('[]' === substr($type, -2)) { - $success = true; - foreach ($value as $item) { - if (!\is_array($item)) { - $invalidTypes[$this->formatTypeOf($item, null)] = true; - - $success = false; - } elseif (!$this->verifyArrayType($type, $item, $invalidTypes, $level + 1)) { - $success = false; + foreach ($value as $val) { + if (!$this->verifyTypes($type, $val, $invalidTypes, $level + 1)) { + $valid = false; } } - return $success; + return $valid; } - $valid = true; - - foreach ($value as $item) { - if (!self::isValueValidType($type, $item)) { - $invalidTypes[$this->formatTypeOf($item, $type)] = $value; - - $valid = false; - } + if (('null' === $type && null === $value) || (\function_exists($func = 'is_'.$type) && $func($value)) || $value instanceof $type) { + return true; } - return $valid; + if (!$invalidTypes || $level > 0) { + $invalidTypes[$this->formatTypeOf($value)] = true; + } + + return false; } /** @@ -906,6 +1073,7 @@ class OptionsResolver implements Options * * @see \ArrayAccess::offsetExists() */ + #[\ReturnTypeWillChange] public function offsetExists($option) { if (!$this->locked) { @@ -918,8 +1086,11 @@ class OptionsResolver implements Options /** * Not supported. * + * @return void + * * @throws AccessException */ + #[\ReturnTypeWillChange] public function offsetSet($option, $value) { throw new AccessException('Setting options via array access is not supported. Use setDefault() instead.'); @@ -928,8 +1099,11 @@ class OptionsResolver implements Options /** * Not supported. * + * @return void + * * @throws AccessException */ + #[\ReturnTypeWillChange] public function offsetUnset($option) { throw new AccessException('Removing options via array access is not supported. Use remove() instead.'); @@ -946,6 +1120,7 @@ class OptionsResolver implements Options * * @see \Countable::count() */ + #[\ReturnTypeWillChange] public function count() { if (!$this->locked) { @@ -958,43 +1133,13 @@ class OptionsResolver implements Options /** * Returns a string representation of the type of the value. * - * This method should be used if you pass the type of a value as - * message parameter to a constraint violation. Note that such - * parameters should usually not be included in messages aimed at - * non-technical people. - * - * @param mixed $value The value to return the type of - * @param string $type + * @param mixed $value The value to return the type of * * @return string The type of the value */ - private function formatTypeOf($value, $type) + private function formatTypeOf($value): string { - $suffix = ''; - - if ('[]' === substr($type, -2)) { - $suffix = '[]'; - $type = substr($type, 0, -2); - while ('[]' === substr($type, -2)) { - $type = substr($type, 0, -2); - $value = array_shift($value); - if (!\is_array($value)) { - break; - } - $suffix .= '[]'; - } - - if (\is_array($value)) { - $subTypes = []; - foreach ($value as $val) { - $subTypes[$this->formatTypeOf($val, null)] = true; - } - - return implode('|', array_keys($subTypes)).$suffix; - } - } - - return (\is_object($value) ? \get_class($value) : \gettype($value)).$suffix; + return \is_object($value) ? \get_class($value) : \gettype($value); } /** @@ -1005,10 +1150,8 @@ class OptionsResolver implements Options * in double quotes ("). * * @param mixed $value The value to format as string - * - * @return string The string representation of the passed value */ - private function formatValue($value) + private function formatValue($value): string { if (\is_object($value)) { return \get_class($value); @@ -1047,13 +1190,9 @@ class OptionsResolver implements Options * Each of the values is converted to a string using * {@link formatValue()}. The values are then concatenated with commas. * - * @param array $values A list of values - * - * @return string The string representation of the value list - * * @see formatValue() */ - private function formatValues(array $values) + private function formatValues(array $values): string { foreach ($values as $key => $value) { $values[$key] = $this->formatValue($value); @@ -1062,24 +1201,28 @@ class OptionsResolver implements Options return implode(', ', $values); } - private static function isValueValidType($type, $value) + private function formatOptions(array $options): string { - return (\function_exists($isFunction = 'is_'.$type) && $isFunction($value)) || $value instanceof $type; - } + if ($this->parentsOptions) { + $prefix = array_shift($this->parentsOptions); + if ($this->parentsOptions) { + $prefix .= sprintf('[%s]', implode('][', $this->parentsOptions)); + } - /** - * @return string|null - */ - private function getParameterClassName(\ReflectionParameter $parameter) - { - if (!method_exists($parameter, 'getType')) { - return ($class = $parameter->getClass()) ? $class->name : null; + $options = array_map(static function (string $option) use ($prefix): string { + return sprintf('%s[%s]', $prefix, $option); + }, $options); } - if (!($type = $parameter->getType()) || $type->isBuiltin()) { + return implode('", "', $options); + } + + private function getParameterClassName(\ReflectionParameter $parameter): ?string + { + if (!($type = $parameter->getType()) instanceof \ReflectionNamedType || $type->isBuiltin()) { return null; } - return $type instanceof \ReflectionNamedType ? $type->getName() : (string) $type; + return $type->getName(); } } diff --git a/modules/paynow/vendor/symfony/options-resolver/composer.json b/modules/paynow/vendor/symfony/options-resolver/composer.json index 0f7e1fd3..b63c7ee6 100644 --- a/modules/paynow/vendor/symfony/options-resolver/composer.json +++ b/modules/paynow/vendor/symfony/options-resolver/composer.json @@ -1,7 +1,7 @@ { "name": "symfony/options-resolver", "type": "library", - "description": "Symfony OptionsResolver Component", + "description": "Provides an improved replacement for the array_replace PHP function", "keywords": ["options", "config", "configuration"], "homepage": "https://symfony.com", "license": "MIT", @@ -16,7 +16,8 @@ } ], "require": { - "php": "^5.5.9|>=7.0.8" + "php": ">=7.1.3", + "symfony/polyfill-php80": "^1.16" }, "autoload": { "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" }, diff --git a/modules/paynow/vendor/symfony/polyfill-php80/LICENSE b/modules/paynow/vendor/symfony/polyfill-php80/LICENSE new file mode 100644 index 00000000..0ed3a246 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2020-present Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/modules/paynow/vendor/symfony/polyfill-php80/Php80.php b/modules/paynow/vendor/symfony/polyfill-php80/Php80.php new file mode 100644 index 00000000..362dd1a9 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/Php80.php @@ -0,0 +1,115 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Ion Bazan + * @author Nico Oelgart + * @author Nicolas Grekas + * + * @internal + */ +final class Php80 +{ + public static function fdiv(float $dividend, float $divisor): float + { + return @($dividend / $divisor); + } + + public static function get_debug_type($value): string + { + switch (true) { + case null === $value: return 'null'; + case \is_bool($value): return 'bool'; + case \is_string($value): return 'string'; + case \is_array($value): return 'array'; + case \is_int($value): return 'int'; + case \is_float($value): return 'float'; + case \is_object($value): break; + case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; + default: + if (null === $type = @get_resource_type($value)) { + return 'unknown'; + } + + if ('Unknown' === $type) { + $type = 'closed'; + } + + return "resource ($type)"; + } + + $class = \get_class($value); + + if (false === strpos($class, '@')) { + return $class; + } + + return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; + } + + public static function get_resource_id($res): int + { + if (!\is_resource($res) && null === @get_resource_type($res)) { + throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); + } + + return (int) $res; + } + + public static function preg_last_error_msg(): string + { + switch (preg_last_error()) { + case \PREG_INTERNAL_ERROR: + return 'Internal error'; + case \PREG_BAD_UTF8_ERROR: + return 'Malformed UTF-8 characters, possibly incorrectly encoded'; + case \PREG_BAD_UTF8_OFFSET_ERROR: + return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; + case \PREG_BACKTRACK_LIMIT_ERROR: + return 'Backtrack limit exhausted'; + case \PREG_RECURSION_LIMIT_ERROR: + return 'Recursion limit exhausted'; + case \PREG_JIT_STACKLIMIT_ERROR: + return 'JIT stack limit exhausted'; + case \PREG_NO_ERROR: + return 'No error'; + default: + return 'Unknown error'; + } + } + + public static function str_contains(string $haystack, string $needle): bool + { + return '' === $needle || false !== strpos($haystack, $needle); + } + + public static function str_starts_with(string $haystack, string $needle): bool + { + return 0 === strncmp($haystack, $needle, \strlen($needle)); + } + + public static function str_ends_with(string $haystack, string $needle): bool + { + if ('' === $needle || $needle === $haystack) { + return true; + } + + if ('' === $haystack) { + return false; + } + + $needleLength = \strlen($needle); + + return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); + } +} diff --git a/modules/paynow/vendor/symfony/polyfill-php80/PhpToken.php b/modules/paynow/vendor/symfony/polyfill-php80/PhpToken.php new file mode 100644 index 00000000..cd78c4cc --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/PhpToken.php @@ -0,0 +1,106 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php80; + +/** + * @author Fedonyuk Anton + * + * @internal + */ +class PhpToken implements \Stringable +{ + /** + * @var int + */ + public $id; + + /** + * @var string + */ + public $text; + + /** + * @var -1|positive-int + */ + public $line; + + /** + * @var int + */ + public $pos; + + /** + * @param -1|positive-int $line + */ + public function __construct(int $id, string $text, int $line = -1, int $position = -1) + { + $this->id = $id; + $this->text = $text; + $this->line = $line; + $this->pos = $position; + } + + public function getTokenName(): ?string + { + if ('UNKNOWN' === $name = token_name($this->id)) { + $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; + } + + return $name; + } + + /** + * @param int|string|array $kind + */ + public function is($kind): bool + { + foreach ((array) $kind as $value) { + if (\in_array($value, [$this->id, $this->text], true)) { + return true; + } + } + + return false; + } + + public function isIgnorable(): bool + { + return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); + } + + public function __toString(): string + { + return (string) $this->text; + } + + /** + * @return list + */ + public static function tokenize(string $code, int $flags = 0): array + { + $line = 1; + $position = 0; + $tokens = token_get_all($code, $flags); + foreach ($tokens as $index => $token) { + if (\is_string($token)) { + $id = \ord($token); + $text = $token; + } else { + [$id, $text, $line] = $token; + } + $tokens[$index] = new static($id, $text, $line, $position); + $position += \strlen($text); + } + + return $tokens; + } +} diff --git a/modules/paynow/vendor/symfony/polyfill-php80/Resources/index.php b/modules/paynow/vendor/symfony/polyfill-php80/Resources/index.php new file mode 100644 index 00000000..88355f61 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/Resources/index.php @@ -0,0 +1,11 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +#[Attribute(Attribute::TARGET_CLASS)] +final class Attribute +{ + public const TARGET_CLASS = 1; + public const TARGET_FUNCTION = 2; + public const TARGET_METHOD = 4; + public const TARGET_PROPERTY = 8; + public const TARGET_CLASS_CONSTANT = 16; + public const TARGET_PARAMETER = 32; + public const TARGET_ALL = 63; + public const IS_REPEATABLE = 64; + + /** @var int */ + public $flags; + + public function __construct(int $flags = self::TARGET_ALL) + { + $this->flags = $flags; + } +} diff --git a/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php new file mode 100644 index 00000000..bd1212f6 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { + class PhpToken extends Symfony\Polyfill\Php80\PhpToken + { + } +} diff --git a/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php new file mode 100644 index 00000000..7c62d750 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php @@ -0,0 +1,20 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + interface Stringable + { + /** + * @return string + */ + public function __toString(); + } +} diff --git a/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php new file mode 100644 index 00000000..01c6c6c8 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class UnhandledMatchError extends Error + { + } +} diff --git a/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php new file mode 100644 index 00000000..783dbc28 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php @@ -0,0 +1,16 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID < 80000) { + class ValueError extends Error + { + } +} diff --git a/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/index.php b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/index.php new file mode 100644 index 00000000..88355f61 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/Resources/stubs/index.php @@ -0,0 +1,11 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php80 as p; + +if (\PHP_VERSION_ID >= 80000) { + return; +} + +if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { + define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); +} + +if (!function_exists('fdiv')) { + function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } +} +if (!function_exists('preg_last_error_msg')) { + function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } +} +if (!function_exists('str_contains')) { + function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_starts_with')) { + function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('str_ends_with')) { + function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } +} +if (!function_exists('get_debug_type')) { + function get_debug_type($value): string { return p\Php80::get_debug_type($value); } +} +if (!function_exists('get_resource_id')) { + function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } +} diff --git a/modules/paynow/vendor/symfony/polyfill-php80/composer.json b/modules/paynow/vendor/symfony/polyfill-php80/composer.json new file mode 100644 index 00000000..a503b039 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/composer.json @@ -0,0 +1,37 @@ +{ + "name": "symfony/polyfill-php80", + "type": "library", + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=7.2" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, + "files": [ "bootstrap.php" ], + "classmap": [ "Resources/stubs" ] + }, + "minimum-stability": "dev", + "extra": { + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/modules/paynow/vendor/symfony/polyfill-php80/index.php b/modules/paynow/vendor/symfony/polyfill-php80/index.php new file mode 100644 index 00000000..88355f61 --- /dev/null +++ b/modules/paynow/vendor/symfony/polyfill-php80/index.php @@ -0,0 +1,11 @@ + + + + + + + + + + + + + + + + + + diff --git a/modules/paynow/views/img/digital-wallets-acg.svg b/modules/paynow/views/img/digital-wallets-acg.svg new file mode 100644 index 00000000..d6505a09 --- /dev/null +++ b/modules/paynow/views/img/digital-wallets-acg.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/paynow/views/img/digital-wallets-ag.svg b/modules/paynow/views/img/digital-wallets-ag.svg new file mode 100644 index 00000000..9ccb3fd7 --- /dev/null +++ b/modules/paynow/views/img/digital-wallets-ag.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/modules/paynow/views/img/digital-wallets-cg.svg b/modules/paynow/views/img/digital-wallets-cg.svg new file mode 100644 index 00000000..32f97b25 --- /dev/null +++ b/modules/paynow/views/img/digital-wallets-cg.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/paynow/views/img/logo-paynow.png b/modules/paynow/views/img/logo-paynow.png index 38cef83c..d8c94dc1 100644 Binary files a/modules/paynow/views/img/logo-paynow.png and b/modules/paynow/views/img/logo-paynow.png differ diff --git a/modules/paynow/views/js/front.js b/modules/paynow/views/js/front.js index b7949a4d..3968d7c4 100644 --- a/modules/paynow/views/js/front.js +++ b/modules/paynow/views/js/front.js @@ -41,14 +41,18 @@ var paynow = { form: '.paynow-blik-form', terms: '#conditions_to_approve\\[terms-and-conditions\\], #cgv', termsLabel: 'label[for="conditions_to_approve\\[terms-and-conditions\\]"], label[for="cgv"]', - termsErrorLabel: '#js-paynow-terms-error', paymentButton: '#payment-confirmation button', blikCode: '#paynow_blik_code', blikButton: 'form.paynow-blik-form div.paynow-payment-option-container button', blikErrorLabel: 'form.paynow-blik-form span.error', pblMethod: 'div.paynow-payment-pbls input[name="paymentMethodId"]', + cardMethod: 'div.paynow-payment-card input[name="paymentMethodToken"]', + cardMethodOptions: 'div.paynow-payment-card .paynow-payment-card-option', paymentMethod: 'input[name="payment-option"]', + + cardMethodMiniMenuOpen: '.paynow-payment-card-menu .paynow-payment-card-menu-button', + cardMethodRemove: '[data-remove-saved-instrument]', }, init: function(){ @@ -59,21 +63,20 @@ var paynow = { $(document).on('click', paynow.selectors.blikButton, paynow.blikFormSubmit); $(document).on('keyup', paynow.selectors.blikCode, paynow.blikValidate); $(document).on('change', paynow.selectors.pblMethod, paynow.pblValidate); - $(document).on('change', paynow.selectors.paymentMethod, paynow.blikFormPrepare); + $(document).on('change', paynow.selectors.cardMethod, paynow.cardValidate); + $(document).on('change', paynow.selectors.paymentMethod, paynow.onPaymentOptionChange); $(document).on('change', paynow.selectors.terms, function(){ - paynow.blikFormPrepare() + paynow.onPaymentOptionChange() paynow.termsValidate() }); - - var termsErrorPlaceholderExists = $(paynow.selectors.terms).length != 0 - && $(paynow.selectors.termsLabel).length != 0 - && $(paynow.selectors.termsErrorLabel).length == 0 - - if (termsErrorPlaceholderExists) { - $(paynow.selectors.termsLabel).after('') - } + $(document).on('click', paynow.selectors.cardMethodMiniMenuOpen, paynow.toggleCardMiniMenu); + $(document).on('click', paynow.selectors.cardMethodRemove, paynow.removeSavedInstrument); + $(document).on('click', function (ev) { + paynow.closeMiniMenu(ev) + }); paynow.addApplePayEnabledToCookie(); + paynow.addFingerprintToCardPayment(); }, overrideDefaults: function() { @@ -104,7 +107,7 @@ var paynow = { } if (paynow.isTermsChecked()) { - $(paynow.selectors.termsErrorLabel).text('') + $(paynow.selectors.blikErrorLabel).text('') return true } else { return false @@ -117,10 +120,9 @@ var paynow = { } $(paynow.selectors.blikErrorLabel).text('') - $(paynow.selectors.termsErrorLabel).text('') if (paynow.termsValidate() == false) { - $(paynow.selectors.termsErrorLabel).text($(paynow.selectors.form).data('terms-message')) + $(paynow.selectors.blikErrorLabel).text($(paynow.selectors.form).data('terms-message')) prestashop.emit('paynow_event_blik_submit_fail', { type: 'terms_not_accepted', }) @@ -160,28 +162,35 @@ var paynow = { ) }, - blikFormPrepare: function() { - if ($(paynow.selectors.blikCode).length != 1) { - return + onPaymentOptionChange: function () { + if ($(paynow.selectors.blikCode).length === 1) { + $(paynow.selectors.blikCode).mask('000 000', {placeholder: "___ ___"}) } - $(paynow.selectors.blikCode).mask('000 000', {placeholder: "___ ___"}) - - if ($(paynow.selectors.form).data('blik-autofocus') == '1') { + if ($(paynow.selectors.form).data('blik-autofocus') === '1') { $(paynow.selectors.blikCode).focus(); } if ($(paynow.selectors.blikCode).is(':visible')) { paynow.paymentButton.disable() paynow.paymentButton.hide() + } else if ($(paynow.selectors.cardMethodOptions).is(':visible') && !$(paynow.selectors.cardMethod + ':checked').length) { + paynow.paymentButton.disable() + } else if ($('div.paynow-payment-pbls .paynow-payment-option-pbl').is(':visible')) { + paynow.pblValidate() } else { paynow.paymentButton.enable() paynow.paymentButton.show() } }, + // backward compatibility + blikFormPrepare: function() { + paynow.onPaymentOptionChange() + }, + blikValidate: function () { - blik_code_value = $(paynow.selectors.blikCode).val().replace(/\s/g, ''); + const blik_code_value = $(paynow.selectors.blikCode).val().replace(/\s/g, ''); if (blik_code_value.length === 6 && !isNaN(parseInt(blik_code_value)) && parseInt(blik_code_value)) { $(paynow.selectors.blikErrorLabel).text(''); @@ -193,8 +202,20 @@ var paynow = { } }, + cardValidate: function () { + const checkedCardOption = $(paynow.selectors.cardMethod + ':checked'); + + if (checkedCardOption.length && (!paynow.config.validateTerms || $(paynow.selectors.terms).is(':checked'))) { + paynow.paymentButton.enable(); + return true + } else { + paynow.paymentButton.disable(); + return false + } + }, + pblValidate: function () { - if (paynow.config.validateTerms && paynow.isTermsChecked()) { + if (!(paynow.config.validateTerms && !paynow.isTermsChecked()) && $(paynow.selectors.pblMethod + ':checked').length > 0) { paynow.paymentButton.enable(); return true } else { @@ -212,6 +233,16 @@ var paynow = { return false }, + closeMiniMenu: function (e) { + if (!$(e.target).is(paynow.selectors.cardMethodRemove) && !$(e.target).is(paynow.selectors.cardMethodMiniMenuOpen)) { + $(paynow.selectors.cardMethodRemove).addClass('--hidden') + } + }, + + toggleCardMiniMenu: function (e) { + $(e.currentTarget).siblings().toggleClass('--hidden') + }, + isTermsChecked: function () { if (paynow.config.allTermsHaveToBeChecked) { return !$(paynow.selectors.terms).is(':not(:checked)') @@ -261,6 +292,63 @@ var paynow = { document.cookie = 'applePayEnabled=' + (applePayEnabled ? '1' : '0'); }, + addFingerprintToCardPayment: function () { + const input = $('#payment-method-fingerprint'); + + if (!input.length) { + return; + } + + try { + const fpPromise = import('https://static.paynow.pl/scripts/PyG5QjFDUI.min.js') + .then(FingerprintJS => FingerprintJS.load()) + + fpPromise + .then(fp => fp.get()) + .then(result => { + input.val(result.visitorId); + }) + } catch (e) { + console.error('Cannot get fingerprint'); + } + }, + + removeSavedInstrument: function (e) { + const target = $(e.currentTarget); + const savedInstrument = target.data('removeSavedInstrument'); + const errorMessage = target.data('errorMessage'); + const cardMethodOption = $('#wrapper-' + savedInstrument); + + cardMethodOption.addClass('loading'); + $.ajax(target.data('action'), { + method: 'POST', type: 'POST', + data: { + 'savedInstrumentToken': savedInstrument, + 'token': target.data('token'), + }, + }).success(function (data, textStatus, jqXHR) { + if (data.success === true) { + cardMethodOption.remove(); + } else { + cardMethodOption.removeClass('loading'); + paynow.showRemoveSavedInstrumentErrorMessage(savedInstrument, errorMessage); + } + }).error(function (jqXHR, textStatus, errorThrown) { + cardMethodOption.removeClass('loading'); + paynow.showRemoveSavedInstrumentErrorMessage(savedInstrument, errorMessage); + }); + }, + + showRemoveSavedInstrumentErrorMessage: function (savedInstrument, errorMessage) { + const errorMessageWrapper = jQuery('#wrapper-' + savedInstrument + ' .paynow-payment-card-error'); + + errorMessageWrapper.text(errorMessage); + + setTimeout(() => { + errorMessageWrapper.text(''); + }, 5000) + }, + paymentButton: { show: function () { $(paynow.selectors.paymentButton).show(); diff --git a/modules/paynow/views/templates/front/1.7/_partials/payment_data_processing_info.tpl b/modules/paynow/views/templates/front/1.7/_partials/payment_data_processing_info.tpl index ce15440c..eea48315 100644 --- a/modules/paynow/views/templates/front/1.7/_partials/payment_data_processing_info.tpl +++ b/modules/paynow/views/templates/front/1.7/_partials/payment_data_processing_info.tpl @@ -13,4 +13,8 @@ {/if} {/foreach} -{/if} \ No newline at end of file +{/if} + +{if $data_paynow_plugin_version} + +{/if} diff --git a/modules/paynow/views/templates/hook/_partials/payment_data_processing_info.tpl b/modules/paynow/views/templates/hook/_partials/payment_data_processing_info.tpl index 231f787d..7ea55186 100644 --- a/modules/paynow/views/templates/hook/_partials/payment_data_processing_info.tpl +++ b/modules/paynow/views/templates/hook/_partials/payment_data_processing_info.tpl @@ -29,4 +29,8 @@ -{/if} \ No newline at end of file +{/if} + +{if $data_paynow_plugin_version} + +{/if} diff --git a/modules/paynow/views/templates/hook/payment.tpl b/modules/paynow/views/templates/hook/payment.tpl index 75dfc20c..a403cbba 100644 --- a/modules/paynow/views/templates/hook/payment.tpl +++ b/modules/paynow/views/templates/hook/payment.tpl @@ -10,7 +10,7 @@ *} {if !empty($payment_options)} {foreach from=$payment_options item=method} - {if ($method.type !== 'BLIK' AND $method.type !== 'PBL' || ($method.type == 'BLIK' AND $method.authorization != 'CODE')) } + {if ($method.type !== 'BLIK' AND $method.type !== 'PBL' AND $method.type !== 'CARD' AND $method.type !== 'DIGITAL_WALLETS' || ($method.type == 'BLIK' AND $method.authorization != 'CODE') || ($method.type == 'CARD' AND empty($method.instruments))) }
{/if}

@@ -24,9 +24,12 @@ {if $method.authorization == 'CODE'} {include file="./_partials/payment_method_blik_form.tpl"} {/if} + {if ($method.type == 'CARD' AND !empty($method.instruments))} + {include file="./_partials/payment_method_card_form.tpl"} + {/if} {/if}

- {if ($method.type !== 'BLIK' AND $method.type !== 'PBL' || ($method.type == 'BLIK' AND $method.authorization != 'CODE')) } + {if ($method.type !== 'BLIK' AND $method.type !== 'PBL' AND $method.type !== 'CARD' || ($method.type == 'BLIK' AND $method.authorization != 'CODE') || ($method.type == 'CARD' AND empty($method.instruments))) }
{/if} {/foreach}