marqeta-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and authenticate Marqeta webhooks. Use when creating webhooks with the Marqeta /webhooks API, checking the required HTTP Basic auth credentials…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Marqeta Webhooks
Marqeta sends event notifications (transactions, card and user state changes, chargebacks, digital wallet tokens, and more) as JSON POSTs to the webhook URLs you register with the /webhooks API. Each program can have up to 10 active webhooks.
When to Use This Skill
- How do I receive Marqeta webhooks?
- How do I authenticate Marqeta webhook requests? (Basic auth, always)
- How do I verify
X-Marqeta-Signature? - How do I answer Marqeta's ping?
- Why does one request contain several notifications?
Authentication (core)
Marqeta's webhook docs: "Authenticate incoming requests using the Basic Auth (base64-encoded) header that Marqeta sends." config.basic_auth_username (1–50 characters) and config.basic_auth_password (20–50 characters, with a digit, lowercase, uppercase and a symbol) are required on every webhook.
const crypto = require('crypto');
const safeEqual = (a, b) => crypto.timingSafeEqual(
crypto.createHash('sha256').update(a).digest(),
crypto.createHash('sha256').update(b).digest());
function verifyBasicAuth(authorization, username, password) {
const match = /^Basic\s+([A-Za-z0-9+/]+={0,2})\s*$/i.exec(String(authorization || ''));
if (!match || !username || !password) return false;
const decoded = Buffer.from(match[1], 'base64').toString('utf8');
const i = decoded.indexOf(':'); // the password may contain ':'
if (i < 0) return false;
const userOk = safeEqual(decoded.slice(0, i), username);
const passOk = safeEqual(decoded.slice(i + 1), password);
return userOk && passOk;
}
Optional: X-Marqeta-Signature
If you set config.secret and config.signature_algorithm (HMAC_SHA_256, recommended, or HMAC_SHA_1, legacy) on the webhook, Marqeta also signs each message. Per the signature verification guide, X-Marqeta-Signature is the lowercase hex HMAC of the raw body, keyed with the secret (Ruby's OpenSSL::HMAC.hexdigest).
function verifyMarqetaSignature(rawBody, signature, secret) {
const value = String(signature || '').trim();
if (!secret || !/^[0-9a-fA-F]{64}$/.test(value)) return false; // 40 for HMAC-SHA1
const expected = crypto.createHmac('sha256', secret).update(rawBody).digest();
return crypto.timingSafeEqual(Buffer.from(value, 'hex'), expected);
}
- Check Basic auth first, always. The signature adds message integrity; it doesn't replace the credentials.
- When you switch from HMAC-SHA1 to HMAC-SHA256, retries signed the old way can arrive for up to two weeks. Accept both during that window (the examples take
MARQETA_SIGNATURE_ALGORITHM=sha256,sha1). - The guide's Ruby sample compares with
==. Use a constant-time comparison. - Wrong or missing credentials or signature:
401. Credentials not configured:500.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
The examples check the signature only when MARQETA_WEBHOOK_SECRET is set. See references/verification.md.
Hookdeck: the Marqeta source type (MARQETA) checks the Basic auth username and password. It doesn't check X-Marqeta-Signature. If you rely on the signature, verify it in your handler as well. Verification is optional on the source, and Hookdeck applies no timestamp window.
Payload
Notifications of the same type are batched, up to 10 per message, under a key named for the type:
{
"transactions": [
{ "type": "authorization", "state": "PENDING", "token": "...", "user_token": "...", "card_token": "...", "amount": 10.00, "created_time": "..." }
]
}
Other keys include cards, usertransitions, businesstransitions, chargebacktransitions, digitalwallettokentransitions, cardactions and directdeposittransitions. Each notification has its own token: dedupe on it. Order isn't guaranteed, so use created_time.
The health check (POST /webhooks/{token}/ping) sends {"pings":[{"token":"marqeta","payload":"healthcheck"}]}. Answer it with 200.
Event Types
You subscribe with events: a single type (transaction.authorization, cardtransition.fulfillment.issued), a base type with a wildcard (transaction.*, cardtransition.*, not subcategories), or * for everything. See Event Types.
Environment Variables
MARQETA_WEBHOOK_USERNAME=your-basic-auth-username # config.basic_auth_username
MARQETA_WEBHOOK_PASSWORD=your-basic-auth-password # config.basic_auth_password
# Optional: check X-Marqeta-Signature too
MARQETA_WEBHOOK_SECRET=your-webhook-secret # config.secret
MARQETA_SIGNATURE_ALGORITHM=sha256 # sha256 | sha1 | sha256,sha1
Local Developm
Установить marqeta-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл marqeta-webhooks?
Receive and authenticate Marqeta webhooks. Use when creating webhooks with the Marqeta /webhooks API, checking the required HTTP Basic auth credentials, optionally verifying X-Marqeta-Signature (hex HMAC-SHA256 or legacy HMAC-SHA1 of the raw body), answering pings, or handling batched transaction, card transition and user transition notifications.
Как установить скилл marqeta-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл marqeta-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic