Command Palette

Search for a command to run...

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

rebilly-webhooks

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

Receive and authenticate Rebilly subscription billing webhooks. Use when setting up a Rebilly webhook endpoint, checking HTTP basic access authentication…

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

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

Rebilly Webhooks

Rebilly sends a JSON webhook when something happens in your organization: a transaction is processed, a customer is created, a subscription is activated, an invoice is issued. When the webhook has HTTP basic access authentication credentials, every request carries Authorization: Basic base64(username:password), and your endpoint authenticates the request by checking them. Rebilly also signs every webhook (see below), but Hookdeck's Rebilly source checks only basic auth, so set basic auth on the Rebilly webhook.

When to Use This Skill

  • How do I receive Rebilly webhooks?
  • How do I check the Authorization: Basic header on a Rebilly webhook?
  • Does Rebilly sign webhooks? (Yes, Security-Signature JWT and v2a and legacy v1a Ed25519, but the examples check basic auth)
  • How do I handle transaction-processed, subscription-activated or invoice-issued events?
  • Why does my Rebilly webhook endpoint return 401, or why does Rebilly keep retrying?

Verification (core)

const crypto = require('crypto');

const BASIC_RE = /^basic +([A-Za-z0-9+/]+={0,2})$/i; // strict base64 alphabet, scheme case-insensitive
const digest = (b) => crypto.createHash('sha256').update(b).digest();
const safeEqual = (a, b) => crypto.timingSafeEqual(digest(a), digest(b));

function verifyRebillyRequest(headers, username, password) {
  if (!username || !password) return false;            // never accept when unconfigured
  const m = BASIC_RE.exec(headers.authorization || '');
  if (!m || m[1].length % 4 !== 0) return false;
  const decoded = Buffer.from(m[1], 'base64');
  if (decoded.toString('base64') !== m[1]) return false; // reject non-canonical base64
  const colon = decoded.indexOf(0x3a);                 // split on the FIRST colon
  if (colon === -1) return false;
  const userOk = safeEqual(decoded.subarray(0, colon), Buffer.from(username));
  const passOk = safeEqual(decoded.subarray(colon + 1), Buffer.from(password));
  return userOk && passOk;                             // both evaluated, no short-circuit
}

In Python, decode with base64.b64decode(value, validate=True), split with bytes.partition(b":") and compare with hmac.compare_digest on bytes (encode both sides; str raises on non-ASCII).

  • Header: Authorization: Basic base64(username:password), set on the webhook in Rebilly. Environment variables: REBILLY_WEBHOOK_USERNAME and REBILLY_WEBHOOK_PASSWORD.
  • Missing or malformed header, or a mismatch: 401. Check it first, for every HTTP method.
  • The credentials must arrive with each request: Event Gateway doesn't prompt for them, and a request with wrong ones still gets a 200 and is recorded as failed verification.
  • A static shared credential authenticates the sender, not the body, and gives no replay protection (basic auth itself carries no signature or timestamp). Use HTTPS and rotate the credential if it leaks.
  • Read the body raw (express.raw({ type: '*/*' })) and parse it only after the check.

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

Rebilly Also Signs Webhooks

Rebilly sends a Security-Signature JWT and a webhook-signature header with Ed25519 signatures. Rebilly recommends the organization-bound v2a signature for new receivers and continues to send v1a for existing receivers. Hookdeck's Rebilly source and the runnable examples check HTTP basic auth. For optional body verification, including deliveries replayed through Hookdeck, see signature verification.

Methods

A Rebilly webhook's method is one of GET, POST, PUT, PATCH or DELETE, so the handlers accept all five, check the credentials before anything else and handle an empty body. Any method the webhook uses must also be allowed on the Hookdeck source (custom methods).

Event Types

The payload has an eventType field plus the resource ids and HAL _embedded / _links. A webhook's optional body template replaces this default payload. Dispatch on eventType.

Event Sent When
transaction-processed A transaction is processed
transaction-declined A transaction is declined
customer-created A customer is created
subscription-activated A subscription is activated
subscription-canceled A subscription is canceled
invoice-issued An invoice is issued
invoice-paid An invoice is paid
data-export-completed A data export is completed

The full list is in the eventsFilter vocabulary of Rebilly's API reference.

Responding

Rebilly retries unless the response is exactly HTTP 200 (not 202 or 204), and also if there is no response within 20 seconds. Return 200 quickly and process asynchronously. Webhooks can be delivered more t

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

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

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

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

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

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

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

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

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

examples/express/.env.exampleexamples/express/README.mdexamples/express/package.jsonexamples/express/src/index.jsexamples/express/src/verify-v2a.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/rebilly/route.tsexamples/nextjs/lib/verify-rebilly.tsexamples/nextjs/package.jsonexamples/nextjs/vitest.config.tsreferences/overview.mdreferences/setup.mdreferences/verification.md

FAQ

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

Receive and authenticate Rebilly subscription billing webhooks. Use when setting up a Rebilly webhook endpoint, checking HTTP basic access authentication, debugging 401s, accepting GET/POST/PUT/PATCH/DELETE webhooks, or handling events like transaction-processed, customer-created, subscription-activated, invoice-issued and data-export-completed.

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

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

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

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

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

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