From bf7448dbe35f3fc99e32687a3719d2308950bfac Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Fri, 6 Feb 2026 09:56:03 +0100 Subject: [PATCH 1/7] Drop PHP 7.4 and Symfony 4.4 support - Require PHP ^8.0 - Require Symfony ^5.4 || ^6.0 || ^7.0 || ^8.0 - Remove symfony/polyfill-php80 dependency --- composer.json | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/composer.json b/composer.json index cfa2fa0b..e885dc86 100644 --- a/composer.json +++ b/composer.json @@ -37,14 +37,13 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.0", "payum/core": "^1.7.2", - "symfony/framework-bundle": "^4.4 || ^5.4 || ^6.0 || ^7.0", - "symfony/form": "^4.4.20 || ^5.4 || ^6.0 || ^7.0", - "symfony/validator": "^4.4 || ^5.4 || ^6.0 || ^7.0", - "symfony/security-csrf": "^4.4 || ^5.4 || ^6.0 || ^7.0", - "symfony/dependency-injection": "^4.4 || ^5.4 || ^6.4 || ^7.0", - "symfony/polyfill-php80": "^1.26" + "symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/form": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/validator": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/security-csrf": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/dependency-injection": "^5.4 || ^6.4 || ^7.0 || ^8.0" }, "require-dev": { "defuse/php-encryption": "^2", @@ -57,16 +56,19 @@ "payum/stripe": "^1.7", "payum/omnipay-v3-bridge": "dev-master", "php-http/guzzle7-adapter": "^1.0", - "phpunit/phpunit": "^9.5", + "symfony/http-client": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "nyholm/psr7": "^1.5", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^9.5 || ^10.0", "psr/log": "^1 || ^2 || ^3", "stripe/stripe-php": "~7.0", - "symfony/browser-kit": "^4.4 || ^5.4 || ^6.0 || ^7.0", - "symfony/expression-language": "^4.4 || ^5.4 || ^6.0 || ^7.0", - "symfony/phpunit-bridge": "^4.4 || ^5.4 || ^6.0 || ^7.0", - "symfony/templating": "^4.4 || ^5.4 || ^6.0 || ^7.0", - "symfony/twig-bundle": "^4.4 || ^5.4 || ^6.0 || ^7.0", - "symfony/web-profiler-bundle": "^4.4 || ^5.4 || ^6.0 || ^7.0", - "symfony/yaml": "^4.4 || ^5.4 || ^6.0 || ^7.0", + "symfony/browser-kit": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/expression-language": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/templating": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/twig-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/web-profiler-bundle": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0 || ^8.0", "twig/twig": "^2.0 || ^3.0" }, "suggest": { From 0ec2192c72cb30159818764ab320adc0f1fba48b Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Fri, 6 Feb 2026 09:56:10 +0100 Subject: [PATCH 2/7] Convert XML service configs to PHP Symfony 8 removed XmlFileLoader, requiring PHP-based service configuration. This converts all XML configs to PHP format using ContainerBuilder API. --- .../Storage/DoctrineStorageFactory.php | 6 +- .../Storage/FilesystemStorageFactory.php | 6 +- .../Factory/Storage/Propel1StorageFactory.php | 6 +- .../Factory/Storage/Propel2StorageFactory.php | 6 +- DependencyInjection/PayumExtension.php | 14 +-- Resources/config/commands.php | 32 +++++ Resources/config/controller.php | 64 ++++++++++ Resources/config/debug.php | 23 ++++ Resources/config/form.php | 43 +++++++ Resources/config/payum.php | 118 ++++++++++++++++++ Resources/config/storage/doctrine.mongodb.php | 30 +++++ Resources/config/storage/doctrine.orm.php | 24 ++++ Resources/config/storage/filesystem.php | 24 ++++ Resources/config/storage/propel1.php | 16 +++ Resources/config/storage/propel2.php | 16 +++ 15 files changed, 409 insertions(+), 19 deletions(-) create mode 100644 Resources/config/commands.php create mode 100644 Resources/config/controller.php create mode 100644 Resources/config/debug.php create mode 100644 Resources/config/form.php create mode 100644 Resources/config/payum.php create mode 100644 Resources/config/storage/doctrine.mongodb.php create mode 100644 Resources/config/storage/doctrine.orm.php create mode 100644 Resources/config/storage/filesystem.php create mode 100644 Resources/config/storage/propel1.php create mode 100644 Resources/config/storage/propel2.php diff --git a/DependencyInjection/Factory/Storage/DoctrineStorageFactory.php b/DependencyInjection/Factory/Storage/DoctrineStorageFactory.php index 50264a1f..7ba0cddf 100644 --- a/DependencyInjection/Factory/Storage/DoctrineStorageFactory.php +++ b/DependencyInjection/Factory/Storage/DoctrineStorageFactory.php @@ -4,7 +4,7 @@ use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\Config\FileLocator; class DoctrineStorageFactory extends AbstractStorageFactory @@ -32,8 +32,8 @@ public function addConfiguration(ArrayNodeDefinition $builder): void protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); - $loader->load('doctrine.'.$config['driver'].'.xml'); + $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); + $loader->load('doctrine.'.$config['driver'].'.php'); $storage = new ChildDefinition(sprintf('payum.storage.doctrine.%s', $config['driver'])); $storage->setPublic(true); diff --git a/DependencyInjection/Factory/Storage/FilesystemStorageFactory.php b/DependencyInjection/Factory/Storage/FilesystemStorageFactory.php index 1ec38e2a..568639e5 100644 --- a/DependencyInjection/Factory/Storage/FilesystemStorageFactory.php +++ b/DependencyInjection/Factory/Storage/FilesystemStorageFactory.php @@ -4,7 +4,7 @@ use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\Config\FileLocator; class FilesystemStorageFactory extends AbstractStorageFactory @@ -29,8 +29,8 @@ public function addConfiguration(ArrayNodeDefinition $builder): void protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); - $loader->load('filesystem.xml'); + $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); + $loader->load('filesystem.php'); $storage = new ChildDefinition('payum.storage.filesystem.prototype'); $storage->setPublic(true); diff --git a/DependencyInjection/Factory/Storage/Propel1StorageFactory.php b/DependencyInjection/Factory/Storage/Propel1StorageFactory.php index 6cd9fb21..f7f100ed 100644 --- a/DependencyInjection/Factory/Storage/Propel1StorageFactory.php +++ b/DependencyInjection/Factory/Storage/Propel1StorageFactory.php @@ -3,7 +3,7 @@ use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\Config\FileLocator; class Propel1StorageFactory extends AbstractStorageFactory @@ -18,8 +18,8 @@ public function getName(): string protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); - $loader->load('propel1.xml'); + $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); + $loader->load('propel1.php'); $storage = new ChildDefinition('payum.storage.propel1'); $storage->setPublic(true); diff --git a/DependencyInjection/Factory/Storage/Propel2StorageFactory.php b/DependencyInjection/Factory/Storage/Propel2StorageFactory.php index ca29b406..4f6931ee 100644 --- a/DependencyInjection/Factory/Storage/Propel2StorageFactory.php +++ b/DependencyInjection/Factory/Storage/Propel2StorageFactory.php @@ -3,7 +3,7 @@ use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\Config\FileLocator; class Propel2StorageFactory extends AbstractStorageFactory @@ -18,8 +18,8 @@ public function getName(): string protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition { - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); - $loader->load('propel2.xml'); + $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); + $loader->load('propel2.php'); $storage = new ChildDefinition('payum.storage.propel2'); $storage->setPublic(true); diff --git a/DependencyInjection/PayumExtension.php b/DependencyInjection/PayumExtension.php index ab21c178..03ed896e 100644 --- a/DependencyInjection/PayumExtension.php +++ b/DependencyInjection/PayumExtension.php @@ -16,7 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface; -use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; +use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpKernel\DependencyInjection\Extension; use Symfony\Component\Config\FileLocator; @@ -52,14 +52,14 @@ public function load(array $configs, ContainerBuilder $container): void $config = $this->processConfiguration($mainConfig, $configs); // load services - $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); - $loader->load('payum.xml'); - $loader->load('commands.xml'); - $loader->load('controller.xml'); - $loader->load('form.xml'); + $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader->load('payum.php'); + $loader->load('commands.php'); + $loader->load('controller.php'); + $loader->load('form.php'); if ($container->getParameter('kernel.debug')) { - $loader->load('debug.xml'); + $loader->load('debug.php'); } $this->loadStorages($config['storages'], $container); diff --git a/Resources/config/commands.php b/Resources/config/commands.php new file mode 100644 index 00000000..26193955 --- /dev/null +++ b/Resources/config/commands.php @@ -0,0 +1,32 @@ +register('payum.command.create_capture_token', CreateCaptureTokenCommand::class) + ->setArguments([new Reference('payum')]) + ->addTag('console.command') + ; + + $container->register('payum.command.create_notify_token', CreateNotifyTokenCommand::class) + ->setArguments([new Reference('payum')]) + ->addTag('console.command') + ; + + $container->register('payum.command.debug_gateway', DebugGatewayCommand::class) + ->setArguments([new Reference('payum')]) + ->addTag('console.command') + ; + + $container->register('payum.command.status', StatusCommand::class) + ->setArguments([new Reference('payum')]) + ->addTag('console.command') + ; +}; diff --git a/Resources/config/controller.php b/Resources/config/controller.php new file mode 100644 index 00000000..356bcb05 --- /dev/null +++ b/Resources/config/controller.php @@ -0,0 +1,64 @@ +register(PayumController::class) + ->setAbstract(true) + ->setArguments([new Reference('payum')]) + ; + + $container->setDefinition(AuthorizeController::class, new ChildDefinition(PayumController::class)) + ->setPublic(true) + ->setAutowired(true) + ->addTag('container.service_subscriber') + ; + + $container->setDefinition(CancelController::class, new ChildDefinition(PayumController::class)) + ->setPublic(true) + ->setAutowired(true) + ->addTag('container.service_subscriber') + ; + + $container->setDefinition(CaptureController::class, new ChildDefinition(PayumController::class)) + ->setPublic(true) + ->setAutowired(true) + ->addTag('container.service_subscriber') + ; + + $container->setDefinition(NotifyController::class, new ChildDefinition(PayumController::class)) + ->setPublic(true) + ->setAutowired(true) + ->addTag('container.service_subscriber') + ; + + $container->setDefinition(PayoutController::class, new ChildDefinition(PayumController::class)) + ->setPublic(true) + ->setAutowired(true) + ->addTag('container.service_subscriber') + ; + + $container->setDefinition(RefundController::class, new ChildDefinition(PayumController::class)) + ->setPublic(true) + ->setAutowired(true) + ->addTag('container.service_subscriber') + ; + + $container->setDefinition(SyncController::class, new ChildDefinition(PayumController::class)) + ->setPublic(true) + ->setAutowired(true) + ->addTag('container.service_subscriber') + ; +}; diff --git a/Resources/config/debug.php b/Resources/config/debug.php new file mode 100644 index 00000000..4dd0ad33 --- /dev/null +++ b/Resources/config/debug.php @@ -0,0 +1,23 @@ +register('payum.extension.log_executed_actions', LogExecutedActionsExtension::class) + ->setPublic(true) + ->setArguments([new Reference('logger', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE)]) + ->addTag('monolog.logger', ['channel' => 'payum']) + ->addTag('payum.extension', ['all' => true, 'alias' => 'log_executed_actions']) + ; + + $container->register('payum.profiler.payum_collector', PayumCollector::class) + ->setPublic(true) + ->addTag('payum.extension', ['all' => true, 'alias' => 'profile_collector', 'prepend' => true]) + ->addTag('data_collector', ['template' => '@Payum/Profiler/payum.html.twig', 'id' => 'payum']) + ; +}; diff --git a/Resources/config/form.php b/Resources/config/form.php new file mode 100644 index 00000000..357dbb43 --- /dev/null +++ b/Resources/config/form.php @@ -0,0 +1,43 @@ +setParameter('payum.available_gateway_factories', []); + + $container->register('payum.form.type.credit_card_expiration_date', CreditCardExpirationDateType::class) + ->setPublic(true) + ->addTag('form.type') + ; + + $container->register('payum.form.type.credit_card', CreditCardType::class) + ->setPublic(true) + ->addTag('form.type') + ; + + $container->register('payum.form.type.gateway_config', GatewayConfigType::class) + ->setPublic(true) + ->setArguments([new Reference('payum')]) + ->addTag('form.type') + ; + + $container->register('payum.form.type.gateway_factories_choice', GatewayFactoriesChoiceType::class) + ->setPublic(true) + ->setArguments(['%payum.available_gateway_factories%']) + ->addTag('form.type') + ; + + $container->register('payum.form.extension.gateway_factories_choice', GatewayFactoriesChoiceTypeExtension::class) + ->setPublic(true) + ->setArguments([new Reference('payum')]) + ->addTag('form.type_extension', ['extended_type' => GatewayFactoriesChoiceType::class]) + ; +}; diff --git a/Resources/config/payum.php b/Resources/config/payum.php new file mode 100644 index 00000000..8566fd6c --- /dev/null +++ b/Resources/config/payum.php @@ -0,0 +1,118 @@ +setParameter('payum.capture_path', 'payum_capture_do'); + $container->setParameter('payum.notify_path', 'payum_notify_do'); + $container->setParameter('payum.authorize_path', 'payum_authorize_do'); + $container->setParameter('payum.refund_path', 'payum_refund_do'); + $container->setParameter('payum.cancel_path', 'payum_cancel_do'); + $container->setParameter('payum.payout_path', 'payum_payout_do'); + + $container->register('payum.builder', PayumBuilder::class) + ->setPublic(false) + ->addMethodCall('setMainRegistry', [new Reference('payum.static_registry')]) + ->addMethodCall('setHttpRequestVerifier', [new Reference('payum.http_request_verifier_builder')]) + ->addMethodCall('setTokenFactory', [new Reference('payum.token_factory_builder')]) + ->addMethodCall('setTokenStorage', [new Reference('payum.security.token_storage')]) + ->addMethodCall('setGenericTokenFactoryPaths', [[ + 'capture' => '%payum.capture_path%', + 'notify' => '%payum.notify_path%', + 'authorize' => '%payum.authorize_path%', + 'refund' => '%payum.refund_path%', + 'cancel' => '%payum.cancel_path%', + 'payout' => '%payum.payout_path%', + ]]) + ->addMethodCall('setCoreGatewayFactory', [new Reference('payum.core_gateway_factory_builder')]) + ; + + $container->register('payum', Payum::class) + ->setPublic(true) + ->setLazy(true) + ->setFactory([new Reference('payum.builder'), 'getPayum']) + ; + + $container->setAlias(Payum::class, 'payum')->setPublic(true); + + $container->register('payum.static_registry', ContainerAwareRegistry::class) + ->setPublic(true) + ->setArguments([ + [], // gateways services - replaced while container is built + [], // storages services - replaced while container is built + [], // gateways factories services - replaced while container is built + new Reference('service_container'), + ]) + ; + + $container->register('payum.converter.reply_to_http_response', ReplyToSymfonyResponseConverter::class) + ->setPublic(true) + ; + + $container->register('payum.listener.reply_to_http_response', ReplyToHttpResponseListener::class) + ->setPublic(true) + ->setArguments([new Reference('payum.converter.reply_to_http_response')]) + ->addTag('kernel.event_listener', ['event' => 'kernel.exception', 'method' => 'onKernelException', 'priority' => 128]) + ; + + $container->register('payum.security.token_storage') + ->setAbstract(true) + ; + + // Extensions + $container->register('payum.extension.storage.prototype', StorageExtension::class) + ->setAbstract(true) + ->setPublic(false) + ->setArguments([null]) // replaced with real storage service + ; + + $container->register('payum.extension.logger', LoggerExtension::class) + ->setPublic(true) + ->setArguments([new Reference('logger', ContainerBuilder::IGNORE_ON_INVALID_REFERENCE)]) + ->addTag('monolog.logger', ['channel' => 'payum']) + ->addTag('payum.extension', ['all' => true, 'alias' => 'psr_logger']) + ; + + // Builders + $container->register('payum.token_factory_builder', TokenFactoryBuilder::class) + ->setPublic(false) + ->setArguments([new Reference('router')]) + ; + + $container->register('payum.http_request_verifier_builder', HttpRequestVerifierBuilder::class) + ->setPublic(false) + ; + + $container->register('payum.core_gateway_factory_builder', CoreGatewayFactoryBuilder::class) + ->setPublic(false) + ->setArguments([new Reference('service_container')]) + ; + + $container->register('payum.action.obtain_credit_card_builder', ObtainCreditCardActionBuilder::class) + ->setPublic(true) + ->setArguments([ + new Reference('form.factory'), + new Reference('request_stack'), + ]) + ; + + $container->register('payum.action.get_http_request', GetHttpRequestAction::class) + ->setPublic(true) + ->addMethodCall('setHttpRequestStack', [new Reference('request_stack')]) + ; +}; diff --git a/Resources/config/storage/doctrine.mongodb.php b/Resources/config/storage/doctrine.mongodb.php new file mode 100644 index 00000000..6a78f38f --- /dev/null +++ b/Resources/config/storage/doctrine.mongodb.php @@ -0,0 +1,30 @@ +parameters() + ->set('payum.storage.doctrine.mongodb.class', DoctrineStorage::class) + ; + + $services = $container->services(); + + $services->set('payum.storage.doctrine.mongodb', '%payum.storage.doctrine.mongodb.class%') + ->public(false) + ->abstract() + ->args([ + ref('payum.document_manager'), + null, // should be set in DoctrineStorageFactory + ]) + ; + + $services->set('payum.document_manager', DocumentManager::class) + ->public(false) + ->factory([ref('doctrine_mongodb'), 'getManager']) + ; +}; diff --git a/Resources/config/storage/doctrine.orm.php b/Resources/config/storage/doctrine.orm.php new file mode 100644 index 00000000..4f8216c3 --- /dev/null +++ b/Resources/config/storage/doctrine.orm.php @@ -0,0 +1,24 @@ +setParameter('payum.storage.doctrine.orm.class', DoctrineStorage::class); + + $container->register('payum.storage.doctrine.orm', '%payum.storage.doctrine.orm.class%') + ->setPublic(false) + ->setAbstract(true) + ->setArguments([ + new Reference('payum.entity_manager'), + null, // should be set in DoctrineStorageFactory + ]) + ; + + $container->setAlias('payum.entity_manager', 'doctrine.orm.default_entity_manager') + ->setPublic(false) + ; +}; diff --git a/Resources/config/storage/filesystem.php b/Resources/config/storage/filesystem.php new file mode 100644 index 00000000..73b5e6c8 --- /dev/null +++ b/Resources/config/storage/filesystem.php @@ -0,0 +1,24 @@ +parameters() + ->set('payum.storage.filesystem.class', FilesystemStorage::class) + ; + + $services = $container->services(); + + $services->set('payum.storage.filesystem.prototype', '%payum.storage.filesystem.class%') + ->public(false) + ->abstract() + ->args([ + null, // should be set in FilesystemStorageFactory + null, // should be set in FilesystemStorageFactory + null, // should be set in FilesystemStorageFactory + ]) + ; +}; diff --git a/Resources/config/storage/propel1.php b/Resources/config/storage/propel1.php new file mode 100644 index 00000000..7b1154bb --- /dev/null +++ b/Resources/config/storage/propel1.php @@ -0,0 +1,16 @@ +services(); + + $services->set('payum.storage.propel1', Propel1Storage::class) + ->public(false) + ->abstract() + ->args([null]) // should be set in Propel1StorageFactory + ; +}; diff --git a/Resources/config/storage/propel2.php b/Resources/config/storage/propel2.php new file mode 100644 index 00000000..e7284e65 --- /dev/null +++ b/Resources/config/storage/propel2.php @@ -0,0 +1,16 @@ +services(); + + $services->set('payum.storage.propel2', Propel2Storage::class) + ->public(false) + ->abstract() + ->args([null]) // should be set in Propel2StorageFactory + ; +}; From ab17ee4641afbc4c6015a499c63152cdef723faf Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Fri, 6 Feb 2026 09:56:19 +0100 Subject: [PATCH 3/7] Convert XML routing files to YAML Symfony 8 removed XML routing support. This converts all routing configuration from XML to YAML format. --- Resources/config/routing/all.xml | 11 ----------- Resources/config/routing/all.yaml | 20 ++++++++++++++++++++ Resources/config/routing/authorize.xml | 7 ------- Resources/config/routing/authorize.yaml | 4 ++++ Resources/config/routing/cancel.xml | 7 ------- Resources/config/routing/cancel.yaml | 4 ++++ Resources/config/routing/capture.xml | 11 ----------- Resources/config/routing/capture.yaml | 9 +++++++++ Resources/config/routing/notify.xml | 11 ----------- Resources/config/routing/notify.yaml | 9 +++++++++ Resources/config/routing/payout.xml | 7 ------- Resources/config/routing/payout.yaml | 4 ++++ Resources/config/routing/refund.xml | 7 ------- Resources/config/routing/refund.yaml | 4 ++++ Resources/config/routing/sync.xml | 7 ------- Resources/config/routing/sync.yaml | 4 ++++ Tests/Functional/app/config/routing.yml | 2 +- 17 files changed, 59 insertions(+), 69 deletions(-) delete mode 100644 Resources/config/routing/all.xml create mode 100644 Resources/config/routing/all.yaml delete mode 100644 Resources/config/routing/authorize.xml create mode 100644 Resources/config/routing/authorize.yaml delete mode 100644 Resources/config/routing/cancel.xml create mode 100644 Resources/config/routing/cancel.yaml delete mode 100644 Resources/config/routing/capture.xml create mode 100644 Resources/config/routing/capture.yaml delete mode 100644 Resources/config/routing/notify.xml create mode 100644 Resources/config/routing/notify.yaml delete mode 100644 Resources/config/routing/payout.xml create mode 100644 Resources/config/routing/payout.yaml delete mode 100644 Resources/config/routing/refund.xml create mode 100644 Resources/config/routing/refund.yaml delete mode 100644 Resources/config/routing/sync.xml create mode 100644 Resources/config/routing/sync.yaml diff --git a/Resources/config/routing/all.xml b/Resources/config/routing/all.xml deleted file mode 100644 index 408e4b42..00000000 --- a/Resources/config/routing/all.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Resources/config/routing/all.yaml b/Resources/config/routing/all.yaml new file mode 100644 index 00000000..4260f3e3 --- /dev/null +++ b/Resources/config/routing/all.yaml @@ -0,0 +1,20 @@ +_payum_capture: + resource: "@PayumBundle/Resources/config/routing/capture.yaml" + +_payum_authorize: + resource: "@PayumBundle/Resources/config/routing/authorize.yaml" + +_payum_notify: + resource: "@PayumBundle/Resources/config/routing/notify.yaml" + +_payum_payout: + resource: "@PayumBundle/Resources/config/routing/payout.yaml" + +_payum_refund: + resource: "@PayumBundle/Resources/config/routing/refund.yaml" + +_payum_sync: + resource: "@PayumBundle/Resources/config/routing/sync.yaml" + +_payum_cancel: + resource: "@PayumBundle/Resources/config/routing/cancel.yaml" diff --git a/Resources/config/routing/authorize.xml b/Resources/config/routing/authorize.xml deleted file mode 100644 index 5ffa0952..00000000 --- a/Resources/config/routing/authorize.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Payum\Bundle\PayumBundle\Controller\AuthorizeController::doAction - - \ No newline at end of file diff --git a/Resources/config/routing/authorize.yaml b/Resources/config/routing/authorize.yaml new file mode 100644 index 00000000..a39b910f --- /dev/null +++ b/Resources/config/routing/authorize.yaml @@ -0,0 +1,4 @@ +payum_authorize_do: + path: /payment/authorize/{payum_token} + defaults: + _controller: Payum\Bundle\PayumBundle\Controller\AuthorizeController::doAction diff --git a/Resources/config/routing/cancel.xml b/Resources/config/routing/cancel.xml deleted file mode 100644 index c02e946c..00000000 --- a/Resources/config/routing/cancel.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Payum\Bundle\PayumBundle\Controller\CancelController::doAction - - \ No newline at end of file diff --git a/Resources/config/routing/cancel.yaml b/Resources/config/routing/cancel.yaml new file mode 100644 index 00000000..df5a61ed --- /dev/null +++ b/Resources/config/routing/cancel.yaml @@ -0,0 +1,4 @@ +payum_cancel_do: + path: /payment/cancel/{payum_token} + defaults: + _controller: Payum\Bundle\PayumBundle\Controller\CancelController::doAction diff --git a/Resources/config/routing/capture.xml b/Resources/config/routing/capture.xml deleted file mode 100644 index a79fdd88..00000000 --- a/Resources/config/routing/capture.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Payum\Bundle\PayumBundle\Controller\CaptureController::doSessionTokenAction - - - - Payum\Bundle\PayumBundle\Controller\CaptureController::doAction - - \ No newline at end of file diff --git a/Resources/config/routing/capture.yaml b/Resources/config/routing/capture.yaml new file mode 100644 index 00000000..c15894a1 --- /dev/null +++ b/Resources/config/routing/capture.yaml @@ -0,0 +1,9 @@ +payum_capture_do_session: + path: /payment/capture/session-token + defaults: + _controller: Payum\Bundle\PayumBundle\Controller\CaptureController::doSessionTokenAction + +payum_capture_do: + path: /payment/capture/{payum_token} + defaults: + _controller: Payum\Bundle\PayumBundle\Controller\CaptureController::doAction diff --git a/Resources/config/routing/notify.xml b/Resources/config/routing/notify.xml deleted file mode 100644 index aea2818a..00000000 --- a/Resources/config/routing/notify.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - Payum\Bundle\PayumBundle\Controller\NotifyController::doUnsafeAction - - - - Payum\Bundle\PayumBundle\Controller\NotifyController::doAction - - \ No newline at end of file diff --git a/Resources/config/routing/notify.yaml b/Resources/config/routing/notify.yaml new file mode 100644 index 00000000..c379bd40 --- /dev/null +++ b/Resources/config/routing/notify.yaml @@ -0,0 +1,9 @@ +payum_notify_do_unsafe: + path: /payment/notify/unsafe/{gateway} + defaults: + _controller: Payum\Bundle\PayumBundle\Controller\NotifyController::doUnsafeAction + +payum_notify_do: + path: /payment/notify/{payum_token} + defaults: + _controller: Payum\Bundle\PayumBundle\Controller\NotifyController::doAction diff --git a/Resources/config/routing/payout.xml b/Resources/config/routing/payout.xml deleted file mode 100644 index 9a82facb..00000000 --- a/Resources/config/routing/payout.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Payum\Bundle\PayumBundle\Controller\PayoutController::doAction - - \ No newline at end of file diff --git a/Resources/config/routing/payout.yaml b/Resources/config/routing/payout.yaml new file mode 100644 index 00000000..ff5a6ccd --- /dev/null +++ b/Resources/config/routing/payout.yaml @@ -0,0 +1,4 @@ +payum_payout_do: + path: /payment/payout/{payum_token} + defaults: + _controller: Payum\Bundle\PayumBundle\Controller\PayoutController::doAction diff --git a/Resources/config/routing/refund.xml b/Resources/config/routing/refund.xml deleted file mode 100644 index 5ad10966..00000000 --- a/Resources/config/routing/refund.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Payum\Bundle\PayumBundle\Controller\RefundController::doAction - - \ No newline at end of file diff --git a/Resources/config/routing/refund.yaml b/Resources/config/routing/refund.yaml new file mode 100644 index 00000000..3b1f0bab --- /dev/null +++ b/Resources/config/routing/refund.yaml @@ -0,0 +1,4 @@ +payum_refund_do: + path: /payment/refund/{payum_token} + defaults: + _controller: Payum\Bundle\PayumBundle\Controller\RefundController::doAction diff --git a/Resources/config/routing/sync.xml b/Resources/config/routing/sync.xml deleted file mode 100644 index 402ac937..00000000 --- a/Resources/config/routing/sync.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Payum\Bundle\PayumBundle\Controller\SyncController::doAction - - \ No newline at end of file diff --git a/Resources/config/routing/sync.yaml b/Resources/config/routing/sync.yaml new file mode 100644 index 00000000..fdcaff40 --- /dev/null +++ b/Resources/config/routing/sync.yaml @@ -0,0 +1,4 @@ +payum_sync_do: + path: /payment/sync/{payum_token} + defaults: + _controller: Payum\Bundle\PayumBundle\Controller\SyncController::doAction diff --git a/Tests/Functional/app/config/routing.yml b/Tests/Functional/app/config/routing.yml index 827711c9..a08aab11 100644 --- a/Tests/Functional/app/config/routing.yml +++ b/Tests/Functional/app/config/routing.yml @@ -1,5 +1,5 @@ payum_all: - resource: "@PayumBundle/Resources/config/routing/all.xml" + resource: "@PayumBundle/Resources/config/routing/all.yaml" prefix: / foo: From eefcb8368edfb4aeb690b2c335f6fd1348cdc026 Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Fri, 6 Feb 2026 09:56:29 +0100 Subject: [PATCH 4/7] Fix Symfony 8 code compatibility - Replace deprecated Request::get() with explicit parameter bag access - Add nullable return type to FormType::getParent() methods - Update CreditCardDate constraint for SF8 named parameter syntax - Add config_sf8.yml for SF8-specific session configuration --- Controller/NotifyController.php | 2 +- Form/Type/CreditCardExpirationDateType.php | 5 +-- Form/Type/GatewayChoiceType.php | 5 +-- Form/Type/GatewayFactoriesChoiceType.php | 5 +-- Security/HttpRequestVerifier.php | 2 +- Tests/Functional/app/config/config_sf8.yml | 6 ++++ Validator/Constraints/CreditCardDate.php | 37 ++++++++++++++++++---- 7 files changed, 41 insertions(+), 21 deletions(-) create mode 100644 Tests/Functional/app/config/config_sf8.yml diff --git a/Controller/NotifyController.php b/Controller/NotifyController.php index 15a4870c..f133d155 100644 --- a/Controller/NotifyController.php +++ b/Controller/NotifyController.php @@ -9,7 +9,7 @@ class NotifyController extends PayumController { public function doUnsafeAction(Request $request): Response { - $gateway = $this->getPayum()->getGateway($request->get('gateway')); + $gateway = $this->getPayum()->getGateway($request->attributes->get('gateway')); $gateway->execute(new Notify(null)); diff --git a/Form/Type/CreditCardExpirationDateType.php b/Form/Type/CreditCardExpirationDateType.php index 136eca0a..329f6797 100644 --- a/Form/Type/CreditCardExpirationDateType.php +++ b/Form/Type/CreditCardExpirationDateType.php @@ -36,10 +36,7 @@ public function configureOptions(OptionsResolver $resolver): void ]); } - /** - * @return ?string - */ - public function getParent() + public function getParent(): ?string { return DateType::class; } diff --git a/Form/Type/GatewayChoiceType.php b/Form/Type/GatewayChoiceType.php index b1b504cb..97461f02 100644 --- a/Form/Type/GatewayChoiceType.php +++ b/Form/Type/GatewayChoiceType.php @@ -28,10 +28,7 @@ public function configureOptions(OptionsResolver $resolver): void ]); } - /** - * @return ?string - */ - public function getParent() + public function getParent(): ?string { return ChoiceType::class; } diff --git a/Form/Type/GatewayFactoriesChoiceType.php b/Form/Type/GatewayFactoriesChoiceType.php index 1b064607..d0f64a8f 100644 --- a/Form/Type/GatewayFactoriesChoiceType.php +++ b/Form/Type/GatewayFactoriesChoiceType.php @@ -28,10 +28,7 @@ public function configureOptions(OptionsResolver $resolver): void ]); } - /** - * @return ?string - */ - public function getParent() + public function getParent(): ?string { return ChoiceType::class; } diff --git a/Security/HttpRequestVerifier.php b/Security/HttpRequestVerifier.php index 635fe764..3cc7dbb9 100644 --- a/Security/HttpRequestVerifier.php +++ b/Security/HttpRequestVerifier.php @@ -36,7 +36,7 @@ public function verify($httpRequest) )); } - if (! $hash = $httpRequest->attributes->get('payum_token', $httpRequest->get('payum_token', false))) { + if (! $hash = $httpRequest->attributes->get('payum_token', $httpRequest->query->get('payum_token', $httpRequest->request->get('payum_token')))) { throw new NotFoundHttpException('Token parameter not set in request'); } diff --git a/Tests/Functional/app/config/config_sf8.yml b/Tests/Functional/app/config/config_sf8.yml new file mode 100644 index 00000000..70454b36 --- /dev/null +++ b/Tests/Functional/app/config/config_sf8.yml @@ -0,0 +1,6 @@ +framework: + session: + handler_id: null + cookie_secure: auto + cookie_samesite: lax + storage_factory_id: session.storage.factory.mock_file diff --git a/Validator/Constraints/CreditCardDate.php b/Validator/Constraints/CreditCardDate.php index 58b186fd..a48e6b99 100644 --- a/Validator/Constraints/CreditCardDate.php +++ b/Validator/Constraints/CreditCardDate.php @@ -20,17 +20,40 @@ class CreditCardDate extends Constraint public $min; - public function __construct($options = null) - { - parent::__construct($options); + public function __construct( + string|array|null $min = null, + ?string $minMessage = null, + ?string $invalidMessage = null, + ?array $groups = null, + mixed $payload = null, + ) { + // Handle BC: if $min is an array, it's old-style options + if (is_array($min)) { + $options = $min; + $minValue = $options['min'] ?? null; + $minMessage = $options['minMessage'] ?? $minMessage; + $invalidMessage = $options['invalidMessage'] ?? $invalidMessage; + parent::__construct($options, $groups, $payload); + } else { + $minValue = $min; + parent::__construct([], $groups, $payload); + } + + if ($minValue !== null) { + $this->min = $minValue; + } + if ($minMessage !== null) { + $this->minMessage = $minMessage; + } + if ($invalidMessage !== null) { + $this->invalidMessage = $invalidMessage; + } if (null === $this->min) { throw new MissingOptionsException('Either option "min" must be given for constraint ' . self::class, ['min']); } - if (null !== $this->min) { - $this->min = new DateTime($this->min); - $this->min->modify('last day of this month'); - } + $this->min = new DateTime($this->min); + $this->min->modify('last day of this month'); } } From ab414a4f27e160b8d921f1040227a66f1fcef1f3 Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Fri, 6 Feb 2026 09:56:36 +0100 Subject: [PATCH 5/7] Update tests for PHPUnit 10+ compatibility - Fix mock class name assertions (Mock_ -> MockObject_) - Update NotifyControllerTest to use request attributes - Exclude abstract test class from phpunit.xml.dist - Remove deprecated PHPUnit config attributes --- Tests/Controller/NotifyControllerTest.php | 23 ++++--------------- .../PayumExtensionTest.php | 2 +- Tests/ReplyToSymfonyResponseConverterTest.php | 2 +- phpunit.xml.dist | 7 ++---- 4 files changed, 8 insertions(+), 26 deletions(-) diff --git a/Tests/Controller/NotifyControllerTest.php b/Tests/Controller/NotifyControllerTest.php index e8f7db3e..4f5efd89 100644 --- a/Tests/Controller/NotifyControllerTest.php +++ b/Tests/Controller/NotifyControllerTest.php @@ -6,12 +6,8 @@ use Payum\Core\GatewayInterface; use Payum\Core\Payum; use Payum\Core\Request\Notify; -use Payum\Core\Security\GenericTokenFactoryInterface; -use Payum\Core\Security\HttpRequestVerifierInterface; -use Payum\Core\Storage\StorageInterface; use PHPUnit\Framework\TestCase; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -33,31 +29,20 @@ public function shouldBeSubClassOfController(): void public function shouldExecuteNotifyRequestOnDoUnsafe(): void { $request = Request::create('/'); - $request->query->set('gateway', 'theGatewayName'); + $request->attributes->set('gateway', 'theGatewayName'); $gatewayMock = $this->createMock(GatewayInterface::class); $gatewayMock ->method('execute') ->with($this->isInstanceOf(Notify::class)); - $registryMock = $this->createMock(Payum::class); - $registryMock + $payumMock = $this->createMock(Payum::class); + $payumMock ->method('getGateway') ->with('theGatewayName') ->willReturn($gatewayMock); - $this->httpRequestVerifierMock = $this->createMock( - HttpRequestVerifierInterface::class - ); - - $this->payum = new Payum( - $registryMock, - $this->httpRequestVerifierMock, - $this->createMock(GenericTokenFactoryInterface::class), - $this->createMock(StorageInterface::class) - ); - - $controller = new NotifyController($this->payum); + $controller = new NotifyController($payumMock); $response = $controller->doUnsafeAction($request); diff --git a/Tests/DependencyInjection/PayumExtensionTest.php b/Tests/DependencyInjection/PayumExtensionTest.php index 2a74d43a..60adcc6d 100644 --- a/Tests/DependencyInjection/PayumExtensionTest.php +++ b/Tests/DependencyInjection/PayumExtensionTest.php @@ -66,8 +66,8 @@ public function shouldAllowAddStorageFactory(): void */ public function throwIfTryToAddStorageFactoryWithEmptyName(): void { - $this->expectExceptionMessage("The storage factory Mock_StorageFactoryInterface_"); $this->expectException(\Payum\Core\Exception\InvalidArgumentException::class); + $this->expectExceptionMessageMatches('/The storage factory (Mock|MockObject)_StorageFactoryInterface_/'); $factoryWithEmptyName = $this->createMock(StorageFactoryInterface::class); $factoryWithEmptyName ->expects($this->once()) diff --git a/Tests/ReplyToSymfonyResponseConverterTest.php b/Tests/ReplyToSymfonyResponseConverterTest.php index 4e8e4912..7d84e9ea 100644 --- a/Tests/ReplyToSymfonyResponseConverterTest.php +++ b/Tests/ReplyToSymfonyResponseConverterTest.php @@ -96,7 +96,7 @@ public function testShouldReturnResponseIfSymfonyHttpResponseReply(): void public function testShouldChangeReplyToLogicExceptionIfNotSupported(): void { $this->expectException(LogicException::class); - $this->expectExceptionMessage('Cannot convert reply Mock_Base_'); + $this->expectExceptionMessageMatches('/Cannot convert reply (Mock|MockObject)_Base_/'); $notSupportedReply = $this->createMock(Base::class); $listener = new ReplyToSymfonyResponseConverter(); diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4aa666be..9a0f9edc 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,19 +1,16 @@ ./Tests + ./Tests/Controller/AbstractControllerTest.php From 7667c5e4724b835d5bbd0a3bccc8ea2ff923552b Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Fri, 6 Feb 2026 09:56:43 +0100 Subject: [PATCH 6/7] Update CI matrix for Symfony 8 support - Add PHP 8.4, 8.5 with Symfony 7.0 and 8.0 - Remove PHP 7.4 and Symfony 4.4 combinations - Remove Symfony 6.0 (non-LTS, has PHPUnit compatibility issues) - Use --prefer-source for payum/core test classes --- .github/workflows/tests.yaml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8cf65d5c..b336ae18 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,24 +14,14 @@ jobs: fail-fast: false matrix: include: - - php: 7.4 - symfony: 4.4.* - - php: 7.4 - symfony: 5.4.* - - php: 8.0 - symfony: 4.4.* - php: 8.0 symfony: 5.4.* - - php: 8.0 - symfony: 6.0.* - - php: 8.1 - symfony: 4.4.* - php: 8.1 symfony: 5.4.* - - php: 8.1 - symfony: 6.0.* - php: 8.1 symfony: 6.4.* + - php: 8.2 + symfony: 5.4.* - php: 8.2 symfony: 6.4.* - php: 8.2 @@ -40,8 +30,12 @@ jobs: symfony: 7.0.* - php: 8.4 symfony: 7.0.* + - php: 8.4 + symfony: 8.0.* - php: 8.5 symfony: 7.0.* + - php: 8.5 + symfony: 8.0.* steps: - name: Checkout @@ -73,7 +67,7 @@ jobs: composer require symfony/flex:"^1|^2" --no-update - name: Install dependencies - run: composer update + run: composer update --prefer-source - name: Run unit tests run: bin/phpunit From d61737e88256f9100c6614e0146c2b7fe7c49153 Mon Sep 17 00:00:00 2001 From: Rafikooo Date: Fri, 6 Feb 2026 11:07:46 +0100 Subject: [PATCH 7/7] Apply review suggestions - Use getString() instead of get() for typed parameter access - Use dirname(__DIR__, N) instead of __DIR__.'/..' concatenation --- Controller/NotifyController.php | 2 +- DependencyInjection/Factory/Storage/DoctrineStorageFactory.php | 2 +- .../Factory/Storage/FilesystemStorageFactory.php | 2 +- DependencyInjection/Factory/Storage/Propel1StorageFactory.php | 2 +- DependencyInjection/Factory/Storage/Propel2StorageFactory.php | 2 +- DependencyInjection/PayumExtension.php | 2 +- Security/HttpRequestVerifier.php | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Controller/NotifyController.php b/Controller/NotifyController.php index f133d155..69cc1850 100644 --- a/Controller/NotifyController.php +++ b/Controller/NotifyController.php @@ -9,7 +9,7 @@ class NotifyController extends PayumController { public function doUnsafeAction(Request $request): Response { - $gateway = $this->getPayum()->getGateway($request->attributes->get('gateway')); + $gateway = $this->getPayum()->getGateway($request->attributes->getString('gateway')); $gateway->execute(new Notify(null)); diff --git a/DependencyInjection/Factory/Storage/DoctrineStorageFactory.php b/DependencyInjection/Factory/Storage/DoctrineStorageFactory.php index 7ba0cddf..c57cf7a9 100644 --- a/DependencyInjection/Factory/Storage/DoctrineStorageFactory.php +++ b/DependencyInjection/Factory/Storage/DoctrineStorageFactory.php @@ -32,7 +32,7 @@ public function addConfiguration(ArrayNodeDefinition $builder): void protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition { - $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); + $loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__, 3).'/Resources/config/storage')); $loader->load('doctrine.'.$config['driver'].'.php'); $storage = new ChildDefinition(sprintf('payum.storage.doctrine.%s', $config['driver'])); diff --git a/DependencyInjection/Factory/Storage/FilesystemStorageFactory.php b/DependencyInjection/Factory/Storage/FilesystemStorageFactory.php index 568639e5..6c278c3e 100644 --- a/DependencyInjection/Factory/Storage/FilesystemStorageFactory.php +++ b/DependencyInjection/Factory/Storage/FilesystemStorageFactory.php @@ -29,7 +29,7 @@ public function addConfiguration(ArrayNodeDefinition $builder): void protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition { - $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); + $loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__, 3).'/Resources/config/storage')); $loader->load('filesystem.php'); $storage = new ChildDefinition('payum.storage.filesystem.prototype'); diff --git a/DependencyInjection/Factory/Storage/Propel1StorageFactory.php b/DependencyInjection/Factory/Storage/Propel1StorageFactory.php index f7f100ed..98808f8f 100644 --- a/DependencyInjection/Factory/Storage/Propel1StorageFactory.php +++ b/DependencyInjection/Factory/Storage/Propel1StorageFactory.php @@ -18,7 +18,7 @@ public function getName(): string protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition { - $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); + $loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__, 3).'/Resources/config/storage')); $loader->load('propel1.php'); $storage = new ChildDefinition('payum.storage.propel1'); diff --git a/DependencyInjection/Factory/Storage/Propel2StorageFactory.php b/DependencyInjection/Factory/Storage/Propel2StorageFactory.php index 4f6931ee..caaec331 100644 --- a/DependencyInjection/Factory/Storage/Propel2StorageFactory.php +++ b/DependencyInjection/Factory/Storage/Propel2StorageFactory.php @@ -18,7 +18,7 @@ public function getName(): string protected function createStorage(ContainerBuilder $container, string $modelClass, array $config): ChildDefinition { - $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../../../Resources/config/storage')); + $loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__, 3).'/Resources/config/storage')); $loader->load('propel2.php'); $storage = new ChildDefinition('payum.storage.propel2'); diff --git a/DependencyInjection/PayumExtension.php b/DependencyInjection/PayumExtension.php index 03ed896e..749a3468 100644 --- a/DependencyInjection/PayumExtension.php +++ b/DependencyInjection/PayumExtension.php @@ -52,7 +52,7 @@ public function load(array $configs, ContainerBuilder $container): void $config = $this->processConfiguration($mainConfig, $configs); // load services - $loader = new PhpFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); + $loader = new PhpFileLoader($container, new FileLocator(dirname(__DIR__).'/Resources/config')); $loader->load('payum.php'); $loader->load('commands.php'); $loader->load('controller.php'); diff --git a/Security/HttpRequestVerifier.php b/Security/HttpRequestVerifier.php index 3cc7dbb9..189d4f87 100644 --- a/Security/HttpRequestVerifier.php +++ b/Security/HttpRequestVerifier.php @@ -36,7 +36,7 @@ public function verify($httpRequest) )); } - if (! $hash = $httpRequest->attributes->get('payum_token', $httpRequest->query->get('payum_token', $httpRequest->request->get('payum_token')))) { + if (! $hash = $httpRequest->attributes->getString('payum_token', $httpRequest->query->getString('payum_token', $httpRequest->request->getString('payum_token')))) { throw new NotFoundHttpException('Token parameter not set in request'); }