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.

Environment Variables: Never hardcode your API keys (Client ID, Secret Key, Server Key) in your code. Use environment variables (e.g., os.getenv('MIDTRANS_SERVER_KEY')) and pass them to the PaymentManager 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.0.tar.gz (10.1 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.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file paynesia-0.1.0.tar.gz.

File metadata

  • Download URL: paynesia-0.1.0.tar.gz
  • Upload date:
  • Size: 10.1 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.0.tar.gz
Algorithm Hash digest
SHA256 d959b480e3ea7db885962a672dbb9a6ffe120cccac448fce596cc52f88186d97
MD5 e19d2f0d5a76a9224ff4c5b718c7dd79
BLAKE2b-256 e2dcb940ae0873fbda80f3224649437e9bcde895325e1c01d9d55ad0f803e1aa

See more details on using hashes here.

Provenance

The following attestation bundles were made for paynesia-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: paynesia-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12d01f2c3decbddece05480de60d06a34be17d0474b4f30db044ff77d7c7fd80
MD5 d93a6a03d8b1737001048b88f9062502
BLAKE2b-256 fc12ed9dbe4d27836a6e8a0246544f67e45e23838f09c9cbed8dca1b5b9db36c

See more details on using hashes here.

Provenance

The following attestation bundles were made for paynesia-0.1.0-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