Download the PHP package djstar7/kpay-sdk without Composer
On this page you can find all versions of the php package djstar7/kpay-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download djstar7/kpay-sdk
More information about djstar7/kpay-sdk
Files in djstar7/kpay-sdk
Package kpay-sdk
Short Description SDK officiel KPay (PHP / Laravel) — paiements & retraits Mobile Money, mode USSD ou passerelle hébergée. Sans dépendance imposée.
License MIT
Homepage https://admin.kpay.site
Informations about the package kpay-sdk
kpay/sdk — PHP / Laravel
SDK officiel KPay (PHP ≥ 8.1, cURL natif). Fonctionne en PHP pur ou
Laravel (auto-discovery : ServiceProvider + façade Kpay).
PHP pur
USSD : ['amount'=>5000,'phoneNumber'=>'674693625','paymentMethod'=>'MTN_MONEY'].
Retrait : $kpay->initWithdrawal([...]).
Laravel
.env :
Hybride : webhook + attente
Le chemin principal recommandé reste le webhook (résolution instantanée). En complément, à la page de retour :
awaitFinalStatus sonde l'API jusqu'à un statut terminal ou la durée
maximale max_duration (seul paramètre configurable).
Flux mode passerelle (détail)
initPayment(['amount'=>..., 'externalId'=>..., 'returnUrl'=>..., 'cancelUrl'=>...])→$res['gatewayUrl']- Rediriger le client vers
$res['gatewayUrl'](page hébergée KPay : saisie nom / numéro / méthode). - KPay traite le paiement, puis renvoie le client vers
returnUrlavec?status&reference&externalId&ts&sig. - À la page de retour :
verifyReturnSignature($request->query())(HMAC-SHA256 surstatus|reference|externalId|tsavecgatewaySecret), puisawaitFinalStatusen filet de sécurité. Le webhook (callbackUrlde l'application) reste la confirmation serveur-à-serveur de référence.
Temps réel — WebSocket (conseillé en complément)
Le SDK PHP est synchrone (cURL natif) : le suivi temps réel se fait côté navigateur, via socket.io, pour un retour visuel instantané sans attendre le polling.
Le WebSocket est un complément UX, pas la source de vérité : gardez le webhook (et
verifyReturnSignature) comme confirmation autoritaire.
Abonnements disponibles (ack { event: "subscribed", data: { room } }) :
| Émettre | Payload | Reçoit |
|---|---|---|
subscribe:transaction |
{ transactionId } |
payment:status_changed |
subscribe:application |
{ applicationId } |
payment:status_changed (toutes les transactions de l'app) |
subscribe:withdrawal |
{ withdrawalId } |
withdrawal:status_changed |
All versions of kpay-sdk with dependencies
ext-curl Version *
ext-json Version *