Skip to main content

epoint-python-sdk

Python Epoint Typed Async Ruff Apple Pay Google Pay License

Typed Python client for the Epoint payment gateway. Sync and async, every endpoint, signed callbacks, and retry rules built so a payment is never sent twice.

pip install epoint-python-sdk

Pay

from epoint_sdk import Epoint

with Epoint("i000000001", "PRIVATE_KEY", success_url="https://shop.az/ok", error_url="https://shop.az/fail") as ep:
    checkout = ep.payments.create("19.90", "ORDER-1042", description="Pro plan")
    redirect(checkout.redirect_url)

Confirm

tx = ep.verify_callback(request.POST)
if tx.paid:
    fulfil(tx.order_id, tx.amount, tx.transaction)

Never trust the redirect alone. Use the signed callback, or ask the gateway:

ep.payments.status(checkout.transaction).paid

Apple Pay and Google Pay

widget = ep.widgets.create("19.90", "ORDER-1043", "Pro plan")
<iframe src="{{ widget.widget_url }}" allow="payment" title="Apple Pay / Google Pay"></iframe>
<script>
addEventListener("message", (e) => {
  if (e.origin !== "{{ widget.origin }}") return;
  fetch("/orders/1043/check/", { method: "POST" });
});
</script>

The page needs Permissions-Policy: payment=(self "https://epoint.az"). The postMessage is a hint only: WidgetMessage.from_event(data) reads it, then confirm on the server with ep.payments.status(widget.transaction) or the signed callback. Epoint enables token payments per merchant. ep.widgets.split(...) is the split variant.

Safety

Situation What the client does
Connection refused, nothing sent Retries, then NotSentError
Timeout, cut connection or 5xx on a call that moves money No retry, OutcomeUnknownError with the order_id
Same failure on a read (status, card, lists) Retries with backoff
429 Retries, the gateway did not process it
status: error from the gateway GatewayError with code and trace_id
Declined card on a direct charge Returns Transaction with failed, never raises
Amount like 1.005, 0, NaN or True InvalidRequestError before anything is sent
base_url over plain http ConfigurationError, except localhost or allow_insecure_http
Callback data over 64 KB Rejected before hashing
Callback for another order or amount tx.matches(order_id=..., amount=...) is False

Reuse the same order_id when you retry. Epoint refuses a used one, so a double click or a crash can not charge twice. Amounts are Decimal end to end, and signatures are compared in constant time.

Endpoints

Namespace Methods
payments create form status reverse hold capture
cards register register_and_pay charge status payout
split create charge register_and_pay
installments plans create
wallets list pay
widgets create split (Apple Pay, Google Pay)
invoices create update get list send_sms send_email
transfers create status (B2B)
client heartbeat verify_callback request

AsyncEpoint has the same methods, awaited.

Config

Pass values in code, or set EPOINT_PUBLIC_KEY, EPOINT_PRIVATE_KEY, EPOINT_SUCCESS_URL, EPOINT_ERROR_URL, EPOINT_LANGUAGE, EPOINT_TIMEOUT, EPOINT_MAX_RETRIES, or put them in epoint.toml. Every path is a setting (EPOINT_ENDPOINTS__PAYMENT=...) and base_url can point at a sandbox such as epoint-sandbox. Messages live in messages.yaml and can be replaced with messages.use(...).

Develop

pip install -e ".[dev]" && pytest && ruff check . && mypy src

License

MIT

Metadata

Release files for epoint-python-sdk 0.2.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 epoint-python-sdk 0.2.0
File Size Uploaded Provenance Actions
epoint_python_sdk-0.2.0.tar.gz 21.7 kB Without provenance Details for epoint_python_sdk-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for epoint-python-sdk 0.2.0
File Interpreter ABI Platform Actions
epoint_python_sdk-0.2.0-py3-none-any.whl Python 3 none any Details for epoint_python_sdk-0.2.0-py3-none-any.whl

Total release size: 42.7 kB

Release files / epoint_python_sdk-0.2.0.tar.gz

Download URL epoint_python_sdk-0.2.0.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
98c87f3078292dfd57f1dff0e07beafb3c9079fac25326cdafa1a83f807d5a19
BLAKE2b-256 checksum
How to use checksums
e8c8207656abe7248eea6b94e5cc2bff307f093bdd130e6dcd0928ec9bd421d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / epoint_python_sdk-0.2.0-py3-none-any.whl

Download URL epoint_python_sdk-0.2.0-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81c0a217b06ca33d725535ca9e978c960ba47df1562d1d9ff2a6466c7c4c159f
BLAKE2b-256 checksum
How to use checksums
571d8445af7a927f6a3fc1ee8983aaa3c8e600379695c86855044df00ad6b4cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for epoint-python-sdk 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

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