Stripe
Description
Stripe integrates Laravel Enso with Stripe customers, payment intents, setup intents, and checkout sessions.
The package registers a webhook endpoint for successful payment intents, stores Stripe customer bindings for users, and provides a service facade around the Stripe PHP SDK for the most common payment objects.
It is intended for applications that keep order logic inside Enso and need Stripe only as the payment gateway layer.
Installation
Install the package:
composer require laravel-enso/stripe
Run the package migrations:
php artisan migrate
Make sure the host application configures Stripe secret and webhook keys under the enso.stripe config namespace.
Features
- Webhook endpoint for
payment_intent.succeeded. - Signature validation through Stripe webhook verification.
- Stripe customer persistence linked to Enso users.
- Service methods for customers, payment intents, setup intents, payment methods, and checkout sessions.
- Dynamic user relation for
stripeCustomer.
Usage
Webhook route:
stripe.paymentIntent
Examples:
Stripe::createCustomer($user);
Stripe::createPaymentIntent($payload);
Stripe::createSetupIntent($payload);
Stripe::createCheckoutSession($payload);
The webhook controller only accepts valid Stripe signatures and only processes the payment_intent.succeeded event type, after which it dispatches the PaymentSucceded event.
API
HTTP routes
POST stripe/paymentIntent
Core service
LaravelEnso\\Stripe\\Services\\Stripe
Available operations:
- create and retrieve customers
- create and retrieve payment intents
- retrieve payment methods
- create setup intents
- create and retrieve checkout sessions
Depends On
Required Enso packages:
Required external packages: