stetodd / stripe-gateway-bundle
Stripe implementation of stetodd/payment-gateway as a Symfony bundle
Package info
github.com/stetodd/stripe-gateway-bundle
Type:symfony-bundle
pkg:composer/stetodd/stripe-gateway-bundle
Requires
- php: >=8.4
- psr/log: ^3.0
- stetodd/payment-gateway: ^0.3
- stripe/stripe-php: ^20.2
- symfony/config: ^7.2|^8.0
- symfony/dependency-injection: ^7.2|^8.0
- symfony/http-foundation: ^7.2|^8.0
- symfony/http-kernel: ^7.2|^8.0
- symfony/serializer: ^7.2|^8.0
- symfony/webhook: ^7.2|^8.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-08-31 22:11:58 UTC
README
Stripe implementation of stetodd/payment-gateway as a Symfony bundle.
Install
composer require stetodd/stripe-gateway-bundle
Register in config/bundles.php:
Stetodd\StripeGatewayBundle\StetoddStripeGatewayBundle::class => ['all' => true],
The bundle binds Stetodd\PaymentGateway\PaymentGatewayInterface to StripePaymentGateway. Override the alias in your own services config to swap implementations (e.g. the Simulator in tests).
Configuration
Defaults read from env vars — set these and you need no bundle config at all:
STRIPE_SECRET_KEY
Or configure explicitly in config/packages/stetodd_stripe_gateway.yaml:
stetodd_stripe_gateway: secret_key: '%env(STRIPE_SECRET_KEY)%' webhook_path: /webhook/stripe
Checkout success/cancel URLs are per-request data: pass absolute URLs on
CreateCheckoutSessionRequest (successUrl, cancelUrl), the same way the
customer portal takes its returnUrl. The gateway appends
session_id={CHECKOUT_SESSION_ID} to the success URL, joining with & when the
URL already carries a query string.
Webhooks
Route Stripe webhooks to the bundled parser in config/packages/webhook.yaml:
framework: webhook: routing: stripe: service: Stetodd\StripeGatewayBundle\Webhook\StripeRequestParser secret: '%env(STRIPE_WEBHOOK_SECRET)%'
Consume events with a #[AsRemoteEventConsumer('stripe')] consumer in your app — that part is application-specific. Stetodd\StripeGatewayBundle\Webhook\WebhookEvent hydrates typed Stripe objects from the payload.