Skip to main content

Small Python client for E-Point payment checkout, callbacks, refunds, and bank response codes.

Project description

epoint-az

Small Python client for E-Point checkout flows.

It handles:

  • E-Point data base64 encoding
  • SHA1 signature generation and verification
  • normal checkout requests
  • card registration with pay
  • saved card execute-pay
  • wallet and token widget payment requests
  • reverse/refund requests
  • callback verification and decoding
  • bank response code lookup

Install

pip install epoint-az

For local development from this repository:

cd packages/epoint-az
python -m pip install -e .

Checkout

from epoint_az import EPointClient

client = EPointClient(
    public_key="your-public-key",
    private_key="your-private-key",
)

response = client.checkout(
    order_id="order-1001",
    amount="12.50",
    currency="AZN",
    description="Order #1001",
    success_redirect_url="https://example.com/payment/success",
    error_redirect_url="https://example.com/payment/error",
    result_url="https://api.example.com/payment/result",
)

if response.ok and response.redirect_url:
    print(response.redirect_url)
else:
    print(response.body)

Callback Verification

from epoint_az import EPointClient, EPointSignatureError

client = EPointClient(public_key="public", private_key="private")

try:
    callback = client.parse_callback(
        data=request.POST["data"],
        signature=request.POST["signature"],
    )
except EPointSignatureError:
    return "OK"

if callback.success:
    print(callback.order_id, callback.transaction, callback.bank_code)
else:
    print(callback.order_id, callback.status, callback.bank_message)

Bank Codes

from epoint_az import describe_bank_code, is_approved_bank_code

assert is_approved_bank_code("000")
assert describe_bank_code("116") == "Decline, insufficient funds"

Signed Payload Only

If your framework already owns HTTP calls, use the signer directly:

signed = client.encode_payload({"public_key": "public", "order_id": "1"})
requests.post(url, data=signed.as_form())

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

epoint_az-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

epoint_az-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: epoint_az-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for epoint_az-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6298a46872f3b89744ad3adf1e13cf56378450d20218d97698861c007ecf9ca6
MD5 acb471976e967e303dfdce8e7366f765
BLAKE2b-256 b1a362baa6c5bd652ed7a1ebba7a75e71dc86d7c529007810e49eefd69af6610

See more details on using hashes here.

Provenance

The following attestation bundles were made for epoint_az-0.1.0.tar.gz:

Publisher: publish.yml on VusalAbdurahmanovX/epoint-az

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file epoint_az-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: epoint_az-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for epoint_az-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f457c82e2d0b1e49f6f9c05789e3c06652fb954e8b0f665dbd10e8599c1f81a7
MD5 4c01f54338418877b68d07f952503ab8
BLAKE2b-256 952caec984653526ee407704acd55d0794018e7da6cd56000e6d9346b34498fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for epoint_az-0.1.0-py3-none-any.whl:

Publisher: publish.yml on VusalAbdurahmanovX/epoint-az

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