Skip to main content

moncash-sdk (Python)

SDK Python simple pour MonCash (Digicel) et NatCash (Natcom). Aucune dépendance, Python 3.10+.

Projet non officiel, sans lien avec Digicel ni Natcom.

pip install moncash-natcash

MonCash

import os
from moncash_natcash import MonCash

moncash = MonCash(os.environ["MONCASH_CLIENT_ID"], os.environ["MONCASH_CLIENT_SECRET"], mode="sandbox")

# 1. Créer le paiement et rediriger le client
paiement = moncash.create_payment(amount=500, order_id="CMD-001")
print(paiement["redirect_url"])

# 2. Au retour (?transactionId=...), vérifier
resultat = moncash.verify_payment(transaction_id="...", order_id="CMD-001", amount=500)
if resultat["ok"]:
    print("Commande payée")

Autres fonctions : get_payment_by_transaction_id, get_payment_by_order_id, transfer, customer_status, prefunded_balance.

NatCash

from moncash_natcash import NatCash

natcash = NatCash(
    private_key="...", partner_code="...", function_code="...",
    username="...", password="...",
    callback_url="https://monsite.ht/natcash/retour",
    mode="sandbox", language="ht",
)

paiement = natcash.create_payment(amount=500, order_id="CMD-001")
print(paiement["redirect_url"])

# Page de retour : NatCash ajoute ?orderNumber=...&code=...&signature=...
resultat = natcash.verify_payment(query=request.args, amount=500)
if resultat["ok"]:
    print("Commande payée")
else:
    print(resultat["reason"])

Natcom ne publie pas de documentation publique : la partie NatCash suit les SDK php-natcash-sdk et natcashify de Louis Midson Lajeanty (MIT).

Tests

cd python
python -m unittest discover -s tests -v

Documentation complète et version Node.js : https://github.com/GuyBastien/moncash-sdk

Metadata

Release files for moncash-natcash 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moncash-natcash 0.1.1
File Size Uploaded Provenance Actions
moncash_natcash-0.1.1.tar.gz 11.3 kB Without provenance Details for moncash_natcash-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for moncash-natcash 0.1.1
File Interpreter ABI Platform Actions
moncash_natcash-0.1.1-py3-none-any.whl Python 3 none any Details for moncash_natcash-0.1.1-py3-none-any.whl

Total release size: 21.3 kB

Release files / moncash_natcash-0.1.1.tar.gz

Download URL moncash_natcash-0.1.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2e7c04eb55e832ccf9d92fbfd9319158f36bab30d9c4d91e2654f5dab1a31d47
BLAKE2b-256 checksum
How to use checksums
371568850fa112cf420407049f3c774bfa7abdce32fd5ecb3956d0940edb108a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / moncash_natcash-0.1.1-py3-none-any.whl

Download URL moncash_natcash-0.1.1-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2ec19fa0d78fb5b57fda9898822c43873f935a227673a85833c5c50fb40a0a3
BLAKE2b-256 checksum
How to use checksums
054cb19d36a7d5404d51722c0f14ffbbc347c16903bdc007d7cc4e130673bf67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for moncash-natcash 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page