Skip to content

hachther/mesomb-python

Repository files navigation

Welcome to pymesomb 👋

Version Documentation License: MIT Twitter: hachther

Python client for MeSomb Services

You can check the full documentation of the api here

Install

pip3 install pymesomb

Usage

Collect money from an account

from pymesomb.operations import PaymentOperation
from pymesomb.utils import RandomGenerator
from datetime import datetime

operation = PaymentOperation('<application_key>', '<access_key>', '<secret_key>')
response = operation.make_collect({
    'amount': 100,
    'service': 'MTN',
    'payer': '670000000',
    'date': datetime.now(),
    'nonce': RandomGenerator.nonce(),
    'trxID': '1'
})
print(response.is_operation_success())
print(response.is_transaction_success())

Depose money in an account

from pymesomb.operations import PaymentOperation
from pymesomb.utils import RandomGenerator
from datetime import datetime

operation = PaymentOperation('<application_key>', '<access_key>', '<secret_key>')
response = operation.make_deposit({
    'amount': 100,
    'service': 'MTN',
    'receiver': '670000000',
    'date': datetime.now(),
    'nonce': RandomGenerator.nonce(),
    'trxID': '1'
})
print(response.is_operation_success())
print(response.is_transaction_success())

Get application status

from pymesomb.operations import PaymentOperation

operation = PaymentOperation('<application_key>', '<access_key>', '<secret_key>')
response = operation.get_status()
print(response.name)

Get transactions by IDs

from pymesomb.operations import PaymentOperation

operation = PaymentOperation('<application_key>', '<access_key>', '<secret_key>')
response = operation.get_transactions(['ID1', 'ID2'])
print(response)

Author

👤 Hachther LLC [email protected]

Show your support

Give a ⭐️ if this project helped you!

About

Python client for MeSomb Services

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published