Skip to main content

Python SDK for maib ecommerce API

Project description

Python SDK for maib ecommerce API

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.1.1.tar.gz (19.9 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.1.1-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: maib_ecommerce_sdk-1.1.1.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for maib_ecommerce_sdk-1.1.1.tar.gz
Algorithm Hash digest
SHA256 35f278b658a2525100a48d74659e76f687c3d8fda5da655b8fdf1c0955880e34
MD5 8f2a837ca0f2ed25489de1e5d3a5bebc
BLAKE2b-256 7a37e8d7ba71989e50f983e3d4b1bf0d7c71d2cdf70cdd40b1e3eb6b876e5c98

See more details on using hashes here.

Provenance

The following attestation bundles were made for maib_ecommerce_sdk-1.1.1.tar.gz:

Publisher: action-pypi-publish.yml on alexminza/maib-ecommerce-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for maib_ecommerce_sdk-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 abbdd1f4d74e9c7c8d3e3bfbefbfabfc093efce32bab980f65ba38f01a084f93
MD5 506fa0b5d42a706c59acbb05fea739f5
BLAKE2b-256 c00932f26f3ad5b013e5b0279b952918aacb1aec9048d96891c593743cdac060

See more details on using hashes here.

Provenance

The following attestation bundles were made for maib_ecommerce_sdk-1.1.1-py3-none-any.whl:

Publisher: action-pypi-publish.yml on alexminza/maib-ecommerce-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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