@forgebuild/hotal-ui 0.23.202 → 0.23.204
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.ts
CHANGED
|
@@ -421,10 +421,32 @@ export interface SpaBookingPayload {
|
|
|
421
421
|
email: string;
|
|
422
422
|
phone: string;
|
|
423
423
|
notes: string;
|
|
424
|
+
/** The PaymentIntent confirmed on the Details step -- only present when
|
|
425
|
+
* payment is enabled (stripePublishableKey + createPaymentIntent). Verify
|
|
426
|
+
* its status and amount server-side before booking, and refund/cancel it
|
|
427
|
+
* if the booking is then rejected. */
|
|
428
|
+
stripePaymentIntentId?: string;
|
|
424
429
|
}
|
|
425
430
|
|
|
426
431
|
export type SpaBookingResult = { ok: true } | { ok: false; error?: string };
|
|
427
432
|
|
|
433
|
+
/** The slot a spa PaymentIntent is created for -- the host prices it. */
|
|
434
|
+
export interface SpaPaymentIntentRequest {
|
|
435
|
+
treatmentId: string;
|
|
436
|
+
date: string;
|
|
437
|
+
time: string;
|
|
438
|
+
therapistId?: string;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export interface SpaPaymentIntentResult {
|
|
442
|
+
clientSecret: string;
|
|
443
|
+
paymentIntentId: string;
|
|
444
|
+
/** The intent's amount (Stripe integer units) and currency, shown as
|
|
445
|
+
* "£X due now" above the card form. Omit either to show no amount. */
|
|
446
|
+
amount?: number;
|
|
447
|
+
currency?: string;
|
|
448
|
+
}
|
|
449
|
+
|
|
428
450
|
export interface SpaBookingWidgetStrings {
|
|
429
451
|
chooseServiceLabel: string;
|
|
430
452
|
loadingServices: string;
|
|
@@ -440,6 +462,7 @@ export interface SpaBookingWidgetStrings {
|
|
|
440
462
|
therapistFilterLabel: string;
|
|
441
463
|
anyTherapistLabel: string;
|
|
442
464
|
staffRowLabel: string;
|
|
465
|
+
bookedAtLabel: string;
|
|
443
466
|
totalLabel: string;
|
|
444
467
|
continueLabel: string;
|
|
445
468
|
changeServiceLabel: string;
|
|
@@ -462,6 +485,13 @@ export interface SpaBookingWidgetStrings {
|
|
|
462
485
|
memberRateLabel: string;
|
|
463
486
|
membersOnlyLabel: string;
|
|
464
487
|
membersOnlyHint: string;
|
|
488
|
+
paymentLabel: string;
|
|
489
|
+
paymentDueLabel: string;
|
|
490
|
+
paymentHint: string;
|
|
491
|
+
paymentUnavailable: string;
|
|
492
|
+
paymentNotReady: string;
|
|
493
|
+
paymentFailed: string;
|
|
494
|
+
confirmPayLabel: string;
|
|
465
495
|
}
|
|
466
496
|
|
|
467
497
|
export interface SpaBookingWidgetElement extends HTMLElement {
|
|
@@ -523,6 +553,16 @@ export interface SpaBookingWidgetElement extends HTMLElement {
|
|
|
523
553
|
* undefined on "Any therapist" or when fetchTherapists was never provided. */
|
|
524
554
|
fetchAvailability?: (fromISO: string, toISO: string, treatmentId: string, therapistId?: string) => Promise<SpaAvailabilityDay[]>;
|
|
525
555
|
submitBooking?: (payload: SpaBookingPayload) => Promise<SpaBookingResult>;
|
|
556
|
+
/** Optional payment: with both this and stripePublishableKey set, the
|
|
557
|
+
* Details step shows a Stripe Payment Element and confirms it before
|
|
558
|
+
* submitBooking (which then gets stripePaymentIntentId). The host's
|
|
559
|
+
* intent decides full charge, deposit, or manual-capture hold. Called
|
|
560
|
+
* on entering Details, and again if the visitor picks a different slot
|
|
561
|
+
* before paying. Unused in skipDetailsStep mode. JS property only. */
|
|
562
|
+
createPaymentIntent?: (req: SpaPaymentIntentRequest) => Promise<SpaPaymentIntentResult>;
|
|
563
|
+
stripePublishableKey?: string;
|
|
564
|
+
/** Stripe Elements `appearance` object. JS property only. */
|
|
565
|
+
stripeAppearance?: Record<string, unknown>;
|
|
526
566
|
}
|
|
527
567
|
|
|
528
568
|
export interface ReservationCancelPayload {
|