Command Palette

Search for a command to run...

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

mollie-webhooks

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

Receive and handle Mollie webhooks. Use when setting up Mollie webhook handlers, verifying the X-Mollie-Signature header on next-gen webhooks, or handling…

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

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

Mollie Webhooks

When to Use This Skill

  • Setting up a Mollie webhook handler (classic webhookUrl or next-gen subscription)
  • Verifying the X-Mollie-Signature header on next-gen webhooks
  • Understanding why classic Mollie webhooks have no signature to verify
  • How do I confirm a Mollie payment status from a classic webhook?
  • Handling payment status changes: paid, authorized, canceled, expired, failed
  • Why does my Mollie webhook only contain an id?

Two Webhook Systems (Read This First)

Mollie runs two webhook systems side by side. They are secured differently, so work out which one you are receiving before writing a handler.

Classic webhooks Next-gen webhooks
Configured by webhookUrl passed when creating a payment (or order, subscription, payment link) A subscription created in the Dashboard (Developers → Webhooks) or POST /v2/webhooks, with a list of eventTypes
Body application/x-www-form-urlencoded, a single id=tr_… JSON event object (resource: "event", id, type, entityId, createdAt, _links, optional _embedded.entity snapshot)
Signed? No Yes: X-Mollie-Signature: sha256=<hex HMAC-SHA256 of the raw body>
Security model Fetch-to-confirm: fetch the payment with your API key Verify the signature with the webhook's signing secret

Mollie's guidance: "If your system needs to support both webhook styles, differentiate between payments webhooks webcalls and new calls (new Webhooks send a new header X-Mollie-Signature...)", and "we recommend using separate URLs (one for each webhooks system)". The examples use /webhooks/mollie for classic and /webhooks/mollie/events for next-gen.

Classic Webhooks: Fetch to Confirm

Classic webhooks are not signed: no HMAC, no signature header, no shared secret. Mollie sends a POST with a single application/x-www-form-urlencoded body parameter:

id=tr_5B8cwPMGnU6qLbRvo7qEZo

The status is deliberately not in the payload. You must not trust the request body: anyone could POST a fake id. Instead you fetch the resource from the Mollie API using your API key and read the authoritative status. This is the fetch-to-confirm pattern, and it is the security model: a forged webhook can only ever cause you to re-fetch a real payment you own.

Mollie ──POST id=tr_xxx──▶  your endpoint
                              │
                              ▼
                    GET /v2/payments/tr_xxx  (with your API key)
                              │
                              ▼
                    read payment.status → act → return 200

Authenticate with your API key as a Bearer token (test_… or live_…). Always return 200 quickly (even for an unknown or deleted id) so Mollie stops retrying.

Node (official SDK, @mollie/api-client):

const { createMollieClient } = require('@mollie/api-client');
const mollie = createMollieClient({ apiKey: process.env.MOLLIE_API_KEY });

// req.body.id came from the x-www-form-urlencoded webhook — do NOT trust it as status.
const payment = await mollie.payments.get(req.body.id); // 404 => unknown id, ack with 200
switch (payment.status) {                               // authoritative status from the API
  case 'paid': /* fulfill order */ break;
  case 'expired': case 'failed': case 'canceled': /* release order */ break;
}

Python (manual fetch with the REST API):

async with httpx.AsyncClient() as client:
    r = await client.get(
        f"https://api.mollie.com/v2/payments/{payment_id}",
        headers={"Authorization": f"Bearer {os.environ['MOLLIE_API_KEY']}"},
    )
# r.status_code == 404 => unknown id, acknowledge with 200
payment = r.json()          # authoritative status from the API
status = payment["status"]  # 'paid' | 'authorized' | 'canceled' | 'expired' | 'failed' | ...

Next-gen Webhooks: Verify X-Mollie-Signature

Each next-gen delivery carries X-Mollie-Signature: sha256=<hex>, an HMAC-SHA256 of the unaltered request body keyed with the webhook's signing secret. To verify: strip the sha256= prefix, compute the HMAC over the raw body, and compare with a timing-safe function. Parse the JSON only after the signature checks out.

Update your stored secret as soon as you rotate it: Mollie's next-gen guide says a new secret revokes the old one at once, "with no overlap window". Its example request still shows two X-Mollie-Signature headers, and Node and the Fetch API join repeated headers into one comma-separated string, so the code below splits on , and accepts the request if any value matches.

const crypto = require('crypto');

function verifyMollieSignature(rawBody, signatureHeader, secret) {
  if (!signatureHeader || !secret) return false;
  const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
  return signatureHeader.split(',').some((value) => {
    const provided = value.t
Полный SKILL.md на GitHub

Установить mollie-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/mollie/events/route.tsexamples/nextjs/app/webhooks/mollie/route.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

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

Receive and handle Mollie webhooks. Use when setting up Mollie webhook handlers, verifying the X-Mollie-Signature header on next-gen webhooks, or handling payment status changes like paid, expired, failed, canceled, or authorized. Covers both systems: classic webhooks (unsigned, id-only, confirm by fetching the payment from the API) and next-gen webhooks (signed JSON events, HMAC-SHA256 of the raw body).

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

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

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

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

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

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