laravel-checkout maintained by itmosoft
ITMOSOFT Laravel Checkout
Checkout orchestration for Laravel 12 and 13 / PHP 8.3+.
Features
- Persistent checkout sessions linked to an existing cart
- Cart line snapshots
- Billing and shipping address snapshots
- Shipping method and amount selection
- Discount, tax, shipping, and grand-total composition
- Required-field validation before completion
- Transactional completion with row-level locking
- Configurable table prefix and session model
Install
composer require itmosoft/laravel-checkout
php artisan vendor:publish --tag=itmosoft-checkout-config
php artisan migrate
Requires itmosoft/laravel-cart.
Start checkout
$checkout = app(\\ItmoSoft\\Checkout\\Services\\CheckoutManager::class)
->start($cart, auth()->id());
Set addresses and totals
$manager->setAddresses($checkout, $billingAddress, $shippingAddress);
$manager->selectShipping($checkout, 'standard', 5.00);
$manager->setTotals($checkout, discount: 10, tax: 13.50);
$errors = $manager->validate($checkout);
if ($errors === []) $manager->complete($checkout);
Checkout snapshots are not a substitute for final server-side price, promotion, tax, stock, and shipping validation. This package does not create orders, reserve inventory, or process payments. Never trust client-submitted totals.
Testing
composer install
vendor/bin/phpunit
License
MIT.