paymint/paymint-laravel

There is no license information available for the latest version (v1.0.1) of this package.

The official Laravel wrapper for PayMint Africa

Maintainers

Package info

github.com/Paymint-Africa/paymint-laravel

pkg:composer/paymint/paymint-laravel

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-06-25 22:52 UTC

This package is auto-updated.

Last update: 2026-06-26 11:25:11 UTC


README

The official Laravel wrapper for PayMint Africa. Seamlessly integrate PayMint into your Laravel application with zero configuration and elegant syntax.

Installation

Install the package via Composer:

composer require paymint/paymint-laravel

Configuration

Add your PayMint API keys to your .env file:

PAYMINT_SECRET_KEY=sk_live_your_secret_key

# Optional: Set a custom base URL for testing or sandbox
# PAYMINT_BASE_URL=https://sandbox.api.paymint.africa/v1/

That's it! The package will automatically load your configuration. You do not need to publish any config files.

Usage

Use the elegant PayMint Facade to interact with the API anywhere in your application.

use PayMint\Laravel\Facades\PayMint;

// Create a Virtual Account
$account = PayMint::virtualAccounts()->create([
    'name' => 'Jane Doe',
    'email' => 'jane@example.com',
    'phone' => '08123456789'
]);

return response()->json($account);

Webhook Verification

Verify incoming webhooks directly inside your Laravel controllers or routes to ensure the payload is securely coming from PayMint.

use Illuminate\Http\Request;
use PayMint\Laravel\Facades\PayMint;
use Illuminate\Support\Facades\Route;

Route::post('/webhook/paymint', function (Request $request) {
    // 1. Get raw payload and signature
    $payload = $request->getContent();
    $signature = $request->header('X-Paymint-Signature');

    // 2. Verify securely
    if (!PayMint::webhooks()->verifySignature($payload, $signature)) {
        return response()->json(['error' => 'Invalid signature detected.'], 401);
    }

    // 3. Process webhook safely!
    $event = $request->input('event');
    
    if ($event === 'payment.success') {
        // Credit the customer's wallet here...
    }

    return response()->json(['status' => 'success']);
});

License

MIT License