UNPKG

@coursebuilder/core

Version:

Core package for Course Builder

69 lines (68 loc) 2.92 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // src/inngest/stripe/event-invoice-payment-succeeded.ts var event_invoice_payment_succeeded_exports = {}; __export(event_invoice_payment_succeeded_exports, { STRIPE_INVOICE_PAYMENT_SUCCEEDED_EVENT: () => STRIPE_INVOICE_PAYMENT_SUCCEEDED_EVENT, stripeInvoicePaymentSucceeded: () => stripeInvoicePaymentSucceeded, stripeInvoicePaymentSucceededConfig: () => stripeInvoicePaymentSucceededConfig, stripeInvoicePaymentSucceededHandler: () => stripeInvoicePaymentSucceededHandler, stripeInvoicePaymentSucceededTrigger: () => stripeInvoicePaymentSucceededTrigger }); module.exports = __toCommonJS(event_invoice_payment_succeeded_exports); var STRIPE_INVOICE_PAYMENT_SUCCEEDED_EVENT = "stripe/invoice-payment-succeeded"; var stripeInvoicePaymentSucceededConfig = { id: "stripe-invoice-payment-succeeded", name: "Stripe Invoice Payment Succeeded" }; var stripeInvoicePaymentSucceededTrigger = { event: STRIPE_INVOICE_PAYMENT_SUCCEEDED_EVENT }; var stripeInvoicePaymentSucceededHandler = /* @__PURE__ */ __name(async ({ event, step, db }) => { const invoice = event.data.stripeEvent.data.object; await step.run("record payment", async () => { }); if (invoice.subscription) { await step.run("process subscription payment", async () => { }); return; } if (invoice.charge) { await step.run("process one-time payment", async () => { }); return; } await step.run("process other payment type", async () => { }); }, "stripeInvoicePaymentSucceededHandler"); var stripeInvoicePaymentSucceeded = { config: stripeInvoicePaymentSucceededConfig, trigger: stripeInvoicePaymentSucceededTrigger, handler: stripeInvoicePaymentSucceededHandler }; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { STRIPE_INVOICE_PAYMENT_SUCCEEDED_EVENT, stripeInvoicePaymentSucceeded, stripeInvoicePaymentSucceededConfig, stripeInvoicePaymentSucceededHandler, stripeInvoicePaymentSucceededTrigger }); //# sourceMappingURL=event-invoice-payment-succeeded.cjs.map