Python SDK for maib ecommerce API
Project description
Python SDK for maib ecommerce API
maib e-commerce API docs: https://docs.maibmerchants.md
Installation
To easily install or upgrade to the latest release, use pip.
pip install --upgrade maib-ecommerce-sdk
Getting started
Import SDK:
from maib_ecommerce_sdk import MaibAuthRequest, MaibApiRequest
Add project configuration:
import os
MAIB_PROJECT_ID = os.getenv('MAIB_PROJECT_ID')
MAIB_PROJECT_SECRET = os.getenv('MAIB_PROJECT_SECRET')
MAIB_SIGNATURE_KEY = os.getenv('MAIB_SIGNATURE_KEY')
SDK usage examples
Get Access Token with Project ID and Project Secret
maib_auth = MaibAuthRequest.create().generate_token(MAIB_PROJECT_ID, MAIB_PROJECT_SECRET)
maib_token = maib_auth['accessToken']
maib_refresh_token = maib_auth['refreshToken']
Get Access Token with Refresh Token
maib_auth = MaibAuthRequest.create().generate_token(maib_refresh_token)
maib_token = maib_auth['accessToken']
maib_refresh_token = maib_auth['refreshToken']
Direct Payment
# Set up required payment parameters
maib_pay_data = {
'amount': 10.25,
'currency': 'EUR',
'clientIp': '127.0.0.1'
}
# Initiate Direct Payment
maib_pay = MaibApiRequest.create().pay(maib_pay_data, maib_token)
maib_pay_url = maib_pay['payUrl']
maib_pay_id = maib_pay['payId']
For more examples see PHP SDK for maib ecommerce API
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
maib_ecommerce_sdk-1.0.7.tar.gz
(19.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file maib_ecommerce_sdk-1.0.7.tar.gz.
File metadata
- Download URL: maib_ecommerce_sdk-1.0.7.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19f133958e4bda59b53fae0ff417a267f42a3c64b5951f1970a6be3959bcaca5
|
|
| MD5 |
e07d04448dca0d22efd831e2a1d5986e
|
|
| BLAKE2b-256 |
895b26434fdca8656817ab3e41cf0f8fa76772e38f048af8f72c15037098de47
|
File details
Details for the file maib_ecommerce_sdk-1.0.7-py3-none-any.whl.
File metadata
- Download URL: maib_ecommerce_sdk-1.0.7-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4108e9c89ee86404476b63104b0a3f869218b45b1e53e04e7009cfe70ca1537
|
|
| MD5 |
a5b7208e5d611eda11f4b52d820756dc
|
|
| BLAKE2b-256 |
92ad7158caa4dc4d9613e3ea13be104e85660520e31b9ebde312b2fc64a5d5fc
|