Skip to main content

Nowgate for Python

Nowgate's SDK for its merchant API: payments, payment links, payouts and refunds, with webhook verification. It needs Python 3.10 or later and nothing outside the standard library, and it is fully typed: every result is a TypedDict, checked by mypy and your editor.

pip install nowgate

Create a payment

import os

from nowgate import Nowgate

client = Nowgate(api_key=os.environ["NOWGATE_API_KEY"])

payment = client.payments.create(
    network="tron",
    asset="USDT",
    amount="25.00",
    order_id="1042",
    idempotency_key="order-1042",
)
print(payment["id"], payment["deposit"]["address"], payment["amount"])

The key picks the API: an ngk_sandbox_… key reaches the sandbox and an ngk_live_… key the live API. Amounts are decimal strings (or Decimals), never floats. A failed call is retried safely with its idempotency key, and lists page with list_all.

Verify a webhook

from nowgate import SignatureVerificationError, Webhook

# body: the request's raw body, exactly as received; signature: its Nowgate-Signature header.
try:
    event = Webhook.construct_event(body, signature, os.environ["NOWGATE_WEBHOOK_SECRET"])
except SignatureVerificationError:
    ...  # answer 400

Documentation

The guides and the API reference are at docs.nowgate.io, and this SDK's page is docs.nowgate.io/sdks/python. The changelog lists its releases, each with the API version it was made for.

Metadata

Release files for nowgate 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 nowgate 0.1.0
File Size Uploaded Provenance Actions
nowgate-0.1.0.tar.gz 34.8 kB Without provenance Details for nowgate-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 73.1 kB

Release files / nowgate-0.1.0.tar.gz

Download URL nowgate-0.1.0.tar.gz
Size 34.8 kB
Tags Source
SHA-256 checksum
How to use checksums
135c2c0149b255d2218f19536b8b9928f7b594d01013aa21abad3ca2b8dc5e02
BLAKE2b-256 checksum
How to use checksums
cb4886fe46c5e49e85d1dfe32a65b3c60ce07f259238c0c83f7aeb2fc458c840
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

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

Download URL nowgate-0.1.0-py3-none-any.whl
Size 38.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4757c7672ee9ed332a539447c8296c74057e686ce0164f337ea9f37ac6baecee
BLAKE2b-256 checksum
How to use checksums
7a241ca3a927c72c62472991bb54d283d774898a1d455af9f36944e2d710c6d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for nowgate 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.

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