sangho / sdk
SDK officiel PHP pour l'API Sangho
dev-main
2026-09-13 14:12 UTC
Requires
- php: ^8.2 || ^8.3 || ^8.4 || ^8.5
- guzzlehttp/guzzle: ^7.10
- ramsey/uuid: ^4.9
Requires (Dev)
- mockery/mockery: ^1.6
- phpstan/phpstan: ^1.11
- phpunit/phpunit: ^10.5
- squizlabs/php_codesniffer: ^3.9
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-14 12:36:28 UTC
README
SDK officiel PHP pour l'API Sangho — paiements XAF pour l'Afrique.
Installation
composer require sangho/sdk
Quickstart
use Sangho\SanghoClient; $client = new SanghoClient('sk_prod_...'); // Créer un payment intent $intent = $client->paymentIntents->create([ 'amount' => 5000, 'currency' => 'XAF', 'customer' => 'cust_xxx', ]); echo $intent['id'];
Gestion des erreurs
use Sangho\Exception\{ SanghoAuthException, SanghoRateLimitException, SanghoValidationException, SanghoException, }; try { $intent = $client->paymentIntents->create(['amount' => 5000, 'customer' => 'cust_xxx']); } catch (SanghoAuthException $e) { echo "Clé API invalide"; } catch (SanghoRateLimitException $e) { echo "Trop de requêtes, retenter après {$e->retryAfter}s"; } catch (SanghoValidationException $e) { echo $e->getParam() . ': ' . $e->getMessage(); } catch (SanghoException $e) { echo "{$e->errorCode} — {$e->getMessage()} ({$e->statusCode})"; }
Documentation
La documentation complète est disponible sur docs.sangho.ga/api/sdks/php.
Ressources disponibles
account · addresses · apps · customers · products · paymentIntents ·
checkoutSessions · invoices · transactions · refunds · subscriptions ·
paymentMethods · receipts · webhooks · paymentLinks · security ·
partners · terminal · sandbox
Contribuer
Voir CONTRIBUTING.md.
Changelog
Voir CHANGELOG.md.
Licence
MIT