Skip to main content

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


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.2.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maib_ecommerce_sdk-1.0.2-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file maib_ecommerce_sdk-1.0.2.tar.gz.

File metadata

  • Download URL: maib_ecommerce_sdk-1.0.2.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.9

File hashes

Hashes for maib_ecommerce_sdk-1.0.2.tar.gz
Algorithm Hash digest
SHA256 65988e77db6528de3dcf40a7a69c749fa747b767f4c94d73b84e432180ffd1de
MD5 8a2e39ddf2f5dda3e02f89246076c897
BLAKE2b-256 7a3c3a02b0c19e2d2779bd8c83d7abd06c1dd995bb74e3213e33edc743dc3770

See more details on using hashes here.

File details

Details for the file maib_ecommerce_sdk-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for maib_ecommerce_sdk-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bf162b8edaf99df79b389f77f84bc008cacba088f0a2f0b92683f0fe29ad30d1
MD5 922ac99dbff7110e10433200cbefe3de
BLAKE2b-256 06de9c0474a54a3c2eb9144c7f5d148fcc787aae2afb9f92fd77604702925eb9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page