Skip to main content

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 description

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.

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
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 · Licence Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

byteinnov_momo-0.1.0.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

byteinnov_momo-0.1.0-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file byteinnov_momo-0.1.0.tar.gz.

File metadata

  • Download URL: byteinnov_momo-0.1.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for byteinnov_momo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aca570aa65aa369b916069bca1f2973d453a636d4f83ef1e890c451a16d3afcc
MD5 4928a13ecd79fb4033e7a6d23d4b1982
BLAKE2b-256 23d0fe283943275ba60163d27cecc82bc63c2eeef55a4aa873da6e5889a4098c

See more details on using hashes here.

File details

Details for the file byteinnov_momo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: byteinnov_momo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for byteinnov_momo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7744ac5ef30c4320c54b048ea8b32652922b3a906c70ed9c5d94411cdd8d19b9
MD5 f2ad596e2bf570f41b3a6d9d5be33c21
BLAKE2b-256 ad5ca24b00300fa31b9107efb4b282d243a57abfd08b68e7198e7e2e04febb52

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page