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.

Coming soon

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#

Tools#

All packages#

PackageStatusPlanned installRequirementsLinks
PHPlabyrinthe/labpay-phpTyped client, safe retries, webhook verification.Preview 0.1.0Not on Packagist yetcomposer require labyrinthe/labpay-phpPHP 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 yetcomposer require labyrinthe/labpay-laravelPHP 8.1+, Laravel 10 to 13
Node.js@labyrinthe/labpayTypeScript client with no dependency, native fetch.Preview 0.1.0Not on npm yetnpm install @labyrinthe/labpayNode.js 18+ (ESM and CommonJS, also Bun, Deno, edge)
PythonlabpayFully typed synchronous client (asyncio client planned).Preview 0.1.0Not on PyPI yetpip install labpayPython 3.9+ (httpx)
Javacom.labyrinthe-rdc:labpayThread-safe client, immutable models.Preview 0.1.0Not on Maven Central yetimplementation("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 yetimplementation("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 yetdotnet add package Labyrinthe.LabPay.NET Standard 2.0 or .NET 8
ASP.NET CoreLabyrinthe.LabPay.AspNetCoreAddLabPay() and MapLabPayWebhooks().Preview 0.1.0Not on NuGet yetdotnet add package Labyrinthe.LabPay.AspNetCore.NET 8
WooCommercelabpay-for-woocommerceMobile Money payment gateway for WooCommerce, no code.Preview 0.1.0Not on WordPress.org yetlabpay-for-woocommerce.zipWordPress 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 yetlabpay.postman_collection.jsonPostman (or Newman on the command line)
OpenAPI 3.1openapi.yamlV2 specification, common base of every SDK.Version 2.0.0GitHubopenapi/openapi.yamlAny 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-… pending

What every SDK does#

  • `test_…` key = sandbox: no real money, separate balances and payments. Going live = switching keys.
  • Automatic reference: without reference, the SDK sends sdk_<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 422 carrying the payment (refused at initiation) is returned with status: failed and failure, not thrown; a 202 is a pending payment.
  • 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, 429 after Retry-After, maintenance-type refusals (503) only after a Retry-After; never DAILY_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: constructEvent checks X-Labyrinthe-Signature on 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?#

NeedAdvice
PHP, Laravel, Node.js, Python, Java, .NETThe SDK: retries, idempotency, typed errors and webhooks already handled.
WooCommerce shopThe plugin, no code.
Another languagePlain HTTP (cURL and "HTTP" tabs of each page) or a client generated from the OpenAPI.
Explore the API by handThe Postman collection.