epoint
Python client for the epoint.az payment gateway.
Covers all 30 documented endpoints: payments, saved cards, refunds and payouts, split payments, pre-authorisation, installments, wallets, Apple Pay and Google Pay, invoices, and B2B transfers. Sync and async, fully typed, one dependency.
pip install epoint
Quick start
from epoint import EpointClient
client = EpointClient(public_key="i000000001", private_key="your-private-key")
payment = client.create_payment(amount=30.75, order_id="order-1", description="Test order")
print(payment.redirect_url)
Send the customer to payment.redirect_url. When they finish, epoint calls your result URL. Verify
it before trusting it:
from epoint import SignatureError
try:
callback = client.verify_callback(data, signature)
except SignatureError:
return "invalid", 400
if callback.ok:
fulfil(callback.order_id, callback.transaction)
Async
AsyncEpointClient has the same methods, awaited:
from epoint import AsyncEpointClient
async with AsyncEpointClient(public_key="i000000001", private_key="your-private-key") as client:
payment = await client.create_payment(amount=30.75, order_id="order-1")
status = await client.get_status(payment.transaction)
verify_callback stays synchronous on both clients, since it only does a signature check.
Configuration
Pass keys directly, or read them from the environment:
client = EpointClient.from_env()
| Variable | |
|---|---|
EPOINT_PUBLIC_KEY |
Required |
EPOINT_PRIVATE_KEY |
Required |
EPOINT_BASE_URL |
Defaults to https://epoint.az |
EPOINT_LANGUAGE |
Defaults to az |
EPOINT_SUCCESS_REDIRECT_URL |
Optional default for payment methods |
EPOINT_FAILED_REDIRECT_URL |
Optional default for payment methods |
language and currency are set once on the client and can be overridden per call.
Testing against the sandbox
There is a local sandbox that behaves like the real gateway, so you can build and test without a merchant account or real money:
client = EpointClient(
public_key="i000000001",
private_key="sandbox_private_key_0000000001",
base_url="http://localhost:8181",
)
See epoint-sandbox. Switching to production means
changing base_url and the keys, nothing else.
Responses
Most methods return a Response. Read known fields as attributes, anything else through get or
raw:
r = client.get_status("te0000000001")
r.status # "success", compares equal to Status.SUCCESS
r.ok # True
r.get("rrn") # bank reference number
r.raw # the full response dict
create_payment, reserve, create_split_payment and the other checkout methods return
redirect_url. get_installment_plans returns a list and list_wallets returns a dict.
Enums
Every value the API uses has an enum. They come from the sandbox's own definitions, so they match
what production sends. Members are str subclasses, so they go over the wire unchanged and
compare equal to the raw value; a plain string still works anywhere an enum is accepted.
from epoint import CardStatus, Currency, EpointClient, Language, Status
client = EpointClient.from_env(language=Language.EN, currency=Currency.USD)
status = client.get_status(transaction)
if status.status == Status.SUCCESS:
fulfil(order_id)
| Enum | Values |
|---|---|
Status |
new, success, failed, error, returned, server_error |
CardStatus |
new, active, pending, rejected, expired, session_expired |
InvoiceStatus |
waiting_for_payment, paid, canceled |
B2BStatus |
PENDING, PROCESSING, SUCCESS, FAILED |
OperationCode |
001 card registration, 100 payment, 200 registration with payment |
Language |
az, en, ru |
Currency |
AZN, USD, EUR, RUB |
Currency is not uniform across the API. Checkout takes all four, but split, pre-auth, refund,
reverse, payout and wallet take AZN and nothing else. SUPPORTED_CURRENCIES and AZN_ONLY hold
those two sets.
SETTLED_STATUSES is what ok checks, and USABLE_CARD_STATUSES is the set a card has to be in
before you can charge it.
Methods
| Group | Methods |
|---|---|
| Checkout | create_payment, create_payment_request, create_amex_payment, change_payment_sum |
| Status | get_status, get_card_status, get_bank_transfer |
| Split | create_split_payment, split_charge_saved_card |
| Pre-auth | reserve, capture |
| Saved cards | register_card, register_card_and_pay, charge_saved_card |
| Money back | refund, reverse |
| Installments | get_installment_plans, pay_by_installment |
| Wallets | list_wallets, pay_with_wallet |
| Apple Pay, Google Pay | create_widget |
| Invoices | create_invoice, update_invoice, get_invoice, list_invoices, send_invoice_sms, send_invoice_email |
| B2B | create_bank_transfer, get_bank_transfer |
| Health | heartbeat |
Errors
| Exception | Raised when |
|---|---|
GatewayError |
epoint returned status: error or failed. Carries code, message, payload. |
TransportError |
Network failure, or a non-JSON or 4xx/5xx response |
SignatureError |
A callback's signature did not match, or its data would not decode |
All three inherit from EpointError.
Signatures
Epoint signs with base64(sha1_raw(private_key + data + private_key)). The client builds and
verifies these for you. The digest is the raw 20 bytes, not the hex string, which is where most
hand-rolled integrations go wrong.
Not affiliated with Epoint
An independent client for developers integrating with epoint.az.
MIT licensed.
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 epoint-0.2.1.tar.gz.
File metadata
- Download URL: epoint-0.2.1.tar.gz
- Upload date:
- Size: 54.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb8e78d356aa52f0b359af16cd14cffc51539d4c42ae196434eee184199ed276
|
|
| MD5 |
b863feb2e2e4da212551888dfd2c5ec9
|
|
| BLAKE2b-256 |
b6ca1bf7b53fafea1b91a865b849d6aa3dfc63d2fe6e074418abf8b7edf5cf6f
|
Provenance
The following attestation bundles were made for epoint-0.2.1.tar.gz:
Publisher:
release.yml on martian56/epoint-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epoint-0.2.1.tar.gz -
Subject digest:
eb8e78d356aa52f0b359af16cd14cffc51539d4c42ae196434eee184199ed276 - Sigstore transparency entry: 2217009002
- Sigstore integration time:
-
Permalink:
martian56/epoint-python@8e770c53d8da4f7cc88dcaf4b10e2b1b809b59de -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/martian56
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e770c53d8da4f7cc88dcaf4b10e2b1b809b59de -
Trigger Event:
push
-
Statement type:
File details
Details for the file epoint-0.2.1-py3-none-any.whl.
File metadata
- Download URL: epoint-0.2.1-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b33f646e88f069bb2ca080cb63b539fb4fffcacb1a0607e12d4e7d2be1ee3a8a
|
|
| MD5 |
7275189e12d576f96a0e1c0579ee224f
|
|
| BLAKE2b-256 |
0e51b1b0632f7881755163b528abc583c689dcd2cd053fca1f35b9b05218788a
|
Provenance
The following attestation bundles were made for epoint-0.2.1-py3-none-any.whl:
Publisher:
release.yml on martian56/epoint-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
epoint-0.2.1-py3-none-any.whl -
Subject digest:
b33f646e88f069bb2ca080cb63b539fb4fffcacb1a0607e12d4e7d2be1ee3a8a - Sigstore transparency entry: 2217009010
- Sigstore integration time:
-
Permalink:
martian56/epoint-python@8e770c53d8da4f7cc88dcaf4b10e2b1b809b59de -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/martian56
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e770c53d8da4f7cc88dcaf4b10e2b1b809b59de -
Trigger Event:
push
-
Statement type: