Skip to main content

Manat for Python

One API for Azerbaijani online payment providers: Kapital Bank, Azericard, Payriff, Epoint, GoldenPay and Yığım. Python 3.10+, no dependencies (standard library only, RSA included).

pip install keytd-manat
from manat import Manat, azn
from manat.providers import KapitalBank

pay = Manat(KapitalBank(username=os.environ["KB_USER"], password=os.environ["KB_PASSWORD"]))

result = pay.create_payment("A-1001", azn("25.50"), "https://shop.az/payment/return")  # 2550 qəpik
if result.next.type == "redirect":
    return redirect(result.next.url)

Store result.payment_id with the order. It is what get_status, refund, capture and cancel take.

Providers

from manat.providers import Azericard, Epoint, GoldenPay, KapitalBank, Payriff, Yigim

KapitalBank(username, password, environment="test")
Azericard(terminal, private_key_pem, "My Shop", "https://shop.az", gateway_public_key=gateway_pem, environment="test")
Payriff(secret_key)
Epoint(public_key, private_key)
GoldenPay(auth_key, merchant_name, environment="test")
Yigim(merchant, api_key, biller, environment="test")
Provider create_payment verify_callback get_status refund capture cancel
Kapital Bank ✓ ✓ ✓ ✓ ✓ ✓
Azericard ✓ (form POST) ✓ ✓ ✓ ✓ ✓
Payriff ✓ ✓ ✓ ✓ ✓ —
Epoint ✓ ✓ ✓ ✓ — —
GoldenPay ✓ ✓ ✓ ✓ — —
Yığım ✓ ✓ ✓ ✓ ✓ ✓

Every provider takes base_url (or gateway_url), transport and timeout keyword arguments.

Callbacks

Pass what your handler received, with the raw body. Unsigned redirects and webhooks are never trusted: the adapter re-reads the payment from the provider's API.

event = pay.verify_callback(request.method, query=request.args, body=request.get_data(as_text=True))
if event.status == "paid":
    ...  # fulfil event.payment_id; for Azericard store event.provider_ref for refunds

Refunds, capture, cancel

pay.refund(payment_id)                                   # full refund
pay.refund(payment_id, amount=azn("10.00"))              # partial
pay.capture(payment_id)                                  # after intent="authorize"
pay.refund(payment_id, provider_ref=event.provider_ref)  # Azericard

Errors

Everything raises manat.ManatError. error.code is one of invalid_request, invalid_signature, provider_error, network_error, unsupported_operation; provider_code, provider_message and raw hold what the provider said.

Tests

cd python && PYTHONPATH=src:tests python3 -m unittest discover -s tests

Metadata

Release files for keytd-manat 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for keytd-manat 0.1.0
File Size Uploaded Provenance Actions
keytd_manat-0.1.0.tar.gz 27.7 kB With provenance Details for keytd_manat-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for keytd-manat 0.1.0
File Interpreter ABI Platform Actions
keytd_manat-0.1.0-py3-none-any.whl Python 3 none any Details for keytd_manat-0.1.0-py3-none-any.whl

Total release size: 62.2 kB

Release files / keytd_manat-0.1.0.tar.gz

Download URL keytd_manat-0.1.0.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
88ca3ca3bb4ab7e5d5d30e862ec3f12475e646946ff6a6e5cc194c62146d47ff
BLAKE2b-256 checksum
How to use checksums
558ddf5f76f025cb2ecb1dba5433be91c7772547d259e95480480bfc43938308
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Release files / keytd_manat-0.1.0-py3-none-any.whl

Download URL keytd_manat-0.1.0-py3-none-any.whl
Size 34.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e48480ca03ed2273b1eb0c8943ad414ef2eccdf5db999e1962d6b4ae6b675262
BLAKE2b-256 checksum
How to use checksums
73db2a70f30ae45ca16c6cae40e02c75f4f44f24f033e5feb9f0d9132aa9b638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

Security for keytd-manat 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for keytd_manat-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page