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.5.tar.gz
(19.2 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.5.tar.gz.
File metadata
- Download URL: maib_ecommerce_sdk-1.0.5.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccdd9ae5e0269aa509383e2016c89a32b8177d706148bee3bd22941156f4c015
|
|
| MD5 |
1cbb05dc1f2964790b52a611acd48603
|
|
| BLAKE2b-256 |
d9869cf60d029172aac7ecb2a19e2f28d6cf271910314f0a76ca3610728bcaaf
|
File details
Details for the file maib_ecommerce_sdk-1.0.5-py3-none-any.whl.
File metadata
- Download URL: maib_ecommerce_sdk-1.0.5-py3-none-any.whl
- Upload date:
- Size: 19.9 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 |
0a2ac656fd1fbea1eb09b59e637ae6c5576573aca74bb1010e805e8951f39657
|
|
| MD5 |
0892b8e6762a38c4254845d48a286eab
|
|
| BLAKE2b-256 |
4b881f73ae5449e7ecb5a0e972c6cd1d5a1ca4c39ba30edd6e86fc9da29cd5c5
|