Python SDK for Finergy MIA POS eComm API
Project description
Python SDK for Finergy MIA POS eComm API
- Finergy MIA POS eComm integration: https://github.com/finergy-tech/mia-pay-ecomm-integration
- GitHub project https://github.com/alexminza/finergy-mia-pos-sdk-python
- PyPI package https://pypi.org/project/finergy-mia-pos-sdk/
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file finergy_mia_pos_sdk-1.1.1.tar.gz.
File metadata
- Download URL: finergy_mia_pos_sdk-1.1.1.tar.gz
- Upload date:
- Size: 21.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a32c9218b6505729812df8eb1b6698d2e780a64377de56dad2580a416a0e0b5
|
|
| MD5 |
a8d5c5363c23305ebca41361e84caaa9
|
|
| BLAKE2b-256 |
b10e0a01669ef985cd157d213dacc43fd7b7c5a8be21de8d4c7dc0408abe6466
|
Provenance
The following attestation bundles were made for finergy_mia_pos_sdk-1.1.1.tar.gz:
Publisher:
action-pypi-publish.yml on alexminza/finergy-mia-pos-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finergy_mia_pos_sdk-1.1.1.tar.gz -
Subject digest:
7a32c9218b6505729812df8eb1b6698d2e780a64377de56dad2580a416a0e0b5 - Sigstore transparency entry: 459486231
- Sigstore integration time:
-
Permalink:
alexminza/finergy-mia-pos-sdk-python@064a4b441703adc016a08ceea507c12768cc313d -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/alexminza
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
action-pypi-publish.yml@064a4b441703adc016a08ceea507c12768cc313d -
Trigger Event:
push
-
Statement type:
File details
Details for the file finergy_mia_pos_sdk-1.1.1-py3-none-any.whl.
File metadata
- Download URL: finergy_mia_pos_sdk-1.1.1-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af6549ebe68506f32632fb9ad67619aceea48631a7294e9a7d2f9a2e4351364c
|
|
| MD5 |
aa5fcabcfe9e4f8b2e058ede099163b9
|
|
| BLAKE2b-256 |
3c6f9eaa84ecb86298e5291efd19ca3f2015423efb73f832252f276b8667dcf8
|
Provenance
The following attestation bundles were made for finergy_mia_pos_sdk-1.1.1-py3-none-any.whl:
Publisher:
action-pypi-publish.yml on alexminza/finergy-mia-pos-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finergy_mia_pos_sdk-1.1.1-py3-none-any.whl -
Subject digest:
af6549ebe68506f32632fb9ad67619aceea48631a7294e9a7d2f9a2e4351364c - Sigstore transparency entry: 459486259
- Sigstore integration time:
-
Permalink:
alexminza/finergy-mia-pos-sdk-python@064a4b441703adc016a08ceea507c12768cc313d -
Branch / Tag:
refs/tags/v1.1.1 - Owner: https://github.com/alexminza
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
action-pypi-publish.yml@064a4b441703adc016a08ceea507c12768cc313d -
Trigger Event:
push
-
Statement type: