Current collected state Current
Observed since 20 Oct, 21:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Official AfconWave Python SDK — Pan-African payments, payouts, crypto, refunds & disputes.
The official Python client library for the AfconWave Payments API.
pip install afconwave
from afconwave import AfconWave
afw = AfconWave(secret_key="sk_test_your_key_here")
payment = afw.create_payment(
amount=5000, # Amount in minor units (5000 = 50 XAF)
currency="XAF",
description="Order #1234",
callback_url="https://yoursite.com/payment/callback",
customer={
"name": "Jean Dupont",
"email": "jean@example.com",
"phone": "+237600000000",
},
metadata={"order_id": "ORD-1234"}
)
print(payment["checkout_url"]) # Redirect user here
print(payment["id"]) # e.g., pay_507f191e8180f
payment = afw.retrieve_payment("pay_507f191e8180f")
print(payment["status"]) # "pending" | "success" | "failed"
print(payment["amount"])
print(payment["paid_at"])
payout = afw.create_payout(
amount=10000,
currency="XAF",
recipient={
"phone": "+237600000001",
"network": "MTN", # "MTN" | "ORANGE" | "MOOV" | "WAVE"
"name": "Marie Kamga",
},
reference="PAYOUT-REF-001"
)
print(payout["status"]) # "pending" | "success" | "failed"
result = afw.list_payments(limit=20, status="success")
for payment in result["data"]:
print(payment["id"], payment["amount"], payment["status"])
Verify that incoming webhooks are genuinely from AfconWave:
import hashlib
import hmac
from flask import Flask, request, abort
app = Flask(__name__)
WEBHOOK_SECRET = "your_webhook_secret"
@app.route("/webhooks/afconwave", methods=["POST"])
def handle_webhook():
signature = request.headers.get("X-AfconWave-Signature", "")
payload = request.get_data(as_text=True)
expected = hmac.new(
WEBHOOK_SECRET.encode(),
payload.encode(),
hashlib.sha256
).hexdigest()
if not hmac.compare_digest(expected, signature):
abort(400, "Invalid signature")
event = request.get_json()
if event["event"] == "payment.success":
print("Payment received:", event["data"]["id"])
elif event["event"] == "payment.failed":
print("Payment failed")
elif event["event"] == "payout.success":
print("Payout delivered")
return "OK", 200
from afconwave import AfconWave, AfconWaveError
afw = AfconWave(secret_key="sk_test_...")
try:
payment = afw.create_payment(amount=5000, currency="XAF", callback_url="...")
except AfconWaveError as e:
print(f"API Error {e.status_code}: {e.message}")
except Exception as e:
print(f"Unexpected error: {e}")
| Parameter | Type | Default | Description |
|---|---|---|---|
secret_key | str | required | Your AfconWave secret API key |
base_url | str | https://api.afconwave.com/v1 | API base URL |
timeout | int | 30 | Request timeout (seconds) |
Use test keys prefixed with sk_test_ for sandbox mode. No real transactions occur.
afw = AfconWave(secret_key="sk_test_...")
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from afconwave import AfconWave
afw = AfconWave(secret_key="sk_live_...")
def create_checkout(request):
payment = afw.create_payment(
amount=int(request.POST["amount"]),
currency="XAF",
callback_url="https://yoursite.com/payment/success",
)
return JsonResponse({"checkout_url": payment["checkout_url"]})
Full API documentation: docs.afconwave.com
MIT © AfconWave
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.1.0 | 11 May 2026 | 5 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 21:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:04aaf170eded39d7ceb1a88b31e801e153382296a99ff791ddcb4c0a7af0485c