@coras-io/embed 0.5.1 → 0.6.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/CHANGELOG.md +28 -0
- package/README.md +15 -2
- package/dist/components/accordion/accordion-item/accordion-item.component.js +9 -3
- package/dist/components/accordion/accordion-item/accordion-item.styles.js +4 -0
- package/dist/components/accordion/accordion.component.js +8 -0
- package/dist/components/alert/alert.component.d.ts +1 -1
- package/dist/components/alert/alert.component.js +4 -3
- package/dist/components/attraction-card/base/attraction-card.mixin.d.ts +0 -2
- package/dist/components/attraction-card/base/attraction-card.mixin.js +0 -6
- package/dist/components/attraction-card/base/attraction-card.types.d.ts +0 -1
- package/dist/components/basket-mobile/basket-mobile.component.d.ts +14 -3
- package/dist/components/basket-mobile/basket-mobile.component.js +71 -15
- package/dist/components/better-carousel/better-carousel.component.d.ts +3 -5
- package/dist/components/better-carousel/better-carousel.component.js +13 -34
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.component.js +5 -12
- package/dist/components/breadcrumbs/breadcrumb-item/breadcrumb-item.styles.js +13 -5
- package/dist/components/breadcrumbs/breadcrumbs.component.d.ts +0 -1
- package/dist/components/breadcrumbs/breadcrumbs.component.js +5 -8
- package/dist/components/breadcrumbs/breadcrumbs.styles.js +8 -2
- package/dist/components/button/button.constants.d.ts +1 -2
- package/dist/components/button/button.constants.js +0 -1
- package/dist/components/calendar/base/calendar.mixin.js +5 -1
- package/dist/components/calendar/multi/multi.component.d.ts +2 -2
- package/dist/components/calendar/multi/multi.component.js +12 -19
- package/dist/components/carousel/carousel.component.js +9 -2
- package/dist/components/categories-tree/categories-tree.component.d.ts +5 -3
- package/dist/components/categories-tree/categories-tree.component.js +22 -21
- package/dist/components/checkbox/checkbox.component.js +5 -1
- package/dist/components/checkbox-group/checkbox-group.component.js +1 -1
- package/dist/components/checkbox-group/checkbox-group.styles.js +1 -1
- package/dist/components/chip/chip.component.js +8 -3
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.d.ts +6 -0
- package/dist/components/crypto-auth-modal/crypto-auth-modal.component.js +15 -1
- package/dist/components/currencies-list/currencies-list.component.js +0 -1
- package/dist/components/dialog/dialog.component.js +52 -21
- package/dist/components/drawer/drawer.component.d.ts +3 -2
- package/dist/components/drawer/drawer.component.js +13 -18
- package/dist/components/drawer/drawer.styles.js +5 -2
- package/dist/components/dropdown/dropdown.component.js +6 -9
- package/dist/components/expiration-timer/expiration-timer.component.d.ts +2 -3
- package/dist/components/expiration-timer/expiration-timer.component.js +10 -8
- package/dist/components/explore-card/explore-card.component.js +3 -1
- package/dist/components/explore-card/explore-card.styles.js +31 -0
- package/dist/components/filters-drawer/filters-drawer.component.js +1 -1
- package/dist/components/flag-icon/flag-icon.component.d.ts +4 -2
- package/dist/components/flag-icon/flag-icon.component.js +16 -4
- package/dist/components/icon/icon.component.js +15 -2
- package/dist/components/image/image.component.js +4 -3
- package/dist/components/image-viewer/image-viewer.component.js +6 -4
- package/dist/components/input-field/input-field.component.js +10 -6
- package/dist/components/layout/layout.styles.js +1 -1
- package/dist/components/locales-list/locales-list.component.js +0 -1
- package/dist/components/location-image/location-image.component.js +0 -1
- package/dist/components/locations-results/locations-results.component.d.ts +10 -0
- package/dist/components/locations-results/locations-results.component.js +22 -15
- package/dist/components/locations-results/locations-results.styles.js +4 -1
- package/dist/components/message-card/message-card.component.d.ts +1 -1
- package/dist/components/message-card/message-card.component.js +4 -3
- package/dist/components/mobile-menu-item/mobile-menu-item.component.d.ts +0 -1
- package/dist/components/mobile-menu-item/mobile-menu-item.component.js +14 -16
- package/dist/components/mobile-menu-item/mobile-menu-item.styles.js +9 -5
- package/dist/components/option-group/option-chip/option-chip.component.d.ts +4 -1
- package/dist/components/option-group/option-chip/option-chip.component.js +23 -10
- package/dist/components/option-group/option-group.component.d.ts +3 -1
- package/dist/components/option-group/option-group.component.js +10 -3
- package/dist/components/overlay/overlay.component.d.ts +0 -5
- package/dist/components/overlay/overlay.component.js +3 -15
- package/dist/components/phone-country-code/phone-country-code.component.d.ts +4 -0
- package/dist/components/phone-country-code/phone-country-code.component.js +37 -0
- package/dist/components/phone-country-codes/phone-country-codes.component.js +1 -1
- package/dist/components/phone-field/phone-field.component.js +2 -2
- package/dist/components/search-button/search-button.component.d.ts +1 -1
- package/dist/components/search-button/search-button.component.js +13 -7
- package/dist/components/seated-selector/seated-selector.component.js +3 -3
- package/dist/components/seats-io/seats-io.component.d.ts +3 -2
- package/dist/components/seats-io/seats-io.component.js +31 -13
- package/dist/components/seats-io/seats-io.constants.d.ts +0 -2
- package/dist/components/seats-io/seats-io.constants.js +0 -3
- package/dist/components/seats-io/seats-io.transform.d.ts +1 -6
- package/dist/components/seats-io/seats-io.transform.js +1 -20
- package/dist/components/select-list/select-list.component.js +7 -2
- package/dist/components/select-list/select-option/select-option.component.d.ts +3 -1
- package/dist/components/select-list/select-option/select-option.component.js +10 -3
- package/dist/components/tabs/tabs.component.d.ts +2 -0
- package/dist/components/tabs/tabs.component.js +59 -5
- package/dist/components/time-tag/time-tag.component.js +1 -1
- package/dist/containers/basket/basket.component.d.ts +1 -1
- package/dist/containers/basket/basket.component.js +21 -20
- package/dist/containers/navbar/navbar.component.d.ts +12 -8
- package/dist/containers/navbar/navbar.component.js +108 -62
- package/dist/containers/navbar/navbar.styles.js +23 -5
- package/dist/containers/navbar/navbar.utils.js +4 -4
- package/dist/contexts/basket/basket.provider.d.ts +3 -4
- package/dist/contexts/basket/basket.provider.js +46 -61
- package/dist/contexts/basket/basket.types.d.ts +0 -2
- package/dist/controllers/time-expiration.d.ts +15 -2
- package/dist/controllers/time-expiration.js +47 -17
- package/dist/core/api/client.d.ts +9 -0
- package/dist/core/api/client.js +26 -0
- package/dist/core/api/middlewares/booking-session/booking-session.constants.d.ts +0 -2
- package/dist/core/api/middlewares/booking-session/booking-session.constants.js +0 -2
- package/dist/core/api/middlewares/booking-session/booking-session.js +3 -12
- package/dist/core/api/middlewares/booking-session/booking-session.utils.d.ts +0 -1
- package/dist/core/api/middlewares/booking-session/booking-session.utils.js +6 -28
- package/dist/core/api/middlewares/error-handler/error-handler.js +5 -1
- package/dist/core/api/middlewares/retry/retry.constants.d.ts +3 -0
- package/dist/core/api/middlewares/retry/retry.constants.js +7 -0
- package/dist/core/api/middlewares/retry/retry.d.ts +2 -0
- package/dist/core/api/middlewares/retry/retry.js +48 -0
- package/dist/core/api/queries.d.ts +13 -38
- package/dist/core/api/queries.js +16 -99
- package/dist/core/events.d.ts +2 -4
- package/dist/core/i18n/date.d.ts +14 -5
- package/dist/core/i18n/date.js +47 -20
- package/dist/core/i18n/localization.js +10 -3
- package/dist/core/images/helpers.js +6 -5
- package/dist/core/logger.d.ts +17 -0
- package/dist/core/logger.js +13 -0
- package/dist/core/types/api-schema.d.ts +7872 -0
- package/dist/core/types/seats-config.d.ts +5 -4
- package/dist/core/types/seats-config.js +10 -3
- package/dist/core/utils/crypto-address.d.ts +12 -0
- package/dist/core/utils/crypto-address.js +17 -0
- package/dist/core/utils/datetime.d.ts +13 -11
- package/dist/core/utils/datetime.js +41 -51
- package/dist/core/utils/loyalty.d.ts +8 -0
- package/dist/core/utils/loyalty.js +10 -0
- package/dist/core/utils/redaction.d.ts +9 -0
- package/dist/core/utils/redaction.js +58 -0
- package/dist/core/utils/time.js +2 -3
- package/dist/helpers/helpers.d.ts +6 -0
- package/dist/helpers/helpers.js +33 -16
- package/dist/locales/ar-SA.d.ts +38 -21
- package/dist/locales/ar-SA.js +38 -21
- package/dist/locales/da-DK.d.ts +38 -21
- package/dist/locales/da-DK.js +38 -21
- package/dist/locales/de-DE.d.ts +38 -21
- package/dist/locales/de-DE.js +38 -21
- package/dist/locales/en-IE.d.ts +38 -21
- package/dist/locales/en-IE.js +38 -21
- package/dist/locales/en-US.d.ts +38 -21
- package/dist/locales/en-US.js +38 -21
- package/dist/locales/es-ES.d.ts +38 -21
- package/dist/locales/es-ES.js +38 -21
- package/dist/locales/fr-FR.d.ts +38 -21
- package/dist/locales/fr-FR.js +38 -21
- package/dist/locales/fr-MA.d.ts +38 -21
- package/dist/locales/fr-MA.js +38 -21
- package/dist/locales/is-IS.d.ts +38 -21
- package/dist/locales/is-IS.js +38 -21
- package/dist/locales/it-IT.d.ts +38 -21
- package/dist/locales/it-IT.js +38 -21
- package/dist/locales/ms-MY.d.ts +38 -21
- package/dist/locales/ms-MY.js +38 -21
- package/dist/locales/nb-NO.d.ts +38 -21
- package/dist/locales/nb-NO.js +38 -21
- package/dist/locales/pl-PL.d.ts +38 -21
- package/dist/locales/pl-PL.js +38 -21
- package/dist/locales/pt-PT.d.ts +38 -21
- package/dist/locales/pt-PT.js +38 -21
- package/dist/locales/sv-SE.d.ts +38 -21
- package/dist/locales/sv-SE.js +38 -21
- package/dist/locales/th-TH.d.ts +38 -21
- package/dist/locales/th-TH.js +38 -21
- package/dist/locales/tr-TR.d.ts +38 -21
- package/dist/locales/tr-TR.js +38 -21
- package/dist/locales/zh-CN.d.ts +38 -21
- package/dist/locales/zh-CN.js +38 -21
- package/dist/locales/zh-HK.d.ts +38 -21
- package/dist/locales/zh-HK.js +38 -21
- package/dist/mixins/base.mixin.d.ts +3 -1
- package/dist/mixins/base.mixin.js +10 -7
- package/dist/mixins/coinbase.mixin.d.ts +13 -17
- package/dist/mixins/coinbase.mixin.js +251 -288
- package/dist/mixins/error-modal.mixin.js +8 -4
- package/dist/mixins/location-search/location-search.d.ts +13 -1
- package/dist/mixins/location-search/location-search.js +35 -27
- package/dist/mixins/overlay/overlay-mixin.js +39 -3
- package/dist/mixins/overlay/types.d.ts +1 -0
- package/dist/mixins/search-mixin/search-mixin.js +8 -5
- package/dist/sdk/diagnostics.js +2 -0
- package/dist/sdk/mount.d.ts +10 -0
- package/dist/sdk/mount.js +20 -1
- package/dist/sdk/page-registry.js +5 -0
- package/dist/sdk/params.d.ts +53 -0
- package/dist/sdk/params.js +180 -0
- package/dist/sdk/redaction.d.ts +1 -4
- package/dist/sdk/redaction.js +2 -41
- package/dist/sdk/types.d.ts +21 -7
- package/dist/sdk/url.d.ts +1 -1
- package/dist/sdk/url.js +12 -5
- package/dist/sdk/validation.d.ts +1 -26
- package/dist/sdk/validation.js +8 -145
- package/dist/styles/tokens.d.ts +1 -1
- package/dist/styles/tokens.generated.d.ts +1 -1
- package/dist/styles/tokens.generated.js +1 -1
- package/dist/views/chrome-only-page/chrome-only-page.component.d.ts +30 -0
- package/dist/views/chrome-only-page/chrome-only-page.component.js +24 -0
- package/dist/views/chrome-only-page/chrome-only-page.d.ts +8 -0
- package/dist/views/chrome-only-page/chrome-only-page.js +6 -0
- package/dist/views/chrome-only-page/chrome-only-page.styles.js +13 -0
- package/dist/views/details-page/details-page.component.d.ts +11 -4
- package/dist/views/details-page/details-page.component.js +263 -237
- package/dist/views/details-page/details-page.utilts.d.ts +63 -3
- package/dist/views/details-page/details-page.utilts.js +53 -5
- package/dist/views/details-page/partials/location-categories/location-categories.component.d.ts +29 -0
- package/dist/views/details-page/partials/location-categories/location-categories.component.js +149 -0
- package/dist/views/details-page/partials/location-categories/location-categories.d.ts +8 -0
- package/dist/views/details-page/partials/location-categories/location-categories.js +6 -0
- package/dist/views/details-page/partials/location-categories/location-categories.styles.js +35 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.d.ts +26 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.component.js +158 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.d.ts +8 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.js +6 -0
- package/dist/views/details-page/partials/location-highlights/location-highlights.styles.js +42 -0
- package/dist/views/details-page/partials/tour-description/tour-description.component.js +1 -4
- package/dist/views/help-page/help-page.component.d.ts +2 -0
- package/dist/views/help-page/help-page.component.js +37 -18
- package/dist/views/help-page/help-page.utils.js +6 -5
- package/dist/views/landing-page/landing-page.component.d.ts +5 -8
- package/dist/views/landing-page/landing-page.component.js +82 -97
- package/dist/views/payment-page/controllers/crypto-auth.controller.d.ts +10 -4
- package/dist/views/payment-page/controllers/crypto-auth.controller.js +53 -31
- package/dist/views/payment-page/controllers/crypto-transfer.controller.d.ts +9 -5
- package/dist/views/payment-page/controllers/crypto-transfer.controller.js +26 -39
- package/dist/views/payment-page/controllers/payment-flow.controller.d.ts +6 -1
- package/dist/views/payment-page/controllers/payment-flow.controller.js +1 -0
- package/dist/views/payment-page/controllers/stripe-payment.controller.d.ts +20 -2
- package/dist/views/payment-page/controllers/stripe-payment.controller.js +42 -19
- package/dist/views/payment-page/partials/activity-details/activity-details.component.d.ts +2 -0
- package/dist/views/payment-page/partials/activity-details/activity-details.component.js +6 -3
- package/dist/views/payment-page/partials/billing-address/billing-address.component.d.ts +2 -0
- package/dist/views/payment-page/partials/billing-address/billing-address.component.js +5 -1
- package/dist/views/payment-page/partials/confirmation/confirmation.component.js +2 -3
- package/dist/views/payment-page/partials/country-field/country-field.component.js +1 -1
- package/dist/views/payment-page/partials/payment-type-selector/payment-type-selector.component.js +3 -3
- package/dist/views/payment-page/partials/stripe/stripe.component.d.ts +2 -0
- package/dist/views/payment-page/partials/stripe/stripe.component.js +36 -7
- package/dist/views/payment-page/partials/stripe/stripe.utils.js +0 -3
- package/dist/views/payment-page/payment-page.component.d.ts +39 -6
- package/dist/views/payment-page/payment-page.component.js +302 -178
- package/dist/views/payment-page/payment-page.constants.d.ts +1 -27
- package/dist/views/payment-page/payment-page.constants.js +3 -30
- package/dist/views/payment-page/payment-page.types.d.ts +1 -19
- package/dist/views/payment-page/payment-page.utils.d.ts +22 -13
- package/dist/views/payment-page/payment-page.utils.js +57 -75
- package/dist/views/payment-page/services/payment-api.service.d.ts +16 -34
- package/dist/views/payment-page/services/payment-api.service.js +19 -27
- package/dist/views/search-page/search-page.component.d.ts +2 -0
- package/dist/views/search-page/search-page.component.js +39 -20
- package/dist/views/suggestion-widget/suggestion-widget.component.d.ts +1 -0
- package/dist/views/suggestion-widget/suggestion-widget.component.js +6 -5
- package/package.json +24 -20
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.d.ts +0 -10
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.component.js +0 -43
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.d.ts +0 -8
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.js +0 -6
- package/dist/components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.js +0 -23
- package/dist/components/attraction-discovery/attraction-discovery.component.d.ts +0 -10
- package/dist/components/attraction-discovery/attraction-discovery.component.js +0 -52
- package/dist/components/attraction-discovery/attraction-discovery.constants.d.ts +0 -4
- package/dist/components/attraction-discovery/attraction-discovery.constants.js +0 -5
- package/dist/components/attraction-discovery/attraction-discovery.d.ts +0 -8
- package/dist/components/attraction-discovery/attraction-discovery.js +0 -6
- package/dist/components/attraction-discovery/attraction-discovery.styles.js +0 -193
- package/dist/components/basket-rewards/basket-rewards.component.d.ts +0 -10
- package/dist/components/basket-rewards/basket-rewards.component.js +0 -52
- package/dist/components/basket-rewards/basket-rewards.d.ts +0 -8
- package/dist/components/basket-rewards/basket-rewards.js +0 -6
- package/dist/components/basket-rewards/basket-rewards.styles.js +0 -18
- package/dist/components/filter-chip/filter-chip.component.d.ts +0 -12
- package/dist/components/filter-chip/filter-chip.component.js +0 -68
- package/dist/components/filter-chip/filter-chip.constants.d.ts +0 -2
- package/dist/components/filter-chip/filter-chip.constants.js +0 -2
- package/dist/components/filter-chip/filter-chip.d.ts +0 -8
- package/dist/components/filter-chip/filter-chip.js +0 -6
- package/dist/components/filter-chip/filter-chip.styles.d.ts +0 -2
- package/dist/components/filter-chip/filter-chip.styles.js +0 -162
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.d.ts +0 -10
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.component.js +0 -43
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.js +0 -6
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.d.ts +0 -2
- package/dist/components/image-carousel/image-carousel-item/image-carousel-item.styles.js +0 -28
- package/dist/components/image-carousel/image-carousel.component.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel.component.js +0 -36
- package/dist/components/image-carousel/image-carousel.d.ts +0 -8
- package/dist/components/image-carousel/image-carousel.js +0 -6
- package/dist/components/image-carousel/image-carousel.styles.d.ts +0 -2
- package/dist/components/image-carousel/image-carousel.styles.js +0 -72
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.d.ts +0 -9
- package/dist/components/itinerary/itinerary-item/itinerary-item.component.js +0 -45
- package/dist/components/itinerary/itinerary-item/itinerary-item.d.ts +0 -8
- package/dist/components/itinerary/itinerary-item/itinerary-item.js +0 -6
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.d.ts +0 -2
- package/dist/components/itinerary/itinerary-item/itinerary-item.styles.js +0 -70
- package/dist/components/itinerary/itinerary.component.d.ts +0 -7
- package/dist/components/itinerary/itinerary.component.js +0 -23
- package/dist/components/itinerary/itinerary.d.ts +0 -8
- package/dist/components/itinerary/itinerary.js +0 -6
- package/dist/components/itinerary/itinerary.styles.d.ts +0 -2
- package/dist/components/itinerary/itinerary.styles.js +0 -15
- package/dist/components/marketing-tag/marketing-tag.component.d.ts +0 -5
- package/dist/components/marketing-tag/marketing-tag.component.js +0 -8
- package/dist/components/marketing-tag/marketing-tag.d.ts +0 -8
- package/dist/components/marketing-tag/marketing-tag.js +0 -6
- package/dist/components/marketing-tag/marketing-tag.styles.d.ts +0 -2
- package/dist/components/marketing-tag/marketing-tag.styles.js +0 -36
- package/dist/components/price/price.component.d.ts +0 -12
- package/dist/components/price/price.component.js +0 -38
- package/dist/components/price/price.d.ts +0 -8
- package/dist/components/price/price.js +0 -6
- package/dist/components/reviews/review/review.component.d.ts +0 -9
- package/dist/components/reviews/review/review.component.js +0 -41
- package/dist/components/reviews/review/review.d.ts +0 -8
- package/dist/components/reviews/review/review.js +0 -6
- package/dist/components/reviews/review/review.styles.d.ts +0 -2
- package/dist/components/reviews/review/review.styles.js +0 -45
- package/dist/components/reviews/reviews.component.d.ts +0 -9
- package/dist/components/reviews/reviews.component.js +0 -56
- package/dist/components/reviews/reviews.d.ts +0 -8
- package/dist/components/reviews/reviews.js +0 -6
- package/dist/components/reviews/reviews.styles.d.ts +0 -2
- package/dist/components/reviews/reviews.styles.js +0 -73
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.d.ts +0 -10
- package/dist/components/selected-tickets-preview/selected-tickets-preview.component.js +0 -51
- package/dist/components/selected-tickets-preview/selected-tickets-preview.d.ts +0 -8
- package/dist/components/selected-tickets-preview/selected-tickets-preview.js +0 -6
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.d.ts +0 -2
- package/dist/components/selected-tickets-preview/selected-tickets-preview.styles.js +0 -89
- package/dist/components/tag/tag.component.d.ts +0 -8
- package/dist/components/tag/tag.component.js +0 -33
- package/dist/components/tag/tag.constants.d.ts +0 -1
- package/dist/components/tag/tag.constants.js +0 -1
- package/dist/components/tag/tag.d.ts +0 -8
- package/dist/components/tag/tag.js +0 -6
- package/dist/components/tag/tag.styles.d.ts +0 -2
- package/dist/components/tag/tag.styles.js +0 -56
- package/dist/components/tooltip/tooltip.component.d.ts +0 -19
- package/dist/components/tooltip/tooltip.component.js +0 -124
- package/dist/components/tooltip/tooltip.d.ts +0 -8
- package/dist/components/tooltip/tooltip.js +0 -6
- package/dist/components/tooltip/tooltip.styles.d.ts +0 -2
- package/dist/components/tooltip/tooltip.styles.js +0 -79
- package/dist/core/signals.d.ts +0 -2
- package/dist/core/signals.js +0 -3
- package/dist/core/storybook/argTypes.d.ts +0 -1
- package/dist/core/storybook/argTypes.js +0 -46
- package/dist/core/storybook/cssprops.d.ts +0 -30
- package/dist/core/storybook/cssprops.js +0 -46
- package/dist/core/storybook/demo.d.ts +0 -4
- package/dist/core/storybook/demo.js +0 -17
- package/dist/core/types/api-errors.d.ts +0 -8
- package/dist/core/types/api-errors.js +0 -1
- package/dist/styles/contrast-fixtures.d.ts +0 -5
- package/dist/styles/contrast-fixtures.js +0 -131
- package/dist/views/payment-page/domain/payment-mappers.d.ts +0 -7
- package/dist/views/payment-page/domain/payment-mappers.js +0 -7
- package/dist/views/payment-page/domain/payment-validators.d.ts +0 -6
- package/dist/views/payment-page/domain/payment-validators.js +0 -6
- package/dist/views/payment-page/domain/recovery-payload.d.ts +0 -8
- package/dist/views/payment-page/domain/recovery-payload.js +0 -7
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.d.ts +0 -22
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.component.js +0 -65
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.d.ts +0 -8
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.js +0 -6
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.d.ts +0 -2
- package/dist/views/payment-page/partials/terms-checkbox/terms-checkbox.styles.js +0 -12
- package/dist/views/payment-page/payment-page.validation-schema.d.ts +0 -28
- package/dist/views/payment-page/payment-page.validation-schema.js +0 -42
- /package/dist/{components/attraction-discovery/attraction-discovery-image/attraction-discovery-image.styles.d.ts → views/chrome-only-page/chrome-only-page.styles.d.ts} +0 -0
- /package/dist/{components/attraction-discovery/attraction-discovery.styles.d.ts → views/details-page/partials/location-categories/location-categories.styles.d.ts} +0 -0
- /package/dist/{components/basket-rewards/basket-rewards.styles.d.ts → views/details-page/partials/location-highlights/location-highlights.styles.d.ts} +0 -0
|
@@ -1,38 +1,12 @@
|
|
|
1
|
-
export declare const STRIPE_ERRORS: {
|
|
2
|
-
invalid_number: () => string;
|
|
3
|
-
invalid_expiry_month: () => string;
|
|
4
|
-
invalid_expiry_year: () => string;
|
|
5
|
-
invalid_expiry_year_past: () => string;
|
|
6
|
-
invalid_cvc: () => string;
|
|
7
|
-
incorrect_number: () => string;
|
|
8
|
-
incomplete_number: () => string;
|
|
9
|
-
incomplete_cvc: () => string;
|
|
10
|
-
incomplete_expiry: () => string;
|
|
11
|
-
expired_card: () => string;
|
|
12
|
-
incorrect_cvc: () => string;
|
|
13
|
-
incorrect_zip: () => string;
|
|
14
|
-
card_declined: () => string;
|
|
15
|
-
missing: () => string;
|
|
16
|
-
processing_error: () => string;
|
|
17
|
-
};
|
|
18
|
-
export declare const STRIPE_FIELD_GENERIC_ERROR: () => string;
|
|
19
1
|
export declare const PAYMENT_LAYOUT_BREAKPOINT_PX = 900;
|
|
20
2
|
export declare const TRANSACTION_POLLING_MAX_ATTEMPTS = 30;
|
|
21
3
|
export declare const TRANSACTION_POLLING_INITIAL_INTERVAL_MS = 1000;
|
|
22
4
|
export declare const TRANSACTION_POLLING_MAX_INTERVAL_MS = 8000;
|
|
5
|
+
export declare const TRANSACTION_RECHECK_MAX_ATTEMPTS = 3;
|
|
23
6
|
export declare const OTP_INACTIVITY_TIMEOUT_MS = 30000;
|
|
24
|
-
export declare const OTP_EXPIRY_MINUTES = 10;
|
|
25
7
|
export declare const OTP_MIN_RESEND_INTERVAL_MS = 60000;
|
|
26
8
|
export declare const OTP_MAX_ATTEMPTS_PER_SESSION = 5;
|
|
27
|
-
export declare const SMS_OTP_INACTIVITY_TIMEOUT_MS = 30000;
|
|
28
|
-
export declare const SMS_OTP_EXPIRY_MINUTES = 5;
|
|
29
9
|
export declare const SMS_OTP_MIN_RESEND_INTERVAL_MS = 60000;
|
|
30
10
|
export declare const SMS_OTP_MAX_ATTEMPTS_PER_SESSION = 5;
|
|
31
11
|
export declare const BALANCE_BACKOFF_INITIAL_MS = 5000;
|
|
32
12
|
export declare const BALANCE_BACKOFF_MAX_MS = 60000;
|
|
33
|
-
export declare const STRIPE_MIN_KEY_LENGTH = 32;
|
|
34
|
-
export declare const STRIPE_PAYMENT_INTENT_PREFIX = "pi_";
|
|
35
|
-
export declare const PHONE_NUMBER_MAX_LENGTH = 15;
|
|
36
|
-
export declare const OTP_CODE_LENGTH = 6;
|
|
37
|
-
export declare const SCROLL_TO_ERROR_DELAY_MS = 100;
|
|
38
|
-
export declare const FORM_DEBOUNCE_MS = 300;
|
|
@@ -1,45 +1,18 @@
|
|
|
1
|
-
import { msg } from "@lit/localize";
|
|
2
|
-
export const STRIPE_ERRORS = {
|
|
3
|
-
invalid_number: () => msg("Your card number is not a valid credit card number."),
|
|
4
|
-
invalid_expiry_month: () => msg("Your card’s expiration month is invalid."),
|
|
5
|
-
invalid_expiry_year: () => msg("Your card’s expiration year is invalid."),
|
|
6
|
-
invalid_expiry_year_past: () => msg("Your card’s expiration year is in the past."),
|
|
7
|
-
invalid_cvc: () => msg("Your card’s security code is invalid."),
|
|
8
|
-
incorrect_number: () => msg("Your card number is incorrect."),
|
|
9
|
-
incomplete_number: () => msg("Your card number is incomplete."),
|
|
10
|
-
incomplete_cvc: () => msg("Your card’s security code is incomplete."),
|
|
11
|
-
incomplete_expiry: () => msg("Your card’s expiration date is incomplete."),
|
|
12
|
-
expired_card: () => msg("Your card has expired."),
|
|
13
|
-
incorrect_cvc: () => msg("Your card’s security code is incorrect."),
|
|
14
|
-
incorrect_zip: () => msg("Your card’s zip code failed validation."),
|
|
15
|
-
card_declined: () => msg("Your card was declined."),
|
|
16
|
-
missing: () => msg("There is no card on a customer that is being charged."),
|
|
17
|
-
processing_error: () => msg("An error occurred while processing the card."),
|
|
18
|
-
};
|
|
19
|
-
export const STRIPE_FIELD_GENERIC_ERROR = () => msg("An error occurred.");
|
|
20
1
|
export const PAYMENT_LAYOUT_BREAKPOINT_PX = 900;
|
|
2
|
+
// Key of the loyalty token in the API's `loyalty.pay` / `loyalty.earn` maps
|
|
21
3
|
// Transaction polling configuration
|
|
22
4
|
export const TRANSACTION_POLLING_MAX_ATTEMPTS = 30;
|
|
23
5
|
export const TRANSACTION_POLLING_INITIAL_INTERVAL_MS = 1000;
|
|
24
6
|
export const TRANSACTION_POLLING_MAX_INTERVAL_MS = 8000;
|
|
7
|
+
// Attempts for the customer-triggered "Check again" from the pending state
|
|
8
|
+
export const TRANSACTION_RECHECK_MAX_ATTEMPTS = 3;
|
|
25
9
|
// OTP configuration (Email)
|
|
26
10
|
export const OTP_INACTIVITY_TIMEOUT_MS = 30000; // 30 seconds
|
|
27
|
-
export const OTP_EXPIRY_MINUTES = 10;
|
|
28
11
|
export const OTP_MIN_RESEND_INTERVAL_MS = 60000; // 1 minute minimum between OTP sends
|
|
29
12
|
export const OTP_MAX_ATTEMPTS_PER_SESSION = 5; // Maximum OTP attempts per session
|
|
30
13
|
// SMS OTP configuration (for phone linking)
|
|
31
|
-
export const SMS_OTP_INACTIVITY_TIMEOUT_MS = 30000; // 30 seconds
|
|
32
|
-
export const SMS_OTP_EXPIRY_MINUTES = 5; // SMS codes expire faster than email
|
|
33
14
|
export const SMS_OTP_MIN_RESEND_INTERVAL_MS = 60000; // 1 minute minimum between SMS sends
|
|
34
15
|
export const SMS_OTP_MAX_ATTEMPTS_PER_SESSION = 5; // Maximum SMS attempts per session
|
|
35
16
|
// Balance polling configuration
|
|
36
17
|
export const BALANCE_BACKOFF_INITIAL_MS = 5000;
|
|
37
18
|
export const BALANCE_BACKOFF_MAX_MS = 60000;
|
|
38
|
-
// Stripe configuration
|
|
39
|
-
export const STRIPE_MIN_KEY_LENGTH = 32;
|
|
40
|
-
export const STRIPE_PAYMENT_INTENT_PREFIX = "pi_";
|
|
41
|
-
// Form configuration
|
|
42
|
-
export const PHONE_NUMBER_MAX_LENGTH = 15;
|
|
43
|
-
export const OTP_CODE_LENGTH = 6;
|
|
44
|
-
export const SCROLL_TO_ERROR_DELAY_MS = 100;
|
|
45
|
-
export const FORM_DEBOUNCE_MS = 300;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { components } from "../../core/types/api-schema.js";
|
|
2
2
|
import type { Stripe, StripeCardNumberElement, StripeElements, PaymentRequest } from "@stripe/stripe-js";
|
|
3
|
-
export type PaymentOption = "fida" | "card" | "google" | "apple";
|
|
4
3
|
export type { PhoneCodeSelection } from "../../components/phone-field/phone-field.types.js";
|
|
5
4
|
type ReservationsData = {
|
|
6
5
|
[reservationId: string]: {
|
|
@@ -46,7 +45,7 @@ export type TransactionStatus = components["schemas"]["UserTransactions"]["statu
|
|
|
46
45
|
export type ReservationConfirmationResponse = components["schemas"]["ReservationsPutResponse"];
|
|
47
46
|
export interface ApiError {
|
|
48
47
|
title?: string;
|
|
49
|
-
errors
|
|
48
|
+
errors: {
|
|
50
49
|
[fieldName: string]: string[] | string | Record<string, string[] | string> | Record<string, Record<string, string[] | string>> | undefined;
|
|
51
50
|
};
|
|
52
51
|
}
|
|
@@ -69,23 +68,6 @@ export interface CustomerData {
|
|
|
69
68
|
phone?: string;
|
|
70
69
|
address?: StripeBillingAddress;
|
|
71
70
|
}
|
|
72
|
-
/**
|
|
73
|
-
* Transaction status values from the API.
|
|
74
|
-
*/
|
|
75
|
-
export type TransactionPollingStatus = "PAID" | "PENDING" | "ADDED" | "SUSPENDED" | "FAILED" | null;
|
|
76
|
-
/**
|
|
77
|
-
* OTP rate limiting state for crypto authentication.
|
|
78
|
-
*/
|
|
79
|
-
export interface OtpRateLimitState {
|
|
80
|
-
/** Number of OTP send attempts in current session */
|
|
81
|
-
attempts: number;
|
|
82
|
-
/** Timestamp of last OTP send */
|
|
83
|
-
lastSentTime: number;
|
|
84
|
-
/** Whether currently rate limited */
|
|
85
|
-
isRateLimited: boolean;
|
|
86
|
-
/** Seconds remaining before next send allowed */
|
|
87
|
-
cooldownRemaining: number;
|
|
88
|
-
}
|
|
89
71
|
/**
|
|
90
72
|
* Field visibility flags computed from requirements data.
|
|
91
73
|
*/
|
|
@@ -3,11 +3,18 @@ import type { ReservationSummary } from "../../contexts/basket/basket.types.js";
|
|
|
3
3
|
import type { FormValues, PhoneCodeSelection, FieldsConfig, ApiError, InputFieldType, InputFieldAutocomplete } from "./payment-page.types.js";
|
|
4
4
|
import type { Client } from "openapi-fetch";
|
|
5
5
|
import type { SupportedLocales } from "../../core/types/index.js";
|
|
6
|
-
import type {
|
|
6
|
+
import type { Logger } from "../../core/logger.js";
|
|
7
|
+
import { type ValidatorContext } from "./payment-page.validators.js";
|
|
7
8
|
/**
|
|
8
9
|
* Capitalizes the first letter of a string and replaces underscores with spaces
|
|
9
10
|
*/
|
|
10
11
|
export declare const capitalizeFirstLetter: (str: string) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Field elements that show an error state, in the forms the partials render.
|
|
14
|
+
* Shared by the payment page's scroll-to-first-error, which cannot query
|
|
15
|
+
* through the partials' shadow roots itself.
|
|
16
|
+
*/
|
|
17
|
+
export declare const INVALID_FIELD_SELECTOR: string;
|
|
11
18
|
/**
|
|
12
19
|
* Gets the default phone code selection based on locale.
|
|
13
20
|
* Extracts the country code from the locale (e.g., "en-IE" -> "IE")
|
|
@@ -134,6 +141,11 @@ export declare function prepareAttendeesData(reservations: ReservationSummary[],
|
|
|
134
141
|
}[];
|
|
135
142
|
hasRequirements: boolean;
|
|
136
143
|
};
|
|
144
|
+
/**
|
|
145
|
+
* The error middleware wraps every non-ok body in an `APIError`; the field
|
|
146
|
+
* mapping below reads the body itself.
|
|
147
|
+
*/
|
|
148
|
+
export declare const unwrapApiErrorBody: (err: unknown) => unknown;
|
|
137
149
|
/**
|
|
138
150
|
* Type guard for API errors
|
|
139
151
|
*/
|
|
@@ -153,17 +165,15 @@ export declare function mapApiErrorsToForm(error: unknown, currentFormErrors: Re
|
|
|
153
165
|
cardError?: string;
|
|
154
166
|
};
|
|
155
167
|
/**
|
|
156
|
-
*
|
|
168
|
+
* Polls the customer's transactions for `transactionId` with exponential
|
|
169
|
+
* backoff until it reaches a final status or `maxAttempts` is spent. A
|
|
170
|
+
* transaction that is not listed yet counts as non-final and keeps polling.
|
|
157
171
|
* Pass an AbortSignal to cancel polling early (e.g., on component disconnect).
|
|
158
172
|
*/
|
|
159
|
-
export declare function pollTransactionStatus(userId: string, maxAttempts: number, initialInterval: number, maxInterval: number, client: Client<paths>, distributorID: string, locale: SupportedLocales, onReferenceId?: (id: string) => void, signal?: AbortSignal): Promise<{
|
|
173
|
+
export declare function pollTransactionStatus(userId: string, transactionId: string, maxAttempts: number, initialInterval: number, maxInterval: number, client: Client<paths>, distributorID: string, locale: SupportedLocales, logger: Logger, onReferenceId?: (id: string) => void, signal?: AbortSignal): Promise<{
|
|
160
174
|
status: string | null;
|
|
161
175
|
tokensToIssue: string | null;
|
|
162
176
|
}>;
|
|
163
|
-
/**
|
|
164
|
-
* Validates an email address
|
|
165
|
-
*/
|
|
166
|
-
export declare const isValidEmail: (email: string) => boolean;
|
|
167
177
|
/**
|
|
168
178
|
* Validates a wallet email address
|
|
169
179
|
*/
|
|
@@ -198,13 +208,12 @@ export declare function mapStripeErrorToField(error: unknown): "number" | "expir
|
|
|
198
208
|
export declare function isFinalStatus(status: string | null): boolean;
|
|
199
209
|
export declare function extractPaymentIntentId(clientSecret: string): string;
|
|
200
210
|
/**
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* @returns Formatted phone number with + prefix, or undefined if invalid
|
|
211
|
+
* Normalises a customer-entered phone number to E.164 ("+353871234567").
|
|
212
|
+
* The country resolves national input, including a trunk prefix such as the
|
|
213
|
+
* leading 0 in "0871234567"; a number typed with "+" is taken as-is.
|
|
214
|
+
* Returns undefined when the input is empty or cannot be parsed.
|
|
206
215
|
*/
|
|
207
|
-
export declare function
|
|
216
|
+
export declare function toE164(value: string | null | undefined, countryCode?: string | null): string | undefined;
|
|
208
217
|
/**
|
|
209
218
|
* Persisted transfer payload stored in localStorage for crash recovery.
|
|
210
219
|
*/
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { msg } from "@lit/localize";
|
|
2
|
-
import { apiGet
|
|
2
|
+
import { apiGet } from "../../core/api/queries.js";
|
|
3
|
+
import { getLoyaltyAmount } from "../../core/utils/loyalty.js";
|
|
4
|
+
import { APIError } from "../../core/api/api-error.js";
|
|
5
|
+
import { parsePhoneNumberFromString, } from "libphonenumber-js/min";
|
|
6
|
+
import { validEmail, } from "./payment-page.validators.js";
|
|
3
7
|
/**
|
|
4
8
|
* Capitalizes the first letter of a string and replaces underscores with spaces
|
|
5
9
|
*/
|
|
@@ -8,6 +12,18 @@ export const capitalizeFirstLetter = (str) => {
|
|
|
8
12
|
return "";
|
|
9
13
|
return str.charAt(0).toUpperCase() + str.slice(1).replace(/_/g, " ");
|
|
10
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Field elements that show an error state, in the forms the partials render.
|
|
17
|
+
* Shared by the payment page's scroll-to-first-error, which cannot query
|
|
18
|
+
* through the partials' shadow roots itself.
|
|
19
|
+
*/
|
|
20
|
+
export const INVALID_FIELD_SELECTOR = [
|
|
21
|
+
"coras-field[error]",
|
|
22
|
+
"coras-phone-field[error]",
|
|
23
|
+
"coras-country-field[has-error]",
|
|
24
|
+
"coras-hotel-pickup-field[has-error]",
|
|
25
|
+
"coras-joined-fields[error]",
|
|
26
|
+
].join(", ");
|
|
11
27
|
/**
|
|
12
28
|
* Gets the default phone code selection based on locale.
|
|
13
29
|
* Extracts the country code from the locale (e.g., "en-IE" -> "IE")
|
|
@@ -89,7 +105,8 @@ export const getFieldValue = (fieldName, formValues) => {
|
|
|
89
105
|
* Handles form value changes and updates the form values object
|
|
90
106
|
*/
|
|
91
107
|
export const handleFormValueChange = (fieldName, value, formValues) => {
|
|
92
|
-
//
|
|
108
|
+
// Shallow copy: a new top-level object is what Lit's property change
|
|
109
|
+
// detection needs; nested reservation entries are updated in place below.
|
|
93
110
|
const newFormValues = { ...formValues };
|
|
94
111
|
// Check if this is a reservation field
|
|
95
112
|
if (fieldName && fieldName.startsWith("reservation_")) {
|
|
@@ -342,13 +359,12 @@ export function prepareCustomerData(formValues, selectedPhoneCode, findCountryCo
|
|
|
342
359
|
const name = getFieldValue("name", formValues);
|
|
343
360
|
const email = getFieldValue("email", formValues);
|
|
344
361
|
const phone = getFieldValue("phone", formValues);
|
|
345
|
-
const phoneCode = selectedPhoneCode?.phoneCode || "";
|
|
346
362
|
const countryName = getFieldValue("country", formValues);
|
|
347
363
|
const countryCode = findCountryCode(countryName);
|
|
348
364
|
const customerData = {
|
|
349
365
|
name: name || `${firstName} ${secondName}`.trim(),
|
|
350
366
|
email,
|
|
351
|
-
phone: phone
|
|
367
|
+
phone: toE164(phone, selectedPhoneCode?.code),
|
|
352
368
|
address: {
|
|
353
369
|
line1: getFieldValue("addressLine1", formValues),
|
|
354
370
|
line2: getFieldValue("addressLine2", formValues),
|
|
@@ -463,21 +479,11 @@ export function prepareAttendeesData(reservations, reservationsCheck, getFieldVa
|
|
|
463
479
|
const city = getFieldValue(`${fieldNamePrefix}city`);
|
|
464
480
|
const province = getFieldValue(`${fieldNamePrefix}province`);
|
|
465
481
|
const dateOfBirth = getFieldValue(`${fieldNamePrefix}date_of_birth`);
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
const phoneCode = getFieldValue(`${fieldNamePrefix}phone_code`) ||
|
|
470
|
-
selectedPhoneCode?.phoneCode ||
|
|
471
|
-
"";
|
|
472
|
-
const fullPhone = phoneCode && phoneNumberRaw
|
|
473
|
-
? `${phoneCode}${phoneNumberRaw}`
|
|
474
|
-
: phoneNumberRaw;
|
|
475
|
-
const phoneNumber = formatPhoneWithPlus(fullPhone);
|
|
482
|
+
const attendeeCountryCode = getFieldValue(`${fieldNamePrefix}country_code`) ||
|
|
483
|
+
selectedPhoneCode?.code;
|
|
484
|
+
const phoneNumber = toE164(getFieldValue(`${fieldNamePrefix}phone_number`), attendeeCountryCode);
|
|
476
485
|
// Only send country_code alongside an actual phone number.
|
|
477
|
-
const countryCode = phoneNumber
|
|
478
|
-
? getFieldValue(`${fieldNamePrefix}country_code`) ||
|
|
479
|
-
selectedPhoneCode?.code
|
|
480
|
-
: undefined;
|
|
486
|
+
const countryCode = phoneNumber ? attendeeCountryCode : undefined;
|
|
481
487
|
// The API rejects null for any attendee field it did not require
|
|
482
488
|
// ("Field may not be null."). Only the fields the customer filled in
|
|
483
489
|
// are required and rendered, so send those and omit the rest.
|
|
@@ -501,6 +507,11 @@ export function prepareAttendeesData(reservations, reservationsCheck, getFieldVa
|
|
|
501
507
|
});
|
|
502
508
|
return { attendees, hasRequirements };
|
|
503
509
|
}
|
|
510
|
+
/**
|
|
511
|
+
* The error middleware wraps every non-ok body in an `APIError`; the field
|
|
512
|
+
* mapping below reads the body itself.
|
|
513
|
+
*/
|
|
514
|
+
export const unwrapApiErrorBody = (err) => err instanceof APIError ? err.response : err;
|
|
504
515
|
/**
|
|
505
516
|
* Type guard for API errors
|
|
506
517
|
*/
|
|
@@ -508,7 +519,8 @@ export const isApiError = (err) => {
|
|
|
508
519
|
return (typeof err === "object" &&
|
|
509
520
|
err !== null &&
|
|
510
521
|
"errors" in err &&
|
|
511
|
-
typeof err.errors === "object"
|
|
522
|
+
typeof err.errors === "object" &&
|
|
523
|
+
err.errors !== null);
|
|
512
524
|
};
|
|
513
525
|
/**
|
|
514
526
|
* Extracts a user-safe error message from an unknown error.
|
|
@@ -538,7 +550,7 @@ export function sanitizeErrorMessage(error, fallback) {
|
|
|
538
550
|
* Handles API errors by mapping them to form fields
|
|
539
551
|
*/
|
|
540
552
|
export function mapApiErrorsToForm(error, currentFormErrors, attendees, reservations) {
|
|
541
|
-
if (isApiError(error)
|
|
553
|
+
if (isApiError(error)) {
|
|
542
554
|
const formErrors = { ...currentFormErrors };
|
|
543
555
|
// Map API errors to form fields
|
|
544
556
|
Object.entries(error.errors).forEach(([field, message]) => {
|
|
@@ -616,42 +628,42 @@ export function mapApiErrorsToForm(error, currentFormErrors, attendees, reservat
|
|
|
616
628
|
}
|
|
617
629
|
}
|
|
618
630
|
/**
|
|
619
|
-
*
|
|
631
|
+
* The reservation PUT returns the id as UUID hex while the transactions list
|
|
632
|
+
* uses the hyphenated form; compare them on their digits only.
|
|
633
|
+
*/
|
|
634
|
+
const isSameTransactionId = (a, b) => a.replace(/-/g, "").toLowerCase() === b.replace(/-/g, "").toLowerCase();
|
|
635
|
+
/**
|
|
636
|
+
* Polls the customer's transactions for `transactionId` with exponential
|
|
637
|
+
* backoff until it reaches a final status or `maxAttempts` is spent. A
|
|
638
|
+
* transaction that is not listed yet counts as non-final and keeps polling.
|
|
620
639
|
* Pass an AbortSignal to cancel polling early (e.g., on component disconnect).
|
|
621
640
|
*/
|
|
622
|
-
export async function pollTransactionStatus(userId, maxAttempts, initialInterval, maxInterval, client, distributorID, locale, onReferenceId, signal) {
|
|
641
|
+
export async function pollTransactionStatus(userId, transactionId, maxAttempts, initialInterval, maxInterval, client, distributorID, locale, logger, onReferenceId, signal) {
|
|
623
642
|
let attempts = 0;
|
|
624
643
|
let currentInterval = initialInterval;
|
|
625
644
|
const checkStatus = async () => {
|
|
626
645
|
try {
|
|
627
|
-
const { data
|
|
646
|
+
const { data } = await apiGet({
|
|
628
647
|
client,
|
|
629
648
|
distributorID,
|
|
630
649
|
locale,
|
|
631
650
|
endpoint: "/{api_version}/users/{customer_id}/transactions",
|
|
632
651
|
path: { customer_id: userId },
|
|
633
|
-
})
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
return { status: null, tokensToIssue: null };
|
|
637
|
-
}
|
|
638
|
-
if (data && data.length > 0) {
|
|
639
|
-
const transaction = data[0];
|
|
640
|
-
if (!transaction)
|
|
641
|
-
return { status: null, tokensToIssue: null };
|
|
652
|
+
});
|
|
653
|
+
const transaction = data?.find((entry) => isSameTransactionId(entry.transaction_id, transactionId));
|
|
654
|
+
if (transaction) {
|
|
642
655
|
if (transaction.reference_id && onReferenceId) {
|
|
643
656
|
onReferenceId(transaction.reference_id);
|
|
644
657
|
}
|
|
645
|
-
const
|
|
646
|
-
|
|
647
|
-
? String(Object.values(loyaltyEarn)[0] ?? "")
|
|
658
|
+
const tokensToIssue = transaction.loyalty?.earn
|
|
659
|
+
? String(getLoyaltyAmount(transaction.loyalty, "earn"))
|
|
648
660
|
: null;
|
|
649
661
|
return { status: transaction.status || null, tokensToIssue };
|
|
650
662
|
}
|
|
651
663
|
return { status: null, tokensToIssue: null };
|
|
652
664
|
}
|
|
653
665
|
catch (err) {
|
|
654
|
-
|
|
666
|
+
logger.error(err, { context: "transaction status poll" });
|
|
655
667
|
return { status: null, tokensToIssue: null };
|
|
656
668
|
}
|
|
657
669
|
};
|
|
@@ -675,16 +687,9 @@ export async function pollTransactionStatus(userId, maxAttempts, initialInterval
|
|
|
675
687
|
currentInterval = nextInterval;
|
|
676
688
|
setTimeout(poll, currentInterval);
|
|
677
689
|
};
|
|
678
|
-
poll();
|
|
690
|
+
void poll();
|
|
679
691
|
});
|
|
680
692
|
}
|
|
681
|
-
/**
|
|
682
|
-
* Validates an email address
|
|
683
|
-
*/
|
|
684
|
-
export const isValidEmail = (email) => {
|
|
685
|
-
const re = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
686
|
-
return re.test(email);
|
|
687
|
-
};
|
|
688
693
|
/**
|
|
689
694
|
* Validates a wallet email address
|
|
690
695
|
*/
|
|
@@ -692,10 +697,7 @@ export const validateWalletEmail = (email) => {
|
|
|
692
697
|
if (!email) {
|
|
693
698
|
return msg("Email is required");
|
|
694
699
|
}
|
|
695
|
-
|
|
696
|
-
return msg("Please enter a valid email address");
|
|
697
|
-
}
|
|
698
|
-
return "";
|
|
700
|
+
return validEmail({ value: email }) ?? "";
|
|
699
701
|
};
|
|
700
702
|
/**
|
|
701
703
|
* ISO-3166-1 alpha-2 pattern (two uppercase letters).
|
|
@@ -722,7 +724,6 @@ export const findCountryCode = (countryName, countries = []) => {
|
|
|
722
724
|
if (country?.code)
|
|
723
725
|
return country.code;
|
|
724
726
|
// PP-007: Deterministic fallback instead of returning raw name
|
|
725
|
-
console.warn(`Country "${countryName}" could not be mapped to ISO code, falling back to ${DEFAULT_COUNTRY_CODE}`);
|
|
726
727
|
return DEFAULT_COUNTRY_CODE;
|
|
727
728
|
};
|
|
728
729
|
/**
|
|
@@ -809,34 +810,15 @@ export function extractPaymentIntentId(clientSecret) {
|
|
|
809
810
|
return parts[0] || "";
|
|
810
811
|
}
|
|
811
812
|
/**
|
|
812
|
-
*
|
|
813
|
-
*
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
* @returns Formatted phone number with + prefix, or undefined if invalid
|
|
813
|
+
* Normalises a customer-entered phone number to E.164 ("+353871234567").
|
|
814
|
+
* The country resolves national input, including a trunk prefix such as the
|
|
815
|
+
* leading 0 in "0871234567"; a number typed with "+" is taken as-is.
|
|
816
|
+
* Returns undefined when the input is empty or cannot be parsed.
|
|
817
817
|
*/
|
|
818
|
-
export function
|
|
819
|
-
if (!
|
|
818
|
+
export function toE164(value, countryCode) {
|
|
819
|
+
if (!value)
|
|
820
820
|
return undefined;
|
|
821
|
-
|
|
822
|
-
const cleaned = phone.replace(/[\s\-().]/g, "");
|
|
823
|
-
// Phone already has + prefix
|
|
824
|
-
if (cleaned.startsWith("+")) {
|
|
825
|
-
// Validate it's not just "+" with no digits
|
|
826
|
-
const digitsOnly = cleaned.slice(1);
|
|
827
|
-
if (!digitsOnly || !/^\d+$/.test(digitsOnly)) {
|
|
828
|
-
console.error("Invalid phone number format");
|
|
829
|
-
return undefined;
|
|
830
|
-
}
|
|
831
|
-
return cleaned;
|
|
832
|
-
}
|
|
833
|
-
// Validate contains only digits before adding a prefix
|
|
834
|
-
if (!/^\d+$/.test(cleaned)) {
|
|
835
|
-
console.error("Phone number contains invalid characters");
|
|
836
|
-
return undefined;
|
|
837
|
-
}
|
|
838
|
-
// Add + prefix
|
|
839
|
-
return `+${cleaned}`;
|
|
821
|
+
return parsePhoneNumberFromString(value, (countryCode || undefined))?.format("E.164");
|
|
840
822
|
}
|
|
841
823
|
// ────────────────────────────────────────────────────────────────────────────
|
|
842
824
|
// Pending crypto transfer recovery - validation & integrity
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Provides a stable interface for payment-related API operations,
|
|
5
5
|
* decoupling controllers from the raw API query functions.
|
|
6
|
-
*
|
|
6
|
+
* Every method resolves with the response and throws an `APIError` (from the
|
|
7
|
+
* client's error middleware) on a non-ok response.
|
|
7
8
|
*/
|
|
8
9
|
import type { SupportedLocales } from "../../../core/types/index.js";
|
|
9
10
|
import type { paths, components } from "../../../core/types/api-schema.js";
|
|
@@ -22,9 +23,8 @@ export declare class PaymentApiService {
|
|
|
22
23
|
code: string;
|
|
23
24
|
name: string;
|
|
24
25
|
phone_code: number;
|
|
25
|
-
}[]
|
|
26
|
-
response: Response
|
|
27
|
-
error: unknown;
|
|
26
|
+
}[];
|
|
27
|
+
response: Response;
|
|
28
28
|
}>;
|
|
29
29
|
fetchGeolocation(): Promise<{
|
|
30
30
|
data: {
|
|
@@ -34,53 +34,37 @@ export declare class PaymentApiService {
|
|
|
34
34
|
slug: string | null;
|
|
35
35
|
parent_location_type: null;
|
|
36
36
|
parent_location: null;
|
|
37
|
-
}
|
|
38
|
-
response: Response
|
|
39
|
-
error: unknown;
|
|
37
|
+
};
|
|
38
|
+
response: Response;
|
|
40
39
|
}>;
|
|
41
40
|
checkReservations(bookingSession: string | null): Promise<{
|
|
42
41
|
data: {
|
|
43
42
|
general: components["schemas"]["GeneralRequirements"];
|
|
44
43
|
reservations: components["schemas"]["ReservationRequirementsAndRestrictions"][];
|
|
45
|
-
}
|
|
46
|
-
response: Response
|
|
47
|
-
error: unknown;
|
|
44
|
+
};
|
|
45
|
+
response: Response;
|
|
48
46
|
}>;
|
|
49
47
|
fetchReservations(bookingSession: string): Promise<{
|
|
50
48
|
data: {
|
|
51
49
|
reservations: (components["schemas"]["EventReservationSummary"] | components["schemas"]["TourReservationSummary"])[];
|
|
52
50
|
total_price: number;
|
|
53
|
-
}
|
|
54
|
-
response: Response
|
|
55
|
-
error: unknown;
|
|
51
|
+
};
|
|
52
|
+
response: Response;
|
|
56
53
|
}>;
|
|
57
54
|
confirmReservation(body: components["schemas"]["ReservationsPutRequest"], bookingSession: string | null, headers?: Record<string, string>): Promise<{
|
|
58
55
|
data: {
|
|
59
56
|
transaction_id: string;
|
|
60
57
|
user_id: string;
|
|
61
58
|
client_secret: string | null;
|
|
62
|
-
}
|
|
63
|
-
response: Response
|
|
64
|
-
error: unknown;
|
|
59
|
+
};
|
|
60
|
+
response: Response;
|
|
65
61
|
}>;
|
|
66
62
|
patchReservation(reservationId: string, body: {
|
|
67
63
|
pickup_id: string | null;
|
|
68
64
|
pickup_entry: string | null;
|
|
69
65
|
}): Promise<{
|
|
70
66
|
data: undefined;
|
|
71
|
-
response: Response
|
|
72
|
-
error: unknown;
|
|
73
|
-
}>;
|
|
74
|
-
fetchTransactions(userId: string): Promise<{
|
|
75
|
-
data: {
|
|
76
|
-
transaction_id: string;
|
|
77
|
-
status: "ADDED" | "PAID" | "PENDING" | "FAILED" | "SUSPENDED" | "REFUNDED" | "PARTIAL_REFUNDED" | "CANCELLED" | "PARTIALLY_CANCELLED" | "PARTIALLY_CONFIRMED";
|
|
78
|
-
created_at: string;
|
|
79
|
-
reference_id: string;
|
|
80
|
-
loyalty: components["schemas"]["LoyaltySchema"];
|
|
81
|
-
}[] | undefined;
|
|
82
|
-
response: Response | undefined;
|
|
83
|
-
error: unknown;
|
|
67
|
+
response: Response;
|
|
84
68
|
}>;
|
|
85
69
|
fetchConfig(): Promise<{
|
|
86
70
|
data: {
|
|
@@ -92,13 +76,11 @@ export declare class PaymentApiService {
|
|
|
92
76
|
seatsio_public_workspace_key: string | null;
|
|
93
77
|
seatsio_region: "eu" | "na" | "sa" | "oc";
|
|
94
78
|
treasury_wallet_address: string | null;
|
|
95
|
-
}
|
|
96
|
-
response: Response
|
|
97
|
-
error: unknown;
|
|
79
|
+
};
|
|
80
|
+
response: Response;
|
|
98
81
|
}>;
|
|
99
82
|
submitUserConsent(email: string, headers?: Record<string, string>): Promise<{
|
|
100
83
|
data: undefined;
|
|
101
|
-
response: Response
|
|
102
|
-
error: unknown;
|
|
84
|
+
response: Response;
|
|
103
85
|
}>;
|
|
104
86
|
}
|