PHPackages                             vega-pay/laravel - 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. vega-pay/laravel

ActiveLibrary[Payment Processing](/categories/payments)

vega-pay/laravel
================

SDK Laravel officiel pour integrer Vega Pay cote serveur.

v1.0.0(1mo ago)02proprietaryPHPPHP ^8.2

Since Jun 15Pushed 1mo agoCompare

[ Source](https://github.com/SmartSofwareServices/vega-pay-laravel)[ Packagist](https://packagist.org/packages/vega-pay/laravel)[ RSS](/packages/vega-pay-laravel/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

vega-pay/laravel
================

[](#vega-paylaravel)

SDK Laravel officiel pour integrer Vega Pay cote serveur.

Ce package utilise uniquement la cle privee `vp_sk_test_...` ou `vp_sk_live_...` pour creer et consulter des paiements. Il ne gere pas les reversements.

Installation
------------

[](#installation)

```
composer require vega-pay/laravel
```

Publier la configuration :

```
php artisan vendor:publish --tag=vega-pay-config
```

Variables `.env` :

```
VEGA_PAY_SECRET_KEY=vp_sk_test_...
VEGA_PAY_PUBLIC_KEY=vp_pk_test_...
VEGA_PAY_WEBHOOK_SECRET=whsec_...
VEGA_PAY_BASE_URL=https://api.vegapay.ci
VEGA_PAY_TIMEOUT=10
```

Creer un paiement
-----------------

[](#creer-un-paiement)

```
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use VegaPay\Laravel\Facades\VegaPay;

Route::post('/checkout', function (Request $request) {
    $payment = VegaPay::createPayment([
        'amount' => $request->integer('amount'),
        'currency' => 'XOF',
        'orderId' => $request->string('order_id')->toString(),
        'customerPhone' => $request->string('phone')->toString(),
        'successUrl' => route('payment.success'),
        'errorUrl' => route('payment.error'),
        'metadata' => [
            'source' => 'laravel',
        ],
    ], idempotencyKey: $request->string('order_id')->toString());

    return redirect()->away($payment['checkoutUrl']);
});
```

Avec une cle marchande Vega Pay, le paiement est automatiquement rattache au compte marchand. Il n'est pas necessaire d'envoyer un `sellerId`.

Recuperer un paiement
---------------------

[](#recuperer-un-paiement)

```
$payment = VegaPay::retrievePayment('pay_...');

if ($payment['status'] === 'succeeded') {
    // Livrer la commande.
}
```

Verifier un webhook
-------------------

[](#verifier-un-webhook)

Ajoute une route qui conserve le body brut.

```
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use VegaPay\Laravel\Facades\VegaPay;
use VegaPay\Laravel\Exceptions\VegaPaySignatureVerificationException;

Route::post('/webhooks/vega-pay', function (Request $request) {
    try {
        $event = VegaPay::constructWebhookEvent(
            $request->getContent(),
            $request->header('X-Pay-Signature', '')
        );
    } catch (VegaPaySignatureVerificationException) {
        abort(400);
    }

    if ($event['type'] === 'payment.succeeded') {
        $payment = $event['data']['payment'];
        // Marquer la commande comme payee.
    }

    return response()->json(['received' => true]);
});
```

Gestion des erreurs
-------------------

[](#gestion-des-erreurs)

```
use VegaPay\Laravel\Exceptions\VegaPayException;

try {
    $payment = VegaPay::createPayment([
        'amount' => 10000,
        'currency' => 'XOF',
        'orderId' => 'CMD-10001',
    ], idempotencyKey: 'CMD-10001');
} catch (VegaPayException $exception) {
    report($exception);

    return back()->withErrors([
        'payment' => $exception->getMessage(),
    ]);
}
```

Sandbox et live
---------------

[](#sandbox-et-live)

Le mode depend de la cle utilisee :

- `vp_sk_test_...` cree des paiements sandbox.
- `vp_sk_live_...` cree des paiements reels apres verification du compte.

La cle privee doit rester cote serveur. La cle publique `vp_pk_*` peut etre exposee dans une integration frontend future, mais elle ne sert pas a creer un paiement serveur.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/da0ac4a7d2cf790283e5370bcb5c44bfb86d4eedb51dfec01dda4ce85d813065?d=identicon)[madess11](/maintainers/madess11)

---

Top Contributors

[![madess11](https://avatars.githubusercontent.com/u/44516297?v=4)](https://github.com/madess11 "madess11 (1 commits)")

---

Tags

laravelpaymentsmobile-moneywavecote-divoirexofvega-pay

### Embed Badge

![Health badge](/badges/vega-pay-laravel/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M348](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)

PHPackages © 2026

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