Appearance
SDK & Librairies clients
Voici les bibliothèques que vous pouvez utiliser pour intégrer HayBTech. La plupart des équipes backend utilisent le SDK de leur langage — c'est la méthode la plus rapide.
Quel SDK utiliser ?
| Mon profil | Ma recommandation |
|---|---|
| Je débute | Commencez par le Guide de Démarrage Rapide avant de toucher aux SDK. |
| J'utilise un CMS | Regardez d'abord les plugins dans la section CMS & E-commerce. |
| Je suis développeur backend | Choisissez votre langage dans la section Backend. |
| Je construis une app mobile | Regardez la section Mobile & Frontend. |
Backend
Les SDK suivants sont stables et utilisés en production par des marchands actifs.
| Langage | Package | Version |
|---|---|---|
| PHP / Laravel | haybtech/php-sdk | 1.0.1 |
| Node.js | @haybtech/sdk | 1.0.0 |
| Python / Django | haybtech-sdk | 1.0.0 |
| Java / Spring Boot | sn.haybtech:haybtech-sdk | 1.0.0 |
| Ruby | haybtech-sdk | 1.0.0 |
| Go | github.com/haybtech/haybtech-go-sdk | 1.0.0 |
| .NET / C# | HayBTech.Sdk | 1.0.0 |
Mobile & Frontend
| Plateforme | Package | Version |
|---|---|---|
| HayBTech.js (Navigateur) | @haybtech/browser | 1.0.0 |
| React Native | @haybtech/react-native | 1.0.0 |
| Flutter | haybtech_flutter_sdk | 1.0.0 |
En cours de développement — pas encore recommandés pour la production :
| Plateforme | Note |
|---|---|
| iOS (Swift) | Distribution via SPM, API stable mais coverage de tests insuffisant |
| Android (Kotlin) | Beta publique, feedback bienvenu |
| Unity | Très early stage |
Plugins CMS & E-commerce
| CMS / Plateforme | Plugin | Version |
|---|---|---|
| WordPress / WooCommerce | WooCommerce Gateway | 1.1.0 |
| Drupal | Commerce HayBTech | 1.0.0 |
| Odoo | Payment Provider | 1.0.0 |
En développement :
| CMS / Plateforme | Statut |
|---|---|
| Magento 2 | Bêta privée — contactez le support pour accès anticipé |
| PrestaShop | En cours, pas de date confirmée |
| WHMCS | Planifié |
Exemples par framework
| Environnement | Frameworks couverts |
|---|---|
| PHP | Laravel, Symfony, PHP natif |
| Node.js | Express, NestJS, Fastify |
| Python | FastAPI, Django, Flask |
| Java | Spring Boot, Jakarta EE |
| Ruby | Rails, Sinatra |
| Go | Gin, Echo, net/http |
| .NET | ASP.NET Core, Minimal APIs |
Conventions communes
Tous nos SDK exposent une surface similaire, quel que soit le langage :
client.payments.create(...)
client.payments.retrieve(id)
client.payments.list({ status: 'success' })
client.payments.verify(id)
client.payments.splits.create(id, [...])
client.webhooks.constructEvent(rawBody, signatureHeader)Réutiliser le client HTTP
Instanciez le client une seule fois au démarrage de l'application. Créer un client par requête gaspille les connexions et ralentit les temps de réponse.
ts
// Bon
const client = new HayBTech({ apiKey: process.env.HAYBTECH_API_KEY! })
function pay() {
return client.payments.create({ ... })
}Retry avec backoff
ts
async function withRetry<T>(fn: () => Promise<T>, max = 3): Promise<T> {
let attempt = 0
while (true) {
try {
return await fn()
} catch (e: any) {
if (e.status >= 500 && attempt < max) {
const wait = 2 ** attempt * 1000 // 1s, 2s, 4s
await new Promise(r => setTimeout(r, wait))
attempt++
continue
}
throw e
}
}
}Sur les 5xx, retentez toujours avec la même Idempotency-Key. Sur les 4xx, corrigez la requête d'abord.
Génération de client à partir de l'OpenAPI
La spécification OpenAPI est disponible sur demande auprès du support.
bash
# Types TypeScript uniquement
npx openapi-typescript ./openapi.yaml -o src/haybtech.types.ts
# Client TypeScript complet
npx @hey-api/openapi-ts -i ./openapi.yaml -o ./src/haybtech-client
# Python
openapi-generator-cli generate -i ./openapi.yaml -g python -o ./haybtech-py
# Go
oapi-codegen -package haybtech ./openapi.yaml > haybtech.gen.goVotre langage n'est pas listé ? Écrivez à support@haybtech.com. Les SDK sont priorisés en fonction des demandes reçues.
