tf-checkout-react 1.7.31 → 2.0.0-beta.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/LICENSE +1 -1
- package/README.md +141 -1033
- package/dist/checkout.css +17 -0
- package/dist/index.d.mts +3930 -0
- package/dist/index.d.ts +3930 -30
- package/dist/index.esm.js +9123 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +9277 -6
- package/dist/index.js.map +1 -0
- package/dist/styles/addons.css +75 -0
- package/dist/styles/auth.css +294 -0
- package/dist/styles/billing.css +98 -0
- package/dist/styles/confirmation.css +51 -0
- package/dist/styles/foundation.css +146 -0
- package/dist/styles/payment.css +179 -0
- package/dist/styles/primitives.css +356 -0
- package/dist/styles/seat-map.css +46 -0
- package/dist/styles/tickets.css +285 -0
- package/dist/styles/verification-confirmation.css +258 -0
- package/package.json +93 -78
- package/src/.d.ts +1 -1
- package/src/CardInput.tsx +374 -0
- package/src/EmbeddedCheckout.tsx +400 -0
- package/src/ResumedCheckout.tsx +132 -0
- package/src/auth/AuthModal.tsx +231 -0
- package/src/auth/ForgotPasswordForm.tsx +93 -0
- package/src/auth/LoginForm.tsx +104 -0
- package/src/auth/PasswordInput.tsx +33 -0
- package/src/auth/RegisterForm.tsx +333 -0
- package/src/auth/ResetPasswordForm.tsx +112 -0
- package/src/auth/index.ts +5 -0
- package/src/checkout.css +17 -0
- package/src/configure.ts +29 -0
- package/src/confirmer.ts +439 -0
- package/src/index.ts +41 -30
- package/src/instance.ts +21 -0
- package/src/sections/AddOns.tsx +241 -0
- package/src/sections/BillingInfo.tsx +743 -0
- package/src/sections/Confirmation.tsx +146 -0
- package/src/sections/IDVerification.tsx +76 -0
- package/src/sections/OrderConfirmation.tsx +277 -0
- package/src/sections/OrderIDVerification.tsx +117 -0
- package/src/sections/OrderSummary.tsx +84 -0
- package/src/sections/Payment.tsx +541 -0
- package/src/sections/SeatMap.tsx +512 -0
- package/src/sections/Tickets.tsx +573 -0
- package/src/sections/billing/BillingAddressFields.tsx +138 -0
- package/src/sections/billing/BuyerField.tsx +75 -0
- package/src/sections/billing/TicketHoldersCard.tsx +119 -0
- package/src/sections/billing/types.ts +10 -0
- package/src/sections/index.ts +15 -0
- package/src/sections/seatMap.utils.ts +105 -0
- package/src/styles/addons.css +75 -0
- package/src/styles/auth.css +294 -0
- package/src/styles/billing.css +98 -0
- package/src/styles/confirmation.css +51 -0
- package/src/styles/foundation.css +146 -0
- package/src/styles/payment.css +179 -0
- package/src/styles/primitives.css +356 -0
- package/src/styles/seat-map.css +46 -0
- package/src/styles/tickets.css +285 -0
- package/src/styles/verification-confirmation.css +258 -0
- package/src/typings.d.ts +2 -2
- package/src/ui/Button.tsx +38 -0
- package/src/ui/Card.tsx +54 -0
- package/src/ui/CheckoutProvider.tsx +172 -0
- package/src/ui/CustomFields.tsx +195 -0
- package/src/ui/Field.tsx +114 -0
- package/src/ui/I18nProvider.tsx +36 -0
- package/src/ui/InstallmentPicker.tsx +69 -0
- package/src/ui/Loader.tsx +12 -0
- package/src/ui/PaymentMethods.tsx +133 -0
- package/src/ui/PriceLine.tsx +24 -0
- package/src/ui/QuantitySelect.tsx +50 -0
- package/src/ui/Stepper.tsx +36 -0
- package/src/ui/Timer.tsx +34 -0
- package/src/ui/TimerBanner.tsx +55 -0
- package/src/ui/cx.ts +3 -0
- package/src/ui/index.ts +54 -0
- package/src/ui/theme.ts +83 -0
- package/src/useCheckout.ts +35 -0
- package/src/xendit.ts +438 -0
- package/dist/adapters/customFields.d.ts +0 -12
- package/dist/adapters/index.d.ts +0 -1
- package/dist/api/auth.d.ts +0 -27
- package/dist/api/cart.d.ts +0 -2
- package/dist/api/checkout.d.ts +0 -3
- package/dist/api/common.d.ts +0 -11
- package/dist/api/guestTicketDelegation.d.ts +0 -47
- package/dist/api/index.d.ts +0 -82
- package/dist/api/interceptors.d.ts +0 -1
- package/dist/api/orders.d.ts +0 -2
- package/dist/api/payment.d.ts +0 -5
- package/dist/api/preRegistrationComplete.d.ts +0 -3
- package/dist/api/publicRequest.d.ts +0 -9
- package/dist/api/resale.d.ts +0 -5
- package/dist/components/account-settings/index.d.ts +0 -3
- package/dist/components/addonsContainer/AddonComponent.d.ts +0 -18
- package/dist/components/addonsContainer/SimpleAddonsContainer.d.ts +0 -20
- package/dist/components/addonsContainer/adapters/index.d.ts +0 -12
- package/dist/components/addonsContainer/index.d.ts +0 -22
- package/dist/components/addonsContainer/normalizers/index.d.ts +0 -1
- package/dist/components/addonsContainer/useAddons.d.ts +0 -23
- package/dist/components/addonsContainer/utils/index.d.ts +0 -16
- package/dist/components/billing-info-container/hooks/index.d.ts +0 -3
- package/dist/components/billing-info-container/hooks/usePaymentContext.d.ts +0 -5
- package/dist/components/billing-info-container/hooks/usePaymentRedirect.d.ts +0 -14
- package/dist/components/billing-info-container/hooks/useStripePayment.d.ts +0 -18
- package/dist/components/billing-info-container/index.d.ts +0 -69
- package/dist/components/billing-info-container/utils.d.ts +0 -59
- package/dist/components/common/Checkbox.d.ts +0 -11
- package/dist/components/common/CheckboxField/index.d.ts +0 -9
- package/dist/components/common/CopyField.d.ts +0 -12
- package/dist/components/common/CopyMessageModal.d.ts +0 -7
- package/dist/components/common/CustomField.d.ts +0 -26
- package/dist/components/common/DatePickerField.d.ts +0 -20
- package/dist/components/common/FieldSection/index.d.ts +0 -19
- package/dist/components/common/FieldSection/utils/index.d.ts +0 -8
- package/dist/components/common/FormikPhoneNumberField.d.ts +0 -11
- package/dist/components/common/Loader.d.ts +0 -2
- package/dist/components/common/ModalComponent/index.d.ts +0 -16
- package/dist/components/common/NativeSelectFeild/index.d.ts +0 -21
- package/dist/components/common/PhoneNumberField.d.ts +0 -14
- package/dist/components/common/PoweredBy.d.ts +0 -2
- package/dist/components/common/RadioField.d.ts +0 -11
- package/dist/components/common/RadioGroupField/index.d.ts +0 -17
- package/dist/components/common/RedirectModal.d.ts +0 -7
- package/dist/components/common/SelectField/index.d.ts +0 -19
- package/dist/components/common/SnackbarAlert.d.ts +0 -13
- package/dist/components/common/index.d.ts +0 -11
- package/dist/components/common/socials.d.ts +0 -10
- package/dist/components/confirmModal/index.d.ts +0 -10
- package/dist/components/confirmationContainer/config.d.ts +0 -1
- package/dist/components/confirmationContainer/index.d.ts +0 -46
- package/dist/components/confirmationContainer/social-buttons.d.ts +0 -16
- package/dist/components/countdown/index.d.ts +0 -14
- package/dist/components/delegationsContainer/IssueComponent.d.ts +0 -10
- package/dist/components/delegationsContainer/IssueTicketForm.d.ts +0 -9
- package/dist/components/delegationsContainer/TicketsAssignedTable.d.ts +0 -11
- package/dist/components/delegationsContainer/TicketsAvailableTable.d.ts +0 -11
- package/dist/components/delegationsContainer/index.d.ts +0 -10
- package/dist/components/forgotPasswordModal/index.d.ts +0 -12
- package/dist/components/idVerificationContainer/VerificationPendingModal.d.ts +0 -10
- package/dist/components/idVerificationContainer/constants.d.ts +0 -21
- package/dist/components/idVerificationContainer/index.d.ts +0 -16
- package/dist/components/index.d.ts +0 -12
- package/dist/components/loginForm/index.d.ts +0 -31
- package/dist/components/loginModal/SignUpForm.d.ts +0 -10
- package/dist/components/loginModal/constants.d.ts +0 -39
- package/dist/components/loginModal/index.d.ts +0 -22
- package/dist/components/myTicketsContainer/index.d.ts +0 -16
- package/dist/components/myTicketsContainer/row.d.ts +0 -3
- package/dist/components/myTicketsContainer/tableConfig.d.ts +0 -5
- package/dist/components/orderDetailsContainer/CustomFieldsForm.d.ts +0 -12
- package/dist/components/orderDetailsContainer/TicketHolderCustomFields.d.ts +0 -10
- package/dist/components/orderDetailsContainer/index.d.ts +0 -66
- package/dist/components/orderDetailsContainer/ticketsTable.d.ts +0 -46
- package/dist/components/orderDetailsContainer/utils/index.d.ts +0 -6
- package/dist/components/paymentContainer/OrderDetails.d.ts +0 -9
- package/dist/components/paymentContainer/PaymentPlanSection.d.ts +0 -10
- package/dist/components/paymentContainer/handlePayment.d.ts +0 -15
- package/dist/components/paymentContainer/index.d.ts +0 -39
- package/dist/components/preRegistration/FieldsSection.d.ts +0 -19
- package/dist/components/preRegistration/Influancers.d.ts +0 -2
- package/dist/components/preRegistration/PreRegistrationComplete.d.ts +0 -13
- package/dist/components/preRegistration/PreRegistrationInformations.d.ts +0 -2
- package/dist/components/preRegistration/Prewards.d.ts +0 -2
- package/dist/components/preRegistration/ShareOptions.d.ts +0 -2
- package/dist/components/preRegistration/constants.d.ts +0 -2
- package/dist/components/preRegistration/index.d.ts +0 -23
- package/dist/components/preRegistration/utils.d.ts +0 -12
- package/dist/components/registerForm/adapters/index.d.ts +0 -4
- package/dist/components/registerForm/constants.d.ts +0 -1
- package/dist/components/registerForm/index.d.ts +0 -16
- package/dist/components/registerModal/index.d.ts +0 -12
- package/dist/components/resetPasswordContainer/index.d.ts +0 -10
- package/dist/components/rsvpContainer/index.d.ts +0 -7
- package/dist/components/seatMapContainer/SeatMapComponent.d.ts +0 -8
- package/dist/components/seatMapContainer/TicketsSection.d.ts +0 -9
- package/dist/components/seatMapContainer/addToCart.d.ts +0 -14
- package/dist/components/seatMapContainer/index.d.ts +0 -2
- package/dist/components/seatMapContainer/utils.d.ts +0 -6
- package/dist/components/signupModal/index.d.ts +0 -12
- package/dist/components/ticketResale/index.d.ts +0 -12
- package/dist/components/ticketResaleModal/index.d.ts +0 -19
- package/dist/components/ticketsContainer/AccessCodeSection.d.ts +0 -7
- package/dist/components/ticketsContainer/InfoIcon.d.ts +0 -5
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +0 -15
- package/dist/components/ticketsContainer/ReferralLogic.d.ts +0 -5
- package/dist/components/ticketsContainer/TicketRow.d.ts +0 -13
- package/dist/components/ticketsContainer/TicketsSection.d.ts +0 -20
- package/dist/components/ticketsContainer/TimeSlotTicketRow.d.ts +0 -19
- package/dist/components/ticketsContainer/TimeSlotsSection.d.ts +0 -25
- package/dist/components/ticketsContainer/index.d.ts +0 -93
- package/dist/components/ticketsContainer/utils.d.ts +0 -13
- package/dist/components/timerWidget/index.d.ts +0 -16
- package/dist/components/waitingList/index.d.ts +0 -9
- package/dist/constants/index.d.ts +0 -7
- package/dist/env.d.ts +0 -16
- package/dist/hoc/CustomFields/index.d.ts +0 -3
- package/dist/hoc/index.d.ts +0 -1
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useCookieListener.d.ts +0 -1
- package/dist/hooks/useEventListener.d.ts +0 -1
- package/dist/hooks/useLocalStorageListener.d.ts +0 -1
- package/dist/hooks/useOnline.d.ts +0 -1
- package/dist/hooks/usePixel.d.ts +0 -6
- package/dist/images/Polygon.png +0 -0
- package/dist/images/cross.svg +0 -44
- package/dist/images/done.svg +0 -3
- package/dist/images/edit.svg +0 -10
- package/dist/images/email.svg +0 -1
- package/dist/images/instagram.svg +0 -5
- package/dist/images/logo-ttf.png +0 -0
- package/dist/images/spotify.svg +0 -6
- package/dist/images/user.svg +0 -1
- package/dist/images/xmark.svg +0 -92
- package/dist/normalizers/index.d.ts +0 -4
- package/dist/tf-checkout-react.cjs.development.js +0 -16149
- package/dist/tf-checkout-react.cjs.development.js.map +0 -1
- package/dist/tf-checkout-react.cjs.production.min.js +0 -2
- package/dist/tf-checkout-react.cjs.production.min.js.map +0 -1
- package/dist/tf-checkout-react.esm.js +0 -16116
- package/dist/tf-checkout-react.esm.js.map +0 -1
- package/dist/tf-checkout-styles.css +0 -1
- package/dist/types/add_on.d.ts +0 -8
- package/dist/types/billing-info-data.d.ts +0 -27
- package/dist/types/checkoutPageConfigs.d.ts +0 -13
- package/dist/types/index.d.ts +0 -6
- package/dist/types/order-data.d.ts +0 -15
- package/dist/types/payment-field.d.ts +0 -6
- package/dist/types/payment-plan-configuration.d.ts +0 -18
- package/dist/types/referral-promotion.d.ts +0 -6
- package/dist/types/verification.d.ts +0 -12
- package/dist/utils/adaptStripeErrors.d.ts +0 -8
- package/dist/utils/auth.d.ts +0 -21
- package/dist/utils/cookies.d.ts +0 -3
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +0 -23
- package/dist/utils/createMarkup.d.ts +0 -3
- package/dist/utils/customFields.d.ts +0 -35
- package/dist/utils/downloadPDF.d.ts +0 -1
- package/dist/utils/form.d.ts +0 -3
- package/dist/utils/formikErrorFocus.d.ts +0 -2
- package/dist/utils/getDomain.d.ts +0 -1
- package/dist/utils/getImage.d.ts +0 -1
- package/dist/utils/getQueryVariable.d.ts +0 -1
- package/dist/utils/htmlNodeFromString.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -15
- package/dist/utils/isBrowser.d.ts +0 -1
- package/dist/utils/isValidNumber.d.ts +0 -1
- package/dist/utils/jsonUtils.d.ts +0 -1
- package/dist/utils/replaceVarInString.d.ts +0 -1
- package/dist/utils/setConfigs.d.ts +0 -11
- package/dist/utils/showZero.d.ts +0 -1
- package/dist/validators/index.d.ts +0 -8
- package/src/adapters/customFields.ts +0 -85
- package/src/adapters/index.ts +0 -1
- package/src/api/auth.ts +0 -88
- package/src/api/cart.ts +0 -28
- package/src/api/checkout.ts +0 -28
- package/src/api/common.ts +0 -190
- package/src/api/guestTicketDelegation.ts +0 -79
- package/src/api/index.ts +0 -346
- package/src/api/interceptors.ts +0 -77
- package/src/api/orders.ts +0 -30
- package/src/api/payment.ts +0 -77
- package/src/api/preRegistrationComplete.ts +0 -37
- package/src/api/publicRequest.ts +0 -47
- package/src/api/resale.ts +0 -28
- package/src/assets/images/Polygon.png +0 -0
- package/src/assets/images/cross.svg +0 -44
- package/src/assets/images/done.svg +0 -3
- package/src/assets/images/edit.svg +0 -10
- package/src/assets/images/email.svg +0 -1
- package/src/assets/images/instagram.svg +0 -5
- package/src/assets/images/logo-ttf.png +0 -0
- package/src/assets/images/spotify.svg +0 -6
- package/src/assets/images/user.svg +0 -1
- package/src/assets/images/xmark.svg +0 -92
- package/src/components/account-settings/index.tsx +0 -161
- package/src/components/account-settings/style.css +0 -200
- package/src/components/addonsContainer/AddonComponent.tsx +0 -204
- package/src/components/addonsContainer/SimpleAddonsContainer.tsx +0 -459
- package/src/components/addonsContainer/adapters/index.tsx +0 -62
- package/src/components/addonsContainer/index.tsx +0 -353
- package/src/components/addonsContainer/normalizers/index.ts +0 -5
- package/src/components/addonsContainer/useAddons.ts +0 -248
- package/src/components/addonsContainer/utils/index.tsx +0 -231
- package/src/components/billing-info-container/hooks/index.ts +0 -3
- package/src/components/billing-info-container/hooks/usePaymentContext.ts +0 -22
- package/src/components/billing-info-container/hooks/usePaymentRedirect.ts +0 -145
- package/src/components/billing-info-container/hooks/useStripePayment.ts +0 -119
- package/src/components/billing-info-container/index.tsx +0 -1695
- package/src/components/billing-info-container/style.css +0 -150
- package/src/components/billing-info-container/utils.tsx +0 -413
- package/src/components/common/Checkbox.tsx +0 -51
- package/src/components/common/CheckboxField/index.tsx +0 -41
- package/src/components/common/CopyField.tsx +0 -53
- package/src/components/common/CopyMessageModal.tsx +0 -34
- package/src/components/common/CustomField.tsx +0 -168
- package/src/components/common/DatePickerField.tsx +0 -126
- package/src/components/common/FieldSection/index.tsx +0 -141
- package/src/components/common/FieldSection/utils/index.tsx +0 -92
- package/src/components/common/FormikPhoneNumberField.tsx +0 -51
- package/src/components/common/Loader.tsx +0 -8
- package/src/components/common/ModalComponent/index.tsx +0 -68
- package/src/components/common/NativeSelectFeild/index.tsx +0 -86
- package/src/components/common/PhoneNumberField.tsx +0 -117
- package/src/components/common/PoweredBy.tsx +0 -15
- package/src/components/common/RadioField.tsx +0 -36
- package/src/components/common/RadioGroupField/index.tsx +0 -76
- package/src/components/common/RedirectModal.tsx +0 -43
- package/src/components/common/SelectField/index.tsx +0 -104
- package/src/components/common/SnackbarAlert.tsx +0 -52
- package/src/components/common/index.tsx +0 -11
- package/src/components/common/socials.tsx +0 -33
- package/src/components/confirmModal/index.tsx +0 -60
- package/src/components/confirmationContainer/config.ts +0 -79
- package/src/components/confirmationContainer/index.tsx +0 -349
- package/src/components/confirmationContainer/social-buttons.tsx +0 -149
- package/src/components/confirmationContainer/style.css +0 -206
- package/src/components/countdown/index.tsx +0 -100
- package/src/components/countdown/style.css +0 -10
- package/src/components/delegationsContainer/IssueComponent.tsx +0 -156
- package/src/components/delegationsContainer/IssueTicketForm.tsx +0 -109
- package/src/components/delegationsContainer/TicketsAssignedTable.tsx +0 -55
- package/src/components/delegationsContainer/TicketsAvailableTable.tsx +0 -54
- package/src/components/delegationsContainer/index.tsx +0 -83
- package/src/components/forgotPasswordModal/index.tsx +0 -138
- package/src/components/forgotPasswordModal/style.css +0 -47
- package/src/components/idVerificationContainer/VerificationPendingModal.tsx +0 -47
- package/src/components/idVerificationContainer/constants.ts +0 -27
- package/src/components/idVerificationContainer/index.tsx +0 -323
- package/src/components/index.ts +0 -12
- package/src/components/loginForm/index.tsx +0 -202
- package/src/components/loginModal/SignUpForm.tsx +0 -329
- package/src/components/loginModal/constants.ts +0 -46
- package/src/components/loginModal/index.tsx +0 -263
- package/src/components/loginModal/style.css +0 -116
- package/src/components/myTicketsContainer/index.tsx +0 -228
- package/src/components/myTicketsContainer/row.tsx +0 -46
- package/src/components/myTicketsContainer/style.css +0 -40
- package/src/components/myTicketsContainer/tableConfig.tsx +0 -80
- package/src/components/myTicketsContainer/types.d.ts +0 -41
- package/src/components/orderDetailsContainer/CustomFieldsForm.tsx +0 -75
- package/src/components/orderDetailsContainer/TicketHolderCustomFields.tsx +0 -100
- package/src/components/orderDetailsContainer/index.tsx +0 -586
- package/src/components/orderDetailsContainer/style.css +0 -77
- package/src/components/orderDetailsContainer/ticketsTable.tsx +0 -246
- package/src/components/orderDetailsContainer/utils/index.tsx +0 -55
- package/src/components/paymentContainer/OrderDetails.tsx +0 -277
- package/src/components/paymentContainer/PaymentPlanSection.tsx +0 -169
- package/src/components/paymentContainer/handlePayment.ts +0 -86
- package/src/components/paymentContainer/index.tsx +0 -643
- package/src/components/paymentContainer/style.css +0 -196
- package/src/components/preRegistration/FieldsSection.tsx +0 -150
- package/src/components/preRegistration/Influancers.tsx +0 -34
- package/src/components/preRegistration/PreRegistrationComplete.tsx +0 -186
- package/src/components/preRegistration/PreRegistrationInformations.tsx +0 -60
- package/src/components/preRegistration/Prewards.tsx +0 -41
- package/src/components/preRegistration/ShareOptions.tsx +0 -77
- package/src/components/preRegistration/constants.tsx +0 -169
- package/src/components/preRegistration/index.tsx +0 -330
- package/src/components/preRegistration/style.css +0 -3
- package/src/components/preRegistration/utils.ts +0 -163
- package/src/components/registerForm/adapters/index.tsx +0 -10
- package/src/components/registerForm/constants.tsx +0 -98
- package/src/components/registerForm/index.tsx +0 -188
- package/src/components/registerModal/index.tsx +0 -154
- package/src/components/registerModal/style.css +0 -18
- package/src/components/resetPasswordContainer/index.tsx +0 -102
- package/src/components/resetPasswordContainer/style.css +0 -36
- package/src/components/rsvpContainer/index.tsx +0 -126
- package/src/components/seatMapContainer/SeatMapComponent.tsx +0 -77
- package/src/components/seatMapContainer/TicketsSection.tsx +0 -286
- package/src/components/seatMapContainer/addToCart.ts +0 -66
- package/src/components/seatMapContainer/index.tsx +0 -443
- package/src/components/seatMapContainer/utils.ts +0 -133
- package/src/components/signupModal/index.tsx +0 -178
- package/src/components/signupModal/style.css +0 -58
- package/src/components/ticketResale/index.tsx +0 -86
- package/src/components/ticketResaleModal/index.tsx +0 -224
- package/src/components/ticketResaleModal/style.css +0 -28
- package/src/components/ticketsContainer/AccessCodeSection.tsx +0 -50
- package/src/components/ticketsContainer/InfoIcon.tsx +0 -35
- package/src/components/ticketsContainer/PromoCodeSection.tsx +0 -116
- package/src/components/ticketsContainer/ReferralLogic.tsx +0 -33
- package/src/components/ticketsContainer/TicketRow.tsx +0 -107
- package/src/components/ticketsContainer/TicketsSection.tsx +0 -350
- package/src/components/ticketsContainer/TimeSlotTicketRow.tsx +0 -243
- package/src/components/ticketsContainer/TimeSlotsSection.tsx +0 -194
- package/src/components/ticketsContainer/index.tsx +0 -986
- package/src/components/ticketsContainer/style.css +0 -178
- package/src/components/ticketsContainer/utils.ts +0 -35
- package/src/components/timerWidget/index.tsx +0 -97
- package/src/components/timerWidget/style.css +0 -35
- package/src/components/waitingList/index.tsx +0 -190
- package/src/components/waitingList/style.css +0 -27
- package/src/constants/index.ts +0 -3
- package/src/env.ts +0 -29
- package/src/hoc/CustomFields/index.tsx +0 -85
- package/src/hoc/index.ts +0 -1
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useCookieListener.ts +0 -32
- package/src/hooks/useEventListener.ts +0 -32
- package/src/hooks/useLocalStorageListener.ts +0 -32
- package/src/hooks/useOnline.ts +0 -21
- package/src/hooks/usePixel.ts +0 -88
- package/src/normalizers/index.ts +0 -49
- package/src/types/add_on.ts +0 -8
- package/src/types/api/auth.d.ts +0 -63
- package/src/types/api/axiosResponse.d.ts +0 -6
- package/src/types/api/cart.d.ts +0 -73
- package/src/types/api/checkout.d.ts +0 -92
- package/src/types/api/common.d.ts +0 -153
- package/src/types/api/guestTicketDelegation.d.ts +0 -18
- package/src/types/api/orders.d.ts +0 -116
- package/src/types/api/payment.d.ts +0 -180
- package/src/types/api/preRegistration.d.ts +0 -11
- package/src/types/api/preRegistrationComplete.d.ts +0 -95
- package/src/types/api/ticketResale.d.ts +0 -13
- package/src/types/billing-info-data.ts +0 -37
- package/src/types/checkoutPageConfigs.ts +0 -13
- package/src/types/formFields.d.ts +0 -29
- package/src/types/index.ts +0 -6
- package/src/types/order-data.ts +0 -16
- package/src/types/payment-field.ts +0 -7
- package/src/types/payment-plan-configuration.ts +0 -19
- package/src/types/pre-registration-complete.d.ts +0 -47
- package/src/types/referral-promotion.ts +0 -7
- package/src/types/seatMap.d.ts +0 -159
- package/src/types/verification.ts +0 -12
- package/src/utils/adaptStripeErrors.ts +0 -26
- package/src/utils/auth.ts +0 -45
- package/src/utils/cookies.ts +0 -73
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +0 -81
- package/src/utils/createMarkup.ts +0 -1
- package/src/utils/customFields.ts +0 -80
- package/src/utils/downloadPDF.tsx +0 -42
- package/src/utils/form.ts +0 -34
- package/src/utils/formikErrorFocus.ts +0 -24
- package/src/utils/getDomain.ts +0 -21
- package/src/utils/getImage.ts +0 -14
- package/src/utils/getQueryVariable.ts +0 -13
- package/src/utils/htmlNodeFromString.ts +0 -6
- package/src/utils/index.ts +0 -15
- package/src/utils/isBrowser.ts +0 -2
- package/src/utils/isValidNumber.ts +0 -8
- package/src/utils/jsonUtils.ts +0 -8
- package/src/utils/replaceVarInString.ts +0 -9
- package/src/utils/setConfigs.ts +0 -24
- package/src/utils/showZero.tsx +0 -10
- package/src/validators/index.ts +0 -61
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<Confirmation/>` — the order-placed receipt + a referral/share growth block
|
|
3
|
+
* (invite friends → cheaper/free tickets). Reads the settled order off the
|
|
4
|
+
* shared checkout; returns null until an order exists.
|
|
5
|
+
*
|
|
6
|
+
* Fire purchase tracking (Meta Pixel / GTM) from the `onComplete(order)` callback
|
|
7
|
+
* you already pass to `<Payment/>` / `<EmbeddedCheckout/>` — the SDK stays analytics-
|
|
8
|
+
* agnostic. The referral REWARD ladder ("how much cheaper") needs the order
|
|
9
|
+
* confirmation payload, which is left to the consumer (pass `children`); the
|
|
10
|
+
* share affordances below need no backend data.
|
|
11
|
+
*/
|
|
12
|
+
import React, { useState, type FC, type ReactNode } from 'react'
|
|
13
|
+
|
|
14
|
+
import { Button } from '../ui/Button'
|
|
15
|
+
import { Card } from '../ui/Card'
|
|
16
|
+
import { useCheckoutContext } from '../ui/CheckoutProvider'
|
|
17
|
+
import { cx } from '../ui/cx'
|
|
18
|
+
|
|
19
|
+
export interface ConfirmationProps {
|
|
20
|
+
/** URL friends land on (referral/event page). Defaults to the current page. */
|
|
21
|
+
shareUrl?: string
|
|
22
|
+
/** Message prefilled into social shares. */
|
|
23
|
+
shareMessage?: string
|
|
24
|
+
/** Link to the buyer's tickets/order — renders a "View my tickets" button. */
|
|
25
|
+
viewOrderUrl?: string
|
|
26
|
+
/** Extra content (e.g. your own referral-reward ladder from the order payload). */
|
|
27
|
+
children?: ReactNode
|
|
28
|
+
className?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Confirmation: FC<ConfirmationProps> = ({
|
|
32
|
+
shareUrl,
|
|
33
|
+
shareMessage = 'I just got my tickets — grab yours!',
|
|
34
|
+
viewOrderUrl,
|
|
35
|
+
children,
|
|
36
|
+
className,
|
|
37
|
+
}) => {
|
|
38
|
+
const checkout = useCheckoutContext()
|
|
39
|
+
const order = checkout.order
|
|
40
|
+
const [copied, setCopied] = useState(false)
|
|
41
|
+
|
|
42
|
+
if (!order) return null
|
|
43
|
+
const pending = order.pending
|
|
44
|
+
|
|
45
|
+
const url = shareUrl ?? (typeof window !== 'undefined' ? window.location.href : '')
|
|
46
|
+
const enc = encodeURIComponent
|
|
47
|
+
const shares: { label: string; href: string }[] = url
|
|
48
|
+
? [
|
|
49
|
+
{
|
|
50
|
+
label: 'Facebook',
|
|
51
|
+
href: `https://www.facebook.com/sharer/sharer.php?u=${enc(url)}`,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: 'X',
|
|
55
|
+
href: `https://twitter.com/intent/tweet?url=${enc(url)}&text=${enc(
|
|
56
|
+
shareMessage
|
|
57
|
+
)}`,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
label: 'WhatsApp',
|
|
61
|
+
href: `https://wa.me/?text=${enc(`${shareMessage} ${url}`)}`,
|
|
62
|
+
},
|
|
63
|
+
]
|
|
64
|
+
: []
|
|
65
|
+
|
|
66
|
+
const copy = () => {
|
|
67
|
+
if (!url || typeof navigator === 'undefined' || !navigator.clipboard) return
|
|
68
|
+
navigator.clipboard.writeText(url).then(
|
|
69
|
+
() => {
|
|
70
|
+
setCopied(true)
|
|
71
|
+
setTimeout(() => setCopied(false), 1500)
|
|
72
|
+
},
|
|
73
|
+
() => undefined
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<Card className={cx('tf-checkout-confirmation', className)}>
|
|
79
|
+
<span className="tf-checkout-confirmation__check">{pending ? '⏳' : '✓'}</span>
|
|
80
|
+
<strong className="tf-checkout-confirmation__title">
|
|
81
|
+
{pending ? 'Payment pending' : 'Your Tickets are Confirmed!'}
|
|
82
|
+
</strong>
|
|
83
|
+
<p className="tf-checkout-note">
|
|
84
|
+
{pending
|
|
85
|
+
? 'We’ll email your tickets as soon as the payment settles.'
|
|
86
|
+
: order.alreadyPaid
|
|
87
|
+
? 'This order was already paid — nothing was charged again.'
|
|
88
|
+
: 'Your tickets are available in the My Tickets section — please bring them with you to the event.'}
|
|
89
|
+
</p>
|
|
90
|
+
{order.orderHash && (
|
|
91
|
+
<p className="tf-checkout-confirmation__ref">Reference: {order.orderHash}</p>
|
|
92
|
+
)}
|
|
93
|
+
|
|
94
|
+
{pending && order.pendingVoucherUrl && (
|
|
95
|
+
<a
|
|
96
|
+
className="tf-checkout-button tf-checkout-button--secondary tf-checkout-button--block"
|
|
97
|
+
href={order.pendingVoucherUrl}
|
|
98
|
+
target="_blank"
|
|
99
|
+
rel="noopener noreferrer"
|
|
100
|
+
>
|
|
101
|
+
View payment voucher
|
|
102
|
+
</a>
|
|
103
|
+
)}
|
|
104
|
+
|
|
105
|
+
{viewOrderUrl && (
|
|
106
|
+
<a
|
|
107
|
+
className="tf-checkout-button tf-checkout-button--secondary tf-checkout-button--block"
|
|
108
|
+
href={viewOrderUrl}
|
|
109
|
+
>
|
|
110
|
+
View my tickets
|
|
111
|
+
</a>
|
|
112
|
+
)}
|
|
113
|
+
|
|
114
|
+
{children}
|
|
115
|
+
|
|
116
|
+
{/* Referral / share — invite friends for cheaper (or free) tickets. */}
|
|
117
|
+
{!pending && url && (
|
|
118
|
+
<div className="tf-checkout-confirmation__share">
|
|
119
|
+
<strong>Your tickets can be cheaper — or even FREE!</strong>
|
|
120
|
+
<p className="tf-checkout-note">
|
|
121
|
+
Invite friends with your link. When they buy, you get rewarded.
|
|
122
|
+
</p>
|
|
123
|
+
<div className="tf-checkout-confirmation__share-link">
|
|
124
|
+
<input className="tf-checkout-input" readOnly value={url} />
|
|
125
|
+
<Button variant="secondary" onClick={copy}>
|
|
126
|
+
{copied ? 'Copied!' : 'Copy link'}
|
|
127
|
+
</Button>
|
|
128
|
+
</div>
|
|
129
|
+
<div className="tf-checkout-confirmation__socials">
|
|
130
|
+
{shares.map((s) => (
|
|
131
|
+
<a
|
|
132
|
+
key={s.label}
|
|
133
|
+
className="tf-checkout-button tf-checkout-button--ghost"
|
|
134
|
+
href={s.href}
|
|
135
|
+
target="_blank"
|
|
136
|
+
rel="noopener noreferrer"
|
|
137
|
+
>
|
|
138
|
+
{s.label}
|
|
139
|
+
</a>
|
|
140
|
+
))}
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
</Card>
|
|
145
|
+
)
|
|
146
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `<IDVerification/>` — shown after an order that needs identity verification
|
|
3
|
+
* (`order.needIdVerification`). Kicks off the engine's verify flow: mint the
|
|
4
|
+
* provider URL, open it, and poll to completion, reflecting each phase. The
|
|
5
|
+
* order is already paid — a stall here never means a failed payment.
|
|
6
|
+
*
|
|
7
|
+
* If you place your order with `placeOrder(method, { autoRunIdVerification:true })`
|
|
8
|
+
* the engine runs this for you; this section is the manual, visible counterpart.
|
|
9
|
+
*/
|
|
10
|
+
import React, { useState, type FC } from 'react'
|
|
11
|
+
|
|
12
|
+
import { errorMessage, type IdVerificationPhase } from 'tf-checkout-shared'
|
|
13
|
+
|
|
14
|
+
import { Button } from '../ui/Button'
|
|
15
|
+
import { Card, SectionHeader } from '../ui/Card'
|
|
16
|
+
import { useCheckoutContext } from '../ui/CheckoutProvider'
|
|
17
|
+
import { cx } from '../ui/cx'
|
|
18
|
+
|
|
19
|
+
type UiPhase = IdVerificationPhase | 'starting'
|
|
20
|
+
|
|
21
|
+
const MESSAGE: Record<UiPhase, string> = {
|
|
22
|
+
idle: 'To complete the purchase, please verify your identity.',
|
|
23
|
+
starting: 'Opening the verification page…',
|
|
24
|
+
polling: 'Waiting for verification to complete in the other tab…',
|
|
25
|
+
verified: 'Identity verified — your tickets are on their way.',
|
|
26
|
+
timeout: 'Still not confirmed. Finish in the other tab, then check again.',
|
|
27
|
+
error: 'We couldn’t reach the verification service. Try again.',
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface IDVerificationProps {
|
|
31
|
+
className?: string
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const IDVerification: FC<IDVerificationProps> = ({ className }) => {
|
|
35
|
+
const checkout = useCheckoutContext()
|
|
36
|
+
const order = checkout.order
|
|
37
|
+
const [phase, setPhase] = useState<UiPhase>('idle')
|
|
38
|
+
const [error, setError] = useState('')
|
|
39
|
+
|
|
40
|
+
if (!order?.needIdVerification) return null
|
|
41
|
+
|
|
42
|
+
const done = phase === 'verified'
|
|
43
|
+
const running = phase === 'starting' || phase === 'polling'
|
|
44
|
+
|
|
45
|
+
const run = () => {
|
|
46
|
+
setError('')
|
|
47
|
+
setPhase('starting')
|
|
48
|
+
checkout
|
|
49
|
+
.runIdVerification(order.orderHash, {
|
|
50
|
+
openUrl: (url) => {
|
|
51
|
+
if (url) window.open(url, '_blank', 'noopener,noreferrer')
|
|
52
|
+
},
|
|
53
|
+
onPhase: (p) => setPhase(p),
|
|
54
|
+
})
|
|
55
|
+
.then((status) => setPhase(status?.verified ? 'verified' : 'polling'))
|
|
56
|
+
.catch((e) => {
|
|
57
|
+
setPhase('error')
|
|
58
|
+
setError(errorMessage(e))
|
|
59
|
+
})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<Card className={cx('tf-checkout-idverify', className)}>
|
|
64
|
+
<SectionHeader title="Account Verification" />
|
|
65
|
+
<p className={cx('tf-checkout-note', done && 'tf-checkout-idverify__done')}>
|
|
66
|
+
{MESSAGE[phase]}
|
|
67
|
+
</p>
|
|
68
|
+
{!done && (
|
|
69
|
+
<Button block onClick={run} loading={running} disabled={running}>
|
|
70
|
+
{phase === 'idle' ? 'Verify' : running ? 'Verifying…' : 'Check again'}
|
|
71
|
+
</Button>
|
|
72
|
+
)}
|
|
73
|
+
{error && <p className="tf-checkout-error-text">{error}</p>}
|
|
74
|
+
</Card>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import React, { useEffect, useRef, useState, type FC, type ReactNode } from 'react'
|
|
2
|
+
|
|
3
|
+
import { errorMessage, ttf } from 'tf-checkout-shared'
|
|
4
|
+
|
|
5
|
+
import { cx } from '../ui/cx'
|
|
6
|
+
import { Loader } from '../ui/Loader'
|
|
7
|
+
|
|
8
|
+
type ConfirmationData = Record<string, any>
|
|
9
|
+
type ReferralPrice = {
|
|
10
|
+
label: string
|
|
11
|
+
subLabel?: string
|
|
12
|
+
price: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const attributesOf = (response: Record<string, unknown>): ConfirmationData => {
|
|
16
|
+
const data = response?.data as Record<string, unknown> | undefined
|
|
17
|
+
const attributes = data?.attributes
|
|
18
|
+
if (attributes && typeof attributes === 'object') return attributes as ConfirmationData
|
|
19
|
+
if (data && typeof data === 'object') return data as ConfirmationData
|
|
20
|
+
return response
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface OrderConfirmationProps {
|
|
24
|
+
orderHash: string
|
|
25
|
+
title?: ReactNode
|
|
26
|
+
message?: ReactNode
|
|
27
|
+
helper?: ReactNode
|
|
28
|
+
eventTitle?: ReactNode
|
|
29
|
+
eventDate?: ReactNode
|
|
30
|
+
eventLocation?: ReactNode
|
|
31
|
+
viewOrderUrl?: string | ((data: ConfirmationData) => string)
|
|
32
|
+
showReferral?: boolean
|
|
33
|
+
showShareButtons?: boolean
|
|
34
|
+
onLoaded?: (data: ConfirmationData) => void
|
|
35
|
+
onError?: (error: unknown) => void
|
|
36
|
+
className?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Reloadable post-purchase confirmation. Its markup intentionally preserves
|
|
41
|
+
* the proven legacy checkout class contract so existing white-label themes do
|
|
42
|
+
* not lose their confirmation-page UX when they adopt Checkout Kit.
|
|
43
|
+
*/
|
|
44
|
+
export const OrderConfirmation: FC<OrderConfirmationProps> = ({
|
|
45
|
+
orderHash,
|
|
46
|
+
title = 'Your order has been confirmed!',
|
|
47
|
+
message,
|
|
48
|
+
helper,
|
|
49
|
+
eventTitle,
|
|
50
|
+
eventDate,
|
|
51
|
+
eventLocation,
|
|
52
|
+
viewOrderUrl,
|
|
53
|
+
showReferral = true,
|
|
54
|
+
showShareButtons = true,
|
|
55
|
+
onLoaded,
|
|
56
|
+
onError,
|
|
57
|
+
className,
|
|
58
|
+
}) => {
|
|
59
|
+
const [data, setData] = useState<ConfirmationData | null>(null)
|
|
60
|
+
const [failure, setFailure] = useState('')
|
|
61
|
+
const [copied, setCopied] = useState(false)
|
|
62
|
+
const loadedRef = useRef(onLoaded)
|
|
63
|
+
const errorRef = useRef(onError)
|
|
64
|
+
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
loadedRef.current = onLoaded
|
|
67
|
+
errorRef.current = onError
|
|
68
|
+
}, [onError, onLoaded])
|
|
69
|
+
|
|
70
|
+
useEffect(() => {
|
|
71
|
+
if (!orderHash) {
|
|
72
|
+
setFailure('The order reference is missing.')
|
|
73
|
+
return
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let active = true
|
|
77
|
+
ttf.confirmation.get(orderHash).then(
|
|
78
|
+
(response) => {
|
|
79
|
+
if (!active) return
|
|
80
|
+
const attributes = attributesOf(response)
|
|
81
|
+
if (!attributes.order_hash) attributes.order_hash = orderHash
|
|
82
|
+
setData(attributes)
|
|
83
|
+
loadedRef.current?.(attributes)
|
|
84
|
+
},
|
|
85
|
+
(error) => {
|
|
86
|
+
if (!active) return
|
|
87
|
+
setFailure(errorMessage(error))
|
|
88
|
+
errorRef.current?.(error)
|
|
89
|
+
}
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return () => {
|
|
93
|
+
active = false
|
|
94
|
+
}
|
|
95
|
+
}, [orderHash])
|
|
96
|
+
|
|
97
|
+
if (failure) {
|
|
98
|
+
return (
|
|
99
|
+
<div className={cx('confirmation-page tf-checkout-confirmation-page', className)}>
|
|
100
|
+
<div className="tf-checkout-auth__alert" role="alert">
|
|
101
|
+
{failure}
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!data) {
|
|
108
|
+
return (
|
|
109
|
+
<div className="tf-checkout-confirmation-page__loading">
|
|
110
|
+
<Loader className="tf-checkout-loader--page" />
|
|
111
|
+
</div>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const customText = String(data.custom_confirmation_page_text ?? '')
|
|
116
|
+
const customReplacement = Boolean(data.custom_confirmation_page_text_full_replacement)
|
|
117
|
+
const attachTickets = Boolean(data.attach_tickets)
|
|
118
|
+
const shareUrl = String(data.personal_share_link ?? '')
|
|
119
|
+
const orderUrl = typeof viewOrderUrl === 'function' ? viewOrderUrl(data) : viewOrderUrl
|
|
120
|
+
const sales = Array.isArray(data.personal_share_sales) ? data.personal_share_sales : []
|
|
121
|
+
const symbol = String(data.currency?.symbol ?? '')
|
|
122
|
+
const currentPrice = Number(data.product_price)
|
|
123
|
+
const pricing: ReferralPrice[] = [
|
|
124
|
+
...(Number.isFinite(currentPrice)
|
|
125
|
+
? [
|
|
126
|
+
{
|
|
127
|
+
label: 'Your ticket is currently',
|
|
128
|
+
price: `${symbol}${currentPrice.toFixed(2)}`,
|
|
129
|
+
},
|
|
130
|
+
]
|
|
131
|
+
: []),
|
|
132
|
+
...sales.map((sale: ConfirmationData) => ({
|
|
133
|
+
label: `If your friends buy ${sale.sales} tickets`,
|
|
134
|
+
subLabel:
|
|
135
|
+
Number(sale.price) === 0 ? 'Your ticket becomes' : 'Your ticket goes down to',
|
|
136
|
+
price:
|
|
137
|
+
Number(sale.price) === 0 ? 'FREE!' : `${symbol}${Number(sale.price).toFixed(2)}`,
|
|
138
|
+
})),
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
const copy = () => {
|
|
142
|
+
if (!shareUrl || typeof navigator === 'undefined' || !navigator.clipboard) return
|
|
143
|
+
void navigator.clipboard.writeText(shareUrl).then(() => {
|
|
144
|
+
setCopied(true)
|
|
145
|
+
window.setTimeout(() => setCopied(false), 1500)
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return (
|
|
150
|
+
<div className={cx('confirmation-page tf-checkout-confirmation-page', className)}>
|
|
151
|
+
<div className="header-container">
|
|
152
|
+
<div className="header-product-text">
|
|
153
|
+
<p className="title">{title}</p>
|
|
154
|
+
{(eventTitle || eventDate || eventLocation) && (
|
|
155
|
+
<div className="event-details">
|
|
156
|
+
{eventTitle && <div className="event-title">{eventTitle}</div>}
|
|
157
|
+
{eventDate && <div className="event-date">{eventDate}</div>}
|
|
158
|
+
{eventLocation && <div className="event-location">{eventLocation}</div>}
|
|
159
|
+
</div>
|
|
160
|
+
)}
|
|
161
|
+
<div className="share-message-section">
|
|
162
|
+
{customReplacement ? (
|
|
163
|
+
<div dangerouslySetInnerHTML={{ __html: customText }} />
|
|
164
|
+
) : (
|
|
165
|
+
<>
|
|
166
|
+
<span className="main">
|
|
167
|
+
{attachTickets
|
|
168
|
+
? 'Your tickets have been emailed to you'
|
|
169
|
+
: (message ?? 'Your tickets are available in My Tickets.')}
|
|
170
|
+
</span>
|
|
171
|
+
<span className="helper">
|
|
172
|
+
{attachTickets ? 'Please bring them with you to the event' : helper}
|
|
173
|
+
</span>
|
|
174
|
+
</>
|
|
175
|
+
)}
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
{customText && !customReplacement && (
|
|
181
|
+
<div
|
|
182
|
+
className="custom-confirmation-page-text tf-checkout-confirmation-page__custom"
|
|
183
|
+
dangerouslySetInnerHTML={{ __html: customText }}
|
|
184
|
+
/>
|
|
185
|
+
)}
|
|
186
|
+
|
|
187
|
+
{orderUrl && (
|
|
188
|
+
<div className="order-details-button-container">
|
|
189
|
+
<a className="view-order-button" href={orderUrl}>
|
|
190
|
+
View Order
|
|
191
|
+
</a>
|
|
192
|
+
</div>
|
|
193
|
+
)}
|
|
194
|
+
|
|
195
|
+
{showReferral && data.disable_referral === false && shareUrl && (
|
|
196
|
+
<>
|
|
197
|
+
<div className="referral_text_image_section">
|
|
198
|
+
<div className="referral_text_section">
|
|
199
|
+
<div className="referral_title_text">
|
|
200
|
+
Your ticket can become
|
|
201
|
+
<span className="strong-text"> cheaper </span>
|
|
202
|
+
or even
|
|
203
|
+
<span className="strong-text"> FREE!</span>
|
|
204
|
+
</div>
|
|
205
|
+
<div className="referral_text">
|
|
206
|
+
<span className="strong-text">Invite friends </span>
|
|
207
|
+
and we'll refund up to
|
|
208
|
+
<span className="strong-text"> 100% </span>
|
|
209
|
+
of your ticket money, if they buy tickets as well!
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
<div className="share_wrapper">
|
|
214
|
+
<div className="share_section">
|
|
215
|
+
<div className="invitation_section">
|
|
216
|
+
<div className="invitation_title">How do you invite your friends?</div>
|
|
217
|
+
<div className="share_buttons">
|
|
218
|
+
<div className="share-by-link">
|
|
219
|
+
<h5 className="share-by-link label">Send them this link:</h5>
|
|
220
|
+
<div className="share-btn-inner">
|
|
221
|
+
<input className="share-input" readOnly value={shareUrl} />
|
|
222
|
+
<button
|
|
223
|
+
className="share-by-link-copy-icon"
|
|
224
|
+
type="button"
|
|
225
|
+
onClick={copy}
|
|
226
|
+
>
|
|
227
|
+
<span className="copy-icon">{copied ? 'Copied!' : 'Copy'}</span>
|
|
228
|
+
</button>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
{showShareButtons && (
|
|
232
|
+
<div className="social-media-btns">
|
|
233
|
+
<a
|
|
234
|
+
className="social-media-sharing"
|
|
235
|
+
href={`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(
|
|
236
|
+
shareUrl
|
|
237
|
+
)}`}
|
|
238
|
+
target="_blank"
|
|
239
|
+
rel="noopener noreferrer"
|
|
240
|
+
>
|
|
241
|
+
Facebook
|
|
242
|
+
</a>
|
|
243
|
+
<a
|
|
244
|
+
className="social-media-sharing"
|
|
245
|
+
href={`https://wa.me/?text=${encodeURIComponent(shareUrl)}`}
|
|
246
|
+
target="_blank"
|
|
247
|
+
rel="noopener noreferrer"
|
|
248
|
+
>
|
|
249
|
+
WhatsApp
|
|
250
|
+
</a>
|
|
251
|
+
</div>
|
|
252
|
+
)}
|
|
253
|
+
</div>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
{pricing.length > 0 && (
|
|
257
|
+
<div className="pricing-section">
|
|
258
|
+
<div className="invitation_title">How much cheaper?</div>
|
|
259
|
+
{pricing.map((item, index) => (
|
|
260
|
+
<div className="pricing-section_wrapper" key={`${item.label}-${index}`}>
|
|
261
|
+
<div className="pricing-section_label">
|
|
262
|
+
{item.label}
|
|
263
|
+
{item.subLabel && (
|
|
264
|
+
<div className="pricing-section_sublabel">{item.subLabel}</div>
|
|
265
|
+
)}
|
|
266
|
+
</div>
|
|
267
|
+
<div className="pricing-section_price">{item.price}</div>
|
|
268
|
+
</div>
|
|
269
|
+
))}
|
|
270
|
+
</div>
|
|
271
|
+
)}
|
|
272
|
+
</div>
|
|
273
|
+
</>
|
|
274
|
+
)}
|
|
275
|
+
</div>
|
|
276
|
+
)
|
|
277
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import React, { useEffect, useState, type FC } from 'react'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
errorMessage,
|
|
5
|
+
runIdVerificationWith,
|
|
6
|
+
ttf,
|
|
7
|
+
type IdVerificationPhase,
|
|
8
|
+
} from 'tf-checkout-shared'
|
|
9
|
+
|
|
10
|
+
import { Button } from '../ui/Button'
|
|
11
|
+
import { Card, SectionHeader } from '../ui/Card'
|
|
12
|
+
import { cx } from '../ui/cx'
|
|
13
|
+
|
|
14
|
+
type UiPhase = IdVerificationPhase | 'checking' | 'starting'
|
|
15
|
+
|
|
16
|
+
const PHASE_MESSAGE: Record<UiPhase, string> = {
|
|
17
|
+
checking: 'Checking your verification status…',
|
|
18
|
+
idle: 'To complete the purchase, please verify your identity.',
|
|
19
|
+
starting: 'Opening the verification page…',
|
|
20
|
+
polling: 'Waiting for verification to complete in the other tab…',
|
|
21
|
+
verified: 'Identity verified — your tickets are on their way.',
|
|
22
|
+
timeout: 'Verification is taking longer than usual. Your payment is safe.',
|
|
23
|
+
error: 'We couldn’t reach the verification service. Try again.',
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface OrderIDVerificationProps {
|
|
27
|
+
orderHash: string
|
|
28
|
+
onVerified?: () => void
|
|
29
|
+
className?: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Routed ID-verification UI that survives a full page navigation. */
|
|
33
|
+
export const OrderIDVerification: FC<OrderIDVerificationProps> = ({
|
|
34
|
+
orderHash,
|
|
35
|
+
onVerified,
|
|
36
|
+
className,
|
|
37
|
+
}) => {
|
|
38
|
+
const [phase, setPhase] = useState<UiPhase>('checking')
|
|
39
|
+
const [failure, setFailure] = useState('')
|
|
40
|
+
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
if (!orderHash) {
|
|
43
|
+
setPhase('error')
|
|
44
|
+
setFailure('The order reference is missing.')
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
|
+
let active = true
|
|
48
|
+
ttf.order.idVerificationStatus(orderHash).then(
|
|
49
|
+
(status) => {
|
|
50
|
+
if (!active) return
|
|
51
|
+
if (status.verified || status.required === false) {
|
|
52
|
+
setPhase('verified')
|
|
53
|
+
onVerified?.()
|
|
54
|
+
} else {
|
|
55
|
+
setPhase('idle')
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
(error) => {
|
|
59
|
+
if (!active) return
|
|
60
|
+
setPhase('error')
|
|
61
|
+
setFailure(errorMessage(error))
|
|
62
|
+
}
|
|
63
|
+
)
|
|
64
|
+
return () => {
|
|
65
|
+
active = false
|
|
66
|
+
}
|
|
67
|
+
}, [onVerified, orderHash])
|
|
68
|
+
|
|
69
|
+
const running = phase === 'checking' || phase === 'starting' || phase === 'polling'
|
|
70
|
+
const run = () => {
|
|
71
|
+
setFailure('')
|
|
72
|
+
setPhase('starting')
|
|
73
|
+
runIdVerificationWith(orderHash, {
|
|
74
|
+
openUrl: (url) => {
|
|
75
|
+
window.open(url, '_blank', 'noopener,noreferrer')
|
|
76
|
+
},
|
|
77
|
+
onPhase: (next) => setPhase(next),
|
|
78
|
+
registerForegroundListener: (recheck) => {
|
|
79
|
+
const listener = () => {
|
|
80
|
+
if (document.visibilityState === 'visible') recheck()
|
|
81
|
+
}
|
|
82
|
+
document.addEventListener('visibilitychange', listener)
|
|
83
|
+
return () => document.removeEventListener('visibilitychange', listener)
|
|
84
|
+
},
|
|
85
|
+
}).then(
|
|
86
|
+
(status) => {
|
|
87
|
+
if (status?.verified || status?.required === false) {
|
|
88
|
+
setPhase('verified')
|
|
89
|
+
onVerified?.()
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
(error) => {
|
|
93
|
+
setPhase('error')
|
|
94
|
+
setFailure(errorMessage(error))
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<Card className={cx('tf-checkout-idverify', className)}>
|
|
101
|
+
<SectionHeader title="Account Verification" />
|
|
102
|
+
<p
|
|
103
|
+
className={cx(
|
|
104
|
+
'tf-checkout-note',
|
|
105
|
+
phase === 'verified' && 'tf-checkout-idverify__done'
|
|
106
|
+
)}
|
|
107
|
+
>
|
|
108
|
+
{failure || PHASE_MESSAGE[phase]}
|
|
109
|
+
</p>
|
|
110
|
+
{phase !== 'verified' && orderHash && (
|
|
111
|
+
<Button block onClick={run} loading={running} disabled={running || !orderHash}>
|
|
112
|
+
{phase === 'idle' ? 'Verify' : running ? 'Verifying…' : 'Try again'}
|
|
113
|
+
</Button>
|
|
114
|
+
)}
|
|
115
|
+
</Card>
|
|
116
|
+
)
|
|
117
|
+
}
|