@funnelsgrove/payments 0.11.4 → 0.11.5
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.
- package/README.md +20 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/providers/stripe/services/checkout/createOneTimeCheckout.d.ts +2 -0
- package/dist/providers/stripe/services/checkout/createOneTimeCheckout.js +5 -0
- package/dist/providers/stripe/services/checkout/createSubscriptionCheckout.d.ts +2 -0
- package/dist/providers/stripe/services/checkout/createSubscriptionCheckout.js +5 -0
- package/dist/providers/stripe/services/checkout/requests.d.ts +83 -0
- package/dist/providers/stripe/services/checkout/requests.js +99 -0
- package/dist/providers/stripe/services/checkout/types.d.ts +83 -0
- package/dist/providers/stripe/services/checkout/types.js +1 -0
- package/dist/providers/stripe/services/checkout/updateSubscriptionCheckoutPlan.d.ts +2 -0
- package/dist/providers/stripe/services/checkout/updateSubscriptionCheckoutPlan.js +5 -0
- package/dist/providers/stripe/services/checkout/verifySubscriptionCheckoutPayment.d.ts +2 -0
- package/dist/providers/stripe/services/checkout/verifySubscriptionCheckoutPayment.js +5 -0
- package/dist/providers/stripe/services/hostedCheckout/createCheckoutSession.d.ts +2 -0
- package/dist/providers/stripe/services/hostedCheckout/createCheckoutSession.js +5 -0
- package/dist/providers/stripe/services/hostedCheckout/redirectToCheckout.d.ts +2 -0
- package/dist/providers/stripe/services/hostedCheckout/redirectToCheckout.js +13 -0
- package/dist/providers/stripe/services/hostedCheckout/requests.d.ts +20 -0
- package/dist/providers/stripe/services/hostedCheckout/requests.js +26 -0
- package/dist/providers/stripe/services/hostedCheckout/types.d.ts +24 -0
- package/dist/providers/stripe/services/hostedCheckout/types.js +1 -0
- package/dist/providers/stripe/services/oneClick/chargePayment.d.ts +2 -0
- package/dist/providers/stripe/services/oneClick/chargePayment.js +5 -0
- package/dist/providers/stripe/services/oneClick/completePayment.d.ts +3 -0
- package/dist/providers/stripe/services/oneClick/completePayment.js +13 -0
- package/dist/providers/stripe/services/oneClick/confirmation.d.ts +6 -0
- package/dist/providers/stripe/services/oneClick/confirmation.js +22 -0
- package/dist/providers/stripe/services/oneClick/requests.d.ts +20 -0
- package/dist/providers/stripe/services/oneClick/requests.js +23 -0
- package/dist/providers/stripe/services/oneClick/types.d.ts +40 -0
- package/dist/providers/stripe/services/oneClick/types.js +1 -0
- package/dist/providers/stripe/services/paymentIntent/createPaymentIntent.d.ts +5 -0
- package/dist/providers/stripe/services/paymentIntent/createPaymentIntent.js +8 -0
- package/dist/providers/stripe/services/paymentIntent/requests.d.ts +12 -0
- package/dist/providers/stripe/services/paymentIntent/requests.js +15 -0
- package/dist/providers/stripe/services/paymentIntent/types.d.ts +18 -0
- package/dist/providers/stripe/services/paymentIntent/types.js +1 -0
- package/dist/providers/stripe/services/shared/checkout.validator.d.ts +3 -0
- package/dist/providers/stripe/services/shared/checkout.validator.js +15 -0
- package/dist/providers/stripe/services/shared/checkoutMetadata.d.ts +3 -0
- package/dist/providers/stripe/services/shared/checkoutMetadata.js +107 -0
- package/dist/providers/stripe/services/shared/types.d.ts +2 -0
- package/dist/providers/stripe/services/shared/types.js +1 -0
- package/dist/providers/stripe/services/stripe.service.d.ts +29 -221
- package/dist/providers/stripe/services/stripe.service.js +20 -546
- package/dist/providers/stripe/services/stripeClient.d.ts +4 -0
- package/dist/providers/stripe/services/stripeClient.js +19 -0
- package/dist/services/paywallOffer.service.d.ts +1 -1
- package/dist/services/paywallPlans/recurring.d.ts +2 -0
- package/dist/services/paywallPlans/recurring.js +72 -0
- package/dist/services/paywallPlans/selection.d.ts +11 -0
- package/dist/services/paywallPlans/selection.js +144 -0
- package/dist/services/paywallPlans/types.d.ts +39 -0
- package/dist/services/paywallPlans/types.js +1 -0
- package/dist/services/paywallPlans.service.d.ts +10 -0
- package/dist/services/paywallPlans.service.js +8 -0
- package/dist/services/publishedBillingRuntime.service.d.ts +1 -1
- package/dist/services/publishedBillingRuntime.service.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CreatePaymentIntentInput } from './types.js';
|
|
2
|
+
export declare const toPaymentIntentRequest: (input: CreatePaymentIntentInput) => {
|
|
3
|
+
offerSetId: string | undefined;
|
|
4
|
+
offerSetKey: string | undefined;
|
|
5
|
+
planId: string;
|
|
6
|
+
amountCents: number;
|
|
7
|
+
couponId: string | undefined;
|
|
8
|
+
analyticsMetadata: Record<string, unknown> | undefined;
|
|
9
|
+
userId: string | undefined;
|
|
10
|
+
environment: import("@funnelsgrove/runtime").RuntimeMode | undefined;
|
|
11
|
+
runtimeConfig: import("@funnelsgrove/runtime").FunnelSdkRuntimeConfigOverrides | undefined;
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { normalizeAnalyticsMetadata } from '../shared/checkoutMetadata.js';
|
|
2
|
+
export const toPaymentIntentRequest = (input) => {
|
|
3
|
+
var _a, _b, _c, _d;
|
|
4
|
+
return {
|
|
5
|
+
offerSetId: ((_a = input.offerSetId) === null || _a === void 0 ? void 0 : _a.trim()) || undefined,
|
|
6
|
+
offerSetKey: ((_b = input.offerSetKey) === null || _b === void 0 ? void 0 : _b.trim()) || undefined,
|
|
7
|
+
planId: input.planId,
|
|
8
|
+
amountCents: input.amountCents,
|
|
9
|
+
couponId: ((_c = input.couponId) === null || _c === void 0 ? void 0 : _c.trim()) || undefined,
|
|
10
|
+
analyticsMetadata: normalizeAnalyticsMetadata(input.analyticsMetadata),
|
|
11
|
+
userId: ((_d = input.user_id) === null || _d === void 0 ? void 0 : _d.trim()) || undefined,
|
|
12
|
+
environment: input.environment,
|
|
13
|
+
runtimeConfig: input.runtimeConfig,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { RuntimeMode } from '@funnelsgrove/runtime';
|
|
2
|
+
import type { StripeRuntimeConfigOverrides } from '../shared/types.js';
|
|
3
|
+
export type CreatePaymentIntentInput = {
|
|
4
|
+
planId: string;
|
|
5
|
+
offerSetId?: string | null;
|
|
6
|
+
offerSetKey?: string | null;
|
|
7
|
+
amountCents: number;
|
|
8
|
+
couponId?: string | null;
|
|
9
|
+
analyticsMetadata?: Record<string, unknown> | null;
|
|
10
|
+
user_id?: string | null;
|
|
11
|
+
environment?: RuntimeMode;
|
|
12
|
+
runtimeConfig?: StripeRuntimeConfigOverrides;
|
|
13
|
+
};
|
|
14
|
+
export type CreatePaymentIntentResponse = {
|
|
15
|
+
clientSecret: string;
|
|
16
|
+
stripePublishableKey?: string;
|
|
17
|
+
environment?: 'test' | 'live';
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CheckoutSessionPlanInput } from '../../../../services/paywallPlans/types.js';
|
|
2
|
+
export declare const requireCheckoutRecurringConfig: (plan: CheckoutSessionPlanInput) => import("../../../../services/paywallPlans/types.js").CheckoutPlanRecurringConfig;
|
|
3
|
+
export declare const requireCheckoutSessionId: (value: string) => string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { resolveCheckoutPlanRecurringConfig } from '../../../../services/paywallPlans/recurring.js';
|
|
2
|
+
export const requireCheckoutRecurringConfig = (plan) => {
|
|
3
|
+
const recurring = resolveCheckoutPlanRecurringConfig(plan);
|
|
4
|
+
if (!recurring) {
|
|
5
|
+
throw new Error('Unable to resolve the recurring interval for the selected plan');
|
|
6
|
+
}
|
|
7
|
+
return recurring;
|
|
8
|
+
};
|
|
9
|
+
export const requireCheckoutSessionId = (value) => {
|
|
10
|
+
const checkoutSessionId = value.trim();
|
|
11
|
+
if (!checkoutSessionId) {
|
|
12
|
+
throw new Error('checkoutSessionId is required');
|
|
13
|
+
}
|
|
14
|
+
return checkoutSessionId;
|
|
15
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { CheckoutSessionPlanInput } from '../../../../services/paywallPlans/types.js';
|
|
2
|
+
export declare const normalizeAnalyticsMetadata: (metadata: Record<string, unknown> | null | undefined) => Record<string, unknown> | undefined;
|
|
3
|
+
export declare const normalizeCheckoutAnalyticsMetadata: (metadata: Record<string, unknown> | null | undefined, plan: Pick<CheckoutSessionPlanInput, "analyticsPurchaseValue">) => Record<string, unknown> | undefined;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
const isRecord = (value) => {
|
|
2
|
+
return Boolean(value) && typeof value === 'object' && !Array.isArray(value);
|
|
3
|
+
};
|
|
4
|
+
const asTrimmedStringOrNull = (value) => {
|
|
5
|
+
if (typeof value !== 'string') {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return value.trim() || null;
|
|
9
|
+
};
|
|
10
|
+
const asNonNegativeNumberOrNull = (value) => {
|
|
11
|
+
const numeric = typeof value === 'number'
|
|
12
|
+
? value
|
|
13
|
+
: typeof value === 'string' && value.trim()
|
|
14
|
+
? Number(value.trim())
|
|
15
|
+
: null;
|
|
16
|
+
if (numeric === null || !Number.isFinite(numeric) || numeric < 0) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return Math.round(numeric * 100) / 100;
|
|
20
|
+
};
|
|
21
|
+
const SENSITIVE_CHECKOUT_URL_QUERY_KEYS = new Set([
|
|
22
|
+
'customeremail',
|
|
23
|
+
'customer_email',
|
|
24
|
+
'email',
|
|
25
|
+
'fullname',
|
|
26
|
+
'full_name',
|
|
27
|
+
'name',
|
|
28
|
+
'phone',
|
|
29
|
+
'phonenumber',
|
|
30
|
+
'phone_number',
|
|
31
|
+
]);
|
|
32
|
+
const sanitizeCheckoutUrl = (value) => {
|
|
33
|
+
if (typeof value !== 'string') {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
const trimmed = value.trim();
|
|
37
|
+
if (!trimmed) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const parsed = new URL(trimmed, typeof window !== 'undefined' ? window.location.origin : 'https://example.invalid');
|
|
42
|
+
for (const key of Array.from(parsed.searchParams.keys())) {
|
|
43
|
+
if (SENSITIVE_CHECKOUT_URL_QUERY_KEYS.has(key.trim().toLowerCase())) {
|
|
44
|
+
parsed.searchParams.delete(key);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return parsed.toString();
|
|
48
|
+
}
|
|
49
|
+
catch (_a) {
|
|
50
|
+
return trimmed;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const currentCheckoutUrl = () => {
|
|
54
|
+
var _a;
|
|
55
|
+
if (typeof window === 'undefined') {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
return sanitizeCheckoutUrl((_a = window.location) === null || _a === void 0 ? void 0 : _a.href);
|
|
59
|
+
};
|
|
60
|
+
const readMetaCookieValue = (name) => {
|
|
61
|
+
var _a;
|
|
62
|
+
if (typeof document === 'undefined') {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
let cookieHeader;
|
|
66
|
+
try {
|
|
67
|
+
cookieHeader = document.cookie;
|
|
68
|
+
}
|
|
69
|
+
catch (_b) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
const encodedValue = (_a = cookieHeader
|
|
73
|
+
.split(';')
|
|
74
|
+
.map((part) => part.trim())
|
|
75
|
+
.find((part) => part.startsWith(`${name}=`))) === null || _a === void 0 ? void 0 : _a.slice(name.length + 1);
|
|
76
|
+
if (!encodedValue) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const value = decodeURIComponent(encodedValue).trim();
|
|
81
|
+
return value && value.length <= 2048 ? value : undefined;
|
|
82
|
+
}
|
|
83
|
+
catch (_c) {
|
|
84
|
+
const value = encodedValue.trim();
|
|
85
|
+
return value && value.length <= 2048 ? value : undefined;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
export const normalizeAnalyticsMetadata = (metadata) => {
|
|
89
|
+
const normalized = Object.fromEntries(Object.entries(isRecord(metadata) ? metadata : {}).filter(([, value]) => value !== undefined && value !== null && value !== ''));
|
|
90
|
+
const fbc = asTrimmedStringOrNull(normalized.fbc) ||
|
|
91
|
+
asTrimmedStringOrNull(normalized._fbc) ||
|
|
92
|
+
readMetaCookieValue('_fbc');
|
|
93
|
+
const fbp = asTrimmedStringOrNull(normalized.fbp) ||
|
|
94
|
+
asTrimmedStringOrNull(normalized._fbp) ||
|
|
95
|
+
readMetaCookieValue('_fbp');
|
|
96
|
+
const checkoutUrl = sanitizeCheckoutUrl(normalized.url) || currentCheckoutUrl();
|
|
97
|
+
const withCheckoutUrl = Object.assign(Object.assign(Object.assign(Object.assign({}, normalized), (fbc ? { fbc } : {})), (fbp ? { fbp } : {})), (checkoutUrl ? { url: checkoutUrl } : {}));
|
|
98
|
+
return Object.keys(withCheckoutUrl).length > 0 ? withCheckoutUrl : undefined;
|
|
99
|
+
};
|
|
100
|
+
export const normalizeCheckoutAnalyticsMetadata = (metadata, plan) => {
|
|
101
|
+
const normalized = normalizeAnalyticsMetadata(metadata);
|
|
102
|
+
const analyticsPurchaseValue = asNonNegativeNumberOrNull(plan.analyticsPurchaseValue);
|
|
103
|
+
if (analyticsPurchaseValue === null) {
|
|
104
|
+
return normalized;
|
|
105
|
+
}
|
|
106
|
+
return Object.assign(Object.assign({}, (normalized !== null && normalized !== void 0 ? normalized : {})), { analyticsPurchaseValue });
|
|
107
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,221 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
introIterations?: number;
|
|
31
|
-
source: 'stripe' | 'config';
|
|
32
|
-
};
|
|
33
|
-
export type StripeRuntimeConfigOverrides = FunnelSdkRuntimeConfigOverrides;
|
|
34
|
-
export type PaywallPlanResolutionOptions = {
|
|
35
|
-
locale?: string | null;
|
|
36
|
-
pricing?: ResolvedCountryPricing<string> | null;
|
|
37
|
-
};
|
|
38
|
-
export declare function buildConfigPaywallPlans(planCatalog?: BillingPlanCatalog | readonly BillingFallbackPlanConfig[], orderedPlanIds?: readonly string[]): readonly PaywallPlan[];
|
|
39
|
-
export declare function getFallbackPlans(planCatalog?: BillingPlanInputCatalog | readonly BillingFallbackPlanConfig[], options?: PaywallPlanResolutionOptions): readonly PaywallPlan[];
|
|
40
|
-
export declare function getOrderedPaywallPlans(plans: readonly PaywallPlan[], orderedPlanIds: readonly string[]): readonly PaywallPlan[];
|
|
41
|
-
export declare function getDefaultPlanId(plans: readonly PaywallPlan[], pricing?: ResolvedCountryPricing<string> | null): string | null;
|
|
42
|
-
export declare function getPaywallPlanSelectionValue(plan: Pick<PaywallPlan, 'id' | 'providerPlanId'>): string;
|
|
43
|
-
export declare function findPaywallPlan(plans: readonly PaywallPlan[], selectionValue: string | null | undefined): PaywallPlan | null;
|
|
44
|
-
export declare function getDefaultPlanSelectionValue(plans: readonly PaywallPlan[], pricing?: ResolvedCountryPricing<string> | null): string | null;
|
|
45
|
-
export declare function isStripeConfigured(mode: RuntimeMode): boolean;
|
|
46
|
-
export declare function getStripePromise(_mode: RuntimeMode, runtimePublishableKey?: string | null): Promise<Stripe | null> | null;
|
|
47
|
-
type CheckoutSessionPlanInput = Pick<PaywallPlan, 'amountCents' | 'analyticsPurchaseValue' | 'billingInterval' | 'billingIntervalCount' | 'description' | 'funnelPlanKey' | 'id' | 'providerPlanId' | 'title' | 'followUpProviderPlanId' | 'followUpPlanTitle' | 'followUpBillingInterval' | 'followUpBillingIntervalCount' | 'introIterations' | 'offerSetId' | 'offerSetKey'>;
|
|
48
|
-
type CheckoutPlanRecurringConfig = {
|
|
49
|
-
interval: BillingPlanInterval;
|
|
50
|
-
intervalCount: number;
|
|
51
|
-
};
|
|
52
|
-
export declare const resolveCheckoutPlanRecurringConfig: (plan: CheckoutSessionPlanInput) => CheckoutPlanRecurringConfig | null;
|
|
53
|
-
type CreatePaymentIntentInput = {
|
|
54
|
-
planId: string;
|
|
55
|
-
offerSetId?: string | null;
|
|
56
|
-
offerSetKey?: string | null;
|
|
57
|
-
amountCents: number;
|
|
58
|
-
couponId?: string | null;
|
|
59
|
-
analyticsMetadata?: Record<string, unknown> | null;
|
|
60
|
-
user_id?: string | null;
|
|
61
|
-
environment?: RuntimeMode;
|
|
62
|
-
runtimeConfig?: StripeRuntimeConfigOverrides;
|
|
63
|
-
};
|
|
64
|
-
type CreatePaymentIntentResponse = {
|
|
65
|
-
clientSecret: string;
|
|
66
|
-
stripePublishableKey?: string;
|
|
67
|
-
environment?: 'test' | 'live';
|
|
68
|
-
};
|
|
69
|
-
type CreateOneTimeCheckoutInput = {
|
|
70
|
-
plan: CheckoutSessionPlanInput;
|
|
71
|
-
runtimeConfigRevisionId?: string | null;
|
|
72
|
-
paymentProfileId?: string | null;
|
|
73
|
-
provider?: 'stripe' | null;
|
|
74
|
-
anonymousUserId?: string | null;
|
|
75
|
-
idempotencyKey?: string | null;
|
|
76
|
-
couponId?: string | null;
|
|
77
|
-
analyticsMetadata?: Record<string, unknown> | null;
|
|
78
|
-
customerEmail?: string | null;
|
|
79
|
-
returnUrl: string;
|
|
80
|
-
user_id?: string | null;
|
|
81
|
-
environment?: RuntimeMode;
|
|
82
|
-
runtimeConfig?: StripeRuntimeConfigOverrides;
|
|
83
|
-
};
|
|
84
|
-
type CreateOneTimeCheckoutResponse = {
|
|
85
|
-
clientSecret: string;
|
|
86
|
-
checkoutSessionId?: string;
|
|
87
|
-
stripePublishableKey?: string;
|
|
88
|
-
environment?: 'test' | 'live';
|
|
89
|
-
paymentProfileId?: string;
|
|
90
|
-
userId?: string;
|
|
91
|
-
anonymousUserId?: string;
|
|
92
|
-
funnelEndUserId?: string;
|
|
93
|
-
};
|
|
94
|
-
export declare function createStripeOneTimeCheckout(input: CreateOneTimeCheckoutInput): Promise<CreateOneTimeCheckoutResponse>;
|
|
95
|
-
/**
|
|
96
|
-
* @deprecated Use createStripeOneTimeCheckout for one-time paywall checkout.
|
|
97
|
-
*/
|
|
98
|
-
export declare function createStripePaymentIntent(input: CreatePaymentIntentInput): Promise<CreatePaymentIntentResponse>;
|
|
99
|
-
export type ChargeOneClickPaymentInput = {
|
|
100
|
-
planId: string;
|
|
101
|
-
planKey?: string | null;
|
|
102
|
-
offerSetId?: string | null;
|
|
103
|
-
runtimeConfigRevisionId?: string | null;
|
|
104
|
-
paymentProfileId?: string | null;
|
|
105
|
-
provider?: 'stripe' | null;
|
|
106
|
-
providerPlanId?: string | null;
|
|
107
|
-
amountCents: number;
|
|
108
|
-
analyticsMetadata?: Record<string, unknown> | null;
|
|
109
|
-
checkoutSessionId?: string | null;
|
|
110
|
-
currency?: string | null;
|
|
111
|
-
description?: string | null;
|
|
112
|
-
idempotencyKey?: string | null;
|
|
113
|
-
stripeCustomerId?: string | null;
|
|
114
|
-
userId?: string | null;
|
|
115
|
-
/** @deprecated Use stripeCustomerId. */
|
|
116
|
-
stripe_customer_id?: string | null;
|
|
117
|
-
/** @deprecated Use userId. */
|
|
118
|
-
user_id?: string | null;
|
|
119
|
-
environment?: RuntimeMode;
|
|
120
|
-
runtimeConfig?: StripeRuntimeConfigOverrides;
|
|
121
|
-
};
|
|
122
|
-
export type ChargeOneClickPaymentResponse = {
|
|
123
|
-
paymentIntentId: string;
|
|
124
|
-
status: string;
|
|
125
|
-
amountCents?: number;
|
|
126
|
-
clientSecret?: string;
|
|
127
|
-
currency?: string;
|
|
128
|
-
environment?: 'test' | 'live';
|
|
129
|
-
stripePublishableKey?: string;
|
|
130
|
-
};
|
|
131
|
-
export declare function chargeStripeOneClickPayment(input: ChargeOneClickPaymentInput): Promise<ChargeOneClickPaymentResponse>;
|
|
132
|
-
export type CompleteStripeOneClickPaymentInput = ChargeOneClickPaymentInput & {
|
|
133
|
-
returnUrl: string;
|
|
134
|
-
};
|
|
135
|
-
export type CompleteStripeOneClickPaymentResponse = ChargeOneClickPaymentResponse & {
|
|
136
|
-
confirmationAttempted: boolean;
|
|
137
|
-
};
|
|
138
|
-
export declare const requiresStripeOneClickConfirmation: (status: string) => boolean;
|
|
139
|
-
export declare function completeStripeOneClickPayment(input: CompleteStripeOneClickPaymentInput): Promise<CompleteStripeOneClickPaymentResponse>;
|
|
140
|
-
type CreateSubscriptionCheckoutInput = {
|
|
141
|
-
plan: CheckoutSessionPlanInput;
|
|
142
|
-
runtimeConfigRevisionId?: string | null;
|
|
143
|
-
paymentProfileId?: string | null;
|
|
144
|
-
provider?: 'stripe' | null;
|
|
145
|
-
anonymousUserId?: string | null;
|
|
146
|
-
couponId?: string | null;
|
|
147
|
-
analyticsMetadata?: Record<string, unknown> | null;
|
|
148
|
-
customerEmail?: string | null;
|
|
149
|
-
returnUrl: string;
|
|
150
|
-
user_id?: string | null;
|
|
151
|
-
environment?: RuntimeMode;
|
|
152
|
-
runtimeConfig?: StripeRuntimeConfigOverrides;
|
|
153
|
-
};
|
|
154
|
-
type CreateSubscriptionCheckoutResponse = {
|
|
155
|
-
clientSecret: string;
|
|
156
|
-
checkoutSessionId?: string;
|
|
157
|
-
subscriptionId?: string;
|
|
158
|
-
stripePublishableKey?: string;
|
|
159
|
-
environment?: 'test' | 'live';
|
|
160
|
-
paymentProfileId?: string;
|
|
161
|
-
userId?: string;
|
|
162
|
-
anonymousUserId?: string;
|
|
163
|
-
funnelEndUserId?: string;
|
|
164
|
-
};
|
|
165
|
-
type UpdateSubscriptionCheckoutPlanInput = {
|
|
166
|
-
checkoutSessionId: string;
|
|
167
|
-
plan: CheckoutSessionPlanInput;
|
|
168
|
-
runtimeConfigRevisionId?: string | null;
|
|
169
|
-
paymentProfileId?: string | null;
|
|
170
|
-
provider?: 'stripe' | null;
|
|
171
|
-
couponId?: string | null;
|
|
172
|
-
analyticsMetadata?: Record<string, unknown> | null;
|
|
173
|
-
customerEmail?: string | null;
|
|
174
|
-
user_id?: string | null;
|
|
175
|
-
environment?: RuntimeMode;
|
|
176
|
-
runtimeConfig?: StripeRuntimeConfigOverrides;
|
|
177
|
-
};
|
|
178
|
-
type UpdateSubscriptionCheckoutPlanResponse = {
|
|
179
|
-
checkoutSessionId: string;
|
|
180
|
-
environment?: 'test' | 'live';
|
|
181
|
-
};
|
|
182
|
-
export type VerifySubscriptionCheckoutPaymentInput = {
|
|
183
|
-
checkoutSessionId: string;
|
|
184
|
-
environment?: RuntimeMode;
|
|
185
|
-
runtimeConfig?: StripeRuntimeConfigOverrides;
|
|
186
|
-
};
|
|
187
|
-
export type VerifySubscriptionCheckoutPaymentResponse = {
|
|
188
|
-
checkoutSessionId: string;
|
|
189
|
-
paid: boolean;
|
|
190
|
-
paymentStatus?: string | null;
|
|
191
|
-
status?: string | null;
|
|
192
|
-
environment?: 'test' | 'live';
|
|
193
|
-
analyticsMetadata?: Record<string, unknown>;
|
|
194
|
-
};
|
|
195
|
-
export declare function createStripeSubscriptionCheckout(input: CreateSubscriptionCheckoutInput): Promise<CreateSubscriptionCheckoutResponse>;
|
|
196
|
-
export declare function updateStripeSubscriptionCheckoutPlan(input: UpdateSubscriptionCheckoutPlanInput): Promise<UpdateSubscriptionCheckoutPlanResponse>;
|
|
197
|
-
export declare function verifyStripeSubscriptionCheckoutPayment(input: VerifySubscriptionCheckoutPaymentInput): Promise<VerifySubscriptionCheckoutPaymentResponse>;
|
|
198
|
-
type CreateCheckoutSessionInput = {
|
|
199
|
-
plan: CheckoutSessionPlanInput;
|
|
200
|
-
successUrl: string;
|
|
201
|
-
cancelUrl: string;
|
|
202
|
-
couponId?: string | null;
|
|
203
|
-
analyticsMetadata?: Record<string, unknown> | null;
|
|
204
|
-
customerEmail?: string | null;
|
|
205
|
-
user_id?: string | null;
|
|
206
|
-
environment?: RuntimeMode;
|
|
207
|
-
runtimeConfig?: StripeRuntimeConfigOverrides;
|
|
208
|
-
};
|
|
209
|
-
type CreateCheckoutSessionResponse = {
|
|
210
|
-
sessionId?: string;
|
|
211
|
-
url: string;
|
|
212
|
-
stripePublishableKey?: string;
|
|
213
|
-
environment?: 'test' | 'live';
|
|
214
|
-
paymentProfileId?: string;
|
|
215
|
-
userId?: string;
|
|
216
|
-
anonymousUserId?: string;
|
|
217
|
-
funnelEndUserId?: string;
|
|
218
|
-
};
|
|
219
|
-
export declare function createStripeCheckoutSession(input: CreateCheckoutSessionInput): Promise<CreateCheckoutSessionResponse>;
|
|
220
|
-
export declare function redirectToStripeCheckout(input: CreateCheckoutSessionInput): Promise<string>;
|
|
221
|
-
export {};
|
|
1
|
+
export type { PaywallPlan } from '../../../services/paywallPlans/types.js';
|
|
2
|
+
export type { StripeRuntimeConfigOverrides } from './shared/types.js';
|
|
3
|
+
export type { PaywallPlanResolutionOptions } from '../../../services/paywallPlans/types.js';
|
|
4
|
+
export { buildConfigPaywallPlans } from '../../../services/paywallPlans/selection.js';
|
|
5
|
+
export { getFallbackPlans } from '../../../services/paywallPlans/selection.js';
|
|
6
|
+
export { getOrderedPaywallPlans } from '../../../services/paywallPlans/selection.js';
|
|
7
|
+
export { getDefaultPlanId } from '../../../services/paywallPlans/selection.js';
|
|
8
|
+
export { getPaywallPlanSelectionValue } from '../../../services/paywallPlans/selection.js';
|
|
9
|
+
export { findPaywallPlan } from '../../../services/paywallPlans/selection.js';
|
|
10
|
+
export { getDefaultPlanSelectionValue } from '../../../services/paywallPlans/selection.js';
|
|
11
|
+
export { isStripeConfigured } from './stripeClient.js';
|
|
12
|
+
export { getStripePromise } from './stripeClient.js';
|
|
13
|
+
export { resolveCheckoutPlanRecurringConfig } from '../../../services/paywallPlans/recurring.js';
|
|
14
|
+
export { createStripeOneTimeCheckout } from './checkout/createOneTimeCheckout.js';
|
|
15
|
+
export { createStripePaymentIntent } from './paymentIntent/createPaymentIntent.js';
|
|
16
|
+
export type { ChargeOneClickPaymentInput } from './oneClick/types.js';
|
|
17
|
+
export type { ChargeOneClickPaymentResponse } from './oneClick/types.js';
|
|
18
|
+
export { chargeStripeOneClickPayment } from './oneClick/chargePayment.js';
|
|
19
|
+
export type { CompleteStripeOneClickPaymentInput } from './oneClick/types.js';
|
|
20
|
+
export type { CompleteStripeOneClickPaymentResponse } from './oneClick/types.js';
|
|
21
|
+
export { requiresStripeOneClickConfirmation } from './oneClick/completePayment.js';
|
|
22
|
+
export { completeStripeOneClickPayment } from './oneClick/completePayment.js';
|
|
23
|
+
export type { VerifySubscriptionCheckoutPaymentInput } from './checkout/types.js';
|
|
24
|
+
export type { VerifySubscriptionCheckoutPaymentResponse } from './checkout/types.js';
|
|
25
|
+
export { createStripeSubscriptionCheckout } from './checkout/createSubscriptionCheckout.js';
|
|
26
|
+
export { updateStripeSubscriptionCheckoutPlan } from './checkout/updateSubscriptionCheckoutPlan.js';
|
|
27
|
+
export { verifyStripeSubscriptionCheckoutPayment } from './checkout/verifySubscriptionCheckoutPayment.js';
|
|
28
|
+
export { createStripeCheckoutSession } from './hostedCheckout/createCheckoutSession.js';
|
|
29
|
+
export { redirectToStripeCheckout } from './hostedCheckout/redirectToCheckout.js';
|