Skip to main content

Python client for MeSomb services.

Project description

Welcome to pymesomb 👋

Version Documentation License: MIT Twitter: hachther

Python client for MeSomb Services

You can check the full documentation of the api here

🏠 Homepage

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 contact@hachther.com

Show your support

Give a ⭐️ if this project helped you!

1.0.2 (2023-07-25)

=== BREAKING CHANGES ===

Only one parameter is now passed to make_deposit and make_collect. The parameter is a Map that will contain all details of your request.

All method is now returning MeSomb model not dict

1.0.0 (2022-10-20)

First release of the module.

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

pymesomb-1.0.2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

pymesomb-1.0.2-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file pymesomb-1.0.2.tar.gz.

File metadata

  • Download URL: pymesomb-1.0.2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pymesomb-1.0.2.tar.gz
Algorithm Hash digest
SHA256 991a428416f817ea8601062601f88d00abb0218b896c7ff033421ae1c0e9ea2d
MD5 753b75f8680e8d10ecb422e27ca14077
BLAKE2b-256 b28a726951b241d103e0d1690d7bb794b2d3ba368633fd09ce4c38d9a51846ba

See more details on using hashes here.

File details

Details for the file pymesomb-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pymesomb-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pymesomb-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 55513537e697109236d95f66ed7471c4d14b57f360a139b21b4914f4c17f8a35
MD5 23c757d80bbb9767a46b6154b4c2bd62
BLAKE2b-256 ea39eab7f88139c7927571dde6c4b3942c221258909f1eabcbe4debe5bc7d979

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