mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
Remove possibility to add Stripe as a payment method when package is missing
This commit is contained in:
parent
833c89118f
commit
df124bc5ff
3 changed files with 36 additions and 1 deletions
|
|
@ -28,7 +28,8 @@
|
|||
"HWI\\Bundle\\OAuthBundle\\Security\\Core\\User\\OAuthAwareUserProviderInterface",
|
||||
"League\\Flysystem\\FilesystemOperator",
|
||||
"Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactoryInterface",
|
||||
"PHPUnit\\Framework\\ExpectationFailedException"
|
||||
"PHPUnit\\Framework\\ExpectationFailedException",
|
||||
"Stripe\\Stripe"
|
||||
],
|
||||
"php-core-extensions" : [
|
||||
"Core",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Sylius package.
|
||||
*
|
||||
* (c) Paweł Jędrzejewski
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Sylius\Bundle\PayumBundle\DependencyInjection\Compiler;
|
||||
|
||||
use Stripe\Stripe;
|
||||
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
|
||||
final class UnregisterStripeGatewayTypePass implements CompilerPassInterface
|
||||
{
|
||||
private const STRIPE_GATEWAY_TYPE_SERVICE_ID = 'sylius.form.type.gateway_configuration.stripe';
|
||||
|
||||
public function process(ContainerBuilder $container)
|
||||
{
|
||||
if (class_exists(Stripe::class)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$container->removeDefinition(self::STRIPE_GATEWAY_TYPE_SERVICE_ID);
|
||||
}
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ namespace Sylius\Bundle\PayumBundle;
|
|||
|
||||
use Sylius\Bundle\PayumBundle\DependencyInjection\Compiler\InjectContainerIntoControllersPass;
|
||||
use Sylius\Bundle\PayumBundle\DependencyInjection\Compiler\RegisterGatewayConfigTypePass;
|
||||
use Sylius\Bundle\PayumBundle\DependencyInjection\Compiler\UnregisterStripeGatewayTypePass;
|
||||
use Sylius\Bundle\PayumBundle\DependencyInjection\Compiler\UseTweakedDoctrineStoragePass;
|
||||
use Sylius\Bundle\ResourceBundle\AbstractResourceBundle;
|
||||
use Sylius\Bundle\ResourceBundle\SyliusResourceBundle;
|
||||
|
|
@ -36,5 +37,6 @@ final class SyliusPayumBundle extends AbstractResourceBundle
|
|||
$container->addCompilerPass(new InjectContainerIntoControllersPass());
|
||||
$container->addCompilerPass(new RegisterGatewayConfigTypePass());
|
||||
$container->addCompilerPass(new UseTweakedDoctrineStoragePass());
|
||||
$container->addCompilerPass(new UnregisterStripeGatewayTypePass(), priority: 128);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue