Search by

koderia-creative-lab / laravel-squad

xenabyte

A modern Laravel client and driver for the Squad (HabariPay) payment gateway.

Package info

github.com/Koderia-Creative-Lab/laravel-squad

pkg:composer/koderia-creative-lab/laravel-squad

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-11-30 10:53 UTC

This package is auto-updated.

Last update: 2026-11-30 10:58:40 UTC


README

A modern Laravel client for the Squad (HabariPay) payment gateway supporting automatic sandbox/production routing, transaction initialization, verification, and HMAC SHA-512 webhook signature validation.

Installation

composer require koderia-creative-lab/laravel-squad

Publish configuration:

php artisan vendor:publish --tag="squad-config"

Configuration

Set the following environment variables in .env:

SQUAD_SECRET_KEY=your_secret_key
SQUAD_ENV=sandbox
SQUAD_REDIRECT_URL=https://your-app.com/payment/callback
SQUAD_SPLIT_MODE=false
SQUAD_TIMEOUT=30
SQUAD_LOGGING=true

Usage

Initialize a Transaction

use Koderia\Squad\Facades\Squad;

$response = Squad::initialize([
    'amount'          => 1500000, // in kobo (₦15,000)
    'email'           => 'customer@example.com',
    'transaction_ref' => 'UNIQUE_TX_REF',
    'customer_name'   => 'Ada Lovelace',
    'metadata'        => ['order_id' => 102],
]);

if ($response->isSuccessful()) {
    return redirect($response->getCheckoutUrl());
}

$error = $response->getErrorMessage();

Verify a Transaction

use Koderia\Squad\Facades\Squad;

$verification = Squad::verify($reference);

if ($verification->isPaid()) {
    $amount = $verification->getAmount();
    $meta   = $verification->getMetaData();
}

Validate Webhook Signatures

use Koderia\Squad\Facades\Squad;

$isValid = Squad::verifyWebhookSignature(
    $request->getContent(),
    (string) $request->header('x-squad-encrypted-body')
);

Testing

vendor/bin/phpunit