@tickean/checkout-js 0.2.0 → 0.2.11
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/dist/index.d.mts +174 -3
- package/dist/index.d.ts +174 -3
- package/dist/index.js +4057 -192
- package/dist/index.mjs +4062 -179
- package/package.json +6 -3
package/dist/index.d.mts
CHANGED
|
@@ -67,6 +67,23 @@ type CheckoutSession = {
|
|
|
67
67
|
nextAction?: NextAction;
|
|
68
68
|
returnUrl?: string | null;
|
|
69
69
|
};
|
|
70
|
+
type PromotionNxM = {
|
|
71
|
+
enabled?: boolean;
|
|
72
|
+
buyQty?: number;
|
|
73
|
+
payQty?: number;
|
|
74
|
+
label?: string;
|
|
75
|
+
startsAt?: string;
|
|
76
|
+
endsAt?: string;
|
|
77
|
+
};
|
|
78
|
+
type QuantityDiscount = {
|
|
79
|
+
enabled?: boolean;
|
|
80
|
+
type?: "SECOND_UNIT_PERCENT" | "NTH_UNIT_PERCENT" | string;
|
|
81
|
+
targetUnit?: number;
|
|
82
|
+
percentOff?: number;
|
|
83
|
+
label?: string;
|
|
84
|
+
startsAt?: string;
|
|
85
|
+
endsAt?: string;
|
|
86
|
+
};
|
|
70
87
|
type PublicShowOption = {
|
|
71
88
|
id: string;
|
|
72
89
|
name?: string;
|
|
@@ -74,15 +91,20 @@ type PublicShowOption = {
|
|
|
74
91
|
price: number;
|
|
75
92
|
currency?: string;
|
|
76
93
|
stock?: number;
|
|
94
|
+
sold?: number;
|
|
95
|
+
reserved?: number;
|
|
96
|
+
availableStock?: number;
|
|
77
97
|
maxPerPurchase?: number;
|
|
78
98
|
optionType?: string;
|
|
79
99
|
accessScope?: string;
|
|
80
100
|
coveredShowIds?: string[];
|
|
81
101
|
passIssuanceMode?: "PER_DAY" | "SINGLE_PASS";
|
|
82
102
|
catalogVisibility?: "PUBLIC" | "PROMO_GATED";
|
|
83
|
-
promotionNxM?:
|
|
84
|
-
quantityDiscount?:
|
|
103
|
+
promotionNxM?: PromotionNxM | null;
|
|
104
|
+
quantityDiscount?: QuantityDiscount | null;
|
|
85
105
|
status?: string;
|
|
106
|
+
/** Present on options returned via promo unlock. */
|
|
107
|
+
showId?: string;
|
|
86
108
|
};
|
|
87
109
|
type PublicShow = {
|
|
88
110
|
id: string;
|
|
@@ -91,6 +113,32 @@ type PublicShow = {
|
|
|
91
113
|
endDate?: string;
|
|
92
114
|
showOptions: PublicShowOption[];
|
|
93
115
|
};
|
|
116
|
+
type RegistrationQuestion = {
|
|
117
|
+
id: string;
|
|
118
|
+
type?: string;
|
|
119
|
+
label?: string;
|
|
120
|
+
required?: boolean;
|
|
121
|
+
options?: string[];
|
|
122
|
+
};
|
|
123
|
+
type RegistrationSettings = {
|
|
124
|
+
maxAttendeesPerPurchase?: number;
|
|
125
|
+
requireAttendeeEmail?: boolean;
|
|
126
|
+
requireAttendeePhone?: boolean;
|
|
127
|
+
terms?: {
|
|
128
|
+
required?: boolean;
|
|
129
|
+
label?: string | null;
|
|
130
|
+
pdfUrl?: string | null;
|
|
131
|
+
} | null;
|
|
132
|
+
questions?: RegistrationQuestion[];
|
|
133
|
+
};
|
|
134
|
+
type PurchaseAttendee = {
|
|
135
|
+
showOptionId: string;
|
|
136
|
+
firstName?: string;
|
|
137
|
+
lastName?: string;
|
|
138
|
+
email?: string;
|
|
139
|
+
phone?: string;
|
|
140
|
+
termsAccepted?: boolean;
|
|
141
|
+
};
|
|
94
142
|
type PublicEvent = {
|
|
95
143
|
id: string;
|
|
96
144
|
slug: string;
|
|
@@ -99,6 +147,9 @@ type PublicEvent = {
|
|
|
99
147
|
images?: unknown[];
|
|
100
148
|
location?: unknown;
|
|
101
149
|
availablePaymentMethods?: string[];
|
|
150
|
+
hasPromoGatedShowOptions?: boolean;
|
|
151
|
+
collectAttendeeData?: boolean;
|
|
152
|
+
registrationSettings?: RegistrationSettings | null;
|
|
102
153
|
organization?: {
|
|
103
154
|
id?: string;
|
|
104
155
|
slug?: string;
|
|
@@ -116,6 +167,7 @@ type QuoteResult = {
|
|
|
116
167
|
totalPrice: number;
|
|
117
168
|
pricingBreakdown?: unknown;
|
|
118
169
|
discountCode?: unknown;
|
|
170
|
+
message?: string;
|
|
119
171
|
unlockedShowOptionIds?: string[];
|
|
120
172
|
unlockedShowOptions?: PublicShowOption[];
|
|
121
173
|
};
|
|
@@ -200,6 +252,25 @@ declare function createTickean(options: CreateTickeanOptions): {
|
|
|
200
252
|
eventSlug: string;
|
|
201
253
|
returnUrl?: string;
|
|
202
254
|
}): Promise<CheckoutSession>;
|
|
255
|
+
exchangeRecovery(params: {
|
|
256
|
+
code: string;
|
|
257
|
+
}): Promise<{
|
|
258
|
+
sessionId: string;
|
|
259
|
+
sessionToken: string;
|
|
260
|
+
expiresAt: string;
|
|
261
|
+
suggestedStep?: string | number;
|
|
262
|
+
event: PublicEvent;
|
|
263
|
+
capabilities?: Record<string, boolean>;
|
|
264
|
+
cart: CartItem[];
|
|
265
|
+
discountCode?: string | null;
|
|
266
|
+
buyer?: Buyer | null;
|
|
267
|
+
buyerVerified?: boolean;
|
|
268
|
+
purchase?: PurchaseResult["purchase"] | null;
|
|
269
|
+
payment?: PaymentResult | null;
|
|
270
|
+
nextAction?: NextAction;
|
|
271
|
+
shoppingCartReference?: string | null;
|
|
272
|
+
phase?: string;
|
|
273
|
+
}>;
|
|
203
274
|
getSession(): Promise<CheckoutSession>;
|
|
204
275
|
getCatalog(): Promise<PublicEvent>;
|
|
205
276
|
quote(params: {
|
|
@@ -207,6 +278,17 @@ declare function createTickean(options: CreateTickeanOptions): {
|
|
|
207
278
|
discountCode?: string;
|
|
208
279
|
showId?: string;
|
|
209
280
|
}): Promise<QuoteResult>;
|
|
281
|
+
lookupBuyer(params: {
|
|
282
|
+
phone: string;
|
|
283
|
+
}): Promise<{
|
|
284
|
+
exists: boolean;
|
|
285
|
+
buyer?: {
|
|
286
|
+
id: string;
|
|
287
|
+
phone: string;
|
|
288
|
+
name?: string;
|
|
289
|
+
email?: string;
|
|
290
|
+
};
|
|
291
|
+
}>;
|
|
210
292
|
sendOtp(params: {
|
|
211
293
|
phone: string;
|
|
212
294
|
channel?: string;
|
|
@@ -226,6 +308,7 @@ declare function createTickean(options: CreateTickeanOptions): {
|
|
|
226
308
|
expectedTotal?: number;
|
|
227
309
|
shoppingCartReference?: string;
|
|
228
310
|
idempotencyKey?: string;
|
|
311
|
+
attendees?: PurchaseAttendee[];
|
|
229
312
|
}): Promise<PurchaseResult>;
|
|
230
313
|
createPayment(params: {
|
|
231
314
|
orderId: string;
|
|
@@ -296,6 +379,9 @@ type CheckoutAction = {
|
|
|
296
379
|
} | {
|
|
297
380
|
type: "SET_EVENT";
|
|
298
381
|
event: PublicEvent;
|
|
382
|
+
} | {
|
|
383
|
+
type: "MERGE_UNLOCKED_OPTIONS";
|
|
384
|
+
options: PublicShowOption[];
|
|
299
385
|
} | {
|
|
300
386
|
type: "PURCHASE_START";
|
|
301
387
|
} | {
|
|
@@ -310,6 +396,8 @@ type CheckoutAction = {
|
|
|
310
396
|
type: "SET_NEXT_ACTION";
|
|
311
397
|
nextAction: NextAction;
|
|
312
398
|
payment?: PaymentResult | null;
|
|
399
|
+
} | {
|
|
400
|
+
type: "RESET_PAYMENT_FLOW";
|
|
313
401
|
} | {
|
|
314
402
|
type: "PROCESSING";
|
|
315
403
|
} | {
|
|
@@ -332,6 +420,8 @@ declare function checkoutReducer(state: CheckoutState, action: CheckoutAction):
|
|
|
332
420
|
type CreateCheckoutControllerOptions = CreateTickeanOptions & {
|
|
333
421
|
eventSlug: string;
|
|
334
422
|
returnUrl?: string;
|
|
423
|
+
/** Abandonment recovery code from `?resume=` deep link. */
|
|
424
|
+
resumeCode?: string;
|
|
335
425
|
quoteDebounceMs?: number;
|
|
336
426
|
persistence?: PersistenceAdapter | false;
|
|
337
427
|
persistenceKey?: string;
|
|
@@ -344,6 +434,25 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
344
434
|
eventSlug: string;
|
|
345
435
|
returnUrl?: string;
|
|
346
436
|
}): Promise<CheckoutSession>;
|
|
437
|
+
exchangeRecovery(params: {
|
|
438
|
+
code: string;
|
|
439
|
+
}): Promise<{
|
|
440
|
+
sessionId: string;
|
|
441
|
+
sessionToken: string;
|
|
442
|
+
expiresAt: string;
|
|
443
|
+
suggestedStep?: string | number;
|
|
444
|
+
event: PublicEvent;
|
|
445
|
+
capabilities?: Record<string, boolean>;
|
|
446
|
+
cart: CartItem[];
|
|
447
|
+
discountCode?: string | null;
|
|
448
|
+
buyer?: Buyer | null;
|
|
449
|
+
buyerVerified?: boolean;
|
|
450
|
+
purchase?: PurchaseResult["purchase"] | null;
|
|
451
|
+
payment?: PaymentResult | null;
|
|
452
|
+
nextAction?: NextAction;
|
|
453
|
+
shoppingCartReference?: string | null;
|
|
454
|
+
phase?: string;
|
|
455
|
+
}>;
|
|
347
456
|
getSession(): Promise<CheckoutSession>;
|
|
348
457
|
getCatalog(): Promise<PublicEvent>;
|
|
349
458
|
quote(params: {
|
|
@@ -351,6 +460,17 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
351
460
|
discountCode?: string;
|
|
352
461
|
showId?: string;
|
|
353
462
|
}): Promise<QuoteResult>;
|
|
463
|
+
lookupBuyer(params: {
|
|
464
|
+
phone: string;
|
|
465
|
+
}): Promise<{
|
|
466
|
+
exists: boolean;
|
|
467
|
+
buyer?: {
|
|
468
|
+
id: string;
|
|
469
|
+
phone: string;
|
|
470
|
+
name?: string;
|
|
471
|
+
email?: string;
|
|
472
|
+
};
|
|
473
|
+
}>;
|
|
354
474
|
sendOtp(params: {
|
|
355
475
|
phone: string;
|
|
356
476
|
channel?: string;
|
|
@@ -370,6 +490,7 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
370
490
|
expectedTotal?: number;
|
|
371
491
|
shoppingCartReference?: string;
|
|
372
492
|
idempotencyKey?: string;
|
|
493
|
+
attendees?: PurchaseAttendee[];
|
|
373
494
|
}): Promise<PurchaseResult>;
|
|
374
495
|
createPayment(params: {
|
|
375
496
|
orderId: string;
|
|
@@ -397,6 +518,15 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
397
518
|
setCartItem: (showOptionId: string, amount: number) => void;
|
|
398
519
|
setCart: (cart: CartItem[]) => void;
|
|
399
520
|
applyDiscountCode: (code: string) => Promise<QuoteResult>;
|
|
521
|
+
lookupBuyer: (phone: string) => Promise<{
|
|
522
|
+
exists: boolean;
|
|
523
|
+
buyer?: {
|
|
524
|
+
id: string;
|
|
525
|
+
phone: string;
|
|
526
|
+
name?: string;
|
|
527
|
+
email?: string;
|
|
528
|
+
};
|
|
529
|
+
}>;
|
|
400
530
|
sendOtp: (phone: string, channel?: string) => Promise<void>;
|
|
401
531
|
verifyOtp: (params: {
|
|
402
532
|
phone: string;
|
|
@@ -410,11 +540,13 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
410
540
|
discountCode?: string;
|
|
411
541
|
showId?: string;
|
|
412
542
|
idempotencyKey?: string;
|
|
543
|
+
attendees?: PurchaseAttendee[];
|
|
413
544
|
}) => Promise<{
|
|
414
545
|
purchaseId: string;
|
|
415
546
|
payment: PaymentResult;
|
|
416
547
|
nextAction: NextAction;
|
|
417
548
|
}>;
|
|
549
|
+
changePaymentMethod: () => void;
|
|
418
550
|
confirmPayment: (params?: {
|
|
419
551
|
paymentId?: string;
|
|
420
552
|
confirmationToken?: string;
|
|
@@ -443,4 +575,43 @@ declare function createEventEmitterTelemetry(listeners?: TelemetryListener[]): T
|
|
|
443
575
|
subscribe(listener: TelemetryListener): () => void;
|
|
444
576
|
};
|
|
445
577
|
|
|
446
|
-
|
|
578
|
+
type PaymentSocketSnapshot = {
|
|
579
|
+
purchaseId?: string;
|
|
580
|
+
orderId?: string;
|
|
581
|
+
paymentId?: string;
|
|
582
|
+
status?: string;
|
|
583
|
+
amount?: number;
|
|
584
|
+
currency?: string;
|
|
585
|
+
};
|
|
586
|
+
type PaymentSocketWatchHandle = {
|
|
587
|
+
promise: Promise<PaymentSocketSnapshot>;
|
|
588
|
+
dispose: () => void;
|
|
589
|
+
get connected(): boolean;
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* Join the legacy cart payment room (same as ecommerce) and resolve when
|
|
593
|
+
* payment:confirmed arrives. HTTP polling remains the fallback.
|
|
594
|
+
*/
|
|
595
|
+
declare function watchPaymentSocket(params: {
|
|
596
|
+
apiBaseUrl: string;
|
|
597
|
+
shoppingCartReference: string;
|
|
598
|
+
purchaseId?: string;
|
|
599
|
+
signal?: AbortSignal;
|
|
600
|
+
timeoutMs?: number;
|
|
601
|
+
}): PaymentSocketWatchHandle;
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Navigate the top-level browsing context (breaks out of iframes).
|
|
605
|
+
* Used for Mercado Pago hosted checkout so payment is not trapped in embeds.
|
|
606
|
+
*/
|
|
607
|
+
declare function navigateTopLevel(url: string): void;
|
|
608
|
+
declare function resolveRedirectUrl(params: {
|
|
609
|
+
nextAction?: {
|
|
610
|
+
type: string;
|
|
611
|
+
url?: string;
|
|
612
|
+
} | null;
|
|
613
|
+
redirectUrl?: string | null;
|
|
614
|
+
initPoint?: string | null;
|
|
615
|
+
}): string | null;
|
|
616
|
+
|
|
617
|
+
export { type Buyer, type CartItem, type CheckoutAction, type CheckoutController, type CheckoutPhase, type CheckoutSession, type CheckoutState, type CheckoutTransport, type CreateCheckoutControllerOptions, type CreateTickeanOptions, type NextAction, type PaymentResult, type PaymentSocketSnapshot, type PaymentSocketWatchHandle, type PaymentStatusResult, type PersistedCheckoutState, type PersistenceAdapter, type PromotionNxM, type PublicEvent, type PublicShow, type PublicShowOption, type PurchaseAttendee, type PurchaseResult, type QuantityDiscount, type QuoteResult, type RegistrationQuestion, type RegistrationSettings, type TelemetryAdapter, type TelemetryEvent, type TelemetryListener, type TickeanClient, TickeanError, type TickeanErrorPayload, checkoutReducer, createCheckoutController, createEventEmitterTelemetry, createInitialState, createMemoryPersistence, createNoopTelemetry, createSessionStoragePersistence, createTickean, navigateTopLevel, resolveRedirectUrl, watchPaymentSocket };
|
package/dist/index.d.ts
CHANGED
|
@@ -67,6 +67,23 @@ type CheckoutSession = {
|
|
|
67
67
|
nextAction?: NextAction;
|
|
68
68
|
returnUrl?: string | null;
|
|
69
69
|
};
|
|
70
|
+
type PromotionNxM = {
|
|
71
|
+
enabled?: boolean;
|
|
72
|
+
buyQty?: number;
|
|
73
|
+
payQty?: number;
|
|
74
|
+
label?: string;
|
|
75
|
+
startsAt?: string;
|
|
76
|
+
endsAt?: string;
|
|
77
|
+
};
|
|
78
|
+
type QuantityDiscount = {
|
|
79
|
+
enabled?: boolean;
|
|
80
|
+
type?: "SECOND_UNIT_PERCENT" | "NTH_UNIT_PERCENT" | string;
|
|
81
|
+
targetUnit?: number;
|
|
82
|
+
percentOff?: number;
|
|
83
|
+
label?: string;
|
|
84
|
+
startsAt?: string;
|
|
85
|
+
endsAt?: string;
|
|
86
|
+
};
|
|
70
87
|
type PublicShowOption = {
|
|
71
88
|
id: string;
|
|
72
89
|
name?: string;
|
|
@@ -74,15 +91,20 @@ type PublicShowOption = {
|
|
|
74
91
|
price: number;
|
|
75
92
|
currency?: string;
|
|
76
93
|
stock?: number;
|
|
94
|
+
sold?: number;
|
|
95
|
+
reserved?: number;
|
|
96
|
+
availableStock?: number;
|
|
77
97
|
maxPerPurchase?: number;
|
|
78
98
|
optionType?: string;
|
|
79
99
|
accessScope?: string;
|
|
80
100
|
coveredShowIds?: string[];
|
|
81
101
|
passIssuanceMode?: "PER_DAY" | "SINGLE_PASS";
|
|
82
102
|
catalogVisibility?: "PUBLIC" | "PROMO_GATED";
|
|
83
|
-
promotionNxM?:
|
|
84
|
-
quantityDiscount?:
|
|
103
|
+
promotionNxM?: PromotionNxM | null;
|
|
104
|
+
quantityDiscount?: QuantityDiscount | null;
|
|
85
105
|
status?: string;
|
|
106
|
+
/** Present on options returned via promo unlock. */
|
|
107
|
+
showId?: string;
|
|
86
108
|
};
|
|
87
109
|
type PublicShow = {
|
|
88
110
|
id: string;
|
|
@@ -91,6 +113,32 @@ type PublicShow = {
|
|
|
91
113
|
endDate?: string;
|
|
92
114
|
showOptions: PublicShowOption[];
|
|
93
115
|
};
|
|
116
|
+
type RegistrationQuestion = {
|
|
117
|
+
id: string;
|
|
118
|
+
type?: string;
|
|
119
|
+
label?: string;
|
|
120
|
+
required?: boolean;
|
|
121
|
+
options?: string[];
|
|
122
|
+
};
|
|
123
|
+
type RegistrationSettings = {
|
|
124
|
+
maxAttendeesPerPurchase?: number;
|
|
125
|
+
requireAttendeeEmail?: boolean;
|
|
126
|
+
requireAttendeePhone?: boolean;
|
|
127
|
+
terms?: {
|
|
128
|
+
required?: boolean;
|
|
129
|
+
label?: string | null;
|
|
130
|
+
pdfUrl?: string | null;
|
|
131
|
+
} | null;
|
|
132
|
+
questions?: RegistrationQuestion[];
|
|
133
|
+
};
|
|
134
|
+
type PurchaseAttendee = {
|
|
135
|
+
showOptionId: string;
|
|
136
|
+
firstName?: string;
|
|
137
|
+
lastName?: string;
|
|
138
|
+
email?: string;
|
|
139
|
+
phone?: string;
|
|
140
|
+
termsAccepted?: boolean;
|
|
141
|
+
};
|
|
94
142
|
type PublicEvent = {
|
|
95
143
|
id: string;
|
|
96
144
|
slug: string;
|
|
@@ -99,6 +147,9 @@ type PublicEvent = {
|
|
|
99
147
|
images?: unknown[];
|
|
100
148
|
location?: unknown;
|
|
101
149
|
availablePaymentMethods?: string[];
|
|
150
|
+
hasPromoGatedShowOptions?: boolean;
|
|
151
|
+
collectAttendeeData?: boolean;
|
|
152
|
+
registrationSettings?: RegistrationSettings | null;
|
|
102
153
|
organization?: {
|
|
103
154
|
id?: string;
|
|
104
155
|
slug?: string;
|
|
@@ -116,6 +167,7 @@ type QuoteResult = {
|
|
|
116
167
|
totalPrice: number;
|
|
117
168
|
pricingBreakdown?: unknown;
|
|
118
169
|
discountCode?: unknown;
|
|
170
|
+
message?: string;
|
|
119
171
|
unlockedShowOptionIds?: string[];
|
|
120
172
|
unlockedShowOptions?: PublicShowOption[];
|
|
121
173
|
};
|
|
@@ -200,6 +252,25 @@ declare function createTickean(options: CreateTickeanOptions): {
|
|
|
200
252
|
eventSlug: string;
|
|
201
253
|
returnUrl?: string;
|
|
202
254
|
}): Promise<CheckoutSession>;
|
|
255
|
+
exchangeRecovery(params: {
|
|
256
|
+
code: string;
|
|
257
|
+
}): Promise<{
|
|
258
|
+
sessionId: string;
|
|
259
|
+
sessionToken: string;
|
|
260
|
+
expiresAt: string;
|
|
261
|
+
suggestedStep?: string | number;
|
|
262
|
+
event: PublicEvent;
|
|
263
|
+
capabilities?: Record<string, boolean>;
|
|
264
|
+
cart: CartItem[];
|
|
265
|
+
discountCode?: string | null;
|
|
266
|
+
buyer?: Buyer | null;
|
|
267
|
+
buyerVerified?: boolean;
|
|
268
|
+
purchase?: PurchaseResult["purchase"] | null;
|
|
269
|
+
payment?: PaymentResult | null;
|
|
270
|
+
nextAction?: NextAction;
|
|
271
|
+
shoppingCartReference?: string | null;
|
|
272
|
+
phase?: string;
|
|
273
|
+
}>;
|
|
203
274
|
getSession(): Promise<CheckoutSession>;
|
|
204
275
|
getCatalog(): Promise<PublicEvent>;
|
|
205
276
|
quote(params: {
|
|
@@ -207,6 +278,17 @@ declare function createTickean(options: CreateTickeanOptions): {
|
|
|
207
278
|
discountCode?: string;
|
|
208
279
|
showId?: string;
|
|
209
280
|
}): Promise<QuoteResult>;
|
|
281
|
+
lookupBuyer(params: {
|
|
282
|
+
phone: string;
|
|
283
|
+
}): Promise<{
|
|
284
|
+
exists: boolean;
|
|
285
|
+
buyer?: {
|
|
286
|
+
id: string;
|
|
287
|
+
phone: string;
|
|
288
|
+
name?: string;
|
|
289
|
+
email?: string;
|
|
290
|
+
};
|
|
291
|
+
}>;
|
|
210
292
|
sendOtp(params: {
|
|
211
293
|
phone: string;
|
|
212
294
|
channel?: string;
|
|
@@ -226,6 +308,7 @@ declare function createTickean(options: CreateTickeanOptions): {
|
|
|
226
308
|
expectedTotal?: number;
|
|
227
309
|
shoppingCartReference?: string;
|
|
228
310
|
idempotencyKey?: string;
|
|
311
|
+
attendees?: PurchaseAttendee[];
|
|
229
312
|
}): Promise<PurchaseResult>;
|
|
230
313
|
createPayment(params: {
|
|
231
314
|
orderId: string;
|
|
@@ -296,6 +379,9 @@ type CheckoutAction = {
|
|
|
296
379
|
} | {
|
|
297
380
|
type: "SET_EVENT";
|
|
298
381
|
event: PublicEvent;
|
|
382
|
+
} | {
|
|
383
|
+
type: "MERGE_UNLOCKED_OPTIONS";
|
|
384
|
+
options: PublicShowOption[];
|
|
299
385
|
} | {
|
|
300
386
|
type: "PURCHASE_START";
|
|
301
387
|
} | {
|
|
@@ -310,6 +396,8 @@ type CheckoutAction = {
|
|
|
310
396
|
type: "SET_NEXT_ACTION";
|
|
311
397
|
nextAction: NextAction;
|
|
312
398
|
payment?: PaymentResult | null;
|
|
399
|
+
} | {
|
|
400
|
+
type: "RESET_PAYMENT_FLOW";
|
|
313
401
|
} | {
|
|
314
402
|
type: "PROCESSING";
|
|
315
403
|
} | {
|
|
@@ -332,6 +420,8 @@ declare function checkoutReducer(state: CheckoutState, action: CheckoutAction):
|
|
|
332
420
|
type CreateCheckoutControllerOptions = CreateTickeanOptions & {
|
|
333
421
|
eventSlug: string;
|
|
334
422
|
returnUrl?: string;
|
|
423
|
+
/** Abandonment recovery code from `?resume=` deep link. */
|
|
424
|
+
resumeCode?: string;
|
|
335
425
|
quoteDebounceMs?: number;
|
|
336
426
|
persistence?: PersistenceAdapter | false;
|
|
337
427
|
persistenceKey?: string;
|
|
@@ -344,6 +434,25 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
344
434
|
eventSlug: string;
|
|
345
435
|
returnUrl?: string;
|
|
346
436
|
}): Promise<CheckoutSession>;
|
|
437
|
+
exchangeRecovery(params: {
|
|
438
|
+
code: string;
|
|
439
|
+
}): Promise<{
|
|
440
|
+
sessionId: string;
|
|
441
|
+
sessionToken: string;
|
|
442
|
+
expiresAt: string;
|
|
443
|
+
suggestedStep?: string | number;
|
|
444
|
+
event: PublicEvent;
|
|
445
|
+
capabilities?: Record<string, boolean>;
|
|
446
|
+
cart: CartItem[];
|
|
447
|
+
discountCode?: string | null;
|
|
448
|
+
buyer?: Buyer | null;
|
|
449
|
+
buyerVerified?: boolean;
|
|
450
|
+
purchase?: PurchaseResult["purchase"] | null;
|
|
451
|
+
payment?: PaymentResult | null;
|
|
452
|
+
nextAction?: NextAction;
|
|
453
|
+
shoppingCartReference?: string | null;
|
|
454
|
+
phase?: string;
|
|
455
|
+
}>;
|
|
347
456
|
getSession(): Promise<CheckoutSession>;
|
|
348
457
|
getCatalog(): Promise<PublicEvent>;
|
|
349
458
|
quote(params: {
|
|
@@ -351,6 +460,17 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
351
460
|
discountCode?: string;
|
|
352
461
|
showId?: string;
|
|
353
462
|
}): Promise<QuoteResult>;
|
|
463
|
+
lookupBuyer(params: {
|
|
464
|
+
phone: string;
|
|
465
|
+
}): Promise<{
|
|
466
|
+
exists: boolean;
|
|
467
|
+
buyer?: {
|
|
468
|
+
id: string;
|
|
469
|
+
phone: string;
|
|
470
|
+
name?: string;
|
|
471
|
+
email?: string;
|
|
472
|
+
};
|
|
473
|
+
}>;
|
|
354
474
|
sendOtp(params: {
|
|
355
475
|
phone: string;
|
|
356
476
|
channel?: string;
|
|
@@ -370,6 +490,7 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
370
490
|
expectedTotal?: number;
|
|
371
491
|
shoppingCartReference?: string;
|
|
372
492
|
idempotencyKey?: string;
|
|
493
|
+
attendees?: PurchaseAttendee[];
|
|
373
494
|
}): Promise<PurchaseResult>;
|
|
374
495
|
createPayment(params: {
|
|
375
496
|
orderId: string;
|
|
@@ -397,6 +518,15 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
397
518
|
setCartItem: (showOptionId: string, amount: number) => void;
|
|
398
519
|
setCart: (cart: CartItem[]) => void;
|
|
399
520
|
applyDiscountCode: (code: string) => Promise<QuoteResult>;
|
|
521
|
+
lookupBuyer: (phone: string) => Promise<{
|
|
522
|
+
exists: boolean;
|
|
523
|
+
buyer?: {
|
|
524
|
+
id: string;
|
|
525
|
+
phone: string;
|
|
526
|
+
name?: string;
|
|
527
|
+
email?: string;
|
|
528
|
+
};
|
|
529
|
+
}>;
|
|
400
530
|
sendOtp: (phone: string, channel?: string) => Promise<void>;
|
|
401
531
|
verifyOtp: (params: {
|
|
402
532
|
phone: string;
|
|
@@ -410,11 +540,13 @@ declare function createCheckoutController(options: CreateCheckoutControllerOptio
|
|
|
410
540
|
discountCode?: string;
|
|
411
541
|
showId?: string;
|
|
412
542
|
idempotencyKey?: string;
|
|
543
|
+
attendees?: PurchaseAttendee[];
|
|
413
544
|
}) => Promise<{
|
|
414
545
|
purchaseId: string;
|
|
415
546
|
payment: PaymentResult;
|
|
416
547
|
nextAction: NextAction;
|
|
417
548
|
}>;
|
|
549
|
+
changePaymentMethod: () => void;
|
|
418
550
|
confirmPayment: (params?: {
|
|
419
551
|
paymentId?: string;
|
|
420
552
|
confirmationToken?: string;
|
|
@@ -443,4 +575,43 @@ declare function createEventEmitterTelemetry(listeners?: TelemetryListener[]): T
|
|
|
443
575
|
subscribe(listener: TelemetryListener): () => void;
|
|
444
576
|
};
|
|
445
577
|
|
|
446
|
-
|
|
578
|
+
type PaymentSocketSnapshot = {
|
|
579
|
+
purchaseId?: string;
|
|
580
|
+
orderId?: string;
|
|
581
|
+
paymentId?: string;
|
|
582
|
+
status?: string;
|
|
583
|
+
amount?: number;
|
|
584
|
+
currency?: string;
|
|
585
|
+
};
|
|
586
|
+
type PaymentSocketWatchHandle = {
|
|
587
|
+
promise: Promise<PaymentSocketSnapshot>;
|
|
588
|
+
dispose: () => void;
|
|
589
|
+
get connected(): boolean;
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* Join the legacy cart payment room (same as ecommerce) and resolve when
|
|
593
|
+
* payment:confirmed arrives. HTTP polling remains the fallback.
|
|
594
|
+
*/
|
|
595
|
+
declare function watchPaymentSocket(params: {
|
|
596
|
+
apiBaseUrl: string;
|
|
597
|
+
shoppingCartReference: string;
|
|
598
|
+
purchaseId?: string;
|
|
599
|
+
signal?: AbortSignal;
|
|
600
|
+
timeoutMs?: number;
|
|
601
|
+
}): PaymentSocketWatchHandle;
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Navigate the top-level browsing context (breaks out of iframes).
|
|
605
|
+
* Used for Mercado Pago hosted checkout so payment is not trapped in embeds.
|
|
606
|
+
*/
|
|
607
|
+
declare function navigateTopLevel(url: string): void;
|
|
608
|
+
declare function resolveRedirectUrl(params: {
|
|
609
|
+
nextAction?: {
|
|
610
|
+
type: string;
|
|
611
|
+
url?: string;
|
|
612
|
+
} | null;
|
|
613
|
+
redirectUrl?: string | null;
|
|
614
|
+
initPoint?: string | null;
|
|
615
|
+
}): string | null;
|
|
616
|
+
|
|
617
|
+
export { type Buyer, type CartItem, type CheckoutAction, type CheckoutController, type CheckoutPhase, type CheckoutSession, type CheckoutState, type CheckoutTransport, type CreateCheckoutControllerOptions, type CreateTickeanOptions, type NextAction, type PaymentResult, type PaymentSocketSnapshot, type PaymentSocketWatchHandle, type PaymentStatusResult, type PersistedCheckoutState, type PersistenceAdapter, type PromotionNxM, type PublicEvent, type PublicShow, type PublicShowOption, type PurchaseAttendee, type PurchaseResult, type QuantityDiscount, type QuoteResult, type RegistrationQuestion, type RegistrationSettings, type TelemetryAdapter, type TelemetryEvent, type TelemetryListener, type TickeanClient, TickeanError, type TickeanErrorPayload, checkoutReducer, createCheckoutController, createEventEmitterTelemetry, createInitialState, createMemoryPersistence, createNoopTelemetry, createSessionStoragePersistence, createTickean, navigateTopLevel, resolveRedirectUrl, watchPaymentSocket };
|