Python package for MVOLA API
###Installation
python -m pip install mvola_api
###Exemple
import os
import uuid
from datetime import datetime as dt
from pathlib import Path
from mvola_api import MVolaMerchantPayAPI, AUthResult, Config, MvolaTransactionData, HashedMap,PRODUCTION_URL
from dotenv import dotenv_values
#load .env
config = dotenv_values(Path(os.getcwd(), '.env'))
# for sandbox
api: MVolaMerchantPayAPI = MVolaMerchantPayAPI()
# for production
api: MVolaMerchantPayAPI = MVolaMerchantPayAPI(PRODUCTION_URL)
# revoke token
api.revoke_token(config.get('CONSUMER_KEY'), config.get('CONSUMER_SECRET'), True)
# The third parameter fro revoke_token is to auto update Bearer token for the API, So, no need to call set_access_token
# If you want to load access token
auth_data = api.revoke_token(config.get('CONSUMER_KEY'), config.get('CONSUMER_SECRET'), True)
print(auth_data.access_token)
#Transaction
#create transaction config
transaction_config: Config = Config(**{
'version': "1.0",
'xCorrelationID': f'{uuid.uuid4()}',
'userLanguage': "MG",
'userAccountIdentifier': "msisdn;034350003",
'partnerName': "Mvola API"
})
# init transaction config
api.init_config(transaction_config)
transaction: MvolaTransactionData = MvolaTransactionData(**{
'amount': 500,
'currency': "Ar",
'descriptionText': "Description",
'requestDate': dt.now().isoformat(),
'debitParty': [
HashedMap(**{
'key': "msisdn",
'value': "034350003",
})
],
'creditParty': [
HashedMap(**{
'key': "msisdn",
'value': "034350003",
}),
],
'metadata': [
HashedMap(**{
'key': "partnerName",
'value': "Mvola API",
}),
HashedMap(**{
'key': "fc",
'value': "USD",
}),
HashedMap(**{
'key': "amountFc",
'value': "1",
}),
],
'requestingOrganisationTransactionReference': f'{uuid.uuid4()}',
'originalTransactionReference': f'{uuid.uuid4()}',
})
# start transaction
transaction_response = api.initiate_transaction(transaction)
print(transaction_response)
# get details
transaction_details = api.get_details(transactionId)
#get status
transaction_status = api.get_status(serverCorrelationId)
Metadata
Release files for mvola-api 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mvola-api-1.0.2.tar.gz | 4.3 kB | Without provenance | Details for mvola-api-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mvola_api-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for mvola_api-1.0.2-py3-none-any.whl |
Total release size: 9.5 kB
Release files / mvola-api-1.0.2.tar.gz
| Download URL | mvola-api-1.0.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a9e8ab286fe4590c96fe1ea5ad2734e78123703ca959c955ceb544a5a540bbf
|
|
BLAKE2b-256 checksum How to use checksums |
7bebae84305f33303e2b6da8fc6d3bc1f737693485bec72dae272c0ea02c24ea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.2 Windows/10
|
Release files / mvola_api-1.0.2-py3-none-any.whl
| Download URL | mvola_api-1.0.2-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7bc6f9fd9f70c787b22c9c73adf006c91e1f079805c846dc18812ee768ab484d
|
|
BLAKE2b-256 checksum How to use checksums |
c0fe52df3940a7370b9529e34035fdcc0f4eb7e3f112d8e4ca643988a2229638
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.13 CPython/3.9.2 Windows/10
|
Security for mvola-api 1.0.2
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.