pine-labs-webhooks
БесплатноЗапускает вложенные скриптыНе проверенReceive and verify Pine Labs Online (Plural by Pine Labs) webhooks. Use when setting up Pine Labs webhook handlers, debugging Standard Webhooks signature…
от hookdeck★ 104 звезды на GitHubОб этом скилле
Pine Labs Webhooks
Pine Labs Online (Plural by Pine Labs) is an Indian payment gateway. It sends webhooks for orders, payments, refunds, card tokens, subscriptions, customers, payouts and cross-border settlement.
When to Use This Skill
- How do I receive Pine Labs webhooks?
- How do I verify a Pine Labs webhook signature (
webhook-signature)? - Why does Pine Labs signature verification fail with the
standardwebhooksorsvixlibrary? - How do I handle
ORDER_PROCESSED,PAYMENT_FAILEDorREFUND_PROCESSEDevents? - How do I handle
SUBSCRIPTION_CHARGEDorpayout-transaction-success? - Why am I processing the same Pine Labs event twice, or getting events out of order?
Verification (core)
Pine Labs uses the Standard Webhooks headers. Verification is mandatory per Pine Labs' docs.
| Header | Value |
|---|---|
webhook-id |
Event ID. Same when the webhook is resent |
webhook-timestamp |
Unix seconds when the event was triggered |
webhook-signature |
Space-delimited list of v1,<base64> signatures |
Signed content is {webhook-id}.{webhook-timestamp}.{raw body}, HMAC-SHA256, base64. The key is the secret key from the Pine Labs dashboard as raw UTF-8 bytes. There is no whsec_ prefix and nothing to base64-decode. Pine Labs' docs say to base64-encode the key and decode it again before use, which cancels out.
Hookdeck's configuration alert reads exactly: "Paste the secret key exactly as shown in the Pine Labs dashboard, without adding a whsec_ prefix." Put the secret in
PINE_LABS_WEBHOOK_SECRETthe same way.
import crypto from 'node:crypto';
// rawBody: the exact bytes received (express.raw() / request.text()), NOT re-serialised JSON.
// toleranceSec = 0 (default) skips the timestamp window, because Hookdeck retries and replays
// keep the original webhook-timestamp. A positive value opts in.
function verifyPineLabsWebhook(rawBody, { id, timestamp, signature }, secret, toleranceSec = 0) {
if (!id || !signature || !/^[1-9][0-9]*$/.test(timestamp ?? '')) throw new Error('Missing or malformed headers');
if (toleranceSec > 0 && Math.abs(Date.now() / 1000 - Number(timestamp)) > toleranceSec) {
throw new Error('Timestamp outside tolerance');
}
const key = secret.startsWith('whsec_')
? Buffer.from(secret.slice(6), 'base64') // only if the secret itself starts with whsec_
: Buffer.from(secret, 'utf8'); // Pine Labs: the secret as-is
if (key.length === 0) throw new Error('Empty signing key');
const expected = crypto.createHmac('sha256', key).update(`${id}.${timestamp}.`).update(rawBody).digest();
const ok = signature.split(' ').some((entry) => {
const [version, sig] = entry.split(',');
const given = Buffer.from(sig ?? '', 'base64');
return version === 'v1' && given.length === expected.length && crypto.timingSafeEqual(given, expected);
});
if (!ok) throw new Error('Invalid signature');
return JSON.parse(rawBody.toString('utf8'));
}
Header fallback: read the webhook-* headers and, when webhook-id is absent, use the svix-id, svix-timestamp and svix-signature headers instead. The examples do this and test it.
Why not the standardwebhooks or svix libraries? They base64-decode the secret, so they compute the wrong key for Pine Labs' raw string secret. They also enforce a 5-minute timestamp window, which rejects Hookdeck retries and replays (they keep the original timestamp). The examples verify by hand and make the window opt-in with PINE_LABS_WEBHOOK_TOLERANCE_SECONDS (default 0).
The Python version is in references/verification.md.
For complete handlers with tests, see examples/express/, examples/nextjs/, examples/fastapi/.
Payload Shape, Retries and Ordering
Order, payment, refund, customer, token and subscription events are { "event_type": "...", "data": { ... } }. Payout events (and the Pay by Points order examples) use camelCase eventType with camelCase data fields, so read event_type ?? eventType.
{ "event_type": "ORDER_PROCESSED",
"data": { "order_id": "v1-240909084141-aa-O2oJwd", "status": "PROCESSED",
"order_amount": { "value": 200, "currency": "INR" } } }
- Reply
2XXwithin 5 seconds. Anything else is retried: immediately, then after 5 seconds, 5 minutes, 30 minutes, 2 hours, 5 hours and twice more at 10 hours. (The webhooks overview page says "up to three times", which conflicts with the retry policy page.) - Order is not guaranteed.
ORDER_PROCESSEDcan arrive beforeORDER_AUTHORIZED. Don't build a state machine on arrival order, and use the Get Order API when in doubt. - Deduplicate on
webhook-id, which stays the same when an event is resent.
Common Event Types
Pine Labs documents 30 event types (the list may n
Установить pine-labs-webhooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл pine-labs-webhooks?
Receive and verify Pine Labs Online (Plural by Pine Labs) webhooks. Use when setting up Pine Labs webhook handlers, debugging Standard Webhooks signature verification (webhook-id, webhook-timestamp, webhook-signature, secret key used as raw UTF-8 bytes), or handling events like ORDER_PROCESSED, PAYMENT_FAILED, REFUND_PROCESSED, SUBSCRIPTION_CHARGED, TOKEN_ACTIVATED and payout-transaction-success.
Как установить скилл pine-labs-webhooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл pine-labs-webhooks запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic