A framework-agnostic Python library for multiple payment gateways (Doku, Xendit, Midtrans, Duitku, AyoConnect) and Fonnte.
Project description
Paynesia
A framework-agnostic Python library for integrating multiple Indonesian payment gateways.
Supported Gateways
- Midtrans
- Xendit
- Doku
- Duitku
- AyoConnect
- Fonnte (WhatsApp Notification)
Security Notes
[!IMPORTANT] Signature Verification: Always verify webhook signatures to prevent fraud. This library provides built-in signature verification in
handle_webhookfor all supported gateways.Doku Gateway: You MUST pass the
request_pathargument (e.g.,/api/callbacks/doku) tohandle_webhookfor strict signature verification.Ayoconnect Gateway: Signature verification requires either
client_secret(for HMAC) orpublic_key(for RSA). If using RSA, ensure thecryptographylibrary is installed.Xendit Gateway: Please configure
webhook_secretto enable HMAC signature verification. Legacycallback_tokenusage is deprecated.Environment Variables: Never hardcode your keys. Use environment variables and pass them to the configuration.
Installation
pip install paynesia
Usage
import os
from paynesia.manager import PaymentManager
# Optional: if using python-dotenv to load .env file
# from dotenv import load_dotenv
# load_dotenv()
config = {
'default': 'midtrans',
'gateways': {
'midtrans': {
'server_key': os.getenv('MIDTRANS_SERVER_KEY'),
'is_production': os.getenv('MIDTRANS_IS_PRODUCTION', 'False') == 'True'
}
}
}
manager = PaymentManager(config)
payment = manager.driver('midtrans').create_payment({
'order_id': 'ORDER-123',
'amount': 10000,
'customer': {'email': 'user@example.com'}
})
print(payment)
Project details
Release history Release notifications | RSS feed
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 paynesia-0.1.1.tar.gz.
File metadata
- Download URL: paynesia-0.1.1.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d1d0687eaaece260efa11e8cc2f27d83e952f074fcaed01af6b05b453667ae0
|
|
| MD5 |
ca8434161671170d53a5e6a4e7f47c16
|
|
| BLAKE2b-256 |
5a312fafebec40a2f953d39543f607761951016e25967da19c567eb4958b92bf
|
Provenance
The following attestation bundles were made for paynesia-0.1.1.tar.gz:
Publisher:
publish-to-pypi.yml on Fadhila36/paynesia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paynesia-0.1.1.tar.gz -
Subject digest:
5d1d0687eaaece260efa11e8cc2f27d83e952f074fcaed01af6b05b453667ae0 - Sigstore transparency entry: 850111795
- Sigstore integration time:
-
Permalink:
Fadhila36/paynesia@f8d7a86c6b0329dfede18ac16a3c8d7fab8f8cd4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Fadhila36
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f8d7a86c6b0329dfede18ac16a3c8d7fab8f8cd4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file paynesia-0.1.1-py3-none-any.whl.
File metadata
- Download URL: paynesia-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
601ac4252fb3fe6062d568053b3d7bb489ed4a48aa349974d2a9385a26018d2a
|
|
| MD5 |
353e15a52aaaa6fc4fef24780723e183
|
|
| BLAKE2b-256 |
4f2cd58898574050655f3d22de514710e18988fe2fde9eabd194637f73a88073
|
Provenance
The following attestation bundles were made for paynesia-0.1.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on Fadhila36/paynesia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
paynesia-0.1.1-py3-none-any.whl -
Subject digest:
601ac4252fb3fe6062d568053b3d7bb489ed4a48aa349974d2a9385a26018d2a - Sigstore transparency entry: 850111796
- Sigstore integration time:
-
Permalink:
Fadhila36/paynesia@f8d7a86c6b0329dfede18ac16a3c8d7fab8f8cd4 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Fadhila36
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@f8d7a86c6b0329dfede18ac16a3c8d7fab8f8cd4 -
Trigger Event:
release
-
Statement type: