SDKs and tools
SDKs and tools
The official LabPay SDKs (PHP, Laravel, Node.js, Python, Java, .NET), the WooCommerce plugin, the Postman collection and the V2 OpenAPI specification.
The SDKs cover the whole API V2 (V1 is not covered) with the same API in every language: deposits.create, payouts.create / cancel, refunds.create, payments.get / list / iterate / findByReference / sync, providers.countries / list / availability / predict, account.get / balances / balance / rotateWebhookSecret / rotateTestKey, notifications.list / resend and webhook verification with constructEvent — names adapted to each language's conventions.
Version 0.1.0 (preview): the SDKs are tested but not published yet on Packagist, npm, PyPI, Maven Central, NuGet or WordPress.org. Each page gives the planned install command and, until then, how to install from the GitHub repository.
SDKs by language#
labyrinthe/labpay-php — PHP 8.1+, PSR-18.Laravel labyrinthe/labpay-laravel — facade, webhook route, events.Node.js / TypeScript @labyrinthe/labpay — Node 18+, no dependency.Python labpay — Python 3.9+, httpx, typed.Java and Spring Boot com.labyrinthe-rdc:labpay — Java 17+ and Spring Boot 3 starter..NET (C#) Labyrinthe.LabPay — .NET Standard 2.0 / .NET 8, ASP.NET Core.Tools#
All packages#
| Package | Status | Planned install | Requirements | Links |
|---|---|---|---|---|
PHPlabyrinthe/labpay-phpTyped client, safe retries, webhook verification. | Preview 0.1.0Not on Packagist yet | composer require labyrinthe/labpay-php | PHP 8.1+, any PSR-18 client (Guzzle by default) | |
Laravellabyrinthe/labpay-laravelFacade, publishable config, signed webhook route and events. | Preview 0.1.0Not on Packagist yet | composer require labyrinthe/labpay-laravel | PHP 8.1+, Laravel 10 to 13 | |
Node.js@labyrinthe/labpayTypeScript client with no dependency, native fetch. | Preview 0.1.0Not on npm yet | npm install @labyrinthe/labpay | Node.js 18+ (ESM and CommonJS, also Bun, Deno, edge) | |
PythonlabpayFully typed synchronous client (asyncio client planned). | Preview 0.1.0Not on PyPI yet | pip install labpay | Python 3.9+ (httpx) | |
Javacom.labyrinthe-rdc:labpayThread-safe client, immutable models. | Preview 0.1.0Not on Maven Central yet | implementation("com.labyrinthe-rdc:labpay:0.1.0") | Java 17+, no dependency (java.net.http) | |
Spring Bootcom.labyrinthe-rdc:labpay-spring-boot-starterAuto-configuration (labpay.*) and webhook endpoint. | Preview 0.1.0Not on Maven Central yet | implementation("com.labyrinthe-rdc:labpay-spring-boot-starter:0.1.0") | Java 17+, Spring Boot 3 | |
.NETLabyrinthe.LabPayAsync client (HttpClient, System.Text.Json). | Preview 0.1.0Not on NuGet yet | dotnet add package Labyrinthe.LabPay | .NET Standard 2.0 or .NET 8 | |
ASP.NET CoreLabyrinthe.LabPay.AspNetCoreAddLabPay() and MapLabPayWebhooks(). | Preview 0.1.0Not on NuGet yet | dotnet add package Labyrinthe.LabPay.AspNetCore | .NET 8 | |
WooCommercelabpay-for-woocommerceMobile Money payment gateway for WooCommerce, no code. | Preview 0.1.0Not on WordPress.org yet | labpay-for-woocommerce.zip | WordPress 6.4+, WooCommerce 8.0+, PHP 8.1+ | |
Postmanlabpay.postman_collection.jsonThe 17 V2 requests, local and production environments. | Preview 0.1.0Not on GitHub yet | labpay.postman_collection.json | Postman (or Newman on the command line) | |
OpenAPI 3.1openapi.yamlV2 specification, common base of every SDK. | Version 2.0.0GitHub | openapi/openapi.yaml | Any OpenAPI 3.1 tool |
The same collection in every language#
POST /V2/deposits with the test key
<?php
use Labyrinthe\LabPay\Client;
$labpay = new Client('test_xxxxxxxxxxxxxxxx'); // ou Client::fromEnv() (LABPAY_API_KEY)
$payment = $labpay->deposits->create(
amount: '1000',
currency: 'CDF',
phone: '0813456789',
reference: 'ORDER-42', // facultatif : sinon le SDK génère sdk_<uuid>
callbackUrl: 'https://boutique.example/webhooks/labpay',
customerMessage: 'Commande 42',
metadata: ['orderId' => '42'],
);
echo $payment->id, ' ', $payment->status->value; // DEP-… pendingWhat every SDK does#
- `test_…` key = sandbox: no real money, separate balances and payments. Going live = switching keys.
- Automatic reference: without
reference, the SDK sendssdk_<uuid>, so that a deposit, payout or refund can be retried after a network failure or a 5xx without double payment (idempotency). Can be disabled (autoReference/auto_reference/AutoReference). - A refused payment is a payment: a
422carrying the payment (refused at initiation) is returned withstatus: failedandfailure, not thrown; a202is apendingpayment. - Errors typed by `code` (then by HTTP status), with per-field validation errors; an unknown code stays readable. Base your logic on the code, never on the message (in French).
- Safe retries (2 by default): reads and payments with a reference,
429afterRetry-After, maintenance-type refusals (503) only after aRetry-After; neverDAILY_LIMIT_REACHED. Rotations, notification resends, payout cancellations and payments without reference are never retried after a network error or a 5xx. - Local validation before any request (amount, currency, number, reference, URL…): invalid input raises an argument error with no network call.
- Verified webhooks:
constructEventchecksX-Labyrinthe-Signatureon the raw body, in constant time, with a 300 s tolerance and both secrets during a rotation. - Secure by default: the key never shows up in logs, dumps or exception messages.
SDK or plain HTTP?#
| Need | Advice |
|---|---|
| PHP, Laravel, Node.js, Python, Java, .NET | The SDK: retries, idempotency, typed errors and webhooks already handled. |
| WooCommerce shop | The plugin, no code. |
| Another language | Plain HTTP (cURL and "HTTP" tabs of each page) or a client generated from the OpenAPI. |
| Explore the API by hand | The Postman collection. |