Skip to main content

group-payments

Клиент Group Pay API для Python и консольная утилита gp. Python 3.10+, одна зависимость: httpx.

Установка

pip install group-payments

Быстрый старт

from group_payments import Client

gp = Client("gp_test_...", base_url="https://<адрес API>/api/v1")
payment = gp.payments.create(amount="100.00", description="Заказ 42", order_id="o-42", expires_in_minutes=30)
print(payment["paymentUrl"])

for p in gp.paginate("/payments", limit=50):
    print(p["id"], p["status"])

AsyncClient повторяет тот же API: await gp.payments.get(...), async for ... in gp.paginate(...), await gp.aclose().

  • Именованные аргументы уходят в API в camelCase: order_id → orderId.
  • Каждый POST получает Idempotency-Key, общий для всех повторов. Свой ключ: idempotency_key=.
  • До 3 попыток с экспоненциальной паузой, Retry-After учитывается.
  • Ошибки типизированы (NotFoundError, RateLimitError, ...) и содержат status, code, request_id, param, doc_url.
  • Адрес API обязателен: аргумент base_url= или переменная GP_BASE_URL.

Вебхуки

from group_payments import webhook

event = webhook.verify(raw_body, request_headers, secret)

Передавайте исходное тело запроса, а не пересобранный JSON. При неверной подписи выбрасывается webhook.WebhookError.

Утилита gp

gp login --key gp_test_... --base-url https://<адрес API>/api/v1
gp trigger payment.succeeded
gp listen --forward-to http://localhost:3000/hook
gp events resend EVENT_ID

Ключ хранится в $GP_CONFIG или ~/.config/gp/config.json.

Лицензия

MIT

Metadata

Release files for group-payments 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for group-payments 0.1.2
File Size Uploaded
group_payments-0.1.2.tar.gz 7.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for group-payments 0.1.2
File Interpreter ABI Platform
group_payments-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 17.8 kB

Release files / group_payments-0.1.2.tar.gz

Download URL group_payments-0.1.2.tar.gz
Size 7.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8101cb9f34a4ffbf2fb0b73fcce799a3470c3a5dc1f3f94d87ab6044b38d46d9
BLAKE2b-256 checksum
How to use checksums
d60e97e671c2f6647d78eded2e25ad881ce50d472830b838441ef1202507cf72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / group_payments-0.1.2-py3-none-any.whl

Download URL group_payments-0.1.2-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
637492a3ff5a5478acf40f187632cfdbb3bd387a15dc0a4457ce78b928866d95
BLAKE2b-256 checksum
How to use checksums
b444228042c33b675c42c2b60ee444a3353b1447dcb03f467814a2c40808b49e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

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