codeplugtech / creem-payments
Laravel Package for Creem.io Payments
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/codeplugtech/creem-payments
Requires
- php: ^8.2
- ext-json: *
- ext-openssl: *
- guzzlehttp/guzzle: ^7.4.5
- illuminate/contracts: ^10.0|^11.0|^12.0
- illuminate/database: ^10.0|^11.0|^12.0
- illuminate/http: ^10.0|^11.0|^12.0
- illuminate/routing: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
- illuminate/view: ^10.0|^11.0|^12.0
- moneyphp/money: ^3.2|^4.0
- nesbot/carbon: ^2.67|^3.0
- spatie/url: ^1.3.5|^2.0
- symfony/http-kernel: ^6.2|^7.0
- symfony/polyfill-intl-icu: ^1.22.1
Requires (Dev)
- mockery/mockery: ^1.5.1
- orchestra/testbench: ^8.14|^9.0
- pestphp/pest: ^3.6
- phpstan/phpstan: ^1.10
Suggests
- ext-intl: Allows for more locales besides the default "en" when formatting money values.
README
- Add the
Billabletrait to your billable model definition.
use Codeplugtech\CreemPayments\Billable; use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable { use Billable; }
- Add API Keys to your
.envfile
CREEM_API_KEY=YOUR_API_KEY
CREEM_SANDBOX=true
CREEM_WEBHOOK_SECRET=YOUR_WEBHOOK_KEY
- You can create a checkout session using the code below:
$user->subscription()->createCheckoutSession([ 'product_id' => 'prod_123', 'customer_email' => $user->email, // other parameters ]);
or via the static method:
use Codeplugtech\CreemPayments\CreemPayments; CreemPayments::createCheckoutSession([ 'product_id' => 'prod_123', 'customer_email' => 'test@example.com' ]);
- Exclude
creem/*from CSRF protection inbootstrap/app.phpfile for Laravel 11
->withMiddleware(function (Middleware $middleware) { $middleware->validateCsrfTokens(except: [ 'creem/*', ]); })