JA
ベータ版の翻訳

@core / stripe

1.0.0 ▾
認証済みMIT
GitHub

共有 Stripe クライアントと、署名検証済みで冪等な単一 Webhook(各モジュールへイベントを配信)

コード8 ファイルコンテキスト約 545 トークンMCP stripeスキャン合格

.genpmignore 適用後に組み込まれる正確なツリーです。固定先:

src/lib/stripe/adapters/hono.ts読み取り専用 · 43dfe91
// Adaptador Hono: `app.route('/api/stripe/webhook', stripeWebhookRoutes())`.
import { Hono } from 'hono';
import { handleStripeWebhook, WebhookSignatureError } from '../index.ts';

export function stripeWebhookRoutes() {
  return new Hono().post('/', async (c) => {
    try {
      // Cuerpo en bruto: la firma se calcula sobre los bytes exactos.
      return c.json(await handleStripeWebhook(await c.req.text(), c.req.header('stripe-signature') ?? null));
    } catch (e) {
      if (e instanceof WebhookSignatureError) return c.json({ error: e.message }, 400);
      throw e;
    }
  });
}

@core/stripe を報告

パッケージを報告するには GitHub でログインしてください。

GitHub で続ける