Search by

itmosoft / laravel-checkout

adeelrao007

A reusable Laravel checkout orchestration package with address snapshots, cart validation, shipping selection, and checkout state management. Supports Laravel 12 and 13.

Package info

github.com/ITMOSOFT/laravel-checkout

pkg:composer/itmosoft/laravel-checkout

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-11-04 14:53 UTC

This package is auto-updated.

Last update: 2026-11-04 14:54:22 UTC


README

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.