PHPackages                             ameotoko/stripe-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. ameotoko/stripe-bundle

ActiveContao-bundle[Payment Processing](/categories/payments)

ameotoko/stripe-bundle
======================

Simple Stripe controller for Contao 5

v2.0.0(1y ago)045LGPL-3.0-or-laterPHPPHP ^8.1

Since Jan 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/ameotoko/stripe-bundle)[ Packagist](https://packagist.org/packages/ameotoko/stripe-bundle)[ RSS](/packages/ameotoko-stripe-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (9)Used By (0)

Simple Stripe bundle for Contao 4
=================================

[](#simple-stripe-bundle-for-contao-4)

The bundle sets up basic environment, if you want to start using [Stripe](https://stripe.com) in your Contao application.

API key parameters
------------------

[](#api-key-parameters)

Add your API keys to the bundle config, and they will also become available as container parameters:

```
# config/config.yml

stripe:
    secret_key: 'sk_test_****'
    publishable_key: 'pk_test_****'
```

Then use it in your own services if you need:

```
# config/services.yml

services:
    App\EventListener\StripeListener:
        arguments:
            - '%stripe.secret_key%'
```

IMPORTANT: store your production API keys in environment variables, to avoid committing them to version control:

```
# .env.local

STRIPE_SECRET_KEY=sk_live_****
```

```
# config/config_prod.yml

stripe:
    secret_key: '%env(STRIPE_SECRET_KEY)%'
```

Endpoints
---------

[](#endpoints)

EndpointRouteResponse (success)Response (error)`/_stripe/payment``stripe_create_payment_intent``{"clientSecret": string}`HTTP 500 `{"error": string}``/_stripe/checkout``stripe_create_checkout_session``{"url": string}`HTTP 500 `{"error": string}``/_stripe/webhook``stripe_webhook`HTTP 200 (empty)HTTP 400 (empty)The bundle creates 2 endpoints in your application, which you can call from your Javascript to create payment intents or checkout sessions:

```

    const paymentData = {
        success_url: '...',
        cancel_url: '...',
        payment_method_types: ['card', 'sepa_debit', 'sofort', 'ideal', 'alipay'],
        mode: 'payment',
        billing_address_collection: 'required',
        line_items: [...],
        metadata: {...}
    }

    fetch('
