EN

@core / stripe

1.0.0 ▾
verifiedMIT
GitHub

Shared Stripe client and one idempotent, signature-verified webhook endpoint dispatching events to every module

Code8 filesContext~545 tokensMCP stripescan passed

The exact tree that will be injected, after .genpmignore. Pinned to

src/lib/stripe/adapters/hono.tsread-only · 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;
    }
  });
}

Report @core/stripe

Sign in with GitHub to report a package.