Logo Lanfrica

TheBeyonder237/nexus-africa

Domain:

digital infrastructure

Record type:

software
Creator:
The
Host:
Async-first Python SDK for the Nexus/Neero Mobile Money payment gateway (CEMAC zone) # nexus-africa Async-first Python SDK for the Nexus/Neero payment gateway (CEMAC zone — Cameroon, Central Africa). ## Why this SDK? The official `neero-gateway` uses stdlib only (synchronous). This SDK adds: - **Async-first** via `httpx` — drop-in for FastAPI / async frameworks - **Pydantic v2 models** — typed request and response objects - **Typed exceptions** — one class per error family (`PaymentMethodError`, `GatewayError`, `IdempotencyConflict`…) - **Full endpoint coverage** — Payment Methods, Transaction Intents, Balances, Sessions, BaaS (cards, KYC onboarding) - **Webhook helper** — `verify_and_parse()` with HMAC-SHA512 + replay protection ## Installation ```bash pip install nexus-africa ``` ## Quick start — sync ```python from nexus_africa import NexusClient, MobileMoneyProvider, PaymentType with NexusClient("sk_test_...", platform_code="MYAPP") as client: # 1. Register the client's Mobile Money wallet client_pm = client.payment_methods.create_mobile_money( "+237691111111", "CM", MobileMoneyProvider.ORANGE_MONEY ) # 2. Register your Nexus Merchant account merchant_pm = client.payment_methods.create_merchant( merchant_key="mk_...", store_id="store_...", balance_id="bal_...", operator_id=9, ) # 3. Initiate cash-in (client → merchant) intent = client.intents.cash_in( source_payment_method_id=client_pm.id, destination_payment_method_id=merchant_pm.id, amount=5000, # XAF, integer idempotency_key="order_42", # optional but recommended ) print(intent.status) # PENDING print(intent.id) # intent_... ``` ## Quick start — async ```python import asyncio from nexus_africa import AsyncNexusClient, MobileMoneyProvider async def main(): async with AsyncNexusClient("sk_test_...", platform_code="MYAPP") as client: pm = await client.payment_methods.create_mobile_money( "+237651111111", "CM", MobileMoneyProvider.MTN_MONEY ) intent = await client.intents.cash_in( source_payment_method_id=pm.id, destination_payment_method_id=" ", amount=50 …