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.2.1

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.2.1
File Size Uploaded Provenance Actions
keytd_manat-0.2.1.tar.gz 28.1 kB With provenance Details for keytd_manat-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 62.9 kB

Release files / keytd_manat-0.2.1.tar.gz

Download URL keytd_manat-0.2.1.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6e35cc7f8e5549a14cc8020f7ec262be8f82e3efda2e3be9a6efc11e61b3fbf4
BLAKE2b-256 checksum
How to use checksums
732154dc1679f90eeda0cd542ad9a591367bc3613c87df8a27d39b21cc505179
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.2.1-py3-none-any.whl

Download URL keytd_manat-0.2.1-py3-none-any.whl
Size 34.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6ca1aa7a3f6f0114a7b5f85d3a4088f3aa156869409ff1b098de4cd2a8c9990
BLAKE2b-256 checksum
How to use checksums
9fc44c6802cc35a392a39af8c9e3ad21a57e262f0b53b10d94d878127eea845f
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.2.1

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.2.1.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