Metadata-Version: 2.4
Name: byteinnov-momo
Version: 0.1.0
Summary: Clients mobile money Afrique de l'Ouest (Moov Money SOAP, MTN MoMo REST) : codec pur (requêtes canoniques, parsing, mapping d'erreurs vers un état commun) séparé du transport HTTP injectable
Project-URL: Homepage, https://gitlab.byteinnov.com/bi-dev-team/packages/psp
Author: Byteinnov
License: Apache-2.0
Keywords: benin,mobile-money,momo,moov,mtn,psp
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# byteinnov-momo

Clients mobile money Afrique de l'Ouest — **Moov Money Bénin** (SOAP Merchant) et **MTN MoMo** (REST momodeveloper, Collection + Disbursement). Python 3.10+, stdlib uniquement, typé (`py.typed`).

Portage à parité stricte de l'implémentation Kotlin de référence : mêmes requêtes octet par octet, même parsing, même mapping d'erreurs — vérifié par un harnais de parité en CI. Les protocoles et leurs pièges (état `CREATED` MTN, code `95`-pending Moov…) sont documentés dans le dépôt.

```python
from byteinnov_momo.mtn import MtnClient, MtnConfig, MtnCredentials, RequestToPay

client = MtnClient(MtnConfig(
    base_url="https://sandbox.momodeveloper.mtn.com",
    target_environment="sandbox",
    collection=MtnCredentials(subscription_key, api_user_id, api_key),
))
reference_id = str(uuid.uuid4())          # clé d'idempotence, à persister
client.request_to_pay(reference_id, RequestToPay(
    amount="100", currency="EUR",         # EUR sandbox, XOF prod Bénin
    external_id="CMD-1042", party_id="46733123454",
))
status = client.get_request_to_pay_status(reference_id)   # poller ≥ 60 s en sandbox
```

```python
from byteinnov_momo.moov import MoovClient, MoovConfig, PushRequest

moov = MoovClient(MoovConfig(endpoint_url=..., token=...))
push = moov.push_with_pending(PushRequest(
    msisdn="+2290160130000", amount=500,
    message="Commande #1042", external_data1=payment_id,
))
```

Architecture : **codec pur** (construction canonique, parsing, mapping vers l'état commun `SUCCESS | PENDING | CANCELLED | FAILED | UNKNOWN`) séparé du **transport HTTP injectable** (`urllib` par défaut, remplaçable).

Source, protocoles détaillés, harnais de parité : [gitlab.byteinnov.com/bi-dev-team/packages/psp](https://gitlab.byteinnov.com/bi-dev-team/packages/psp) · Licence [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0).
