@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.
@@ -4465,6 +4465,13 @@ async function startGiftIntent(db, input) {
4465
4465
  };
4466
4466
  }
4467
4467
 
4468
+ // src/stripe-webhook-secret.ts
4469
+ async function resolveStripeWebhookSecret(db, runtime) {
4470
+ const scoped = await getVaultSecret(db, stripeWebhookSecretName(runtime));
4471
+ if (scoped || !runtime) return scoped;
4472
+ return getVaultSecret(db, "stripe_webhook_secret");
4473
+ }
4474
+
4468
4475
  // src/payments-route-support.ts
4469
4476
  var paymentErrorCode = (error) => error && typeof error === "object" && typeof error.code === "string" ? error.code : "unknown";
4470
4477
  function paymentLineItems(group) {
@@ -4673,7 +4680,7 @@ async function startSubscription(req, env, ctx) {
4673
4680
  }
4674
4681
  async function ingestWebhook(req, env, ctx) {
4675
4682
  const db = ctx.makeDb(env);
4676
- const webhookSecret = await getVaultSecret(db, stripeWebhookSecretName(env.ODLA_RUNTIME));
4683
+ const webhookSecret = await resolveStripeWebhookSecret(db, env.ODLA_RUNTIME);
4677
4684
  if (!webhookSecret) return json({ error: "webhook not configured" }, 503);
4678
4685
  const rawBody = await req.text();
4679
4686
  const ingest = await createStripeProvider({ webhookSecret }).ingestWebhook(rawBody, req.headers.get("stripe-signature") ?? "");