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.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 nowgate 0.2.0
File Size Uploaded Provenance Actions
nowgate-0.2.0.tar.gz 36.0 kB Without provenance Details for nowgate-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 75.1 kB

Release files / nowgate-0.2.0.tar.gz

Download URL nowgate-0.2.0.tar.gz
Size 36.0 kB
Tags Source
SHA-256 checksum
How to use checksums
305e76971049a7007abd378f30023e54c7f255ece639a038eb08d9ef117d51f3
BLAKE2b-256 checksum
How to use checksums
eadc8e8705e96ad1f58a3c2587df0f92ce6d79eb96107828f82e34772ce1e145
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.2.0-py3-none-any.whl

Download URL nowgate-0.2.0-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9fd11eba43f97d97672e429d0c92f189db56e1a96dd394c8c9eb803b00525bfe
BLAKE2b-256 checksum
How to use checksums
d1c6ed16395a72fc3af176fa0532fed6c6663fcb545255c893f8abff89271454
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.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