Socket
Book a DemoInstallSign in
Socket

maib-ecommerce-sdk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maib-ecommerce-sdk

Python SDK for maib ecommerce API

pipPyPI
Version
1.1.3
Maintainers
1

Python SDK for maib ecommerce API

  • maib e-commerce API docs: https://docs.maibmerchants.md/e-commerce/
  • GitHub project https://github.com/alexminza/maib-ecommerce-sdk-python
  • PyPI package https://pypi.org/project/maib-ecommerce-sdk/

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

Keywords

maib

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts