Download the PHP package romansh/laravel-creem without Composer
On this page you can find all versions of the php package romansh/laravel-creem. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download romansh/laravel-creem
More information about romansh/laravel-creem
Files in romansh/laravel-creem
Package laravel-creem
Short Description A Laravel package for Creem.io payment provider with support for products, checkouts, subscriptions, transactions, licenses, and discount codes
License MIT
Informations about the package laravel-creem
LaravelCreem Package
A Laravel package for Creem.io payment provider. Built with Laravel-native patterns, clean architecture, and developer experience as top priorities.
Features
- Laravel-Native: Built on
Illuminate\Http\Clientwith automatic retries and timeouts - Multi-Profile Configuration: Support multiple API keys and environments
- Complete API Coverage: Products, Checkouts, Customers, Subscriptions, Transactions, Licenses, and Discounts
- Webhooks: Built-in signature verification and event dispatching
- Type-Safe: Full PHPDoc annotations and Laravel IDE helper compatible
- Well-Tested: Comprehensive unit and feature tests
- Event-Driven: Laravel events for all webhook types
- Artisan Commands: Test webhooks locally with ease
- PSR-12 Compliant: Clean, readable, maintainable code
Requirements
- PHP 8.1 or higher
- Laravel 10.x, 11.x, 12.x
Installation
Install via Composer:
Publish the configuration file:
Add your Creem credentials to .env:
Demo Application
A full-featured demo app is available as a separate package: romansh/laravel-creem-demo
Open http://localhost/creem-demo — configure API keys, webhook secret, and webhook URL directly in the browser. No .env editing required.
The demo covers products, subscriptions, checkouts, discounts, transactions, and webhook event handling with live logs. Docker setup includes optional Cloudflare Tunnel for webhook testing.
Configuration
The package supports multiple configuration profiles. Open config/creem.php to configure:
Usage
Basic Usage (Default Profile)
For direct or off-session payment flows, pass an explicit price_id rather than only a product_id. Hosted checkout can apply provider-side regional price selection, but saved-card style charges should identify the exact regional price to avoid currency mismatches.
Using Named Profiles
Using Inline Configuration
Services
Products
Checkouts
Customers
Subscriptions
Transactions
Licenses
Discount Codes
Webhooks
Automatic Setup
Webhook routes are automatically registered. The default endpoint is:
Configure the webhook URL in your Creem dashboard:
Webhook Events
The package dispatches Laravel events for all Creem webhook types. Each webhook is mapped
to a corresponding event class under Romansh\LaravelCreem\Events. All Creem webhook
events extend CreemEvent and expose the following typed properties:
$eventId— unique Creem event id$eventType— the original event string (e.g.checkout.completed)$createdAt— unix timestamp in milliseconds$object— the decoded Creem resource object$payload— the full raw webhook payload
Common webhook event classes provided by the package include:
CheckoutCompletedDisputeCreatedRefundCreatedPaymentFailedSubscriptionCreatedSubscriptionActiveSubscriptionPaidSubscriptionCanceledSubscriptionExpiredSubscriptionPastDueSubscriptionPausedSubscriptionTrialingSubscriptionScheduledCancelSubscriptionUpdate
Additionally the package emits two application-level events to simplify access provisioning logic:
-
GrantAccess— dispatched automatically aftercheckout.completedandsubscription.paid. It receives(array $customer, array $metadata, array $payload)where$customeris the Creem customer object and$metadatais merchant-defined metadata from the originating resource. RevokeAccess— dispatched automatically aftersubscription.canceledandsubscription.expired. It also receives(array $customer, array $metadata, array $payload).
Listening to Events
Register event listeners in app/Providers/EventServiceProvider.php:
Create a listener example:
Custom Webhook Handling
You can also create a custom webhook controller and apply the VerifyCreemWebhook middleware:
Testing Webhooks Locally
Use the built-in Artisan command to test webhooks:
Error Handling
The package throws specific exceptions for different error scenarios:
Testing
The package includes comprehensive tests:
Using HTTP Fakes in Tests
Example Controllers
Checkout Controller
Subscription Management Controller
License Validation Controller
Advanced Configuration
Custom HTTP Settings
Modify config/creem.php:
Custom Webhook Path
Multiple Webhook Endpoints
You can set up different webhook endpoints for different profiles:
API Reference
Profile Resolution Rules
-
String (Profile Name): Loads named profile from config
-
No Profile (Default): Uses 'default' profile
- Array (Inline Config): Uses provided configuration
Troubleshooting
Invalid Webhook Signature
Ensure your webhook secret matches between .env and Creem dashboard.
API Key Issues
Missing Profile Exception
Solution: Add the profile to config/creem.php or use an existing profile name.
Contributing
Contributions are welcome! Please ensure:
- PSR-12 code style compliance
- All tests pass
- New features include tests
- Documentation is updated
Run Laravel Pint for code formatting:
Security
If you discover a security vulnerability, please email the package maintainer.
License
The MIT License (MIT). Please see License File for more information.
Support
- Creem Documentation: https://docs.creem.io
- Package Issues: https://github.com/romansh/laravel-creem/issues
All versions of laravel-creem with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/http Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0