@funnelsgrove/runtime 0.1.53 → 0.1.54
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.
|
@@ -98,6 +98,26 @@ export type FunnelSdkCreateSubscriptionCheckoutResponse = {
|
|
|
98
98
|
stripePublishableKey?: string;
|
|
99
99
|
environment?: FunnelSdkRuntimeMode;
|
|
100
100
|
};
|
|
101
|
+
export type FunnelSdkCreateOneTimeCheckoutInput = {
|
|
102
|
+
planId: string;
|
|
103
|
+
amountCents: number;
|
|
104
|
+
returnUrl: string;
|
|
105
|
+
analyticsMetadata?: Record<string, unknown> | null;
|
|
106
|
+
couponId?: string | null;
|
|
107
|
+
customerEmail?: string | null;
|
|
108
|
+
description?: string | null;
|
|
109
|
+
environment?: FunnelSdkRuntimeMode;
|
|
110
|
+
providerPlanId?: string | null;
|
|
111
|
+
runtimeConfig?: FunnelSdkRuntimeConfigOverrides;
|
|
112
|
+
title?: string | null;
|
|
113
|
+
userId?: string | null;
|
|
114
|
+
};
|
|
115
|
+
export type FunnelSdkCreateOneTimeCheckoutResponse = {
|
|
116
|
+
clientSecret: string;
|
|
117
|
+
checkoutSessionId?: string;
|
|
118
|
+
stripePublishableKey?: string;
|
|
119
|
+
environment?: FunnelSdkRuntimeMode;
|
|
120
|
+
};
|
|
101
121
|
export type FunnelSdkUpdateSubscriptionCheckoutPlanInput = {
|
|
102
122
|
checkoutSessionId: string;
|
|
103
123
|
planId: string;
|
|
@@ -131,6 +151,9 @@ export type FunnelSdkVerifySubscriptionCheckoutResponse = {
|
|
|
131
151
|
environment?: FunnelSdkRuntimeMode;
|
|
132
152
|
analyticsMetadata?: Record<string, unknown>;
|
|
133
153
|
};
|
|
154
|
+
/**
|
|
155
|
+
* @deprecated Use FunnelSdkCreateOneTimeCheckoutInput for one-time paywall checkout.
|
|
156
|
+
*/
|
|
134
157
|
export type FunnelSdkCreateOneTimePaymentIntentInput = {
|
|
135
158
|
planId: string;
|
|
136
159
|
amountCents: number;
|
|
@@ -140,6 +163,9 @@ export type FunnelSdkCreateOneTimePaymentIntentInput = {
|
|
|
140
163
|
runtimeConfig?: FunnelSdkRuntimeConfigOverrides;
|
|
141
164
|
userId?: string | null;
|
|
142
165
|
};
|
|
166
|
+
/**
|
|
167
|
+
* @deprecated Use FunnelSdkCreateOneTimeCheckoutResponse for one-time paywall checkout.
|
|
168
|
+
*/
|
|
143
169
|
export type FunnelSdkCreateOneTimePaymentIntentResponse = {
|
|
144
170
|
clientSecret: string;
|
|
145
171
|
stripePublishableKey?: string;
|
|
@@ -196,8 +222,12 @@ declare class FunnelSdkService {
|
|
|
196
222
|
}): Promise<FunnelSdkListPaymentPlansResponse>;
|
|
197
223
|
createHostedCheckoutSession(input: FunnelSdkCreateHostedCheckoutSessionInput): Promise<FunnelSdkCreateHostedCheckoutSessionResponse>;
|
|
198
224
|
createSubscriptionCheckout(input: FunnelSdkCreateSubscriptionCheckoutInput): Promise<FunnelSdkCreateSubscriptionCheckoutResponse>;
|
|
225
|
+
createOneTimeCheckout(input: FunnelSdkCreateOneTimeCheckoutInput): Promise<FunnelSdkCreateOneTimeCheckoutResponse>;
|
|
199
226
|
updateSubscriptionCheckoutPlan(input: FunnelSdkUpdateSubscriptionCheckoutPlanInput): Promise<FunnelSdkUpdateSubscriptionCheckoutPlanResponse>;
|
|
200
227
|
verifySubscriptionCheckout(input: FunnelSdkVerifySubscriptionCheckoutInput): Promise<FunnelSdkVerifySubscriptionCheckoutResponse>;
|
|
228
|
+
/**
|
|
229
|
+
* @deprecated Use createOneTimeCheckout for one-time paywall checkout.
|
|
230
|
+
*/
|
|
201
231
|
createOneTimePaymentIntent(input: FunnelSdkCreateOneTimePaymentIntentInput): Promise<FunnelSdkCreateOneTimePaymentIntentResponse>;
|
|
202
232
|
chargeOneClickPayment(input: FunnelSdkChargeOneClickPaymentInput): Promise<FunnelSdkChargeOneClickPaymentResponse>;
|
|
203
233
|
updateSubscription<ResponsePayload>(input: FunnelSdkUpdateSubscriptionInput): Promise<ResponsePayload>;
|
|
@@ -226,6 +226,25 @@ class FunnelSdkService {
|
|
|
226
226
|
errorMessage: 'Unable to create subscription checkout',
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
|
+
async createOneTimeCheckout(input) {
|
|
230
|
+
return this.postJson('/sdk/public/payments/one-time-checkout', {
|
|
231
|
+
runtimeConfig: input.runtimeConfig,
|
|
232
|
+
body: {
|
|
233
|
+
planId: input.planId,
|
|
234
|
+
providerPlanId: input.providerPlanId,
|
|
235
|
+
title: input.title,
|
|
236
|
+
description: input.description,
|
|
237
|
+
amountCents: input.amountCents,
|
|
238
|
+
couponId: input.couponId,
|
|
239
|
+
analyticsMetadata: input.analyticsMetadata,
|
|
240
|
+
customerEmail: input.customerEmail,
|
|
241
|
+
returnUrl: input.returnUrl,
|
|
242
|
+
user_id: input.userId,
|
|
243
|
+
environment: input.environment,
|
|
244
|
+
},
|
|
245
|
+
errorMessage: 'Unable to create one-time checkout',
|
|
246
|
+
});
|
|
247
|
+
}
|
|
229
248
|
async updateSubscriptionCheckoutPlan(input) {
|
|
230
249
|
return this.postJson('/sdk/public/payments/subscriptions/update-plan', {
|
|
231
250
|
runtimeConfig: input.runtimeConfig,
|
|
@@ -257,6 +276,9 @@ class FunnelSdkService {
|
|
|
257
276
|
errorMessage: 'Unable to verify subscription checkout',
|
|
258
277
|
});
|
|
259
278
|
}
|
|
279
|
+
/**
|
|
280
|
+
* @deprecated Use createOneTimeCheckout for one-time paywall checkout.
|
|
281
|
+
*/
|
|
260
282
|
async createOneTimePaymentIntent(input) {
|
|
261
283
|
return this.postJson('/sdk/public/payments/intents', {
|
|
262
284
|
runtimeConfig: input.runtimeConfig,
|