PHPackages                             milzer/checkout - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. milzer/checkout

ActiveLibrary[Payment Processing](/categories/payments)

milzer/checkout
===============

the checkout package for the Nezasa checkout system

v1.0.93(1mo ago)01.4k4[2 issues](https://github.com/milzer-tech/checkout/issues)[3 PRs](https://github.com/milzer-tech/checkout/pulls)MITPHPPHP ^8.3.0CI failing

Since Aug 24Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/milzer-tech/checkout)[ Packagist](https://packagist.org/packages/milzer/checkout)[ RSS](/packages/milzer-checkout/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (87)Versions (105)Used By (0)

Checkout Process for Nezasa Web Application
===========================================

[](#checkout-process-for-nezasa-web-application)

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
------------

[](#requirements)

Make sure your environment meets the following requirements:

1. **PHP** 8.3 or higher
2. **MySQL** 8
3. **Laravel** 11 or higher
4. \*\*Redis \*\*

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 &amp; Setup
------------------------

[](#installation--setup)

This package is already installed and pre-configured in the [checkout-main-app repository](https://github.com/milzer-tech/checkout-main-app).

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.

Setup on Nezasa instance
------------------------

[](#setup-on-nezasa-instance)

After deploying the laravel application, you need to chanege the following settings on your Nezasa instance:

- Go to Nezasa cockpit
- Then to Settings
- Select your instance
- Click on the checkout tab
- Scroll down to custom checkout
- Change configuration to your laravel application url like

```
http://your-domain.com/checkout/details?checkoutId=${CHECKOUT_ID}&itineraryId=${ITINERARY_ID}&origin=${ORIGIN}

```

Features of the Package
-----------------------

[](#features-of-the-package)

Below is a list of the key features included in this package:

1. **Itinerary Summary** – Summarizes itinerary details such as travel dates, travelers, and pricing.
2. **Contact Form Handling** – Customizes the display and validation of contact input fields based on the Nezasa API.
3. **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.
4. **Country List Integration** – Displays the list of countries retrieved from the Nezasa API.
5. **Availability Check** – Automatically checks itinerary availability once the required data is provided, working seamlessly in the background.
6. **Promotional Codes** – Allows applying promotional codes to a booking through the Nezasa API.
7. **Additional Services** – Supports adding and removing extra services in a booking using the Nezasa API.
8. **Payment Provider Integration** – Provides a flexible design to integrate different payment providers into the project. (Currently, only **Oppwa** is supported.)
9. **Transaction Handling** – Initiates and stores transaction data via the Nezasa API.
10. **Booking Confirmation** – Manages booking confirmation and displays the booking reference.
11. **Error &amp; Exception Handling** – Handles errors gracefully, with user-friendly messages and fallback options.
12. **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.
13. **Multi-language Support** – Includes localization for English, German, French, and Spanish, with easy extensibility for additional languages.
14. **Configuration Options** – Offers flexible configuration to adapt the package to project needs, such as updating payment provider credentials.
15. **Best Practices** – Follows industry best practices for security, performance, and code quality, ensuring a robust and maintainable package.

---

### Setting up Configuration

[](#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"
```

### Passolution travel information

[](#passolution-travel-information)

Passolution travel information is shown only when all required conditions are met:

1. Passolution is enabled in the checkout configuration.
2. A valid Passolution token is configured.
3. The Nezasa regulatory information response has travel information confirmation enabled for the checkout.

Add the following variables to the `.env` file of your Laravel application:

```
# Passolution Travel Information
CHECKOUT_PASSOLUTION_ACTIVE=true
CHECKOUT_PASSOLUTION_BASE_URL="https://api.passolution.eu/api/v2"
CHECKOUT_PASSOLUTION_TOKEN="your passolution token"
```

The checkout will not show the travel information confirmation step if Nezasa does not return `travelInformation.confirmationEnabled = true`, even when Passolution is active and a token is configured.

### Country priority options

[](#country-priority-options)

You can pin selected countries to the top of country dropdowns. The order of `CHECKOUT_PRIORITIZED_COUNTRY_CODES` controls the order shown to the user.

```
# Country Dropdown Priorities
CHECKOUT_PRIORITIZED_COUNTRY_CODES="DE,AT,CH"
CHECKOUT_PRIORITIZED_COUNTRY_FIELDS="nationality,country"
```

`CHECKOUT_PRIORITIZED_COUNTRY_CODES` accepts comma-separated ISO 3166-1 alpha-2 country codes. Missing or duplicate country codes are ignored.

`CHECKOUT_PRIORITIZED_COUNTRY_FIELDS` accepts comma-separated field names. Country priority ordering is applied only to these fields.

### Oppwaa payment provide

[](#oppwaa-payment-provide)

You need set up theses variables in the `.env` file of your Laravel application:

```
# Oppwa Payment Provider
CHECKOUT_WIDGET_OPPWA_ACTIVE=true
CHECKOUT_WIDGET_OPPWA_NAME='Oppwa'
CHECKOUT_WIDGET_OPPWA_ENTITY_ID="*******"
CHECKOUT_WIDGET_OPPWA_TOKEN="*******"
```

This a test card number:

```
4200000000000091
```

Enter the remaining data as you wish. You will find the other card number for different situations in this link:

### Stripe payment provide

[](#stripe-payment-provide)

You need set up theses variables in the `.env` file of your Laravel application:

```
# Strip Payment Provider
CHECKOUT_STRIPE_ACTIVE=true
CHECKOUT_STRIPE_NAME='Stripe'
CHECKOUT_STRIPE_SECRET_KEY="your stripe secret key"
```

This a test card number:

```
4242424242424242
```

Enter the remaining data as you wish. You will find the other card number for different situations in this link:

### Computop payment provide

[](#computop-payment-provide)

You need set up theses variables in the `.env` file of your Laravel application:

```
# Strip Payment Provider
CHECKOUT_COMPUTOP_ACTIVE=true

# false for production
CHECKOUT_COMPUTOP_TEST_MODE=true

CHECKOUT_COMPUTOP_NAME='Computop'
CHECKOUT_COMPUTOP_USERNAME='your username'
CHECKOUT_COMPUTOP_PASSWORD='your password'
```

This a test card number:

```
//Mastercard
5555555555554444
```

For payment confirmation, use the challenge code `1234`. Enter the remaining data as you wish. You will find the other card number for different situations in this link:

Adding a new payment method
---------------------------

[](#adding-a-new-payment-method)

Payment methods are intentionally pluggable. A new provider should be added as a new gateway class without changing the existing production gateways. The checkout discovers providers from the `payment` array in `config/checkout.php`, filters them by `isActive()`, and then uses the implemented contract type to decide whether to redirect the customer or render an embedded widget.

Before adding a provider, choose the integration type:

- Use `RedirectPaymentContract` when the customer leaves the checkout and completes payment on a hosted provider page.
- Use `WidgetPaymentContract` when the provider renders a widget, iframe, script, or form inside the checkout page.

Both contracts extend `PaymentContract`, so every gateway must implement the shared payment lifecycle.

### 1. Create the gateway class

[](#1-create-the-gateway-class)

Create a dedicated class under `src/Payments/Gateways/{ProviderName}`. Use the existing gateways as references:

- `src/Payments/Gateways/Invoice/InvoiceGateway.php` for a simple redirect flow.
- `src/Payments/Gateways/Oppwa/OppwaWidgetGateway.php` for a widget flow.
- `src/Payments/Gateways/Computop/ComputopTokenGateway.php` for a tokenized flow.

Example redirect gateway skeleton:

```
