Command Palette

Search for a command to run...

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

gocardless-webhooks

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

Receive and verify GoCardless webhooks. Use when setting up GoCardless webhook handlers, debugging Webhook-Signature verification, or handling bank debit…

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

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

GoCardless Webhooks

GoCardless is a bank debit / recurring payments platform. It sends webhooks as batches of events (up to 250 per request) in an events array, signed with an HMAC-SHA256 signature in the Webhook-Signature header.

When to Use This Skill

  • How do I receive GoCardless webhooks?
  • How do I verify the GoCardless Webhook-Signature header?
  • Why is my GoCardless webhook signature verification failing?
  • How do I handle payments confirmed/failed, mandates cancelled, or payouts paid events?
  • How do I process the GoCardless events array idempotently?

How GoCardless Signs Webhooks

  • Header: Webhook-Signature — a bare 64-char lowercase hex digest (no X- prefix, no sha256= scheme prefix)
  • Algorithm: HMAC-SHA256 over the raw request body, keyed with the webhook endpoint secret (from your GoCardless Dashboard)
  • Key: use the secret verbatim as a UTF-8 string — do NOT base64-decode it even though it looks base64url-ish; decoding it produces a wrong signature
  • Encoding: lowercase hex string
  • Comparison: timing-safe equality
  • Response: return a 2xx within 10 seconds (204 No Content once the whole batch is accepted). Return 498 for a bad signature: GoCardless logs it and doesn't retry. Any other non-2xx or a timeout is retried, up to 9 attempts in all at increasing intervals, and you can retry from the Dashboard or with POST /webhooks/{id}/actions/retry. Delivery is at-least-once and the same event can appear in more than one webhook, so keep handlers idempotent on event.id (not meta.webhook_id, which identifies the delivery attempt).

(GoCardless's webhooks reference names the scheme: an HMAC SHA256 hex digest of the raw body, keyed with the endpoint secret. Also checked in 2026-08 against a live sandbox delivery and the official gocardless-nodejs SDK.)

Always verify against the raw body — parsing JSON first and re-serializing will change the bytes and break the signature.

Verification (core)

Use the official gocardless-nodejs SDK where it runs (Node.js). parse() verifies the signature (timing-safe) and returns the events array, throwing InvalidSignatureError when the signature does not match.

// Node.js — official SDK (gocardless-nodejs), req.body is the RAW Buffer
const { parse, InvalidSignatureError } = require('gocardless-nodejs/webhooks');

try {
  const events = parse(
    req.body,                                  // raw body (Buffer/string), NOT parsed JSON
    process.env.GOCARDLESS_WEBHOOK_SECRET,     // webhook endpoint secret
    req.headers['webhook-signature']           // Webhook-Signature header
  );
  // signature valid — process each event, then respond 204
} catch (err) {
  if (err instanceof InvalidSignatureError) {
    // signature mismatch — respond 498 (do not process)
  }
}

GoCardless's other client libraries (Python gocardless_pro, Ruby, PHP, Java, .NET, Go) have the same webhook parser. Without one (as in the FastAPI example), verify manually — same algorithm, timing-safe compare:

import hmac, hashlib
expected = hmac.new(secret.encode(), raw_body, hashlib.sha256).hexdigest()
valid = hmac.compare_digest(expected, signature_header)  # timing-safe

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

Common Event Types

GoCardless events combine a resource_type with an action. The most common:

resource_type action Triggered When
payments confirmed Funds confirmed collected from the customer
payments paid_out Payment included in a payout to your bank account
payments failed Payment failed (e.g. insufficient funds)
payments cancelled Payment cancelled
payments charged_back Customer charged the payment back
mandates active Mandate set up and ready to collect
mandates customer_approval_granted Extra customer approval (e.g. a second signatory) granted
mandates cancelled Mandate cancelled (e.g. bank account closed)
mandates failed Mandate setup failed
mandates expired Mandate expired through inactivity
payouts paid Payout sent to your bank account
refunds paid Refund paid to the customer
refunds failed Refund failed
subscriptions created Subscription created
subscriptions cancelled Subscription cancelled

See overview.md for the full action list per resource type.

Environment Variables

# Webhook endpoint secret from the GoCardless Dashboard (Developers → Webhooks)
GOCARDLESS_WEBHOOK_SECRET=your_webhook_endpoint_secret

Local Development

For local webhook testing, run th

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

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

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

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

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

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

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

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

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

TODO.mdexamples/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/layout.tsxexamples/nextjs/app/page.tsxexamples/nextjs/app/webhooks/gocardless/route.tsexamples/nextjs/next.config.jsexamples/nextjs/package.jsonexamples/nextjs/tsconfig.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

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

Receive and verify GoCardless webhooks. Use when setting up GoCardless webhook handlers, debugging Webhook-Signature verification, or handling bank debit events like payments confirmed, payments failed, mandates cancelled, and payouts paid.

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

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

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

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

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

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