@digilogiclabs/saas-factory-payments 5.1.1 → 5.2.0

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.
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Donation checkout types — supports inline price_data so apps don't
3
+ * need pre-created Stripe products. Zero Stripe Dashboard setup needed.
4
+ */
5
+ /** A named donation tier with fixed amount and optional recurrence. */
6
+ interface DonationTier {
7
+ /** Unique key for the tier (e.g., 'fan', 'referee', 'gold_patron'). */
8
+ id: string;
9
+ /** Display name (e.g., 'Gold Patron'). */
10
+ name: string;
11
+ /** Description shown to the user and on the Stripe receipt. */
12
+ description: string;
13
+ /** Amount in the smallest currency unit (e.g., 300 = $3.00 USD). */
14
+ amountCents: number;
15
+ /** Whether this tier recurs monthly. Default: false (one-time). */
16
+ recurring?: boolean;
17
+ }
18
+ /** Options for creating a donation checkout session. */
19
+ interface DonationCheckoutOptions {
20
+ /**
21
+ * Either a tier ID (resolved from the tiers map) or 'custom'.
22
+ * When 'custom', `customAmountCents` must be provided.
23
+ */
24
+ tier: string;
25
+ /** Amount in cents for custom donations. Required when tier is 'custom'. */
26
+ customAmountCents?: number;
27
+ /** Whether a custom donation should recur monthly. Default: false. */
28
+ customRecurring?: boolean;
29
+ /** URL to redirect to on successful checkout. */
30
+ successUrl: string;
31
+ /** URL to redirect to on cancelled checkout. */
32
+ cancelUrl: string;
33
+ /** Additional metadata to attach to the Stripe session. */
34
+ metadata?: Record<string, string>;
35
+ /** Existing Stripe customer ID (optional). */
36
+ customerId?: string;
37
+ /** Allow Stripe promo codes. Default: true. */
38
+ allowPromotionCodes?: boolean;
39
+ /** Collect billing address. Default: 'auto'. */
40
+ billingAddressCollection?: 'auto' | 'required';
41
+ }
42
+ /** Result of a successful donation checkout session creation. */
43
+ interface DonationCheckoutResult {
44
+ /** The Stripe checkout session ID. */
45
+ sessionId: string;
46
+ /** The URL to redirect the user to for payment. */
47
+ url: string | null;
48
+ }
49
+
50
+ export type { DonationTier as D, DonationCheckoutOptions as a, DonationCheckoutResult as b };
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Donation checkout types — supports inline price_data so apps don't
3
+ * need pre-created Stripe products. Zero Stripe Dashboard setup needed.
4
+ */
5
+ /** A named donation tier with fixed amount and optional recurrence. */
6
+ interface DonationTier {
7
+ /** Unique key for the tier (e.g., 'fan', 'referee', 'gold_patron'). */
8
+ id: string;
9
+ /** Display name (e.g., 'Gold Patron'). */
10
+ name: string;
11
+ /** Description shown to the user and on the Stripe receipt. */
12
+ description: string;
13
+ /** Amount in the smallest currency unit (e.g., 300 = $3.00 USD). */
14
+ amountCents: number;
15
+ /** Whether this tier recurs monthly. Default: false (one-time). */
16
+ recurring?: boolean;
17
+ }
18
+ /** Options for creating a donation checkout session. */
19
+ interface DonationCheckoutOptions {
20
+ /**
21
+ * Either a tier ID (resolved from the tiers map) or 'custom'.
22
+ * When 'custom', `customAmountCents` must be provided.
23
+ */
24
+ tier: string;
25
+ /** Amount in cents for custom donations. Required when tier is 'custom'. */
26
+ customAmountCents?: number;
27
+ /** Whether a custom donation should recur monthly. Default: false. */
28
+ customRecurring?: boolean;
29
+ /** URL to redirect to on successful checkout. */
30
+ successUrl: string;
31
+ /** URL to redirect to on cancelled checkout. */
32
+ cancelUrl: string;
33
+ /** Additional metadata to attach to the Stripe session. */
34
+ metadata?: Record<string, string>;
35
+ /** Existing Stripe customer ID (optional). */
36
+ customerId?: string;
37
+ /** Allow Stripe promo codes. Default: true. */
38
+ allowPromotionCodes?: boolean;
39
+ /** Collect billing address. Default: 'auto'. */
40
+ billingAddressCollection?: 'auto' | 'required';
41
+ }
42
+ /** Result of a successful donation checkout session creation. */
43
+ interface DonationCheckoutResult {
44
+ /** The Stripe checkout session ID. */
45
+ sessionId: string;
46
+ /** The URL to redirect the user to for payment. */
47
+ url: string | null;
48
+ }
49
+
50
+ export type { DonationTier as D, DonationCheckoutOptions as a, DonationCheckoutResult as b };