milzer / checkout
the checkout package for the Nezasa checkout system
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 2
pkg:composer/milzer/checkout
Requires
- php: ^8.3.0
- azimkordpour/power-enum: ^1.2
- livewire/livewire: ^3.6
- saloonphp/saloon: ^3.0
- spatie/laravel-data: ^4.15
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.18.1
- mockery/mockery: ^1.6
- orchestra/testbench: ^10.3
- pestphp/pest: ^3.5.1
- pestphp/pest-plugin-type-coverage: ^3.1
- phpstan/phpstan: ^2.1
- rector/rector: ^2.1
- spatie/phpunit-snapshot-assertions: ^5.2
- symfony/var-dumper: ^7.1.6
README
This Laravel package provides a complete checkout process for the Nezasa web application.
It integrates with Nezasa’s APIs to handle all the necessary steps for booking an itinerary, ensuring a smooth and reliable booking experience.
Requirements
Make sure your environment meets the following requirements:
- PHP 8.3 or higher
- MySQL 8
- Laravel 11 or higher
- Redis (optional)
The package relies heavily on cache** and queues to ensure better performance.
It is highly recommended to use Redis as both the queue driver and cache driver for optimal speed and reliability.
Installation & Setup
This package is already installed and pre-configured in the checkout-main-app repository.
The repository also includes useful configurations and dependencies to help you set up and run a Laravel application faster:
- Vite configuration for asset bundling and front-end builds
- Laravel Horizon for managing and monitoring queues
With these configurations in place, you can quickly get started with the Nezasa checkout.
Features of the Package
Below is a list of the key features included in this package:
- Itinerary Summary – Summarizes itinerary details such as travel dates, travelers, and pricing.
- Contact Form Handling – Customizes the display and validation of contact input fields based on the Nezasa API.
- Traveler Form Handling – Customizes the display and validation of traveler input fields according to the Nezasa API. The page dynamically adapts to the number of rooms and travelers.
- Country List Integration – Displays the list of countries retrieved from the Nezasa API.
- Availability Check – Automatically checks itinerary availability once the required data is provided, working seamlessly in the background.
- Promotional Codes – Allows applying promotional codes to a booking through the Nezasa API.
- Additional Services – Supports adding and removing extra services in a booking using the Nezasa API.
- Payment Provider Integration – Provides a flexible design to integrate different payment providers into the project. (Currently, only Oppwa is supported.)
- Transaction Handling – Initiates and stores transaction data via the Nezasa API.
- Booking Confirmation – Manages booking confirmation and displays the booking reference.
- Error & Exception Handling – Handles errors gracefully, with user-friendly messages and fallback options.
- Save Booking State – Preserves the current state of the booking process. For example, if a user leaves the page while entering traveler details, all entered data is stored and restored the next time they return.
- Multi-language Support – Includes localization for English, German, French, and Spanish, with easy extensibility for additional languages.
- Configuration Options – Offers flexible configuration to adapt the package to project needs, such as updating payment provider credentials.
- Best Practices – Follows industry best practices for security, performance, and code quality, ensuring a robust and maintainable package.
Setting up Configuration
Add the following variables to the .env
file of your Laravel application:
# Nezasa API CHECKOUT_NEZASA_BASE_URL="nezasa trip builder api url" CHECKOUT_NEZASA_USERNAME="username" CHECKOUT_NEZASA_PASSWORD="password" # Oppwa Payment Provider CHECKOUT_WIDGET_OPPWA_ENTITY_ID="*******" CHECKOUT_WIDGET_OPPWA_TOKEN="*******" CHECKOUT_WIDGET_OPPWA_ACTIVE=true
Useful commands:
⚡️ Install the package using Composer:
composer milzer/checkout
Then you need to run the following command to publish the migration file:
php artisan vendor:publish --tag=checkout-migrations
And execute the migration:
php artisan migrate
🧹 Keep a modern codebase with Pint:
composer lint
✅ Run refactors using Rector
composer refactor
⚗️ Run static analysis using PHPStan:
composer test:types
✅ Run unit tests using PEST
composer test:unit
🚀 Run the entire test suite:
composer test
This package was created by milzer GmbH under the MIT license.