Skip to main content


A light Python module for your API Mvola .

Documentation | Report bugs | Contribute

INSTALLATION

You can consult the link on pypi.org here for mode documentation.

pip install mvola==1.0.1

USAGE

Check the demo file here

Start the API

Create your account here. After you create application , you should have Consummer_key and Consummer_secret.

# Import the module mvola
from mvola import Mvola

# Initiate the api => API(Consummer_key, Consummer_secret)
api = Mvola("{consummer_key}","{consummer_secret}")

Generate token

Check the documentation here

res = api.generate_token()
if res.success :
    api.token = res
    print(res)
else :
    print(f"Status_code[{res.status_code}] \n {res.error}")
OUTPUT

Success

    {
        "Success": true,
        "Error": null,
        "Status code": 200,
        "Value": {
            "access_token": "eyJ4NXQiOiJPRE5tWkRFMll6UTRNVEkxTVRZME1tSmhaR00yTUdWa1lUZGhOall5TWpnM01XTmpNalJqWWpnMll6bGpNRGRsWWpZd05ERmhZVGd6WkRoa1lUVm1OZyIsImtpZCI6Ik9ETm1aREUyWXpRNE1USTFNVFkwTW1KaFpHTTJNR1ZrWVRkaE5qWXlNamczTVdOak1qUmpZamcyWXpsak1EZGxZall3TkRGaFlUZ3paRGhrWVRWbU5nX1JTMjU2IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJyaXZvMjMwMkBnbWFpbC5jb21AY2FyYm9uLnN1cGVyIiwiYXV0IjoiQVBQTElDQVRJT04iLCJhdWQiOiIwekw3ZVRyU0VmWGY2a2t3SjUzRFNlZ0NiQndhIiwibmJmIjoxNjUyMDk2Mzc1LCJhenAiOiIwekw3ZVRyU0VmWGY2a2t3SjUzRFNlZ0NiQndhIiwic2NvcGUiOiJFWFRfSU5UX01WT0xBX1NDT1BFIiwiaXNzIjoiaHR0cHM6XC9cL2FwaW0ucHJlcC50ZWxtYS5tZzo5NDQzXC9vYXV0aDJcL3Rva2VuIiwiZXhwIjoxNjUyMDk5OTc1LCJpYXQiOjE2NTIwOTYzNzUsImp0aSI6Ijk0ZWRlZjIyLTFmYzEtNDYxNS05YzZjLWQxZGQ3MDg1NmFjYyJ9.MQ6ew1r7nMWZN3hI8Xvbv0PuZgsi-GY_IjsO-NeXmALh1KnwOOwhgo1cMu9hRGsXWg3XZexqLagLHRcjYNDXJKR6QuYrop6WzZuGMGsNs-PL_1jrjctOLIS2VGBL1utCdDvhvfYgG-oOs2cisBUIQ7TtHF8haTd0w4WdNVkxt66Jz5ZGhEbOBralbym3-Bgjo_2wbuKy9iY0x6xqr2xMuhPXkgTFyZmAqmUv32zIIyvfC6OiEcfcXF2T3Bm_NqJN8BNXXu8ST3sdU_dEp2wYEf5f4d8LxUygNVv5n9kkdlmLrRWpoEeWfpIcfAeMuMdyLaXAgQj-T7BInM5wECMhYg",
            "scope": "EXT_INT_MVOLA_SCOPE",
            "token_type": "Bearer",
            "expires_in": 3600
        }
    }

Failed [example]

    Status_code[401] 
    {
        'error_description': 'A valid OAuth client could not be found for client_id: 0zL7eTrSEfXf6kwJ53DSegCbBwa', 
        'error': 'invalid_client'
    }

The token generated by this function must expire after 3600s by default,to change that go to the dashboard of Mvola API Application in the plaform.

Initiate Transaction

Check the documentation here

from mvola.tools import Transaction

transaction = Transaction(
    token="{{token}}", # [Token] Requiered fields
    UserLanguage="FR", # MG or FR
    UserAccountIdentifier="0343500003", # [UserAccountIdentifier] Requiered fields 
    partnerName="Marketbot", # Name of your application
    amount="1500",
    X_Callback_URL="https://2809-102-16-43-64.ngrok.io", # Webhook link for client , Mvola sends requests in this links once the transaction is finished 
    currency="Ar", # Possible Values : Ar only
    descriptionText="Unedescription", # String (len<40Characters)without special character
    requestDate="2022-05-06T02:14:59.567Z", # Respect the consraints as in this example
    debit="0343500003", # [Debit] Required fields | Phone number of subscriber .In preprod it’s fixed: 034350003 or 0343500004
    credit="0343500004",  # [Credit] Required fields | Phone number of merchant. In preprod it’s fixed: 034350003 or 0343500004
)

# Init transaction
res = api.init_transaction(transaction)

if res.success :
    print(res.value)
else :
    print(f"Status_code [{res.status_code}] \n {res.error}")
OUTPUT

Success :

    {
        'status': 'pending', 
        'serverCorrelationId': '821ff7f5-43e2-4e6e-af47-a8c40150f950', 
        'notificationMethod': 'callback'
    }

Failed [example]:

    Status_code : [401] ,
    {
        'fault': {
            'code': 900901, 
            'message': 'Invalid Credentials', 
            'description': 'Invalid Credentials. Make sure you have given the correct access token'
        }
    }

Status of Transaction

Check the documentation here

from mvola.tools import Transaction

transaction = Transaction(
    token="{{token}}", # [Token] Requiered fields
    UserLanguage="FR", # MG or FR
    UserAccountIdentifier="0343500003", # [UserAccountIdentifier] Requiered fields 
    partnerName="Marketbot", # Name of your application
    serverCorrelationId='c8e9e922-b965-4515-b390-137b41c9f40b' , # The response when you initiate transaction
)

# Status of  transaction
res = api.init_transaction(transaction)

if res.success :
    print(res.value)
else :
    print(f"Status_code [{res.status_code}] \n {res.error}")
OUTPUT

Success :

    {
        "status": "success",
        "serverCorrelationId": "821ff7f5-43e2-4e6e-af47-a8c40150f950",
        "notificationMethod": "callback",
        "objectReference": ""
    }

Failed [example]:

    Status_code : [401] ,
    {
        'status': '', 
        'serverCorrelationId': '821ff7f5-73e2-4e6e-af47-a8c40150f950', 
        'notificationMethod': '', 
        'objectReference': ''
    }

How to contribute ?

  • Make a fork of the repository
  • TODO List #02
  • Create a Pull Request

Contributors

Image des contributeurs GitHub

Metadata

Release files for mvola 1.0.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 mvola 1.0.1
File Size Uploaded Provenance Actions
mvola-1.0.1.tar.gz 10.9 kB Without provenance Details for mvola-1.0.1.tar.gz

Release files / mvola-1.0.1.tar.gz

Download URL mvola-1.0.1.tar.gz
Size 10.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ad059d6c823f3723adb1ac84f70f76f9774e76c88ba3855f5b75db643b7d00a5
BLAKE2b-256 checksum
How to use checksums
463e3653e4191020dddada3d2a930c932c8781403ce17947c359615f2f52536a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.8.10

Security for mvola 1.0.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.

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