@odla-ai/chapter 0.43.0 → 0.43.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4435,6 +4435,13 @@ async function startGiftIntent(db, input) {
4435
4435
  };
4436
4436
  }
4437
4437
 
4438
+ // src/stripe-webhook-secret.ts
4439
+ async function resolveStripeWebhookSecret(db, runtime) {
4440
+ const scoped = await getVaultSecret(db, stripeWebhookSecretName(runtime));
4441
+ if (scoped || !runtime) return scoped;
4442
+ return getVaultSecret(db, "stripe_webhook_secret");
4443
+ }
4444
+
4438
4445
  // src/payments-route-support.ts
4439
4446
  var paymentErrorCode = (error) => error && typeof error === "object" && typeof error.code === "string" ? error.code : "unknown";
4440
4447
  function paymentLineItems(group) {
@@ -4643,7 +4650,7 @@ async function startSubscription(req, env, ctx) {
4643
4650
  }
4644
4651
  async function ingestWebhook(req, env, ctx) {
4645
4652
  const db = ctx.makeDb(env);
4646
- const webhookSecret = await getVaultSecret(db, stripeWebhookSecretName(env.ODLA_RUNTIME));
4653
+ const webhookSecret = await resolveStripeWebhookSecret(db, env.ODLA_RUNTIME);
4647
4654
  if (!webhookSecret) return json({ error: "webhook not configured" }, 503);
4648
4655
  const rawBody = await req.text();
4649
4656
  const ingest = await createStripeProvider({ webhookSecret }).ingestWebhook(rawBody, req.headers.get("stripe-signature") ?? "");