Choisissez votre langage et intégrez HunterTech Pay en moins de 10 minutes
Créez un compte marchand et générez vos clés dans le dashboard
Disponible pour Python, Node.js, et PHP
Quelques lignes de code suffisent !
Cycle complet d'une transaction de paiement Mobile Money
📋 Étape 1
⏱️ ~5 minutes
💻 Étape 2
⏱️ ~10 minutes
🔐 Étape 3
⏱️ ~200ms
Redirection
📱 Étape 4 - Traitement Opérateur
⏱️ 5-60 secondes
Réponse Async
🔔 Étape 5
⏱️ Temps réel
Bibliothèques maintenues officiellement pour une intégration rapide et sécurisée
SDK officiel pour Python 3.8+
SDK officiel pour Node.js 16+ et TypeScript
SDK officiel pour PHP 8.0+
Structure modulaire partagée par Python, Node.js et PHP
Code métier
HunterTechPay()
Classe principale
HunterTechPay
Classe TypeScript
HunterTechPay
Classe PHP
Architecture partagée
https://api.huntertechpay.com/v1
Exemples complets pour chaque SDK officiel
📥 Installation: pip install huntertechpay
from huntertechpay import HunterTechPay
# Initialize client
hunter = HunterTechPay(
api_key='htp_live_your_api_key',
secret_key='sk_live_your_secret_key',
base_url='https://api.huntertechpay.com'
)
# Get available providers
providers = hunter.get_providers('CM') # Cameroon
for provider in providers.providers:
print(f"{provider.name}: {provider.cashin_service_code}")
# Deposit (CASHIN) - From mobile money to wallet
deposit = hunter.deposit(
amount=10000.0, # 10,000 XAF
currency='XAF',
country='CM',
phone='+237699123456',
service_code='HT_PAIEMENTMARCHAND_MTN_CM',
partner_id='ORDER-12345',
description='Payment for order #12345'
)
print(f"Transaction ID: {deposit.transaction_id}")
print(f"Status: {deposit.status}")
# Check transaction status
status = hunter.check_status('ORDER-12345', 'partner_id')
print(f"Current status: {status.status}")Recevez des notifications en temps réel sur le statut de vos transactions
transaction.pendingTransaction initiée
transaction.processingEn cours de traitement
transaction.successTransaction réussie
transaction.failedTransaction échouée
Node.js Express
// Node.js Express Webhook Handler
const crypto = require('crypto');
app.post('/webhook/huntertechpay', (req, res) => {
// Get signature from header
const signature = req.headers['x-hunter-signature'];
const timestamp = req.headers['x-hunter-timestamp'];
// Verify signature
const payload = JSON.stringify(req.body);
const message = `${timestamp}.${payload}`;
const expectedSignature = crypto
.createHmac('sha512', SECRET_KEY)
.update(message)
.digest('hex');
if (signature !== expectedSignature) {
return res.status(401).json({ error: 'Invalid signature' });
}
// Process webhook
const { event, transaction_id, partner_id, status } = req.body;
if (event === 'transaction.success') {
// Update your database
await updateOrderStatus(partner_id, 'paid');
}
res.status(200).json({ success: true });
});Communication asynchrone en temps réel entre HunterTech Pay et votre serveur
Transaction complétée sur Mobile Money (Success/Failed/Pending)
Trigger
Création du payload webhook avec signature HMAC-SHA512
POST Request
Endpoint webhook reçoit la requête POST
📥 Headers reçus:
Vérification
Vérification de l'authenticité du webhook
Traitement
Mise à jour de votre base de données et logique métier
📊 Actions:
📧 Notifications:
Réponse
Confirmation de réception à HunterTech Pay
Toutes les requêtes API doivent être signées pour garantir la sécurité
🔒 Bonne nouvelle: Si vous utilisez nos SDKs officiels, l'authentification HMAC-SHA512 est gérée automatiquement ! Vous n'avez pas à vous soucier de la génération des signatures.
Math.floor(Date.now() / 1000){timestamp}.{json_body}Construction du payload et génération du timestamp
{
"amount": 50000,
"provider": "mtn",
"phone": "+237670000000"
}timestamp = Math.floor(
Date.now() / 1000
)
// Ex: 1711234567Calcul de la signature avec votre Secret Key
message = timestamp + "." + JSON.stringify(payload)
// Ex: 1711234567.{"amount":50000,"provider":"mtn",...}signature = HMAC_SHA512(message, secret_key)
// Résultat: chaîne hexadécimale de 128 caractèresX-API-Key: htp_live_your_api_key
X-Hunter-Timestamp: 1711234567
X-Hunter-Signature: a4f2d8e9c1b3...Le serveur reçoit la requête avec les headers de sécurité
{
"amount": 50000,
"provider": "mtn",
"phone": "+237670000000"
}Validation de l'authenticité de la requête
timestamp = headers["X-Hunter-Timestamp"]
signature_reçue = headers["X-Hunter-Signature"]
body = request.bodymessage = timestamp + "." + body
signature_calculée = HMAC_SHA512(message, secret_key)if (signature_reçue === signature_calculée) {
// ✓ Signature valide → Continuer
} else {
// ✗ Signature invalide → Rejeter (401)
}temps_écoulé = current_time - timestamp
if (temps_écoulé > 300) { // 5 minutes
// ✗ Requête trop ancienne → Rejeter
}Requête authentifiée
Requête rejetée
Testez votre intégration sans effectuer de vraies transactions
https://api.huntertechpay.comhttps://sandbox-api.huntertechpay.com| Numéro | Comportement |
|---|---|
| +237600000001 | Succès immédiat |
| +237600000002 | Échec (fonds insuffisants) |
| +237600000003 | Timeout |
| +237600000004 | Succès après 30s |