Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

paysafe-webhooks

БесплатноЗапускает вложенные скриптыНе проверен

Receive and verify Paysafe Payments API webhooks. Use when setting up Paysafe webhook handlers, debugging Signature header verification, or handling events…

hookdeckот hookdeck★ 104 звезды на GitHub

Об этом скилле

Paysafe Webhooks

When to Use This Skill

  • How do I receive Paysafe webhooks?
  • How do I verify the Paysafe Signature header?
  • Why is my Paysafe webhook signature verification failing?
  • How do I handle PAYMENT_HANDLE_COMPLETED or SETTLEMENT_COMPLETED events?
  • Handling redirect-flow payment methods (Skrill, Paysafecard, PayPal, Interac) that finish asynchronously

Verification (core)

Paysafe sends a Signature header containing the base64 HMAC-SHA256 of the raw JSON request body, keyed with your hmacKey. Use the key as a raw UTF-8 string (do not base64-decode it). There is no timestamp in the signed content.

const crypto = require('crypto');

function verifyPaysafeWebhook(rawBody, signatureHeader, secret) {
  if (!rawBody || !signatureHeader || !secret) return false;
  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('base64');
  try {
    return crypto.timingSafeEqual(Buffer.from(signatureHeader), Buffer.from(expected));
  } catch {
    return false; // different lengths = invalid
  }
}
import base64, hashlib, hmac

def verify_paysafe_webhook(raw_body: bytes, signature_header: str | None, secret: str) -> bool:
    if not raw_body or not signature_header:
        return False
    expected = base64.b64encode(hmac.new(secret.encode(), raw_body, hashlib.sha256).digest()).decode()
    return hmac.compare_digest(signature_header.encode(), expected.encode())

Raw body only. Verify the exact bytes received before parsing. In Express use express.raw({ type: '*/*' }) so any content type verifies.

For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.

Common Event Types

Every enveloped example has eventName, attemptNumber, resourceId, eventDate and payload. Other fields vary by docs page (see references/overview.md).

eventName Description
PAYMENT_HANDLE_INITIATED Payment handle request received, awaiting downstream processor
PAYMENT_HANDLE_PAYABLE Handle is PAYABLE and can be used for a payment call
PAYMENT_HANDLE_COMPLETED Payment associated with the handle was initiated
PAYMENT_HANDLE_FAILED Handle request failed or was declined
PAYMENT_COMPLETED Payment request completed
PAYMENT_FAILED Payment failed or was declined
PAYMENT_CANCELLED Payment fully voided (reversed)
PAYMENT_HELD Payment placed on hold for risk review
SETTLEMENT_COMPLETED Settlement request completed
SETTLEMENT_FAILED Settlement failed or was declined

Per-method pages also name PAYMENT_PENDING and SA_CREDIT_RETURN_COMPLETED, which the events tables omit, so return 2xx for names you don't recognize. Other categories include void authorization (VOIDAUTH_*), registration, refunds, original/standalone credits, and payment scheduler. See Paysafe webhook events.

Notes

  • Paysafe describes payloads as minimal and recommends one GET call to reconfirm the status a webhook reports.
  • Paysafe's docs show three body shapes, one a bare resource with no eventName, so dispatch on eventName when present (see references/overview.md).
  • Return 2xx to acknowledge. On a 4xx or 5xx response Paysafe retries up to three times.
  • Webhooks are configured through the Business Portal (the Paysafe Checkout docs say to open a service request there); Paysafe strongly recommends them for redirect-flow payment methods.

Environment Variables

PAYSAFE_WEBHOOK_SECRET=your_paysafe_hmac_key_here   # the hmacKey Paysafe's signature uses

Local Development

npx hookdeck-cli listen 3000 paysafe --path /webhooks/paysafe

No account required. Use port 8000 for FastAPI.

Reference Materials

Recommended: webhook-handler-patterns

We recommend installing the webhook-handler-patterns skill alongside this one for handler sequence, idempotency, error handling, and retry logic. Key references (open on GitHub):

Полный SKILL.md на GitHub

Установить paysafe-webhooks в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/fastapi/.env.exampleexamples/fastapi/README.mdexamples/fastapi/main.pyexamples/fastapi/requirements.txtexamples/fastapi/test_webhook.pyexamples/nextjs/.env.exampleexamples/nextjs/README.mdexamples/nextjs/app/webhooks/paysafe/route.tsexamples/nextjs/lib/verify.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

Что делает скилл paysafe-webhooks?

Receive and verify Paysafe Payments API webhooks. Use when setting up Paysafe webhook handlers, debugging Signature header verification, or handling events like PAYMENT_HANDLE_COMPLETED, PAYMENT_COMPLETED, and SETTLEMENT_COMPLETED.

Как установить скилл paysafe-webhooks?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл paysafe-webhooks запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить paysafe-webhooks с