@seatlayer/js 0.37.0 → 0.38.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.
- package/README.md +33 -0
- package/dist/chunk-HMLY7DHA.js +16 -0
- package/dist/chunk-HMLY7DHA.js.map +1 -0
- package/dist/hostedCheckout-PLHKPT6W.js +345 -0
- package/dist/hostedCheckout-PLHKPT6W.js.map +1 -0
- package/dist/index.cjs +745 -156
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +182 -1
- package/dist/index.d.ts +182 -1
- package/dist/index.js +261 -31
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -239,6 +239,52 @@ interface BestAvailableResult {
|
|
|
239
239
|
items?: HoldResult['items'];
|
|
240
240
|
zoneId?: string;
|
|
241
241
|
}
|
|
242
|
+
/** A gateway the organizer can be connected to. */
|
|
243
|
+
type PaymentProviderName = 'stripe' | 'razorpay';
|
|
244
|
+
/**
|
|
245
|
+
* Why `payment-options` came back with an empty list.
|
|
246
|
+
*
|
|
247
|
+
* The three are NOT interchangeable and two of them give opposite advice:
|
|
248
|
+
* `not_configured` means the organizer takes payment somewhere else,
|
|
249
|
+
* `payments_off_for_event` means they deliberately do not sell THIS event
|
|
250
|
+
* online, and `unavailable_for_event` means they switched it on and it is
|
|
251
|
+
* broken. Collapsing them makes the widget blame a working integration for a
|
|
252
|
+
* decision that was made on purpose.
|
|
253
|
+
*/
|
|
254
|
+
type PaymentOptionsReason = 'not_configured' | 'payments_off_for_event' | 'unavailable_for_event';
|
|
255
|
+
/**
|
|
256
|
+
* What this event can take money through. Since the per-event gateway column
|
|
257
|
+
* landed, `providers` holds AT MOST ONE entry — the gateway the organizer
|
|
258
|
+
* assigned — so no browser can choose which one charges.
|
|
259
|
+
*
|
|
260
|
+
* `reason` is optional on the wire: a widget pinned against an older worker
|
|
261
|
+
* still parses, and its absence means what that worker meant by an empty list.
|
|
262
|
+
*/
|
|
263
|
+
interface PaymentOptionsResult {
|
|
264
|
+
providers: PaymentProviderName[];
|
|
265
|
+
currency: string | null;
|
|
266
|
+
reason?: PaymentOptionsReason | null;
|
|
267
|
+
}
|
|
268
|
+
/** A started payment. Exactly one of the two handoffs comes back. */
|
|
269
|
+
interface CheckoutSessionResult {
|
|
270
|
+
orderId: string;
|
|
271
|
+
totalMinor: number;
|
|
272
|
+
currency: string;
|
|
273
|
+
expiresAt: number;
|
|
274
|
+
/** Hosted gateway page — navigate to it. */
|
|
275
|
+
redirectUrl?: string;
|
|
276
|
+
/** In-page modal gateway — open it without leaving the page. */
|
|
277
|
+
clientPayload?: Record<string, unknown>;
|
|
278
|
+
}
|
|
279
|
+
/** An order's state while its gateway webhook is in flight. */
|
|
280
|
+
interface OrderStatusResult {
|
|
281
|
+
orderId: string;
|
|
282
|
+
status: string;
|
|
283
|
+
totalMinor: number;
|
|
284
|
+
currency: string;
|
|
285
|
+
amountFormatted: string;
|
|
286
|
+
seatCount: number;
|
|
287
|
+
}
|
|
242
288
|
interface PubApiOptions {
|
|
243
289
|
/**
|
|
244
290
|
* Buyer access session. When present, EVERY scoped operation on this client
|
|
@@ -1183,13 +1229,82 @@ interface SeatPickerOptions {
|
|
|
1183
1229
|
* photo when a seat carries one. Default true; set false to hide the affordance.
|
|
1184
1230
|
*/
|
|
1185
1231
|
seatView?: boolean;
|
|
1232
|
+
/**
|
|
1233
|
+
* WHERE the buyer goes once their seats are held. Default `'handoff'`.
|
|
1234
|
+
*
|
|
1235
|
+
* 'handoff' (default, and every integration that has ever existed) the
|
|
1236
|
+
* widget fires {@link onCheckout} with a holdId and priced line
|
|
1237
|
+
* items, and YOUR server takes the money. Nothing about this path
|
|
1238
|
+
* changes, and no payment code is even downloaded.
|
|
1239
|
+
* 'hosted' the widget takes the money through the gateway the ORGANIZER
|
|
1240
|
+
* connected, on their account — the "sell tickets with no
|
|
1241
|
+
* backend" path. Requires the org to be on hosted checkout and
|
|
1242
|
+
* the event to have a gateway assigned; when it does not, this
|
|
1243
|
+
* falls back to `'handoff'` for that buyer rather than dead-ending
|
|
1244
|
+
* them, and reports why through {@link onCheckoutUnavailable}.
|
|
1245
|
+
*
|
|
1246
|
+
* Named for the destination rather than as a boolean flag because there is a
|
|
1247
|
+
* real third answer coming and `hostedCheckout: true` would have no room for
|
|
1248
|
+
* it; spelling the default out also makes a host's intent legible in their own
|
|
1249
|
+
* source instead of hiding it in an absent option.
|
|
1250
|
+
*
|
|
1251
|
+
* TWO THINGS ARE WORTH KNOWING BEFORE YOU SWITCH THIS ON:
|
|
1252
|
+
*
|
|
1253
|
+
* 1. It needs the widget's own transport. A host-supplied `transport` owns its
|
|
1254
|
+
* credentials and its backend, so hosted checkout stays off there (with one
|
|
1255
|
+
* console warning) rather than reaching past it to api.seatlayer.io.
|
|
1256
|
+
* 2. WHERE A HOSTED GATEWAY RETURNS THE BUYER IS THE SERVER'S CHOICE. The
|
|
1257
|
+
* checkout session's return URL is built from the deployment's own allowed
|
|
1258
|
+
* origins, so a buyer paying by card from an embed on your domain comes back
|
|
1259
|
+
* to SeatLayer's buyer page and is confirmed THERE, not in this widget. The
|
|
1260
|
+
* widget resumes in place only when it is mounted on a page that actually
|
|
1261
|
+
* receives `?order=…&status=success` (a page on an allowed origin, and the
|
|
1262
|
+
* in-page gateways, which never navigate away at all). Until the server
|
|
1263
|
+
* accepts a caller-supplied return URL, treat a card payment from a
|
|
1264
|
+
* third-party embed as "the buyer finishes on our page".
|
|
1265
|
+
*/
|
|
1266
|
+
checkout?: 'handoff' | 'hosted';
|
|
1186
1267
|
/**
|
|
1187
1268
|
* Buyer pressed the CTA and the hold succeeded — hand off to YOUR checkout.
|
|
1188
1269
|
* `hold` and `seats` are the legacy args (unchanged since 0.6). `handoff` (P4)
|
|
1189
1270
|
* is the stable, self-contained {@link CheckoutHandoff} to build your order
|
|
1190
1271
|
* against — holdId, expiry, currency and priced line items. Prefer it.
|
|
1272
|
+
*
|
|
1273
|
+
* Under `checkout: 'hosted'` this fires ONLY when hosted checkout cannot run
|
|
1274
|
+
* for this event, so a host can keep one code path for both. It never fires
|
|
1275
|
+
* alongside a payment the widget is taking itself.
|
|
1191
1276
|
*/
|
|
1192
1277
|
onCheckout?: (hold: HoldResult, seats: PickerSeat[], handoff: CheckoutHandoff) => void;
|
|
1278
|
+
/**
|
|
1279
|
+
* `checkout: 'hosted'` was asked for and this event cannot take money.
|
|
1280
|
+
* The seats ARE held — the buyer is mid-journey — so this is a routing
|
|
1281
|
+
* decision, not an error, and it is never collapsed into {@link onError}.
|
|
1282
|
+
*
|
|
1283
|
+
* `reason` carries the server's three-way answer verbatim, because two of the
|
|
1284
|
+
* three give opposite advice: `payments_off_for_event` means the organizer
|
|
1285
|
+
* deliberately does not sell this event online (nothing is wrong), while
|
|
1286
|
+
* `unavailable_for_event` means they switched it on and it is broken. Anything
|
|
1287
|
+
* unreadable — a failed lookup, an older worker — reads as `not_configured`,
|
|
1288
|
+
* which asserts the least about them.
|
|
1289
|
+
*
|
|
1290
|
+
* `onCheckout` fires immediately after this with the same hold. Supply either
|
|
1291
|
+
* (or both) and you own the next screen; supply NEITHER and the widget shows
|
|
1292
|
+
* the buyer an honest card of its own rather than swallowing the press.
|
|
1293
|
+
*/
|
|
1294
|
+
onCheckoutUnavailable?: (event: {
|
|
1295
|
+
reason: PaymentOptionsReason;
|
|
1296
|
+
handoff: CheckoutHandoff;
|
|
1297
|
+
}) => void;
|
|
1298
|
+
/**
|
|
1299
|
+
* `checkout: 'hosted'` only — the gateway's webhook landed and the order is
|
|
1300
|
+
* PAID. The one signal a host with no backend actually needs, and the only
|
|
1301
|
+
* place a receipt can come from on a page that has no server of its own.
|
|
1302
|
+
*
|
|
1303
|
+
* Distinct from {@link onBooked}, which reports the same sale seen from the
|
|
1304
|
+
* seat map over the realtime channel and cannot fire at all for a buyer whose
|
|
1305
|
+
* widget was torn down by a redirect to the gateway.
|
|
1306
|
+
*/
|
|
1307
|
+
onOrderConfirmed?: (order: OrderStatusResult) => void;
|
|
1193
1308
|
/**
|
|
1194
1309
|
* The held seats were BOOKED (P4) — your server completed payment and the
|
|
1195
1310
|
* booking landed over the realtime channel while the widget was still open.
|
|
@@ -1265,6 +1380,20 @@ declare class SeatPicker {
|
|
|
1265
1380
|
private handedOff;
|
|
1266
1381
|
/** Guards single onBooked + single success overlay per hold. */
|
|
1267
1382
|
private bookedShown;
|
|
1383
|
+
/**
|
|
1384
|
+
* `'hosted'` only when the host asked for it AND the widget owns its own
|
|
1385
|
+
* transport. Resolved once in the constructor so every later read is a field
|
|
1386
|
+
* comparison rather than a re-derivation that could drift.
|
|
1387
|
+
*/
|
|
1388
|
+
private readonly checkoutMode;
|
|
1389
|
+
/**
|
|
1390
|
+
* In-flight or settled `payment-options` for this event, started at render in
|
|
1391
|
+
* hosted mode. One request, kicked off while the buyer is still choosing, so
|
|
1392
|
+
* pressing Pay does not wait on a lookup whose answer never changes mid-session.
|
|
1393
|
+
*/
|
|
1394
|
+
private paymentOptions;
|
|
1395
|
+
/** The mounted payment card, while one is up. */
|
|
1396
|
+
private checkoutPanel;
|
|
1268
1397
|
private extendEl;
|
|
1269
1398
|
private bookedEl;
|
|
1270
1399
|
private gaQty;
|
|
@@ -1426,6 +1555,22 @@ declare class SeatPicker {
|
|
|
1426
1555
|
static open(options: Omit<SeatPickerOptions, 'container'>): Promise<SeatPicker>;
|
|
1427
1556
|
constructor(options: SeatPickerOptions);
|
|
1428
1557
|
render(): Promise<this>;
|
|
1558
|
+
/**
|
|
1559
|
+
* A hosted gateway returned this buyer to a page that runs the widget, with
|
|
1560
|
+
* `?order=…&status=…` in the URL. Pick the order up and finish the story.
|
|
1561
|
+
*
|
|
1562
|
+
* Only `success` resumes. `cancelled` means the buyer backed out at the
|
|
1563
|
+
* gateway and their seats are still held — the map they are looking at IS the
|
|
1564
|
+
* right screen, and opening a card to say "you cancelled" would be noise.
|
|
1565
|
+
*
|
|
1566
|
+
* The two parameters are then stripped with `replaceState`, because they are a
|
|
1567
|
+
* one-shot instruction: leaving them in place would re-open the confirmation
|
|
1568
|
+
* on every later navigation, and would carry an order id into browser history
|
|
1569
|
+
* and any Referer this page later sends. `status` is only ever removed
|
|
1570
|
+
* alongside an `order` we actually consumed, so a host page that uses a
|
|
1571
|
+
* `status` parameter of its own keeps it.
|
|
1572
|
+
*/
|
|
1573
|
+
private resumeHostedOrder;
|
|
1429
1574
|
/**
|
|
1430
1575
|
* Move layout-dependent chrome between its wide dock (map regions / zoom
|
|
1431
1576
|
* column) and its narrow dock (the sheet's consolidated Filters row), and
|
|
@@ -1589,6 +1734,10 @@ declare class SeatPicker {
|
|
|
1589
1734
|
* uploaded photo (seat.viewUrl) when present, else a panorama generated from
|
|
1590
1735
|
* the chart geometry — the stage placed at this seat's true bearing + size.
|
|
1591
1736
|
* Zero extra dependencies: an equirectangular image panned with `repeat-x`.
|
|
1737
|
+
*
|
|
1738
|
+
* Async only because the generator is a lazy chunk (see `loadPanorama`); an
|
|
1739
|
+
* organizer photo needs no generator and never waits on it. The two callers
|
|
1740
|
+
* are click handlers, so nothing observes the promise.
|
|
1592
1741
|
*/
|
|
1593
1742
|
private openSeatView;
|
|
1594
1743
|
private closeSeatView;
|
|
@@ -1637,6 +1786,38 @@ declare class SeatPicker {
|
|
|
1637
1786
|
*/
|
|
1638
1787
|
private detectBooked;
|
|
1639
1788
|
private showBooked;
|
|
1789
|
+
/**
|
|
1790
|
+
* The seats are held. Send the buyer wherever this picker's `checkout` option
|
|
1791
|
+
* says they go.
|
|
1792
|
+
*
|
|
1793
|
+
* The default branch is the literal call that stood here before hosted
|
|
1794
|
+
* checkout existed, unchanged, so nothing about an existing integration moves.
|
|
1795
|
+
*/
|
|
1796
|
+
private checkoutHandoff;
|
|
1797
|
+
/**
|
|
1798
|
+
* Take the money ourselves, through the organizer's own gateway.
|
|
1799
|
+
*
|
|
1800
|
+
* Order of operations matters: ASK FIRST, load second. `payment-options` is
|
|
1801
|
+
* already in flight from render, and its answer decides whether any payment
|
|
1802
|
+
* code is fetched at all — an event that cannot charge never downloads the
|
|
1803
|
+
* card that would have charged it.
|
|
1804
|
+
*
|
|
1805
|
+
* An empty list is not a failure and never dead-ends the buyer. It routes them
|
|
1806
|
+
* to whatever the host has: `onCheckoutUnavailable` (with the server's reason,
|
|
1807
|
+
* so the host can say the right one of three very different sentences), then
|
|
1808
|
+
* `onCheckout` with the ordinary handoff. A host that supplied neither gets
|
|
1809
|
+
* the widget's own honest card instead of a press that did nothing.
|
|
1810
|
+
*/
|
|
1811
|
+
private startHostedCheckout;
|
|
1812
|
+
/**
|
|
1813
|
+
* Fetch the checkout chunk and put its card over the map.
|
|
1814
|
+
*
|
|
1815
|
+
* Every failure here lands the buyer back on a map with their seats still
|
|
1816
|
+
* held, which is a place they can act from — a blocked chunk request must not
|
|
1817
|
+
* leave them staring at a CTA that no longer does anything.
|
|
1818
|
+
*/
|
|
1819
|
+
private openCheckoutPanel;
|
|
1820
|
+
private closeCheckoutPanel;
|
|
1640
1821
|
/** Assemble the stable {@link CheckoutHandoff} from a hold's server line items. */
|
|
1641
1822
|
private buildHandoff;
|
|
1642
1823
|
private emitHoldChange;
|
|
@@ -3443,4 +3624,4 @@ declare class ChannelsMode {
|
|
|
3443
3624
|
handleBack(): boolean;
|
|
3444
3625
|
}
|
|
3445
3626
|
|
|
3446
|
-
export { ACCESS_LINK_DEFAULTS, type AccessLinkRecord, type AccessLinkReveal, type AccessLinkState, type AccessLinkStatus, type AccessLinkStatusRecord, ApiError, type ArchiveBlockedDetails, type AssignmentBuckets, type AssignmentDropDetails, type AssignmentResult, type AttachPickerFrameOptions, type BestAvailableResult, type BucketRow, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, type ChannelAccessIntent, type ChannelAccessSummary, type ChannelAllocationPage, type ChannelAuditEntry, type ChannelAuditPage, type ChannelCounts, type ChannelListResult, type ChannelPreviewProjection, type ChannelRecord, type ChannelSeatStatus, type ChannelState, type ChannelsCapabilities, type ChannelsClient, ChannelsMode, type ChannelsModeHost, type ChannelsSeatView, type CheckoutHandoff, type CheckoutLineItem, type ControlRoomActivityEntry, type ControlRoomSectionMetric, type ControlRoomSnapshot, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type LogEntry, type LogPage, ManageApi, ManageApiError, PUBLIC_CHANNEL_ID, PUBLIC_CHANNEL_NAME, type Projection, type PubApiOptions, type RealtimeSink, type ReportByStatus, type ReportCategoryMeta, type ReportCategoryRow, type ReportResult, type ResumedHoldResult, SeatManager, type SeatManagerActionResult, type SeatManagerActivity, type SeatManagerCapability, type SeatManagerConnection, type SeatManagerMode, type SeatManagerOptions, type SeatManagerTallies, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedObjectUnavailableEvent, type SelectedSeat, type SelectionSourceRow, type StatusChange, type SubscribeTicket$1 as SubscribeTicket, accessIntentLabel, accessLine, accessLinkBadge, accessLinkErrorCopy, accessLinkIsLive, accessLinkPolicyLines, attachPickerFrame, bucketRows, bucketRowsHtml, createBuyerAccessContext, createControllerSink, dropReviewRows, isPublicChannelId, markerLetter, markerOf, mutationCount, needsMoveConfirmation, planAssignment, retryAfterCopy, selectionSources, stateBadge, suggestMarker };
|
|
3627
|
+
export { ACCESS_LINK_DEFAULTS, type AccessLinkRecord, type AccessLinkReveal, type AccessLinkState, type AccessLinkStatus, type AccessLinkStatusRecord, ApiError, type ArchiveBlockedDetails, type AssignmentBuckets, type AssignmentDropDetails, type AssignmentResult, type AttachPickerFrameOptions, type BestAvailableResult, type BucketRow, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, type ChannelAccessIntent, type ChannelAccessSummary, type ChannelAllocationPage, type ChannelAuditEntry, type ChannelAuditPage, type ChannelCounts, type ChannelListResult, type ChannelPreviewProjection, type ChannelRecord, type ChannelSeatStatus, type ChannelState, type ChannelsCapabilities, type ChannelsClient, ChannelsMode, type ChannelsModeHost, type ChannelsSeatView, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, type ControlRoomActivityEntry, type ControlRoomSectionMetric, type ControlRoomSnapshot, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type LogEntry, type LogPage, ManageApi, ManageApiError, type OrderStatusResult, PUBLIC_CHANNEL_ID, PUBLIC_CHANNEL_NAME, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type Projection, type PubApiOptions, type RealtimeSink, type ReportByStatus, type ReportCategoryMeta, type ReportCategoryRow, type ReportResult, type ResumedHoldResult, SeatManager, type SeatManagerActionResult, type SeatManagerActivity, type SeatManagerCapability, type SeatManagerConnection, type SeatManagerMode, type SeatManagerOptions, type SeatManagerTallies, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedObjectUnavailableEvent, type SelectedSeat, type SelectionSourceRow, type StatusChange, type SubscribeTicket$1 as SubscribeTicket, accessIntentLabel, accessLine, accessLinkBadge, accessLinkErrorCopy, accessLinkIsLive, accessLinkPolicyLines, attachPickerFrame, bucketRows, bucketRowsHtml, createBuyerAccessContext, createControllerSink, dropReviewRows, isPublicChannelId, markerLetter, markerOf, mutationCount, needsMoveConfirmation, planAssignment, retryAfterCopy, selectionSources, stateBadge, suggestMarker };
|
package/dist/index.d.ts
CHANGED
|
@@ -239,6 +239,52 @@ interface BestAvailableResult {
|
|
|
239
239
|
items?: HoldResult['items'];
|
|
240
240
|
zoneId?: string;
|
|
241
241
|
}
|
|
242
|
+
/** A gateway the organizer can be connected to. */
|
|
243
|
+
type PaymentProviderName = 'stripe' | 'razorpay';
|
|
244
|
+
/**
|
|
245
|
+
* Why `payment-options` came back with an empty list.
|
|
246
|
+
*
|
|
247
|
+
* The three are NOT interchangeable and two of them give opposite advice:
|
|
248
|
+
* `not_configured` means the organizer takes payment somewhere else,
|
|
249
|
+
* `payments_off_for_event` means they deliberately do not sell THIS event
|
|
250
|
+
* online, and `unavailable_for_event` means they switched it on and it is
|
|
251
|
+
* broken. Collapsing them makes the widget blame a working integration for a
|
|
252
|
+
* decision that was made on purpose.
|
|
253
|
+
*/
|
|
254
|
+
type PaymentOptionsReason = 'not_configured' | 'payments_off_for_event' | 'unavailable_for_event';
|
|
255
|
+
/**
|
|
256
|
+
* What this event can take money through. Since the per-event gateway column
|
|
257
|
+
* landed, `providers` holds AT MOST ONE entry — the gateway the organizer
|
|
258
|
+
* assigned — so no browser can choose which one charges.
|
|
259
|
+
*
|
|
260
|
+
* `reason` is optional on the wire: a widget pinned against an older worker
|
|
261
|
+
* still parses, and its absence means what that worker meant by an empty list.
|
|
262
|
+
*/
|
|
263
|
+
interface PaymentOptionsResult {
|
|
264
|
+
providers: PaymentProviderName[];
|
|
265
|
+
currency: string | null;
|
|
266
|
+
reason?: PaymentOptionsReason | null;
|
|
267
|
+
}
|
|
268
|
+
/** A started payment. Exactly one of the two handoffs comes back. */
|
|
269
|
+
interface CheckoutSessionResult {
|
|
270
|
+
orderId: string;
|
|
271
|
+
totalMinor: number;
|
|
272
|
+
currency: string;
|
|
273
|
+
expiresAt: number;
|
|
274
|
+
/** Hosted gateway page — navigate to it. */
|
|
275
|
+
redirectUrl?: string;
|
|
276
|
+
/** In-page modal gateway — open it without leaving the page. */
|
|
277
|
+
clientPayload?: Record<string, unknown>;
|
|
278
|
+
}
|
|
279
|
+
/** An order's state while its gateway webhook is in flight. */
|
|
280
|
+
interface OrderStatusResult {
|
|
281
|
+
orderId: string;
|
|
282
|
+
status: string;
|
|
283
|
+
totalMinor: number;
|
|
284
|
+
currency: string;
|
|
285
|
+
amountFormatted: string;
|
|
286
|
+
seatCount: number;
|
|
287
|
+
}
|
|
242
288
|
interface PubApiOptions {
|
|
243
289
|
/**
|
|
244
290
|
* Buyer access session. When present, EVERY scoped operation on this client
|
|
@@ -1183,13 +1229,82 @@ interface SeatPickerOptions {
|
|
|
1183
1229
|
* photo when a seat carries one. Default true; set false to hide the affordance.
|
|
1184
1230
|
*/
|
|
1185
1231
|
seatView?: boolean;
|
|
1232
|
+
/**
|
|
1233
|
+
* WHERE the buyer goes once their seats are held. Default `'handoff'`.
|
|
1234
|
+
*
|
|
1235
|
+
* 'handoff' (default, and every integration that has ever existed) the
|
|
1236
|
+
* widget fires {@link onCheckout} with a holdId and priced line
|
|
1237
|
+
* items, and YOUR server takes the money. Nothing about this path
|
|
1238
|
+
* changes, and no payment code is even downloaded.
|
|
1239
|
+
* 'hosted' the widget takes the money through the gateway the ORGANIZER
|
|
1240
|
+
* connected, on their account — the "sell tickets with no
|
|
1241
|
+
* backend" path. Requires the org to be on hosted checkout and
|
|
1242
|
+
* the event to have a gateway assigned; when it does not, this
|
|
1243
|
+
* falls back to `'handoff'` for that buyer rather than dead-ending
|
|
1244
|
+
* them, and reports why through {@link onCheckoutUnavailable}.
|
|
1245
|
+
*
|
|
1246
|
+
* Named for the destination rather than as a boolean flag because there is a
|
|
1247
|
+
* real third answer coming and `hostedCheckout: true` would have no room for
|
|
1248
|
+
* it; spelling the default out also makes a host's intent legible in their own
|
|
1249
|
+
* source instead of hiding it in an absent option.
|
|
1250
|
+
*
|
|
1251
|
+
* TWO THINGS ARE WORTH KNOWING BEFORE YOU SWITCH THIS ON:
|
|
1252
|
+
*
|
|
1253
|
+
* 1. It needs the widget's own transport. A host-supplied `transport` owns its
|
|
1254
|
+
* credentials and its backend, so hosted checkout stays off there (with one
|
|
1255
|
+
* console warning) rather than reaching past it to api.seatlayer.io.
|
|
1256
|
+
* 2. WHERE A HOSTED GATEWAY RETURNS THE BUYER IS THE SERVER'S CHOICE. The
|
|
1257
|
+
* checkout session's return URL is built from the deployment's own allowed
|
|
1258
|
+
* origins, so a buyer paying by card from an embed on your domain comes back
|
|
1259
|
+
* to SeatLayer's buyer page and is confirmed THERE, not in this widget. The
|
|
1260
|
+
* widget resumes in place only when it is mounted on a page that actually
|
|
1261
|
+
* receives `?order=…&status=success` (a page on an allowed origin, and the
|
|
1262
|
+
* in-page gateways, which never navigate away at all). Until the server
|
|
1263
|
+
* accepts a caller-supplied return URL, treat a card payment from a
|
|
1264
|
+
* third-party embed as "the buyer finishes on our page".
|
|
1265
|
+
*/
|
|
1266
|
+
checkout?: 'handoff' | 'hosted';
|
|
1186
1267
|
/**
|
|
1187
1268
|
* Buyer pressed the CTA and the hold succeeded — hand off to YOUR checkout.
|
|
1188
1269
|
* `hold` and `seats` are the legacy args (unchanged since 0.6). `handoff` (P4)
|
|
1189
1270
|
* is the stable, self-contained {@link CheckoutHandoff} to build your order
|
|
1190
1271
|
* against — holdId, expiry, currency and priced line items. Prefer it.
|
|
1272
|
+
*
|
|
1273
|
+
* Under `checkout: 'hosted'` this fires ONLY when hosted checkout cannot run
|
|
1274
|
+
* for this event, so a host can keep one code path for both. It never fires
|
|
1275
|
+
* alongside a payment the widget is taking itself.
|
|
1191
1276
|
*/
|
|
1192
1277
|
onCheckout?: (hold: HoldResult, seats: PickerSeat[], handoff: CheckoutHandoff) => void;
|
|
1278
|
+
/**
|
|
1279
|
+
* `checkout: 'hosted'` was asked for and this event cannot take money.
|
|
1280
|
+
* The seats ARE held — the buyer is mid-journey — so this is a routing
|
|
1281
|
+
* decision, not an error, and it is never collapsed into {@link onError}.
|
|
1282
|
+
*
|
|
1283
|
+
* `reason` carries the server's three-way answer verbatim, because two of the
|
|
1284
|
+
* three give opposite advice: `payments_off_for_event` means the organizer
|
|
1285
|
+
* deliberately does not sell this event online (nothing is wrong), while
|
|
1286
|
+
* `unavailable_for_event` means they switched it on and it is broken. Anything
|
|
1287
|
+
* unreadable — a failed lookup, an older worker — reads as `not_configured`,
|
|
1288
|
+
* which asserts the least about them.
|
|
1289
|
+
*
|
|
1290
|
+
* `onCheckout` fires immediately after this with the same hold. Supply either
|
|
1291
|
+
* (or both) and you own the next screen; supply NEITHER and the widget shows
|
|
1292
|
+
* the buyer an honest card of its own rather than swallowing the press.
|
|
1293
|
+
*/
|
|
1294
|
+
onCheckoutUnavailable?: (event: {
|
|
1295
|
+
reason: PaymentOptionsReason;
|
|
1296
|
+
handoff: CheckoutHandoff;
|
|
1297
|
+
}) => void;
|
|
1298
|
+
/**
|
|
1299
|
+
* `checkout: 'hosted'` only — the gateway's webhook landed and the order is
|
|
1300
|
+
* PAID. The one signal a host with no backend actually needs, and the only
|
|
1301
|
+
* place a receipt can come from on a page that has no server of its own.
|
|
1302
|
+
*
|
|
1303
|
+
* Distinct from {@link onBooked}, which reports the same sale seen from the
|
|
1304
|
+
* seat map over the realtime channel and cannot fire at all for a buyer whose
|
|
1305
|
+
* widget was torn down by a redirect to the gateway.
|
|
1306
|
+
*/
|
|
1307
|
+
onOrderConfirmed?: (order: OrderStatusResult) => void;
|
|
1193
1308
|
/**
|
|
1194
1309
|
* The held seats were BOOKED (P4) — your server completed payment and the
|
|
1195
1310
|
* booking landed over the realtime channel while the widget was still open.
|
|
@@ -1265,6 +1380,20 @@ declare class SeatPicker {
|
|
|
1265
1380
|
private handedOff;
|
|
1266
1381
|
/** Guards single onBooked + single success overlay per hold. */
|
|
1267
1382
|
private bookedShown;
|
|
1383
|
+
/**
|
|
1384
|
+
* `'hosted'` only when the host asked for it AND the widget owns its own
|
|
1385
|
+
* transport. Resolved once in the constructor so every later read is a field
|
|
1386
|
+
* comparison rather than a re-derivation that could drift.
|
|
1387
|
+
*/
|
|
1388
|
+
private readonly checkoutMode;
|
|
1389
|
+
/**
|
|
1390
|
+
* In-flight or settled `payment-options` for this event, started at render in
|
|
1391
|
+
* hosted mode. One request, kicked off while the buyer is still choosing, so
|
|
1392
|
+
* pressing Pay does not wait on a lookup whose answer never changes mid-session.
|
|
1393
|
+
*/
|
|
1394
|
+
private paymentOptions;
|
|
1395
|
+
/** The mounted payment card, while one is up. */
|
|
1396
|
+
private checkoutPanel;
|
|
1268
1397
|
private extendEl;
|
|
1269
1398
|
private bookedEl;
|
|
1270
1399
|
private gaQty;
|
|
@@ -1426,6 +1555,22 @@ declare class SeatPicker {
|
|
|
1426
1555
|
static open(options: Omit<SeatPickerOptions, 'container'>): Promise<SeatPicker>;
|
|
1427
1556
|
constructor(options: SeatPickerOptions);
|
|
1428
1557
|
render(): Promise<this>;
|
|
1558
|
+
/**
|
|
1559
|
+
* A hosted gateway returned this buyer to a page that runs the widget, with
|
|
1560
|
+
* `?order=…&status=…` in the URL. Pick the order up and finish the story.
|
|
1561
|
+
*
|
|
1562
|
+
* Only `success` resumes. `cancelled` means the buyer backed out at the
|
|
1563
|
+
* gateway and their seats are still held — the map they are looking at IS the
|
|
1564
|
+
* right screen, and opening a card to say "you cancelled" would be noise.
|
|
1565
|
+
*
|
|
1566
|
+
* The two parameters are then stripped with `replaceState`, because they are a
|
|
1567
|
+
* one-shot instruction: leaving them in place would re-open the confirmation
|
|
1568
|
+
* on every later navigation, and would carry an order id into browser history
|
|
1569
|
+
* and any Referer this page later sends. `status` is only ever removed
|
|
1570
|
+
* alongside an `order` we actually consumed, so a host page that uses a
|
|
1571
|
+
* `status` parameter of its own keeps it.
|
|
1572
|
+
*/
|
|
1573
|
+
private resumeHostedOrder;
|
|
1429
1574
|
/**
|
|
1430
1575
|
* Move layout-dependent chrome between its wide dock (map regions / zoom
|
|
1431
1576
|
* column) and its narrow dock (the sheet's consolidated Filters row), and
|
|
@@ -1589,6 +1734,10 @@ declare class SeatPicker {
|
|
|
1589
1734
|
* uploaded photo (seat.viewUrl) when present, else a panorama generated from
|
|
1590
1735
|
* the chart geometry — the stage placed at this seat's true bearing + size.
|
|
1591
1736
|
* Zero extra dependencies: an equirectangular image panned with `repeat-x`.
|
|
1737
|
+
*
|
|
1738
|
+
* Async only because the generator is a lazy chunk (see `loadPanorama`); an
|
|
1739
|
+
* organizer photo needs no generator and never waits on it. The two callers
|
|
1740
|
+
* are click handlers, so nothing observes the promise.
|
|
1592
1741
|
*/
|
|
1593
1742
|
private openSeatView;
|
|
1594
1743
|
private closeSeatView;
|
|
@@ -1637,6 +1786,38 @@ declare class SeatPicker {
|
|
|
1637
1786
|
*/
|
|
1638
1787
|
private detectBooked;
|
|
1639
1788
|
private showBooked;
|
|
1789
|
+
/**
|
|
1790
|
+
* The seats are held. Send the buyer wherever this picker's `checkout` option
|
|
1791
|
+
* says they go.
|
|
1792
|
+
*
|
|
1793
|
+
* The default branch is the literal call that stood here before hosted
|
|
1794
|
+
* checkout existed, unchanged, so nothing about an existing integration moves.
|
|
1795
|
+
*/
|
|
1796
|
+
private checkoutHandoff;
|
|
1797
|
+
/**
|
|
1798
|
+
* Take the money ourselves, through the organizer's own gateway.
|
|
1799
|
+
*
|
|
1800
|
+
* Order of operations matters: ASK FIRST, load second. `payment-options` is
|
|
1801
|
+
* already in flight from render, and its answer decides whether any payment
|
|
1802
|
+
* code is fetched at all — an event that cannot charge never downloads the
|
|
1803
|
+
* card that would have charged it.
|
|
1804
|
+
*
|
|
1805
|
+
* An empty list is not a failure and never dead-ends the buyer. It routes them
|
|
1806
|
+
* to whatever the host has: `onCheckoutUnavailable` (with the server's reason,
|
|
1807
|
+
* so the host can say the right one of three very different sentences), then
|
|
1808
|
+
* `onCheckout` with the ordinary handoff. A host that supplied neither gets
|
|
1809
|
+
* the widget's own honest card instead of a press that did nothing.
|
|
1810
|
+
*/
|
|
1811
|
+
private startHostedCheckout;
|
|
1812
|
+
/**
|
|
1813
|
+
* Fetch the checkout chunk and put its card over the map.
|
|
1814
|
+
*
|
|
1815
|
+
* Every failure here lands the buyer back on a map with their seats still
|
|
1816
|
+
* held, which is a place they can act from — a blocked chunk request must not
|
|
1817
|
+
* leave them staring at a CTA that no longer does anything.
|
|
1818
|
+
*/
|
|
1819
|
+
private openCheckoutPanel;
|
|
1820
|
+
private closeCheckoutPanel;
|
|
1640
1821
|
/** Assemble the stable {@link CheckoutHandoff} from a hold's server line items. */
|
|
1641
1822
|
private buildHandoff;
|
|
1642
1823
|
private emitHoldChange;
|
|
@@ -3443,4 +3624,4 @@ declare class ChannelsMode {
|
|
|
3443
3624
|
handleBack(): boolean;
|
|
3444
3625
|
}
|
|
3445
3626
|
|
|
3446
|
-
export { ACCESS_LINK_DEFAULTS, type AccessLinkRecord, type AccessLinkReveal, type AccessLinkState, type AccessLinkStatus, type AccessLinkStatusRecord, ApiError, type ArchiveBlockedDetails, type AssignmentBuckets, type AssignmentDropDetails, type AssignmentResult, type AttachPickerFrameOptions, type BestAvailableResult, type BucketRow, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, type ChannelAccessIntent, type ChannelAccessSummary, type ChannelAllocationPage, type ChannelAuditEntry, type ChannelAuditPage, type ChannelCounts, type ChannelListResult, type ChannelPreviewProjection, type ChannelRecord, type ChannelSeatStatus, type ChannelState, type ChannelsCapabilities, type ChannelsClient, ChannelsMode, type ChannelsModeHost, type ChannelsSeatView, type CheckoutHandoff, type CheckoutLineItem, type ControlRoomActivityEntry, type ControlRoomSectionMetric, type ControlRoomSnapshot, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type LogEntry, type LogPage, ManageApi, ManageApiError, PUBLIC_CHANNEL_ID, PUBLIC_CHANNEL_NAME, type Projection, type PubApiOptions, type RealtimeSink, type ReportByStatus, type ReportCategoryMeta, type ReportCategoryRow, type ReportResult, type ResumedHoldResult, SeatManager, type SeatManagerActionResult, type SeatManagerActivity, type SeatManagerCapability, type SeatManagerConnection, type SeatManagerMode, type SeatManagerOptions, type SeatManagerTallies, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedObjectUnavailableEvent, type SelectedSeat, type SelectionSourceRow, type StatusChange, type SubscribeTicket$1 as SubscribeTicket, accessIntentLabel, accessLine, accessLinkBadge, accessLinkErrorCopy, accessLinkIsLive, accessLinkPolicyLines, attachPickerFrame, bucketRows, bucketRowsHtml, createBuyerAccessContext, createControllerSink, dropReviewRows, isPublicChannelId, markerLetter, markerOf, mutationCount, needsMoveConfirmation, planAssignment, retryAfterCopy, selectionSources, stateBadge, suggestMarker };
|
|
3627
|
+
export { ACCESS_LINK_DEFAULTS, type AccessLinkRecord, type AccessLinkReveal, type AccessLinkState, type AccessLinkStatus, type AccessLinkStatusRecord, ApiError, type ArchiveBlockedDetails, type AssignmentBuckets, type AssignmentDropDetails, type AssignmentResult, type AttachPickerFrameOptions, type BestAvailableResult, type BucketRow, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, type ChannelAccessIntent, type ChannelAccessSummary, type ChannelAllocationPage, type ChannelAuditEntry, type ChannelAuditPage, type ChannelCounts, type ChannelListResult, type ChannelPreviewProjection, type ChannelRecord, type ChannelSeatStatus, type ChannelState, type ChannelsCapabilities, type ChannelsClient, ChannelsMode, type ChannelsModeHost, type ChannelsSeatView, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, type ControlRoomActivityEntry, type ControlRoomSectionMetric, type ControlRoomSnapshot, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type LogEntry, type LogPage, ManageApi, ManageApiError, type OrderStatusResult, PUBLIC_CHANNEL_ID, PUBLIC_CHANNEL_NAME, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type Projection, type PubApiOptions, type RealtimeSink, type ReportByStatus, type ReportCategoryMeta, type ReportCategoryRow, type ReportResult, type ResumedHoldResult, SeatManager, type SeatManagerActionResult, type SeatManagerActivity, type SeatManagerCapability, type SeatManagerConnection, type SeatManagerMode, type SeatManagerOptions, type SeatManagerTallies, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedObjectUnavailableEvent, type SelectedSeat, type SelectionSourceRow, type StatusChange, type SubscribeTicket$1 as SubscribeTicket, accessIntentLabel, accessLine, accessLinkBadge, accessLinkErrorCopy, accessLinkIsLive, accessLinkPolicyLines, attachPickerFrame, bucketRows, bucketRowsHtml, createBuyerAccessContext, createControllerSink, dropReviewRows, isPublicChannelId, markerLetter, markerOf, mutationCount, needsMoveConfirmation, planAssignment, retryAfterCopy, selectionSources, stateBadge, suggestMarker };
|