PHPackages                             geniuspay/laravel-sdk - 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. geniuspay/laravel-sdk

ActiveLibrary[Payment Processing](/categories/payments)

geniuspay/laravel-sdk
=====================

Laravel SDK pour l'intégration des paiements GeniusPay (Wave, Orange Money, MTN Money, Carte)

v2.0.1(1mo ago)07[1 issues](https://github.com/Genius-Groupsgit/geniuspay-laravel/issues)MITPHPPHP ^8.2

Since Jan 19Pushed 1mo agoCompare

[ Source](https://github.com/Genius-Groupsgit/geniuspay-laravel)[ Packagist](https://packagist.org/packages/geniuspay/laravel-sdk)[ Docs](https://github.com/geniuspay/laravel-geniuspay)[ RSS](/packages/geniuspay-laravel-sdk/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (6)Versions (3)Used By (0)

Laravel GeniusPay
=================

[](#laravel-geniuspay)

[![Latest Version](https://camo.githubusercontent.com/54e737a433acb83f02a9f983b6b45907639bc626e952aec690ceb21ece4c700c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656e6975737061792f6c61726176656c2d67656e6975737061792e737667)](https://packagist.org/packages/geniuspay/laravel-geniuspay)[![Laravel](https://camo.githubusercontent.com/73692ab0f1fac2901149539199fa738ac249d6cd2387048e8063666cfab3d736/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31302e7825323025374325323031312e7825323025374325323031322e782d7265642e737667)](https://laravel.com)[![PHP](https://camo.githubusercontent.com/0f16581d1180dbfd4c0e13166ec1267d4ad2f2fab8281ea6d6b284cf5c65d921/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322532422d626c75652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE)

SDK Laravel officiel pour l'intégration des paiements GeniusPay (Wave, Orange Money, MTN Money, Carte bancaire).

🚀 Installation
--------------

[](#-installation)

```
composer require geniuspay/laravel-geniuspay
```

### Installation automatique

[](#installation-automatique)

```
php artisan geniuspay:install
```

### Installation manuelle

[](#installation-manuelle)

```
# Publier la configuration
php artisan vendor:publish --tag=geniuspay-config

# Publier les migrations
php artisan vendor:publish --tag=geniuspay-migrations

# Exécuter les migrations
php artisan migrate
```

⚙️ Configuration
----------------

[](#️-configuration)

Ajoutez ces variables dans votre fichier `.env` :

```
GENIUSPAY_SANDBOX=true
GENIUSPAY_API_KEY=pk_sandbox_xxxxxxxxxxxx
GENIUSPAY_API_SECRET=sk_sandbox_xxxxxxxxxxxx
GENIUSPAY_WEBHOOK_SECRET=your_webhook_secret
```

### Options de configuration

[](#options-de-configuration)

VariableDescriptionDéfaut`GENIUSPAY_SANDBOX`Mode sandbox`true``GENIUSPAY_API_KEY`Clé API publique-`GENIUSPAY_API_SECRET`Clé API secrète-`GENIUSPAY_WEBHOOK_SECRET`Secret webhook-`GENIUSPAY_DEBUG`Mode debug`false``GENIUSPAY_CURRENCY`Devise par défaut`XOF`📖 Utilisation
-------------

[](#-utilisation)

### Avec la Facade

[](#avec-la-facade)

```
use GeniusPay\Laravel\Facades\GeniusPay;

// Créer un paiement
$payment = GeniusPay::createPayment([
    'amount' => 5000,
    'currency' => 'XOF',
    'payment_method' => 'wave', // Optionnel
    'description' => 'Commande #123',
    'customer' => [
        'name' => 'John Doe',
        'email' => 'john@example.com',
        'phone' => '+221771234567',
    ],
    'success_url' => route('payment.success'),
    'error_url' => route('payment.error'),
    'metadata' => [
        'order_id' => 123,
    ],
]);

// Rediriger vers la page de paiement
return redirect($payment->paymentUrl);
```

### Avec l'injection de dépendances

[](#avec-linjection-de-dépendances)

```
use GeniusPay\Laravel\GeniusPayClient;

class PaymentController extends Controller
{
    public function __construct(
        private GeniusPayClient $geniusPay
    ) {}

    public function create(Request $request)
    {
        $payment = $this->geniusPay->createPayment([
            'amount' => $request->amount,
            'customer' => [
                'email' => $request->user()->email,
            ],
        ]);

        return redirect($payment->paymentUrl);
    }
}
```

### Récupérer un paiement

[](#récupérer-un-paiement)

```
$payment = GeniusPay::getPayment('MTX-ABC123');

if ($payment->isCompleted()) {
    // Paiement réussi
}

if ($payment->isPending()) {
    // En attente
}

if ($payment->isFailed()) {
    // Échoué
}
```

### Lister les paiements

[](#lister-les-paiements)

```
$result = GeniusPay::listPayments([
    'status' => 'completed',
    'from' => '2025-01-01',
    'to' => '2025-12-31',
    'per_page' => 50,
]);

foreach ($result['data'] as $payment) {
    echo $payment->reference . ': ' . $payment->amount;
}
```

### Vérifier le solde

[](#vérifier-le-solde)

```
$balance = GeniusPay::getBalance();
// ['available' => 150000, 'pending' => 25000]
```

🔔 Webhooks
----------

[](#-webhooks)

Le package gère automatiquement les webhooks. Configurez l'URL dans votre dashboard GeniusPay :

```
https://votresite.com/geniuspay/webhook

```

### Écouter les événements

[](#écouter-les-événements)

```
// app/Providers/EventServiceProvider.php
use GeniusPay\Laravel\Events\PaymentCompleted;
use GeniusPay\Laravel\Events\PaymentFailed;

protected $listen = [
    PaymentCompleted::class => [
        \App\Listeners\HandlePaymentCompleted::class,
    ],
    PaymentFailed::class => [
        \App\Listeners\HandlePaymentFailed::class,
    ],
];
```

### Créer un listener

[](#créer-un-listener)

```
// app/Listeners/HandlePaymentCompleted.php
namespace App\Listeners;

use GeniusPay\Laravel\Events\PaymentCompleted;

class HandlePaymentCompleted
{
    public function handle(PaymentCompleted $event): void
    {
        $reference = $event->getReference();
        $orderId = $event->getMetadata('order_id');

        // Mettre à jour votre commande
        $order = Order::find($orderId);
        $order->markAsPaid($reference);
    }
}
```

### Événements disponibles

[](#événements-disponibles)

ÉvénementDescription`WebhookReceived`Webhook reçu (tous types)`PaymentCompleted`Paiement réussi`PaymentFailed`Paiement échoué`PaymentCancelled`Paiement annulé`PaymentPending`Paiement en attente`RefundCompleted`Remboursement effectué🔗 Trait HasGeniusPayPayments
----------------------------

[](#-trait-hasgeniuspaypayments)

Ajoutez facilement les paiements à vos modèles :

```
use GeniusPay\Laravel\Traits\HasGeniusPayPayments;

class Order extends Model
{
    use HasGeniusPayPayments;
}

// Utilisation
$order = Order::find(1);

// Créer un paiement lié à la commande
$payment = $order->createGeniusPayPayment([
    'amount' => $order->total,
    'description' => "Commande #{$order->id}",
]);

// Récupérer les paiements
$order->geniusPayTransactions;
$order->completedPayments()->get();
$order->totalPaid();
```

🧪 Tests
-------

[](#-tests)

### Mode sandbox

[](#mode-sandbox)

En mode sandbox (`GENIUSPAY_SANDBOX=true`), aucune transaction réelle n'est effectuée.

### Cartes de test

[](#cartes-de-test)

NuméroRésultat4084 0841 1111 1111Succès4084 0841 2222 2222Échec### Test de connexion

[](#test-de-connexion)

```
if (GeniusPay::testConnection()) {
    echo "Connexion OK";
}
```

🛠️ Commandes Artisan
--------------------

[](#️-commandes-artisan)

```
# Installer le package
php artisan geniuspay:install

# Générer un secret webhook
php artisan geniuspay:webhook-secret
```

⚠️ Gestion des erreurs
----------------------

[](#️-gestion-des-erreurs)

```
use GeniusPay\Laravel\Exceptions\ApiException;
use GeniusPay\Laravel\Exceptions\AuthenticationException;
use GeniusPay\Laravel\Exceptions\ValidationException;

try {
    $payment = GeniusPay::createPayment($data);
} catch (AuthenticationException $e) {
    // Clés API invalides
} catch (ValidationException $e) {
    // Données invalides
    $errors = $e->getErrors();
} catch (ApiException $e) {
    // Autre erreur API
}
```

📚 Ressources
------------

[](#-ressources)

- [Documentation API](https://pay.genius.ci/doc)
- [Dashboard GeniusPay](https://pay.genius.ci/dashboard)
- [Support](mailto:pay@genius.ci)

📄 Licence
---------

[](#-licence)

MIT License. Voir [LICENSE](LICENSE).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~142 days

Total

2

Last Release

45d ago

PHP version history (2 changes)V2.0.0PHP ^8.1

v2.0.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9640329?v=4)[Margarita](/maintainers/Toufa)[@toufa](https://github.com/toufa)

---

Top Contributors

[![Genius-Groupsgit](https://avatars.githubusercontent.com/u/150700564?v=4)](https://github.com/Genius-Groupsgit "Genius-Groupsgit (8 commits)")

---

Tags

laravelpaymentmobile-moneyafricaOrange MoneySénégalwavemtn-moneycote-ivoiregeniuspay

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/geniuspay-laravel-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/geniuspay-laravel-sdk/health.svg)](https://phpackages.com/packages/geniuspay-laravel-sdk)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.6k](/packages/simplestats-io-laravel-client)[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4851.0k](/packages/sebdesign-laravel-viva-payments)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
