Skip to main content

Python SDK for Finergy MIA POS eComm API

Project description

Python SDK for Finergy MIA POS eComm API

Installation

To easily install or upgrade to the latest release, use pip:

pip install --upgrade finergy-mia-pos-sdk

Getting started

Import SDK:

from finergy_mia_pos_sdk import FinergyMiaPosSdk

Add project configuration:

import os

FINERGY_MIA_POS_BASE_URL = os.getenv('FINERGY_MIA_POS_BASE_URL', FinergyMiaPosSdk.TEST_BASE_URL)
FINERGY_MIA_POS_MERCHANT_ID = os.getenv('FINERGY_MIA_POS_MERCHANT_ID')
FINERGY_MIA_POS_SECRET_KEY = os.getenv('FINERGY_MIA_POS_SECRET_KEY')
FINERGY_MIA_POS_TERMINAL_ID = os.getenv('FINERGY_MIA_POS_TERMINAL_ID')

SDK usage examples

Initialize SDK instance

finergy_sdk = FinergyMiaPosSdk(
    base_url=FINERGY_MIA_POS_BASE_URL,
    merchant_id=FINERGY_MIA_POS_MERCHANT_ID,
    secret_key=FINERGY_MIA_POS_SECRET_KEY)

Create order payment

payment_data = {
    'terminalId': FINERGY_MIA_POS_TERMINAL_ID,
    'orderId': 'order12345',
    'amount': 150.75,
    'currency': 'MDL',
    'language': 'ro',
    'payDescription': 'Payment for order #12345',
    'paymentType': 'qr',
    'clientName': 'Test Client',
    'clientPhone': '00000000',
    'clientEmail': 'test@test.com',
    'callbackUrl': 'http://your_callback_url',
    'successUrl': 'http://your_success_url?orderId=order12345',
    'failUrl': 'http://your_failUrl_url?orderId=order12345'
}

create_payment_response = finergy_sdk.create_payment(payment_data=payment_data)

payment_id = create_payment_response['paymentId']
checkout_page = create_payment_response['checkoutPage']

Validate callback signature

callback_data = {
    'result': {
        'terminalId': 'TRMW0001',
        'orderId': '108',
        'paymentId': '2a663962-c954-4984-90e5-1d24c3305f7b',
        'status': 'EXPIRED',
        'amount': 1775.00,
        'currency': 'MDL',
        'paymentType': 'qr',
        'paymentDate': '2024-12-17T11:54:23'
    },
    'signature': 'gtWkQdF2X2oCwO/+a+DJxpDc5DhjC1PMVWrnCXsCX54qOo24siRTy4PAjHoYet1r0KERVEL65p7UZuHcaK+TOiJptlalMUVZWbGLPf05WpyKPOPSPI1P4ZoADzJpceYsKjjZImB/+ft6OAF+ahxazhHkiT1Ze05vwD2L1D6zRohcxZl9XRJMChZcVD9bdNy23ozwuq6FwlnneJJeCPNvqveg7f5e0CD1NXWdLJ3WryP0ypcGtQGZAY+PrhkdVG5SWhYr0FFniAZIrp9yOFn3vrsUP4rpZmeqIahSV6x12pyyRsm+bs/tjw/kPR34ygG7ksXsrpwhQbltAHWeWwnOmg=='
}

validate_result = finergy_sdk.validate_callback_signature(callback_data=callback_data)

Get payment status

payment_status_response = finergy_sdk.get_payment_status(payment_id=payment_id)

For more examples see Finergy MIA POS PHP SDK

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

finergy_mia_pos_sdk-1.1.2.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

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

finergy_mia_pos_sdk-1.1.2-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file finergy_mia_pos_sdk-1.1.2.tar.gz.

File metadata

  • Download URL: finergy_mia_pos_sdk-1.1.2.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for finergy_mia_pos_sdk-1.1.2.tar.gz
Algorithm Hash digest
SHA256 781dbc2d949e8fdcd5bfb2e9a77cdea58cf2b5dc65cb73aa89653d6017ff67d6
MD5 8f7a492d6b915bb24d88457d38813dc6
BLAKE2b-256 9c428978b1054aa120ba7b8e266aae7a4e6b05749d903efa4443c973b3015b01

See more details on using hashes here.

Provenance

The following attestation bundles were made for finergy_mia_pos_sdk-1.1.2.tar.gz:

Publisher: action-pypi-publish.yml on alexminza/finergy-mia-pos-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 finergy_mia_pos_sdk-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for finergy_mia_pos_sdk-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 99e258c5ba27a67198ec0e9154ca7eb8c8b7d77131fd5c1ee7c7ee1172bc563b
MD5 73c50bb7c5a0af2225a4771e6268b9db
BLAKE2b-256 8f48ec263b043af618661df9a339d6950c5b4162603386e32204541d80f4df79

See more details on using hashes here.

Provenance

The following attestation bundles were made for finergy_mia_pos_sdk-1.1.2-py3-none-any.whl:

Publisher: action-pypi-publish.yml on alexminza/finergy-mia-pos-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