@riverbankcms/sdk 0.148.0 → 0.150.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 +1 -1
- package/dist/EventEmbeddedCheckoutStep-D00Kc8Zj.mjs +285 -0
- package/dist/{PreviewEditorSidebar-DvEPG3Z2.mjs → PreviewEditorSidebar-7ZhmmnBB.mjs} +103 -66
- package/dist/{PreviewEditorUI-D6eb6fkx.mjs → PreviewEditorUI-BIJucTRd.mjs} +3 -6
- package/dist/{PreviewQueryProvider-5znTyJuz.mjs → PreviewQueryProvider-C0mndwHB.mjs} +3 -3
- package/dist/{SdkPreviewModeRuntime-DJ6utQ_R.mjs → SdkPreviewModeRuntime-tj45gmCX.mjs} +96 -67
- package/dist/{SiteChromeCustomizeContext-CFJYh6vo.mjs → SiteChromeCustomizeContext-BFOt0ss-.mjs} +4804 -4161
- package/dist/_dts/ai/src/contracts/proposals.d.ts +660 -0
- package/dist/_dts/ai/src/contracts/siteStyleProposalSchemas.d.ts +510 -0
- package/dist/_dts/api/src/billing.d.ts +2 -2
- package/dist/_dts/api/src/bookingConfig.d.ts +33 -48
- package/dist/_dts/api/src/bookingManagementEndpoints.d.ts +2 -6
- package/dist/_dts/api/src/bookingOperations.d.ts +5 -7
- package/dist/_dts/api/src/bookingRecords.d.ts +15 -11
- package/dist/_dts/api/src/bookingRefundOutcomes.d.ts +5 -5
- package/dist/_dts/api/src/clientErrorReporting.d.ts +11 -0
- package/dist/_dts/api/src/commercePortalEndpoints.d.ts +0 -2
- package/dist/_dts/api/src/common/cancellation.d.ts +23 -0
- package/dist/_dts/api/src/contentRuntime.d.ts +5 -1
- package/dist/_dts/api/src/customerMembershipOutcomes.d.ts +1 -1
- package/dist/_dts/api/src/endpoints.d.ts +2 -10
- package/dist/_dts/api/src/eventManagementContracts.d.ts +4 -7
- package/dist/_dts/api/src/footerCompositionContracts.d.ts +9 -0
- package/dist/_dts/api/src/footerSettings.d.ts +3 -3
- package/dist/_dts/api/src/index.d.ts +4 -4
- package/dist/_dts/api/src/navigation/bookingPortalLink.d.ts +13 -0
- package/dist/_dts/api/src/navigation.d.ts +1 -0
- package/dist/_dts/api/src/publicAppointmentBookingContracts.d.ts +2 -2
- package/dist/_dts/api/src/publicExperience/commerceEndpoints.d.ts +2 -29
- package/dist/_dts/api/src/publicExperience/eventEndpoints.d.ts +9 -173
- package/dist/_dts/api/src/request.d.ts +1 -1
- package/dist/_dts/api/src/sdk-event-upsert.d.ts +1 -1
- package/dist/_dts/api/src/sdkPullEventContracts.d.ts +1 -1
- package/dist/_dts/api/src/sdkThemeWire.d.ts +12 -0
- package/dist/_dts/api/src/siteManagementEndpoints.d.ts +3 -3
- package/dist/_dts/api/src/siteOperations.d.ts +6 -2
- package/dist/_dts/api/src/siteSettings.d.ts +2 -0
- package/dist/_dts/blocks/src/client/site-chrome.d.ts +1 -1
- package/dist/_dts/blocks/src/client.d.ts +2 -1
- package/dist/_dts/blocks/src/contracts/index.d.ts +1 -1
- package/dist/_dts/blocks/src/contracts/non-block-islands.d.ts +2 -2
- package/dist/_dts/blocks/src/contracts/proof-block-islands.d.ts +38 -10
- package/dist/_dts/blocks/src/portal/types.d.ts +9 -6
- package/dist/_dts/blocks/src/rendering/server.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/events/shared/schemas.d.ts +24 -24
- package/dist/_dts/blocks/src/system/blocks/events/shared/types.d.ts +1 -1
- package/dist/_dts/blocks/src/system/blocks/shared/bookingPaymentTerms.d.ts +84 -160
- package/dist/_dts/blocks/src/system/blocks/shop.d.ts +2 -2
- package/dist/_dts/blocks/src/system/blocks/shop.shared.d.ts +31 -4
- package/dist/_dts/blocks/src/system/blocks/site-footer-runtime.d.ts +30 -3
- package/dist/_dts/blocks/src/system/designCapabilities.d.ts +10 -1
- package/dist/_dts/blocks/src/system/runtime/api/index.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/appointments.d.ts +2 -2
- package/dist/_dts/blocks/src/system/runtime/api/types/core.d.ts +3 -1
- package/dist/_dts/blocks/src/system/runtime/api/types/events.d.ts +38 -18
- package/dist/_dts/blocks/src/system/runtime/components/registry.client.d.ts +48 -6
- package/dist/_dts/blocks/src/system/runtime/components/runtime-backed-blocks.d.ts +24 -3
- package/dist/_dts/blocks/src/system/runtime/hooks/useBookingNowIso.d.ts +8 -0
- package/dist/_dts/blocks/src/system/runtime/hooks/useHeadlessEventRegistrationFlow.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.server.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/booking-form.state.d.ts +2 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/commerce/shared/display.d.ts +9 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-details/presentation.d.ts +14 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventEmbeddedCheckoutStep.d.ts +13 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationPayment.d.ts +15 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/EventRegistrationWizardActions.d.ts +0 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/FullyBookedStep.d.ts +6 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentBlockingPanel.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/PaymentSelectionStep.d.ts +4 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.contract.d.ts +15 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/event-registration.headless.planning.d.ts +4 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/eventPaymentOptions.d.ts +3 -3
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentLocation.d.ts +3 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/paymentResponse.d.ts +72 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationCompletion.d.ts +66 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationErrorRecovery.d.ts +1 -4
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/registrationStateMachine.d.ts +13 -5
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/sessionStorage.d.ts +11 -52
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/types.d.ts +19 -2
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationStripeReturn.d.ts +7 -42
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationSubmit.d.ts +7 -8
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventRegistrationWizard.d.ts +94 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useGuestRegistrationRecovery.d.ts +30 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/usePaymentStatusRecovery.d.ts +24 -12
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useRegistrationAdmission.d.ts +18 -0
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/wizardSteps.d.ts +6 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration.interactive.d.ts +1 -1
- package/dist/_dts/blocks/src/system/runtime/nodes/events/shared/eventCollectionContract.d.ts +24 -24
- package/dist/_dts/blocks/src/system/runtime/nodes/shop.interactive.d.ts +41 -6
- package/dist/_dts/blocks/src/system/runtime/shared/bookingPaymentOptions.d.ts +7 -2
- package/dist/_dts/blocks/src/system/runtime/shared/stripe/browserStripe.d.ts +8 -0
- package/dist/_dts/blocks/src/system/transforms/registry/eventCalendar.d.ts +8 -0
- package/dist/_dts/commerce/src/purchase/bookingPaymentSelection.d.ts +54 -0
- package/dist/_dts/commerce/src/purchase/checkoutCommitPlan.d.ts +58 -13
- package/dist/_dts/commerce/src/purchase/checkoutCopy.d.ts +10 -0
- package/dist/_dts/commerce/src/purchase/checkoutErrorCodes.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/checkoutPaymentPlanPlanning.d.ts +16 -21
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTerms.d.ts +23 -40
- package/dist/_dts/commerce/src/purchase/checkoutPresentation.d.ts +49 -0
- package/dist/_dts/commerce/src/purchase/checkoutSessionMetadata.d.ts +6 -6
- package/dist/_dts/commerce/src/purchase/checkoutStripeFinalizationPlanning.d.ts +5 -1
- package/dist/_dts/commerce/src/purchase/checkoutStripeSessionPlanning.d.ts +5 -4
- package/dist/_dts/commerce/src/purchase/event-registration-errors.d.ts +9 -0
- package/dist/_dts/commerce/src/purchase/index.d.ts +3 -3
- package/dist/_dts/commerce/src/purchase/membershipOrderItemMetadata.d.ts +4 -0
- package/dist/_dts/commerce/src/purchase/oneTimeCheckoutPlanning.d.ts +9 -4
- package/dist/_dts/commerce/src/purchase/orderInstalmentClosure.d.ts +13 -1
- package/dist/_dts/commerce/src/purchase/orderInstalmentLifecycle.d.ts +5 -0
- package/dist/_dts/commerce/src/purchase/orderItemMetadata.d.ts +4 -1
- package/dist/_dts/commerce/src/purchase/orderTypes.d.ts +7 -1
- package/dist/_dts/commerce/src/purchase/refundRailSplit.d.ts +1 -1
- package/dist/_dts/commerce/src/purchase/stateTransitions.d.ts +2 -2
- package/dist/_dts/commerce/src/purchase/stripeCheckoutReturnUrl.d.ts +9 -2
- package/dist/_dts/commerce/src/purchase/stripeMinimumCharge.d.ts +6 -0
- package/dist/_dts/commerce/src/purchase/types.d.ts +7 -7
- package/dist/_dts/content-editor/src/FooterComposerOverview.d.ts +3 -2
- package/dist/_dts/content-editor/src/controller/editLeaseHandover.d.ts +30 -0
- package/dist/_dts/content-editor/src/footerPreviewRuntime.d.ts +6 -1
- package/dist/_dts/content-editor/src/lib/browserStorage.d.ts +5 -0
- package/dist/_dts/content-editor/src/useFooterComposerState.d.ts +7 -0
- package/dist/_dts/core/src/booking-flexible-balance.d.ts +2 -2
- package/dist/_dts/core/src/booking-instalment-deposit.d.ts +20 -0
- package/dist/_dts/core/src/booking-live-payment-terms.d.ts +72 -0
- package/dist/_dts/core/src/booking-payment-options.d.ts +24 -0
- package/dist/_dts/core/src/booking-payment-schemas.d.ts +522 -0
- package/dist/_dts/core/src/branded.d.ts +3 -0
- package/dist/_dts/core/src/edit-lease.d.ts +5 -0
- package/dist/_dts/core/src/index.d.ts +4 -0
- package/dist/_dts/core/src/patch/index.d.ts +30 -0
- package/dist/_dts/db/src/generated/supabase/database.types.d.ts +326 -36
- package/dist/_dts/media-editor/src/MediaPickerDialog.d.ts +3 -1
- package/dist/_dts/media-editor/src/MediaPickerMiniDialog.d.ts +10 -0
- package/dist/_dts/media-editor/src/index.d.ts +2 -0
- package/dist/_dts/preview-next/src/client/preview/PreviewEntryControllerProvider.d.ts +0 -1
- package/dist/_dts/preview-next/src/client/preview/PreviewShell.d.ts +1 -1
- package/dist/_dts/preview-next/src/client/previewAuthStore.d.ts +7 -0
- package/dist/_dts/preview-next/src/constants.d.ts +4 -0
- package/dist/_dts/preview-next/src/keepAlive.d.ts +1 -0
- package/dist/_dts/sdk/src/bookings/index.d.ts +2 -1
- package/dist/_dts/sdk/src/bookings/types.d.ts +1 -1
- package/dist/_dts/sdk/src/rendering/islands/types.d.ts +2 -12
- package/dist/_dts/sdk/src/version.d.ts +1 -1
- package/dist/_dts/theme-core/src/blocks/index.d.ts +1 -0
- package/dist/_dts/theme-core/src/blocks/opaquePanels.d.ts +147 -0
- package/dist/_dts/theme-core/src/boxBackgroundSchema.d.ts +22 -0
- package/dist/_dts/theme-core/src/buttons/buttonSurfaceContext.d.ts +22 -0
- package/dist/_dts/theme-core/src/cards/roles.d.ts +12 -0
- package/dist/_dts/theme-core/src/generated/containerResponsiveThemeCss.d.ts +1 -1
- package/dist/_dts/theme-core/src/mock-themes/all.d.ts +198 -0
- package/dist/_dts/theme-core/src/palette/utils/index.d.ts +2 -0
- package/dist/_dts/theme-core/src/palette/utils/scrimContrast.d.ts +22 -0
- package/dist/_dts/theme-core/src/runtime/bridgeColourTokens.d.ts +10 -0
- package/dist/_dts/theme-core/src/schema.d.ts +330 -0
- package/dist/_dts/theme-core/src/site-styles/appearancePresetCatalog.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/blockAppearancePresets.d.ts +0 -51
- package/dist/_dts/theme-core/src/site-styles/lookResolution.d.ts +11 -0
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorCapabilities.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignEditorModel.d.ts +7 -1
- package/dist/_dts/theme-core/src/site-styles/pageDesignIntent.d.ts +0 -5
- package/dist/_dts/theme-core/src/site-styles/previewRuntimeCapabilities.d.ts +12 -6
- package/dist/_dts/theme-core/src/site-styles/runtimeCompiler.d.ts +7 -4
- package/dist/_dts/theme-core/src/site-styles/sectionSurfaceBackgrounds.d.ts +65 -0
- package/dist/_dts/theme-core/src/site-styles/types.d.ts +17 -0
- package/dist/_dts/theme-core/src/surfaces/opaqueSurface.d.ts +43 -0
- package/dist/_dts/ui/src/color-picker.d.ts +1 -1
- package/dist/_dts/ui/src/palette/useHexDraft.d.ts +7 -0
- package/dist/client/{BookingMailingListNote-CzRt2dF_.mjs → BookingMailingListNote-CYHOufsI.mjs} +33 -124
- package/dist/client/{CheckboxChoice-B33MqoUo.mjs → CheckboxChoice-M-3HycLw.mjs} +1 -1
- package/dist/client/{DemoBookingPortalAccess-mxqwap3f.mjs → DemoBookingPortalAccess-Cvr9O_ca.mjs} +2 -2
- package/dist/client/{EventCombined.client-CDb11igO.mjs → EventCombined.client-m5UZIobP.mjs} +7 -7
- package/dist/client/EventEmbeddedCheckoutStep-DL6zFAkA.mjs +289 -0
- package/dist/client/{EventListing.client-EgYhzKPa.mjs → EventListing.client-DeMfCM04.mjs} +2 -2
- package/dist/client/{LeafletStaticMap-gtmtaA2b.mjs → LeafletStaticMap-CvZ3gOdD.mjs} +1 -1
- package/dist/client/{checkoutUrls-CXhko2Rv.mjs → RichText-BtfNvQV6.mjs} +2 -29
- package/dist/client/{TerminalPanel-DvNUP5ot.mjs → TerminalPanel-CUCNEwlH.mjs} +2 -18
- package/dist/client/{ThemedButton-C7CeUJjW.mjs → ThemedButton-C7WhXuRl.mjs} +2 -2
- package/dist/client/{accordion-kjvt49rA.mjs → accordion-cQm5mjqs.mjs} +1 -1
- package/dist/client/{bookingForm-pbRZordh.mjs → bookingForm-BVPJE5RQ.mjs} +15 -11
- package/dist/client/bookings.mjs +2860 -1222
- package/dist/client/{carousel-f4Zbmicv.mjs → carousel-3vgnY7LC.mjs} +2 -2
- package/dist/client/{carousel.client-A2lG-9od.mjs → carousel.client-CISsdZvg.mjs} +1 -1
- package/dist/client/{cart-DO20An50.mjs → cart-BGK4oOjm.mjs} +3 -3
- package/dist/client/{checkout-Du5amDR_.mjs → checkout-GsBLUNJD.mjs} +3 -3
- package/dist/client/checkoutUrls-ChxwaNtO.mjs +28 -0
- package/dist/client/client.mjs +3324 -2053
- package/dist/client/{colorStyles-j5U9v5JA.mjs → colorStyles-D-32xHZh.mjs} +2 -30
- package/dist/client/{context-eW97E945.mjs → context-D_8s12Fp.mjs} +1 -1
- package/dist/client/{dates-jPCirRea.mjs → dates-DeJQbQ9T.mjs} +2 -2
- package/dist/client/{eventCalendar-C2M-iE4j.mjs → eventCalendar-cmucD4NR.mjs} +10 -10
- package/dist/client/{eventCombined-W6ns3LHg.mjs → eventCombined-ku3E9FTl.mjs} +4 -4
- package/dist/client/{eventDetails-CR-GT0f0.mjs → eventDetails-CyKZ61sF.mjs} +5 -5
- package/dist/client/{eventListing-BK8AfYZz.mjs → eventListing-B7yxGIhX.mjs} +4 -4
- package/dist/client/{eventRegistration-BJSd4KUu.mjs → eventRegistration-BoXfSFgZ.mjs} +1455 -1184
- package/dist/client/{form-BvpfbQaT.mjs → form-CNQOWhJo.mjs} +5 -5
- package/dist/client/{headerSection-I5sUQ8x-.mjs → headerSection-DahaBJGQ.mjs} +3 -3
- package/dist/client/hooks.mjs +283 -193
- package/dist/client/{locationMap-BLvwf9_f.mjs → locationMap-BoDjqYlW.mjs} +4 -4
- package/dist/client/{media-Cl38iOMI.mjs → media-BFY0y2rb.mjs} +2 -1
- package/dist/client/{newsletterForm-DrQ2weE8.mjs → newsletterForm-DtzXDklw.mjs} +4 -4
- package/dist/client/{pricing-BES87mrR.mjs → pricing-DXEh2Lhh.mjs} +1 -1
- package/dist/client/{productDetail-Url9jcc5.mjs → productDetail-D7cPa-00.mjs} +3 -3
- package/dist/client/{productList-DE7ngEZJ.mjs → productList-D1XMap66.mjs} +3 -3
- package/dist/client/{propsDecoder-D1OtGXDV.mjs → propsDecoder-DiIeBopB.mjs} +913 -322
- package/dist/client/rendering/client.mjs +3913 -2260
- package/dist/client/rendering/islands.mjs +19 -19
- package/dist/client/rendering.mjs +3302 -2013
- package/dist/client/result-DRW7JWXz.mjs +30 -0
- package/dist/client/{routeIslandApiConfig-BG9Y-SHg.mjs → routeIslandApiConfig-wzR4lKAY.mjs} +1 -1
- package/dist/client/scrollToBlock-C86BYkyV.mjs +17 -0
- package/dist/client/{shop-CJkuySJ3.mjs → shop-CYT5P-S5.mjs} +13 -14
- package/dist/client/{shop-commerce-store-Bxm75Pg6.mjs → shop-commerce-store-wKhsJQxI.mjs} +1 -1
- package/dist/client/{shop-commerce-4rKj5n9h.mjs → shop-commerce-ypBu_dx4.mjs} +9 -9
- package/dist/client/{shopShared-DpoQDWfz.mjs → shopShared-DFGhYrf2.mjs} +52 -6
- package/dist/client/{useEventFilters-D8HliSqR.mjs → useEventFilters-blSbN5o7.mjs} +8 -8
- package/dist/preview-next/before-render.mjs +15 -22
- package/dist/preview-next/client/runtime.mjs +4 -4
- package/dist/preview-next/constants.mjs +5 -1
- package/dist/preview-next/index.mjs +5 -1
- package/dist/preview-next/keepAlive.mjs +149 -82
- package/dist/preview-next/middleware.mjs +15 -22
- package/dist/{previewAuthStore-BXXF3hhW.mjs → previewAuthStore-BBmV7UsW.mjs} +49 -29
- package/dist/{sdk-runtime-C2a05WjL.mjs → sdk-runtime-2p8uQk1V.mjs} +2 -2
- package/dist/{separator-CuNhBAhS.mjs → separator-Cvvzk0Oo.mjs} +1 -1
- package/dist/server/components.mjs +4041 -3704
- package/dist/server/config-validation.mjs +345 -255
- package/dist/server/config.mjs +345 -255
- package/dist/server/data.mjs +283 -193
- package/dist/server/index.mjs +20 -27
- package/dist/server/next.mjs +788 -469
- package/dist/server/page-converter.mjs +245 -121
- package/dist/server/prebuild.mjs +1 -1
- package/dist/server/rendering/server.mjs +4018 -3690
- package/dist/server/rendering.mjs +4044 -3707
- package/dist/server/routing.mjs +314 -190
- package/dist/server/server.mjs +290 -218
- package/dist/server/theme-bridge.mjs +1122 -310
- package/dist/server/theme.mjs +126 -116
- package/dist/spinner-CDo6AkDz.mjs +658 -0
- package/dist/styles/index.css +75 -212
- package/package.json +1 -1
- package/dist/_dts/api/src/bookingPaymentTermSchemas.d.ts +0 -123
- package/dist/_dts/billing/src/checkout/platform.d.ts +0 -77
- package/dist/_dts/billing/src/config/env.d.ts +0 -29
- package/dist/_dts/billing/src/stripe/client.d.ts +0 -29
- package/dist/_dts/blocks/src/system/runtime/hooks/usePaymentVerification.d.ts +0 -63
- package/dist/_dts/blocks/src/system/runtime/nodes/event-registration/useEventCheckoutHandoffRestore.d.ts +0 -9
- package/dist/_dts/commerce/src/purchase/checkoutPaymentTermPlanning.d.ts +0 -10
- package/dist/_dts/commerce/src/purchase/checkoutValidatedItemPlanning.d.ts +0 -55
- package/dist/_dts/commerce/src/purchase/orderInstalmentPayoff.d.ts +0 -24
- package/dist/client/urlParams-D71VXFGx.mjs +0 -47
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type BlockButtonRole } from '../../constants/buttonRoles';
|
|
2
|
-
import type
|
|
2
|
+
import { type PublicMembershipProduct } from '../../blocks/shop.shared';
|
|
3
3
|
import type { PublicProduct } from '../../blocks/products/shared';
|
|
4
4
|
import { type CartDisplay, type CheckoutDisplay, type PassesMembershipsDisplay, type ProductDetailDisplay, type ProductListDisplay } from './commerce/shared/display';
|
|
5
5
|
import type { CommerceCartItem } from './shop-commerce.shared';
|
|
@@ -112,7 +112,14 @@ export declare const shopBlockRuntime: Readonly<{
|
|
|
112
112
|
description: string | null;
|
|
113
113
|
priceLabel: string;
|
|
114
114
|
intervalLabel: string;
|
|
115
|
-
|
|
115
|
+
action: Readonly<{
|
|
116
|
+
kind: "purchase";
|
|
117
|
+
label: string;
|
|
118
|
+
product: import("../..").PurchasablePublicMembershipProduct;
|
|
119
|
+
}> | Readonly<{
|
|
120
|
+
kind: "unavailable";
|
|
121
|
+
label: string;
|
|
122
|
+
}>;
|
|
116
123
|
}>[];
|
|
117
124
|
}>;
|
|
118
125
|
hydration: Readonly<{
|
|
@@ -161,7 +168,14 @@ export declare const shopBlockRuntime: Readonly<{
|
|
|
161
168
|
description: string | null;
|
|
162
169
|
priceLabel: string;
|
|
163
170
|
intervalLabel: string;
|
|
164
|
-
|
|
171
|
+
action: Readonly<{
|
|
172
|
+
kind: "purchase";
|
|
173
|
+
label: string;
|
|
174
|
+
product: import("../..").PurchasablePublicMembershipProduct;
|
|
175
|
+
}> | Readonly<{
|
|
176
|
+
kind: "unavailable";
|
|
177
|
+
label: string;
|
|
178
|
+
}>;
|
|
165
179
|
}>[];
|
|
166
180
|
}>;
|
|
167
181
|
hydration: Readonly<{
|
|
@@ -204,7 +218,14 @@ export declare const shopBlockRuntime: Readonly<{
|
|
|
204
218
|
description: string | null;
|
|
205
219
|
priceLabel: string;
|
|
206
220
|
intervalLabel: string;
|
|
207
|
-
|
|
221
|
+
action: Readonly<{
|
|
222
|
+
kind: "purchase";
|
|
223
|
+
label: string;
|
|
224
|
+
product: import("../..").PurchasablePublicMembershipProduct;
|
|
225
|
+
}> | Readonly<{
|
|
226
|
+
kind: "unavailable";
|
|
227
|
+
label: string;
|
|
228
|
+
}>;
|
|
208
229
|
}>[];
|
|
209
230
|
}>;
|
|
210
231
|
hydration: Readonly<{
|
|
@@ -565,7 +586,14 @@ export declare const shopInteractiveIslandPropsCodec: Readonly<{
|
|
|
565
586
|
description: string | null;
|
|
566
587
|
priceLabel: string;
|
|
567
588
|
intervalLabel: string;
|
|
568
|
-
|
|
589
|
+
action: Readonly<{
|
|
590
|
+
kind: "purchase";
|
|
591
|
+
label: string;
|
|
592
|
+
product: import("../..").PurchasablePublicMembershipProduct;
|
|
593
|
+
}> | Readonly<{
|
|
594
|
+
kind: "unavailable";
|
|
595
|
+
label: string;
|
|
596
|
+
}>;
|
|
569
597
|
}>[];
|
|
570
598
|
}>;
|
|
571
599
|
hydration: Readonly<{
|
|
@@ -618,7 +646,14 @@ export declare const shopInteractiveIslandPropsCodec: Readonly<{
|
|
|
618
646
|
description: string | null;
|
|
619
647
|
priceLabel: string;
|
|
620
648
|
intervalLabel: string;
|
|
621
|
-
|
|
649
|
+
action: Readonly<{
|
|
650
|
+
kind: "purchase";
|
|
651
|
+
label: string;
|
|
652
|
+
product: import("../..").PurchasablePublicMembershipProduct;
|
|
653
|
+
}> | Readonly<{
|
|
654
|
+
kind: "unavailable";
|
|
655
|
+
label: string;
|
|
656
|
+
}>;
|
|
622
657
|
}>[];
|
|
623
658
|
}>;
|
|
624
659
|
hydration: Readonly<{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type BookingPaymentCollectionOptionKind } from '../../../../../core/src/index';
|
|
1
2
|
import type { BlockBookingPaymentCollectionOption, BlockBookingPaymentTerms } from '../../blocks/shared/bookingPaymentTerms';
|
|
2
|
-
export type BookingPaymentSelectionKind =
|
|
3
|
+
export type BookingPaymentSelectionKind = BookingPaymentCollectionOptionKind;
|
|
3
4
|
export type BookingPaymentOptionSummaryRow = Readonly<{
|
|
4
5
|
label: string;
|
|
5
6
|
value: string;
|
|
@@ -21,7 +22,6 @@ export type BookingPaymentSelectionViewModel = Readonly<{
|
|
|
21
22
|
export declare function resolveBookingPaymentDueNowCents(input: Readonly<{
|
|
22
23
|
option: BlockBookingPaymentCollectionOption;
|
|
23
24
|
totalCents: number;
|
|
24
|
-
bookingStartAt?: string | null;
|
|
25
25
|
}>): number;
|
|
26
26
|
export declare function buildBookingPaymentSelectionViewModel(input: Readonly<{
|
|
27
27
|
serviceTitle: string;
|
|
@@ -29,5 +29,10 @@ export declare function buildBookingPaymentSelectionViewModel(input: Readonly<{
|
|
|
29
29
|
priceAmount?: number | null;
|
|
30
30
|
priceCurrency?: string | null;
|
|
31
31
|
bookingStartAt?: string | null;
|
|
32
|
+
/**
|
|
33
|
+
* When the booking is being made, as an ISO timestamp. Instalment schedules
|
|
34
|
+
* start from here, the same anchor the server uses (the order's creation).
|
|
35
|
+
*/
|
|
36
|
+
nowIso: string;
|
|
32
37
|
locale?: string;
|
|
33
38
|
}>): BookingPaymentSelectionViewModel;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Stripe } from '@stripe/stripe-js';
|
|
2
|
+
import type { EmbeddedCheckoutBrowserContext } from '../../../../../../commerce/src/purchase/index';
|
|
3
|
+
import type { BrowserStripeKey } from '../../../../../../commerce/src/purchase/index';
|
|
4
|
+
export { checkBrowserStripeKey, type BrowserStripeKey } from '../../../../../../commerce/src/purchase/index';
|
|
5
|
+
/** Pure entry loading stays inert until a payment surface calls this function. */
|
|
6
|
+
export declare function loadBrowserStripe(context: EmbeddedCheckoutBrowserContext | Extract<BrowserStripeKey, {
|
|
7
|
+
tag: 'ready';
|
|
8
|
+
}>): Promise<Stripe | null>;
|
|
@@ -20,4 +20,12 @@ declare const readJobSchema: z.ZodObject<{
|
|
|
20
20
|
}, z.core.$strip>;
|
|
21
21
|
export declare const eventCalendarReadProfile: TransformDefinition;
|
|
22
22
|
export declare const eventCalendarReadEnabled: TransformDefinition<z.infer<typeof readJobSchema>>;
|
|
23
|
+
/**
|
|
24
|
+
* The week board's authored band paints `surfaceAlt` across the whole
|
|
25
|
+
* section, under whatever foreground the section resolved. That foreground is
|
|
26
|
+
* the page's only when the section paints nothing itself, so the band is
|
|
27
|
+
* honoured on a plain section and dropped when a Look or override already
|
|
28
|
+
* paints one (light band text on a pale board band otherwise).
|
|
29
|
+
*/
|
|
30
|
+
export declare const eventCalendarBanded: TransformDefinition;
|
|
23
31
|
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { AttendeeId, CheckoutLineId, BookingFlexibleBalanceConfig, BookingInstalmentPlanConfig, EventSeriesId, OccurrenceId } from '../../../core/src/index';
|
|
2
|
+
/** Identity within one checkout; a cart line is a booking command before persistence. */
|
|
3
|
+
export type BookingPaymentAttendeeReference = Readonly<{
|
|
4
|
+
kind: 'persisted';
|
|
5
|
+
attendeeId: AttendeeId;
|
|
6
|
+
}> | Readonly<{
|
|
7
|
+
kind: 'checkout_command';
|
|
8
|
+
checkoutLineId: CheckoutLineId;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* The booking a payment plan or flexible-balance contract collects for. A plan
|
|
12
|
+
* or contract may only cover checkout lines that belong to this booking.
|
|
13
|
+
*/
|
|
14
|
+
export type BookingPaymentBookingReference = Readonly<{
|
|
15
|
+
kind: 'appointment';
|
|
16
|
+
serviceId: string;
|
|
17
|
+
resourceId: string;
|
|
18
|
+
startAt: string;
|
|
19
|
+
}> | Readonly<{
|
|
20
|
+
kind: 'event_ticket';
|
|
21
|
+
occurrenceId: OccurrenceId;
|
|
22
|
+
attendee: BookingPaymentAttendeeReference;
|
|
23
|
+
}> | Readonly<{
|
|
24
|
+
kind: 'event_series_registration';
|
|
25
|
+
eventSeriesId: EventSeriesId;
|
|
26
|
+
attendee: BookingPaymentAttendeeReference;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* How one booking is paid for, resolved from its payment terms and the
|
|
30
|
+
* customer's choice. Appointments and attendee bookings share this shape.
|
|
31
|
+
*
|
|
32
|
+
* `not_required` is the £0 path: nothing is due, so no option was chosen.
|
|
33
|
+
* Plans and contracts carry the booking they collect for and when it starts.
|
|
34
|
+
*/
|
|
35
|
+
export type BookingPaymentSelection = Readonly<{
|
|
36
|
+
kind: 'not_required';
|
|
37
|
+
}> | Readonly<{
|
|
38
|
+
kind: 'upfront' | 'deferred_manual';
|
|
39
|
+
}> | Readonly<{
|
|
40
|
+
kind: 'instalment_plan';
|
|
41
|
+
plan: BookingInstalmentPlanConfig;
|
|
42
|
+
booking: BookingPaymentBookingReference;
|
|
43
|
+
bookingStartAt: string;
|
|
44
|
+
}> | Readonly<{
|
|
45
|
+
kind: 'flexible_balance';
|
|
46
|
+
config: BookingFlexibleBalanceConfig;
|
|
47
|
+
booking: BookingPaymentBookingReference;
|
|
48
|
+
bookingStartAt: string;
|
|
49
|
+
}>;
|
|
50
|
+
export type BookingPlanOrContractSelection = Extract<BookingPaymentSelection, {
|
|
51
|
+
kind: 'instalment_plan' | 'flexible_balance';
|
|
52
|
+
}>;
|
|
53
|
+
export declare function isBookingPlanOrContractSelection(selection: BookingPaymentSelection): selection is BookingPlanOrContractSelection;
|
|
54
|
+
export declare function isSameBookingPaymentReference(left: BookingPaymentBookingReference, right: BookingPaymentBookingReference): boolean;
|
|
@@ -6,7 +6,7 @@ export type CheckoutCommitOrderRecord = Readonly<{
|
|
|
6
6
|
reconciliationState: OrderCheckoutReconciliationState;
|
|
7
7
|
}>;
|
|
8
8
|
export type CheckoutCommitOrderItemRecord = Readonly<Pick<OrderItemPlanningRecord, 'kind' | 'commitState' | 'reconciliationState' | 'fulfilledAt' | 'cancelledAt' | 'customerMembershipId'>>;
|
|
9
|
-
export type CheckoutCommitPlanStepKind = 'consume_credit_reservation' | 'provision_memberships' | 'fulfill_order_items' | 'redeem_discount'
|
|
9
|
+
export type CheckoutCommitPlanStepKind = 'consume_credit_reservation' | 'provision_memberships' | 'fulfill_order_items' | 'redeem_discount';
|
|
10
10
|
export type NormalizedOrderCommitItem<TItem extends CheckoutCommitOrderItemRecord = CheckoutCommitOrderItemRecord> = Readonly<{
|
|
11
11
|
item: TItem;
|
|
12
12
|
commitState: OrderItemCommitState;
|
|
@@ -18,23 +18,68 @@ export type NormalizedOrderCommitSnapshot<TOrder extends CheckoutCommitOrderReco
|
|
|
18
18
|
reconciliationState: OrderCheckoutReconciliationState;
|
|
19
19
|
items: readonly NormalizedOrderCommitItem<TItem>[];
|
|
20
20
|
}>;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
/** Bypass checkouts take no Stripe session, so nothing provisions memberships from one. */
|
|
22
|
+
export type BypassCheckoutCommitPlanStepKind = Exclude<CheckoutCommitPlanStepKind, 'provision_memberships'>;
|
|
23
|
+
export type CheckoutCommitPlanStep<TStep extends CheckoutCommitPlanStepKind = CheckoutCommitPlanStepKind> = Readonly<{
|
|
24
|
+
kind: TStep;
|
|
23
25
|
}>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
/** A bypass commit never records a payment: there is no cash to record. */
|
|
27
|
+
export type BypassCheckoutCommitPlan<TOrder extends CheckoutCommitOrderRecord = CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord = CheckoutCommitOrderItemRecord> = Readonly<{
|
|
28
|
+
paymentRail: Extract<CheckoutPaymentRail, 'bypass'>;
|
|
29
|
+
normalized: NormalizedOrderCommitSnapshot<TOrder, TItem>;
|
|
30
|
+
steps: readonly CheckoutCommitPlanStep<BypassCheckoutCommitPlanStepKind>[];
|
|
31
|
+
paymentRecord: Extract<CheckoutCommitPaymentRecord, 'not_needed'>;
|
|
32
|
+
}>;
|
|
33
|
+
export type StripeCheckoutCommitPlan<TOrder extends CheckoutCommitOrderRecord = CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord = CheckoutCommitOrderItemRecord> = Readonly<{
|
|
34
|
+
paymentRail: Extract<CheckoutPaymentRail, 'stripe'>;
|
|
26
35
|
normalized: NormalizedOrderCommitSnapshot<TOrder, TItem>;
|
|
27
36
|
steps: readonly CheckoutCommitPlanStep[];
|
|
37
|
+
paymentRecord: CheckoutCommitPaymentRecord;
|
|
28
38
|
}>;
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
items: readonly TItem[];
|
|
32
|
-
}): NormalizedOrderCommitSnapshot<TOrder, TItem>;
|
|
33
|
-
export declare function buildCheckoutCommitPlan<TOrder extends CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord>(input: {
|
|
34
|
-
paymentRail: CheckoutPaymentRail;
|
|
39
|
+
export type CheckoutCommitPlan<TOrder extends CheckoutCommitOrderRecord = CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord = CheckoutCommitOrderItemRecord> = BypassCheckoutCommitPlan<TOrder, TItem> | StripeCheckoutCommitPlan<TOrder, TItem>;
|
|
40
|
+
type CheckoutCommitPlanInputBase<TOrder extends CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord> = Readonly<{
|
|
35
41
|
order: TOrder;
|
|
36
42
|
items: readonly TItem[];
|
|
37
43
|
creditReservationState: ReservationFinalizationState;
|
|
38
44
|
hasDiscountRedemption: boolean;
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
}>;
|
|
46
|
+
export type BypassCheckoutCommitPlanInput<TOrder extends CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord> = CheckoutCommitPlanInputBase<TOrder, TItem> & Readonly<{
|
|
47
|
+
paymentRail: Extract<CheckoutPaymentRail, 'bypass'>;
|
|
48
|
+
}>;
|
|
49
|
+
export type StripeCheckoutCommitPlanInput<TOrder extends CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord> = CheckoutCommitPlanInputBase<TOrder, TItem> & Readonly<{
|
|
50
|
+
paymentRail: Extract<CheckoutPaymentRail, 'stripe'>;
|
|
51
|
+
/**
|
|
52
|
+
* True when the commit has no payment of its own to record: the webhook
|
|
53
|
+
* recorded the session's receipt before the plan ran, or a subscription
|
|
54
|
+
* invoice owns the cash (its invoice.paid webhook records it).
|
|
55
|
+
*/
|
|
56
|
+
paymentOwnedElsewhere: boolean;
|
|
57
|
+
}>;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the commit records the order's payment once every step has
|
|
60
|
+
* completed. A Stripe checkout records here only when nothing else owns its
|
|
61
|
+
* payment (see `paymentOwnedElsewhere`): in practice a zero-total checkout,
|
|
62
|
+
* whose record completes the order without a cash receipt.
|
|
63
|
+
*/
|
|
64
|
+
export type CheckoutCommitPaymentRecord = 'record_after_steps' | 'not_needed';
|
|
65
|
+
/**
|
|
66
|
+
* What a checkout commit has done so far that a failure has to undo. The two
|
|
67
|
+
* facts move independently: a resumed commit can start with fulfillment
|
|
68
|
+
* already committed and credit still held. `held` also covers a checkout
|
|
69
|
+
* with no credit reservation, since there is nothing consumed to refund.
|
|
70
|
+
*/
|
|
71
|
+
export type CheckoutCommitProgress = Readonly<{
|
|
72
|
+
credit: 'held' | 'consumed';
|
|
73
|
+
fulfillment: Extract<CheckoutCommitState, 'pending' | 'committed'>;
|
|
74
|
+
}>;
|
|
75
|
+
/** Progress before the first step: items an earlier run committed count as fulfilled. */
|
|
76
|
+
export declare function initialCheckoutCommitProgress(normalized: Pick<NormalizedOrderCommitSnapshot, 'items'>): CheckoutCommitProgress;
|
|
77
|
+
/** Progress after `step` completes. */
|
|
78
|
+
export declare function advanceCheckoutCommitProgress(progress: CheckoutCommitProgress, step: CheckoutCommitPlanStepKind): CheckoutCommitProgress;
|
|
79
|
+
export declare function normalizeOrderCommitSnapshot<TOrder extends CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord>(input: {
|
|
80
|
+
order: TOrder;
|
|
81
|
+
items: readonly TItem[];
|
|
82
|
+
}): NormalizedOrderCommitSnapshot<TOrder, TItem>;
|
|
83
|
+
export declare function buildCheckoutCommitPlan<TOrder extends CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord>(input: BypassCheckoutCommitPlanInput<TOrder, TItem>): BypassCheckoutCommitPlan<TOrder, TItem>;
|
|
84
|
+
export declare function buildCheckoutCommitPlan<TOrder extends CheckoutCommitOrderRecord, TItem extends CheckoutCommitOrderItemRecord>(input: StripeCheckoutCommitPlanInput<TOrder, TItem>): StripeCheckoutCommitPlan<TOrder, TItem>;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Customer copy shared by checkout surfaces, so one approved wording reaches
|
|
3
|
+
* every place that shows it.
|
|
4
|
+
*/
|
|
5
|
+
export declare const checkoutCopy: {
|
|
6
|
+
/** A payment is still being confirmed; checking again is safe. */
|
|
7
|
+
readonly checkoutStillConfirming: "We’re still confirming your payment. This can take a minute – you can check again, and you won’t be charged twice.";
|
|
8
|
+
/** A previous attempt can't be confirmed automatically; the business needs to check it. */
|
|
9
|
+
readonly checkoutAssistanceRequired: "We can’t confirm your last payment attempt yet. Please don’t pay again – contact the business so they can check it.";
|
|
10
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type CheckoutErrorCode = "appointment_not_found" | "appointment_slot_unavailable" | "
|
|
1
|
+
export type CheckoutErrorCode = "appointment_not_found" | "appointment_slot_unavailable" | "booking_payment_terms_not_supported" | "checkout_amount_below_minimum" | "sliding_amount_required" | "sliding_amount_invalid" | "sliding_amount_below_min" | "sliding_amount_above_max" | "not_found" | "site_mismatch" | "registration_disabled" | "invalid_payment_method" | "payment_already_completed" | "invalid_payment_status" | "no_event_association" | "payment_not_required" | "customer_not_found" | "stripe_not_configured" | "stripe_commission_not_supported" | "stripe_tax_not_ready" | "stripe_tax_status_unavailable" | "whole_series_pricing_option_not_available" | "product_not_available" | "product_not_eligible" | "insufficient_credits" | "invalid_discount_code" | "unsupported_discount_scope" | "checkout_in_progress" | "stripe_error" | "internal_error";
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
import { type BookingFlexibleBalanceConfig } from '../../../core/src/index';
|
|
2
|
-
|
|
1
|
+
import { type BookingFlexibleBalanceConfig, type BookingInstalmentPlanConfig } from '../../../core/src/index';
|
|
2
|
+
import type { BookingPaymentSelection } from './bookingPaymentSelection';
|
|
3
|
+
/**
|
|
4
|
+
* What a paid checkout has to collect, given its payment selection. Paying in
|
|
5
|
+
* full, having nothing due and not choosing at all are all collected as one
|
|
6
|
+
* card payment; the free and credit-covered cases bypass before this matters.
|
|
7
|
+
*/
|
|
8
|
+
export type CheckoutPaymentObligation = Readonly<{
|
|
3
9
|
kind: 'stripe';
|
|
10
|
+
}> | Readonly<{
|
|
11
|
+
kind: 'deferred_manual';
|
|
4
12
|
}> | Readonly<{
|
|
5
13
|
kind: 'instalment_plan';
|
|
6
|
-
planDefinition:
|
|
14
|
+
planDefinition: BookingInstalmentPlanConfig;
|
|
7
15
|
}> | Readonly<{
|
|
8
16
|
kind: 'flexible_balance';
|
|
9
|
-
config:
|
|
10
|
-
|
|
17
|
+
config: BookingFlexibleBalanceConfig;
|
|
18
|
+
configuredPaymentDueNowCents: number;
|
|
11
19
|
bookingStartAt: string;
|
|
12
20
|
dueAt: string;
|
|
13
21
|
}>;
|
|
14
|
-
export
|
|
15
|
-
kind: 'standard';
|
|
16
|
-
}> | Readonly<{
|
|
17
|
-
kind: 'instalment_plan';
|
|
18
|
-
planDefinition: TInstalmentPlan;
|
|
19
|
-
}> | Readonly<{
|
|
20
|
-
kind: 'flexible_balance';
|
|
21
|
-
selection: Readonly<{
|
|
22
|
-
config: TFlexibleBalanceConfig;
|
|
23
|
-
bookingStartAt: string;
|
|
24
|
-
dueAt: string;
|
|
25
|
-
}>;
|
|
26
|
-
}>;
|
|
27
|
-
export declare function planStripeRequiredCheckoutPaymentObligation<TInstalmentPlan, TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig>(input: Readonly<{
|
|
22
|
+
export declare function planCheckoutPaymentObligation(input: Readonly<{
|
|
28
23
|
totalAfterDiscountCents: number;
|
|
29
|
-
|
|
30
|
-
}>):
|
|
24
|
+
paymentSelection: BookingPaymentSelection;
|
|
25
|
+
}>): CheckoutPaymentObligation;
|
|
@@ -1,53 +1,36 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
3
|
-
export type CheckoutPaymentTermCollectionOptionKind =
|
|
1
|
+
import { type BookingPaymentCollectionOptionKind, type Result } from '../../../core/src/index';
|
|
2
|
+
import { type BookingPaymentSelection } from './bookingPaymentSelection';
|
|
3
|
+
export type CheckoutPaymentTermCollectionOptionKind = BookingPaymentCollectionOptionKind;
|
|
4
4
|
export type CheckoutPaymentTermsError = Readonly<{
|
|
5
5
|
_tag: 'instalment_plan_not_supported';
|
|
6
6
|
}> | Readonly<{
|
|
7
7
|
_tag: 'flexible_balance_empty_cart';
|
|
8
|
-
}> | Readonly<{
|
|
9
|
-
_tag: 'flexible_balance_requires_single_item';
|
|
10
8
|
}> | Readonly<{
|
|
11
9
|
_tag: 'flexible_balance_not_supported';
|
|
12
10
|
}>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
config: TFlexibleBalanceConfig;
|
|
21
|
-
}> | null;
|
|
22
|
-
export type CheckoutAttendeeBookingPaymentTermSelection<TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig = BookingFlexibleBalanceConfig> = Readonly<{
|
|
23
|
-
kind: 'upfront' | 'deferred_manual';
|
|
24
|
-
}> | Readonly<{
|
|
25
|
-
kind: 'flexible_balance';
|
|
26
|
-
config: TFlexibleBalanceConfig;
|
|
27
|
-
}> | null;
|
|
28
|
-
export type CheckoutPaymentTermLine<TInstalmentPlan, TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig = BookingFlexibleBalanceConfig> = Readonly<{
|
|
29
|
-
kind: 'appointment';
|
|
30
|
-
bookingStartAt: string;
|
|
31
|
-
selectedCollectionOption: CheckoutAppointmentPaymentTermSelection<TInstalmentPlan, TFlexibleBalanceConfig>;
|
|
32
|
-
}> | Readonly<{
|
|
33
|
-
kind: 'attendee_booking';
|
|
34
|
-
bookingStartAt?: string | null;
|
|
35
|
-
selectedCollectionOption: CheckoutAttendeeBookingPaymentTermSelection<TFlexibleBalanceConfig>;
|
|
11
|
+
/**
|
|
12
|
+
* A checkout line as payment terms see it. Bookings carry the selection their
|
|
13
|
+
* own terms resolved to; products and passes carry none.
|
|
14
|
+
*/
|
|
15
|
+
export type CheckoutPaymentTermLine = Readonly<{
|
|
16
|
+
kind: 'booking';
|
|
17
|
+
selection: BookingPaymentSelection;
|
|
36
18
|
}> | Readonly<{
|
|
37
19
|
kind: 'other';
|
|
38
20
|
}>;
|
|
39
|
-
|
|
40
|
-
config: TFlexibleBalanceConfig;
|
|
41
|
-
bookingStartAt: string;
|
|
42
|
-
dueAt: string;
|
|
43
|
-
}>;
|
|
44
|
-
export type CheckoutPaymentTerms<TInstalmentPlan, TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig = BookingFlexibleBalanceConfig> = Readonly<{
|
|
45
|
-
instalmentPlanDefinition: TInstalmentPlan | null;
|
|
46
|
-
flexibleBalanceSelection: CheckoutFlexibleBalanceSelection<TFlexibleBalanceConfig> | null;
|
|
47
|
-
}>;
|
|
48
|
-
type CheckoutPaymentTermsInput<TInstalmentPlan, TFlexibleBalanceConfig extends BookingFlexibleBalanceConfig> = Readonly<{
|
|
21
|
+
type CheckoutPaymentTermsInput = Readonly<{
|
|
49
22
|
requestedCollectionOptionKind?: CheckoutPaymentTermCollectionOptionKind;
|
|
50
|
-
items: readonly CheckoutPaymentTermLine
|
|
23
|
+
items: readonly CheckoutPaymentTermLine[];
|
|
51
24
|
}>;
|
|
52
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Resolves the one payment selection the whole checkout is paid with.
|
|
27
|
+
*
|
|
28
|
+
* A plan or contract only applies when the customer asked for it, and every
|
|
29
|
+
* line has to belong to the booking it collects for. Without a request the
|
|
30
|
+
* checkout pays whatever is due in full, even when a line's terms offered only
|
|
31
|
+
* a plan: that auto-selection stays on the line and isn't applied here.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolveCheckoutPaymentTerms(input: CheckoutPaymentTermsInput): Result<BookingPaymentSelection, CheckoutPaymentTermsError>;
|
|
34
|
+
/** Checks an already resolved selection without choosing the payment option again. */
|
|
35
|
+
export declare function validateCheckoutPaymentSelection(selection: BookingPaymentSelection, items: readonly CheckoutPaymentTermLine[]): Result<BookingPaymentSelection, CheckoutPaymentTermsError>;
|
|
53
36
|
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Browser-safe Checkout contracts shared by payment owners. */
|
|
2
|
+
type CheckoutPresentationFields = {
|
|
3
|
+
hosted: Readonly<{
|
|
4
|
+
successUrl: string;
|
|
5
|
+
cancelUrl: string;
|
|
6
|
+
}>;
|
|
7
|
+
embedded: Readonly<{
|
|
8
|
+
returnUrl: string;
|
|
9
|
+
redirectOnCompletion: 'always' | 'if_required';
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
type CheckoutSessionFields = {
|
|
13
|
+
hosted: Readonly<{
|
|
14
|
+
checkoutUrl: string;
|
|
15
|
+
}>;
|
|
16
|
+
embedded: Readonly<{
|
|
17
|
+
clientSecret: string;
|
|
18
|
+
livemode: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
21
|
+
export type CheckoutMode = keyof CheckoutPresentationFields;
|
|
22
|
+
export type CheckoutPresentation<M extends CheckoutMode = CheckoutMode> = {
|
|
23
|
+
[K in CheckoutMode]: Readonly<{
|
|
24
|
+
mode: K;
|
|
25
|
+
}> & CheckoutPresentationFields[K];
|
|
26
|
+
}[M];
|
|
27
|
+
export type CheckoutSessionHandle<M extends CheckoutMode = CheckoutMode> = {
|
|
28
|
+
[K in CheckoutMode]: Readonly<{
|
|
29
|
+
kind: K;
|
|
30
|
+
sessionId: string;
|
|
31
|
+
}> & CheckoutSessionFields[K];
|
|
32
|
+
}[M];
|
|
33
|
+
export type EmbeddedCheckoutBrowserContext = Readonly<{
|
|
34
|
+
kind: 'connect';
|
|
35
|
+
publishableKey: string;
|
|
36
|
+
accountId: string;
|
|
37
|
+
}> | Readonly<{
|
|
38
|
+
kind: 'direct';
|
|
39
|
+
publishableKey: string;
|
|
40
|
+
}>;
|
|
41
|
+
export type BrowserStripeKey = Readonly<{
|
|
42
|
+
tag: 'ready';
|
|
43
|
+
publishableKey: string;
|
|
44
|
+
}> | Readonly<{
|
|
45
|
+
tag: 'unavailable';
|
|
46
|
+
reason: 'missing_key' | 'invalid_key' | 'mode_mismatch';
|
|
47
|
+
}>;
|
|
48
|
+
export declare function checkBrowserStripeKey(publishableKey: string | undefined, livemode: boolean): BrowserStripeKey;
|
|
49
|
+
export {};
|
|
@@ -17,7 +17,7 @@ export declare const OrderCheckoutSessionMetadataSchema: z.ZodUnion<readonly [z.
|
|
|
17
17
|
type: z.ZodLiteral<"order">;
|
|
18
18
|
site_id: z.ZodString;
|
|
19
19
|
order_id: z.ZodOptional<z.ZodString>;
|
|
20
|
-
customer_email: z.ZodString
|
|
20
|
+
customer_email: z.ZodOptional<z.ZodString>;
|
|
21
21
|
customer_name: z.ZodOptional<z.ZodString>;
|
|
22
22
|
product_id: z.ZodOptional<z.ZodString>;
|
|
23
23
|
attendee_id: z.ZodOptional<z.ZodString>;
|
|
@@ -32,9 +32,9 @@ export declare const OrderCheckoutSessionMetadataSchema: z.ZodUnion<readonly [z.
|
|
|
32
32
|
credit_reserved_cents: z.ZodOptional<z.ZodString>;
|
|
33
33
|
discount_code_amount_cents: z.ZodOptional<z.ZodString>;
|
|
34
34
|
order_payment_reason: z.ZodOptional<z.ZodEnum<{
|
|
35
|
-
flexible_balance_paydown: "flexible_balance_paydown";
|
|
36
|
-
instalment_payoff: "instalment_payoff";
|
|
37
35
|
flexible_balance_initial: "flexible_balance_initial";
|
|
36
|
+
instalment_payoff: "instalment_payoff";
|
|
37
|
+
flexible_balance_paydown: "flexible_balance_paydown";
|
|
38
38
|
}>>;
|
|
39
39
|
order_payment_plan_id: z.ZodOptional<z.ZodString>;
|
|
40
40
|
order_flexible_balance_contract_id: z.ZodOptional<z.ZodString>;
|
|
@@ -48,7 +48,7 @@ export declare const OrderCheckoutSessionMetadataSchema: z.ZodUnion<readonly [z.
|
|
|
48
48
|
type: z.ZodLiteral<"order">;
|
|
49
49
|
site_id: z.ZodString;
|
|
50
50
|
order_id: z.ZodOptional<z.ZodString>;
|
|
51
|
-
customer_email: z.ZodString
|
|
51
|
+
customer_email: z.ZodOptional<z.ZodString>;
|
|
52
52
|
customer_name: z.ZodOptional<z.ZodString>;
|
|
53
53
|
product_id: z.ZodOptional<z.ZodString>;
|
|
54
54
|
attendee_id: z.ZodOptional<z.ZodString>;
|
|
@@ -63,9 +63,9 @@ export declare const OrderCheckoutSessionMetadataSchema: z.ZodUnion<readonly [z.
|
|
|
63
63
|
credit_reserved_cents: z.ZodOptional<z.ZodString>;
|
|
64
64
|
discount_code_amount_cents: z.ZodOptional<z.ZodString>;
|
|
65
65
|
order_payment_reason: z.ZodOptional<z.ZodEnum<{
|
|
66
|
-
flexible_balance_paydown: "flexible_balance_paydown";
|
|
67
|
-
instalment_payoff: "instalment_payoff";
|
|
68
66
|
flexible_balance_initial: "flexible_balance_initial";
|
|
67
|
+
instalment_payoff: "instalment_payoff";
|
|
68
|
+
flexible_balance_paydown: "flexible_balance_paydown";
|
|
69
69
|
}>>;
|
|
70
70
|
order_payment_plan_id: z.ZodOptional<z.ZodString>;
|
|
71
71
|
order_flexible_balance_contract_id: z.ZodOptional<z.ZodString>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export type CheckoutStripeFinalizationPaymentPlanKind = 'stripe' | 'instalment_plan' | 'flexible_balance';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The records besides the order that follow a newly created Stripe session.
|
|
4
|
+
* The order's own session is bound by the initial-session binder, never here.
|
|
5
|
+
*/
|
|
6
|
+
export type CheckoutStripeSessionRecordUpdateTarget = 'order_payment_plan' | 'flexible_balance_contract';
|
|
3
7
|
export type CheckoutStripeSessionRecordUpdatePlan = Readonly<{
|
|
4
8
|
target: CheckoutStripeSessionRecordUpdateTarget;
|
|
5
9
|
orderId: string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type Result } from '../../../core/src/index';
|
|
2
2
|
import { type LineSettlementBreakdown } from './settlement';
|
|
3
3
|
export type CheckoutStripeSessionPaymentPlan = Readonly<{
|
|
4
|
-
kind: 'stripe'
|
|
4
|
+
kind: 'stripe';
|
|
5
5
|
creditReservationId?: string | null;
|
|
6
6
|
}> | Readonly<{
|
|
7
|
-
kind: 'flexible_balance';
|
|
8
|
-
|
|
7
|
+
kind: 'instalment_plan' | 'flexible_balance';
|
|
8
|
+
/** Only this first payment is charged now; the rest is collected later. */
|
|
9
|
+
chargeNowCents: number;
|
|
9
10
|
creditReservationId?: string | null;
|
|
10
11
|
}>;
|
|
11
12
|
export type CheckoutStripeSessionPaymentIntentPaymentPlan = Readonly<{
|
|
@@ -78,7 +79,7 @@ export type CheckoutStripeSessionPlanningError = Readonly<{
|
|
|
78
79
|
amountCents: number;
|
|
79
80
|
message: string;
|
|
80
81
|
}> | Readonly<{
|
|
81
|
-
_tag: '
|
|
82
|
+
_tag: 'invalid_charge_now_amount';
|
|
82
83
|
amountCents: number;
|
|
83
84
|
message: string;
|
|
84
85
|
}>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type EventRegistrationErrorAction = 'none' | 'retry' | 'places' | 'start' | 'details' | 'payment-options' | 'portal' | 'event';
|
|
2
|
+
export declare const unfinishedBookingAssistanceMessage = "We couldn\u2019t safely find your unfinished booking. Please contact the organiser before trying to book again.";
|
|
2
3
|
export declare const eventRegistrationErrors: {
|
|
3
4
|
readonly registrationClosed: {
|
|
4
5
|
readonly message: "Booking is currently closed for this event. Please contact the organiser if you’d like to find out more.";
|
|
@@ -12,6 +13,14 @@ export declare const eventRegistrationErrors: {
|
|
|
12
13
|
readonly message: "We couldn’t reach the payment provider. Please try again in a minute.";
|
|
13
14
|
readonly action: "retry";
|
|
14
15
|
};
|
|
16
|
+
readonly paymentHostUnavailable: {
|
|
17
|
+
readonly message: "Card payments aren’t available on this web address yet. Please contact the organiser to book.";
|
|
18
|
+
readonly action: "none";
|
|
19
|
+
};
|
|
20
|
+
readonly checkoutTemporarilyUnavailable: {
|
|
21
|
+
readonly message: "Event payments are temporarily unavailable while we make an update. Please try again later.";
|
|
22
|
+
readonly action: "retry";
|
|
23
|
+
};
|
|
15
24
|
readonly paymentPageUnavailable: {
|
|
16
25
|
readonly message: "We couldn’t open the payment page. Please refresh this page and try again. If this keeps happening, contact the organiser for help.";
|
|
17
26
|
readonly action: "retry";
|
|
@@ -3,6 +3,7 @@ export * from './allocation';
|
|
|
3
3
|
export * from './orderTypes';
|
|
4
4
|
export * from './orderPlanningTypes';
|
|
5
5
|
export * from './bookingInstalmentSchedule';
|
|
6
|
+
export * from './bookingPaymentSelection';
|
|
6
7
|
export * from './cancellationPolicy';
|
|
7
8
|
export * from './checkoutCollectionPlan';
|
|
8
9
|
export * from './checkoutCommitPlan';
|
|
@@ -11,14 +12,12 @@ export * from './checkoutErrorCodes';
|
|
|
11
12
|
export * from './checkoutOrderItemProjection';
|
|
12
13
|
export * from './checkoutPaymentFlow';
|
|
13
14
|
export * from './checkoutPaymentPlanPlanning';
|
|
14
|
-
export * from './checkoutPaymentTermPlanning';
|
|
15
15
|
export * from './checkoutPaymentTerms';
|
|
16
16
|
export * from './checkoutQuantity';
|
|
17
17
|
export * from './checkoutSettlement';
|
|
18
18
|
export * from './checkoutStripeFinalizationPlanning';
|
|
19
19
|
export * from './checkoutStripeSessionPlanning';
|
|
20
20
|
export * from './checkoutSessionMetadata';
|
|
21
|
-
export * from './checkoutValidatedItemPlanning';
|
|
22
21
|
export * from './canonicalRefundPlanner';
|
|
23
22
|
export * from './confirmationEmailPayment';
|
|
24
23
|
export * from './discountApplication';
|
|
@@ -34,7 +33,6 @@ export * from './orderHistorySource';
|
|
|
34
33
|
export * from './orderInstalmentAdminSettlement';
|
|
35
34
|
export * from './orderInstalmentClosure';
|
|
36
35
|
export * from './orderInstalmentLifecycle';
|
|
37
|
-
export * from './orderInstalmentPayoff';
|
|
38
36
|
export * from './orderInstalmentPlan';
|
|
39
37
|
export * from './orderItemMetadata';
|
|
40
38
|
export * from './orderItemSupport';
|
|
@@ -54,7 +52,9 @@ export * from './settlement';
|
|
|
54
52
|
export * from './shopRefundPlanning';
|
|
55
53
|
export * from './stripeMinimumCharge';
|
|
56
54
|
export * from './stripeCheckoutReturnUrl';
|
|
55
|
+
export * from './checkoutCopy';
|
|
57
56
|
export * from './stateTransitions';
|
|
58
57
|
export * from './event-registration-errors';
|
|
59
58
|
export * from './eventCheckoutRecoveryWindow';
|
|
60
59
|
export { STRIPE_COMMISSION_FREE_REASONS, type StripeCommissionFreeReason, } from './stripeCommissionMetadata';
|
|
60
|
+
export * from './checkoutPresentation';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Result } from '../../../core/src/index';
|
|
2
|
+
import type { StripeBookingCommissionOrderItemMetadata } from './stripeCommissionMetadata';
|
|
3
|
+
import type { CheckoutLineMetadata, MembershipOrderItemMetadata } from './orderItemMetadata';
|
|
4
|
+
export declare function parseMembershipOrderItemMetadata(raw: Record<string, unknown>, checkoutLine: CheckoutLineMetadata, commission: StripeBookingCommissionOrderItemMetadata): Result<MembershipOrderItemMetadata, string>;
|