# Python SDK for maib ecommerce API
maib e-commerce API docs: [https://docs.maibmerchants.md](https://docs.maibmerchants.md)
## Installation
To easily install or upgrade to the latest release, use `pip`.
```shell
pip install --upgrade maib-ecommerce-sdk
```
## Getting started
Import SDK:
```python
from maib_ecommerce_sdk import MaibAuthRequest, MaibApiRequest
```
Add project configuration:
```python
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
```python
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
```python
maib_auth = MaibAuthRequest.create().generate_token(maib_refresh_token)
maib_token = maib_auth['accessToken']
maib_refresh_token = maib_auth['refreshToken']
```
### Direct Payment
```python
# 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](https://github.com/maib-ecomm/maib-sdk-php)
Raw data
{
"_id": null,
"home_page": null,
"name": "maib-ecommerce-sdk",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "maib, ecommerce, payments, api, sdk, python",
"author": "Alexander Minza",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/2a/f7/c02251c788f2b4ddaf53c687015b43dd96b576113658b48ab4b0bca0b9af/maib_ecommerce_sdk-1.0.0.tar.gz",
"platform": null,
"description": "# Python SDK for maib ecommerce API\nmaib e-commerce API docs: [https://docs.maibmerchants.md](https://docs.maibmerchants.md)\n\n## Installation\nTo easily install or upgrade to the latest release, use `pip`.\n```shell\npip install --upgrade maib-ecommerce-sdk\n```\n\n## Getting started\nImport SDK:\n\n```python\nfrom maib_ecommerce_sdk import MaibAuthRequest, MaibApiRequest\n```\n\nAdd project configuration:\n\n```python\nimport os\n\nMAIB_PROJECT_ID = os.getenv('MAIB_PROJECT_ID')\nMAIB_PROJECT_SECRET = os.getenv('MAIB_PROJECT_SECRET')\nMAIB_SIGNATURE_KEY = os.getenv('MAIB_SIGNATURE_KEY')\n```\n\n## SDK usage examples\n### Get Access Token with Project ID and Project Secret\n\n```python\nmaib_auth = MaibAuthRequest.create().generate_token(MAIB_PROJECT_ID, MAIB_PROJECT_SECRET)\n\nmaib_token = maib_auth['accessToken']\nmaib_refresh_token = maib_auth['refreshToken']\n```\n\n### Get Access Token with Refresh Token\n\n```python\nmaib_auth = MaibAuthRequest.create().generate_token(maib_refresh_token)\n\nmaib_token = maib_auth['accessToken']\nmaib_refresh_token = maib_auth['refreshToken']\n```\n\n### Direct Payment\n\n```python\n# Set up required payment parameters\nmaib_pay_data = {\n 'amount': 10.25,\n 'currency': 'EUR',\n 'clientIp': '127.0.0.1'\n}\n\n# Initiate Direct Payment\nmaib_pay = MaibApiRequest.create().pay(maib_pay_data, maib_token)\n\nmaib_pay_url = maib_pay['payUrl']\nmaib_pay_id = maib_pay['payId']\n```\n\nFor more examples see [PHP SDK for maib ecommerce API](https://github.com/maib-ecomm/maib-sdk-php)\n",
"bugtrack_url": null,
"license": "GPL-3.0-or-later",
"summary": "Python SDK for maib ecommerce API",
"version": "1.0.0",
"project_urls": {
"Documentation": "https://docs.maibmerchants.md",
"Homepage": "https://github.com/alexminza/maib-ecommerce-sdk-python",
"Issues": "https://github.com/alexminza/maib-ecommerce-sdk-python/issues",
"Repository": "https://github.com/alexminza/maib-ecommerce-sdk-python"
},
"split_keywords": [
"maib",
" ecommerce",
" payments",
" api",
" sdk",
" python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d3f5ae6494d7d1769fad656fd50f98a0a72c865656265ff634eb661436e07ab5",
"md5": "e6290414c72648febb13dddafbd3f217",
"sha256": "68ccb4cd14d16785b1f7a0452cb9f9936ad2af1723180a6aa9b1bb0add24cb5f"
},
"downloads": -1,
"filename": "maib_ecommerce_sdk-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e6290414c72648febb13dddafbd3f217",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 19688,
"upload_time": "2025-01-21T07:31:21",
"upload_time_iso_8601": "2025-01-21T07:31:21.270981Z",
"url": "https://files.pythonhosted.org/packages/d3/f5/ae6494d7d1769fad656fd50f98a0a72c865656265ff634eb661436e07ab5/maib_ecommerce_sdk-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2af7c02251c788f2b4ddaf53c687015b43dd96b576113658b48ab4b0bca0b9af",
"md5": "69dfe6a4235a560316144ace4bb237fc",
"sha256": "3f0b79c01d562e60a606ac2e1f5f1b17add802d793dbd82b89a38f0e9b1706bf"
},
"downloads": -1,
"filename": "maib_ecommerce_sdk-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "69dfe6a4235a560316144ace4bb237fc",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 19018,
"upload_time": "2025-01-21T07:31:23",
"upload_time_iso_8601": "2025-01-21T07:31:23.136303Z",
"url": "https://files.pythonhosted.org/packages/2a/f7/c02251c788f2b4ddaf53c687015b43dd96b576113658b48ab4b0bca0b9af/maib_ecommerce_sdk-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-21 07:31:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "alexminza",
"github_project": "maib-ecommerce-sdk-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "requests",
"specs": []
}
],
"lcname": "maib-ecommerce-sdk"
}