Skip to main content

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_webhook for all supported gateways.

Doku Gateway: You MUST pass the request_path argument (e.g., /api/callbacks/doku) to handle_webhook for strict signature verification.

Ayoconnect Gateway: Signature verification requires either client_secret (for HMAC) or public_key (for RSA). If using RSA, ensure the cryptography library is installed.

Xendit Gateway: Please configure webhook_secret to enable HMAC signature verification. Legacy callback_token usage 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paynesia-0.1.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

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

paynesia-0.1.1-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

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

Hashes for paynesia-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5d1d0687eaaece260efa11e8cc2f27d83e952f074fcaed01af6b05b453667ae0
MD5 ca8434161671170d53a5e6a4e7f47c16
BLAKE2b-256 5a312fafebec40a2f953d39543f607761951016e25967da19c567eb4958b92bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for paynesia-0.1.1.tar.gz:

Publisher: publish-to-pypi.yml on Fadhila36/paynesia

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

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

Hashes for paynesia-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 601ac4252fb3fe6062d568053b3d7bb489ed4a48aa349974d2a9385a26018d2a
MD5 353e15a52aaaa6fc4fef24780723e183
BLAKE2b-256 4f2cd58898574050655f3d22de514710e18988fe2fde9eabd194637f73a88073

See more details on using hashes here.

Provenance

The following attestation bundles were made for paynesia-0.1.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on Fadhila36/paynesia

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