tf-checkout-react 1.7.30 → 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
|
@@ -1,643 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
/* eslint-disable max-len */
|
|
3
|
-
import './style.css'
|
|
4
|
-
|
|
5
|
-
import { ThemeOptions } from '@mui/material'
|
|
6
|
-
import Alert from '@mui/material/Alert'
|
|
7
|
-
import CircularProgress from '@mui/material/CircularProgress'
|
|
8
|
-
import Container from '@mui/material/Container'
|
|
9
|
-
import { createTheme, ThemeProvider } from '@mui/material/styles'
|
|
10
|
-
import { CSSProperties } from '@mui/styles'
|
|
11
|
-
import { Elements, PaymentElement, useElements, useStripe } from '@stripe/react-stripe-js'
|
|
12
|
-
import {
|
|
13
|
-
loadStripe,
|
|
14
|
-
StripeConstructorOptions,
|
|
15
|
-
StripeElementsOptions,
|
|
16
|
-
} from '@stripe/stripe-js'
|
|
17
|
-
import { StripePaymentElementOptions } from '@stripe/stripe-js'
|
|
18
|
-
import { AxiosError } from 'axios'
|
|
19
|
-
import _get from 'lodash/get'
|
|
20
|
-
import _identity from 'lodash/identity'
|
|
21
|
-
import _isEmpty from 'lodash/isEmpty'
|
|
22
|
-
import _map from 'lodash/map'
|
|
23
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
|
24
|
-
|
|
25
|
-
import { getPaymentData } from '../../api'
|
|
26
|
-
import { FEES_STYLES } from '../../constants'
|
|
27
|
-
import { usePixel } from '../../hooks/usePixel'
|
|
28
|
-
import { createFixedFloatNormalizer, currencyNormalizerCreator } from '../../normalizers'
|
|
29
|
-
import { IAddOn, IOrderData, IPaymentField } from '../../types'
|
|
30
|
-
import {
|
|
31
|
-
IPaymentPlanConfig,
|
|
32
|
-
IPaymentPlanConfigCard,
|
|
33
|
-
} from '../../types/payment-plan-configuration'
|
|
34
|
-
import { CONFIGS, isBrowser } from '../../utils'
|
|
35
|
-
import { getQueryVariable } from '../../utils/getQueryVariable'
|
|
36
|
-
import { Checkbox, Loader } from '../common/index'
|
|
37
|
-
import TimerWidget from '../timerWidget'
|
|
38
|
-
import { handlePaymentMiddleWare } from './handlePayment'
|
|
39
|
-
import { PaymentPlanSection } from './PaymentPlanSection'
|
|
40
|
-
|
|
41
|
-
// Wrapper component to access Stripe hooks inside Elements context
|
|
42
|
-
const StripeWrapper = ({
|
|
43
|
-
options,
|
|
44
|
-
onStripeReady,
|
|
45
|
-
onPaymentElementChange,
|
|
46
|
-
}: {
|
|
47
|
-
options?: StripePaymentElementOptions;
|
|
48
|
-
onStripeReady: (stripe: any, elements: any) => void;
|
|
49
|
-
onPaymentElementChange?: (event: any) => void;
|
|
50
|
-
}) => {
|
|
51
|
-
const stripe = useStripe()
|
|
52
|
-
const elements = useElements()
|
|
53
|
-
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (stripe && elements) {
|
|
56
|
-
onStripeReady(stripe, elements)
|
|
57
|
-
}
|
|
58
|
-
}, [stripe, elements, onStripeReady])
|
|
59
|
-
|
|
60
|
-
return <PaymentElement options={options} onChange={onPaymentElementChange} />
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export interface IPaymentPage {
|
|
64
|
-
paymentFields: IPaymentField[];
|
|
65
|
-
handlePayment: any;
|
|
66
|
-
checkoutData: any;
|
|
67
|
-
formTitle?: string;
|
|
68
|
-
errorText?: string;
|
|
69
|
-
onErrorClose?: () => void;
|
|
70
|
-
onGetPaymentDataSuccess: (value: any) => void;
|
|
71
|
-
onGetPaymentDataError: (value: AxiosError) => void;
|
|
72
|
-
onPaymentError: (value: AxiosError, slug?: string) => void;
|
|
73
|
-
themeOptions?: ThemeOptions & {
|
|
74
|
-
input?: CSSProperties;
|
|
75
|
-
checkbox?: CSSProperties;
|
|
76
|
-
};
|
|
77
|
-
elementsOptions?: StripeElementsOptions;
|
|
78
|
-
paymentElementOptions?: StripePaymentElementOptions;
|
|
79
|
-
onCountdownFinish?: () => void;
|
|
80
|
-
enableTimer?: boolean;
|
|
81
|
-
paymentInfoLabel?: string;
|
|
82
|
-
orderInfoLabel?: string;
|
|
83
|
-
displayPaymentButton?: boolean;
|
|
84
|
-
hidePaymentForm?: boolean;
|
|
85
|
-
hideFieldsBlock?: boolean;
|
|
86
|
-
isSinglePageCheckout?: boolean;
|
|
87
|
-
stripePublishableKey?: string;
|
|
88
|
-
stripeAccountId?: string;
|
|
89
|
-
onStripeReady?: (stripe: any, elements: any) => void;
|
|
90
|
-
onPaymentElementChange?: (event: any) => void;
|
|
91
|
-
enablePaymentPlan?: boolean;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const initialPaymentPlanConfiguration: IPaymentPlanConfig = {
|
|
95
|
-
requires_deposit: false,
|
|
96
|
-
deposit: 0,
|
|
97
|
-
interval: 0,
|
|
98
|
-
non_refundable_amount: 0,
|
|
99
|
-
non_refundable_type: null,
|
|
100
|
-
has_admin_fee: false,
|
|
101
|
-
admin_fee: 0,
|
|
102
|
-
total_installments: 0,
|
|
103
|
-
price_per_installment: 0,
|
|
104
|
-
stripe_setup_intent_secret: '',
|
|
105
|
-
total: 0,
|
|
106
|
-
saved_card: {
|
|
107
|
-
last_4_digits: null,
|
|
108
|
-
stripe_payment_method_id: null,
|
|
109
|
-
} as IPaymentPlanConfigCard,
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const initialOrderValues: IOrderData = {
|
|
113
|
-
id: '',
|
|
114
|
-
product_name: '',
|
|
115
|
-
ticketType: '',
|
|
116
|
-
quantity: '',
|
|
117
|
-
price: '',
|
|
118
|
-
total: '',
|
|
119
|
-
currency: 'USD',
|
|
120
|
-
guest_count: '',
|
|
121
|
-
pay_now: '',
|
|
122
|
-
add_ons: [] as IAddOn[],
|
|
123
|
-
cost: '',
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
const initialReviewValues = {
|
|
127
|
-
order_details: {
|
|
128
|
-
id: '',
|
|
129
|
-
order_hash: '',
|
|
130
|
-
},
|
|
131
|
-
payment_method: {
|
|
132
|
-
stripe_client_secret: '',
|
|
133
|
-
stripe_payment_plan_enabled: false,
|
|
134
|
-
stripe_payment_plan_configuration: {} as any,
|
|
135
|
-
stripe_publishable_key: '',
|
|
136
|
-
id: '',
|
|
137
|
-
name: '',
|
|
138
|
-
stripeConnectedAccount: '',
|
|
139
|
-
},
|
|
140
|
-
billing_info: {},
|
|
141
|
-
event_details: {
|
|
142
|
-
flagSeatMapAllowed: false,
|
|
143
|
-
slug: '',
|
|
144
|
-
},
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export const PaymentContainer = ({
|
|
148
|
-
paymentFields = [],
|
|
149
|
-
handlePayment,
|
|
150
|
-
formTitle = 'Get Your Tickets',
|
|
151
|
-
errorText,
|
|
152
|
-
checkoutData,
|
|
153
|
-
onErrorClose = _identity,
|
|
154
|
-
onGetPaymentDataSuccess = _identity,
|
|
155
|
-
onGetPaymentDataError = _identity,
|
|
156
|
-
onPaymentError = _identity,
|
|
157
|
-
themeOptions,
|
|
158
|
-
elementsOptions,
|
|
159
|
-
paymentElementOptions,
|
|
160
|
-
onCountdownFinish = _identity,
|
|
161
|
-
enableTimer = false,
|
|
162
|
-
orderInfoLabel = 'Order Review',
|
|
163
|
-
paymentInfoLabel = 'Order Confirmation',
|
|
164
|
-
displayPaymentButton = true,
|
|
165
|
-
hidePaymentForm = false,
|
|
166
|
-
hideFieldsBlock = false,
|
|
167
|
-
isSinglePageCheckout = false,
|
|
168
|
-
stripePublishableKey,
|
|
169
|
-
stripeAccountId,
|
|
170
|
-
onStripeReady = _identity,
|
|
171
|
-
onPaymentElementChange,
|
|
172
|
-
enablePaymentPlan = true,
|
|
173
|
-
}: IPaymentPage) => {
|
|
174
|
-
const [reviewData, setReviewData] = useState(initialReviewValues)
|
|
175
|
-
const [orderData, setOrderData] = useState(initialOrderValues)
|
|
176
|
-
const [error, setError] = useState(null)
|
|
177
|
-
const [paymentIsLoading, setPaymentIsLoading] = useState(false)
|
|
178
|
-
const [paymentDataIsLoading, setPaymentDataIsLoading] = useState(true)
|
|
179
|
-
const [currency, setCurrency] = useState('')
|
|
180
|
-
const [showPaymentPlanSection, setShowPaymentPlanSection] = useState(false)
|
|
181
|
-
|
|
182
|
-
const [paymentPlanIsAvailable, setPaymentPlanIsAvailable] = useState(false)
|
|
183
|
-
const [paymentPlanConfig, setPaymentPlanConfig] = useState(
|
|
184
|
-
initialPaymentPlanConfiguration
|
|
185
|
-
)
|
|
186
|
-
const [paymentPlanUseSavedCard, setPaymentPlanUseSavedCard] = useState(true)
|
|
187
|
-
|
|
188
|
-
const showFormTitle = Boolean(formTitle)
|
|
189
|
-
const showErrorText = Boolean(errorText)
|
|
190
|
-
|
|
191
|
-
const eventId =
|
|
192
|
-
getQueryVariable('event_id') || _get(reviewData, 'cart[0].product_id') || ''
|
|
193
|
-
const { hash, total } = checkoutData
|
|
194
|
-
const isFreeTickets = useMemo(
|
|
195
|
-
() => (!Number(total) && !Number(orderData.total)) || !Number(orderData.pay_now),
|
|
196
|
-
[total, orderData]
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
const pageUrl = isBrowser ? window.location.href.split('?')[0] : ''
|
|
200
|
-
usePixel(eventId, { page: 'review', pageUrl })
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
useEffect(() => {
|
|
204
|
-
const fetchPaymentData = async () => {
|
|
205
|
-
try {
|
|
206
|
-
const paymentDataResponse = await getPaymentData(hash)
|
|
207
|
-
if (paymentDataResponse.success) {
|
|
208
|
-
const attributes = paymentDataResponse?.data?.attributes
|
|
209
|
-
setReviewData(attributes)
|
|
210
|
-
const { cart, order_details } = attributes
|
|
211
|
-
const {
|
|
212
|
-
tickets: [ticket],
|
|
213
|
-
} = order_details
|
|
214
|
-
|
|
215
|
-
const orderDataArray = _map(order_details.tickets, item => ({
|
|
216
|
-
product_name: cart[0]?.product_name,
|
|
217
|
-
ticketType: item?.name,
|
|
218
|
-
quantity: item?.guest_count,
|
|
219
|
-
price: item?.price,
|
|
220
|
-
cost: item?.cost,
|
|
221
|
-
id: item.id,
|
|
222
|
-
count: item?.quantity,
|
|
223
|
-
}))
|
|
224
|
-
|
|
225
|
-
const orderData = {
|
|
226
|
-
id: order_details?.id,
|
|
227
|
-
product_name: cart[0]?.product_name,
|
|
228
|
-
ticketType: ticket?.name,
|
|
229
|
-
quantity: ticket?.quantity,
|
|
230
|
-
price: ticket?.price,
|
|
231
|
-
total: order_details?.total,
|
|
232
|
-
currency: order_details?.currency,
|
|
233
|
-
add_ons: order_details?.add_ons || [],
|
|
234
|
-
pay_now: order_details?.pay_now || '',
|
|
235
|
-
guest_count: order_details?.guest_count || '',
|
|
236
|
-
debt: order_details?.debt || null,
|
|
237
|
-
tableTypes: orderDataArray,
|
|
238
|
-
cost: ticket?.cost,
|
|
239
|
-
subtotal: order_details?.subtotal,
|
|
240
|
-
fees: order_details?.fees,
|
|
241
|
-
}
|
|
242
|
-
setOrderData(orderData)
|
|
243
|
-
setCurrency(order_details?.currency)
|
|
244
|
-
onGetPaymentDataSuccess(paymentDataResponse.data)
|
|
245
|
-
}
|
|
246
|
-
} catch (e) {
|
|
247
|
-
setError(_get(e, 'response.data.message', null))
|
|
248
|
-
onGetPaymentDataError((e as Record<string, unknown>).response as AxiosError)
|
|
249
|
-
} finally {
|
|
250
|
-
setPaymentDataIsLoading(false)
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
if (isSinglePageCheckout) {
|
|
255
|
-
if (!orderData?.total) {
|
|
256
|
-
setOrderData(current => ({ ...current, pay_now: 1, total: 1 }))
|
|
257
|
-
setPaymentDataIsLoading(false)
|
|
258
|
-
}
|
|
259
|
-
} else {
|
|
260
|
-
fetchPaymentData()
|
|
261
|
-
}
|
|
262
|
-
}, [
|
|
263
|
-
orderData,
|
|
264
|
-
hash,
|
|
265
|
-
isSinglePageCheckout,
|
|
266
|
-
onGetPaymentDataError,
|
|
267
|
-
onGetPaymentDataSuccess,
|
|
268
|
-
])
|
|
269
|
-
|
|
270
|
-
const showPaymentForm = () => {
|
|
271
|
-
if (hidePaymentForm) {
|
|
272
|
-
return false
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
let showPaymentForm = !isFreeTickets
|
|
276
|
-
|
|
277
|
-
if (
|
|
278
|
-
paymentPlanIsAvailable &&
|
|
279
|
-
showPaymentPlanSection &&
|
|
280
|
-
!!paymentPlanConfig.saved_card?.stripe_payment_method_id
|
|
281
|
-
) {
|
|
282
|
-
showPaymentForm = !paymentPlanUseSavedCard
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
return showPaymentForm
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const getPublishableKey = () =>
|
|
289
|
-
stripePublishableKey || _get(reviewData, 'payment_method.stripe_publishable_key')
|
|
290
|
-
|
|
291
|
-
const getStripePromise = useCallback(() => {
|
|
292
|
-
const stripePublishableKey = getPublishableKey()
|
|
293
|
-
const stripeAccount =
|
|
294
|
-
stripeAccountId || _get(reviewData, 'payment_method.stripe_connected_account')
|
|
295
|
-
|
|
296
|
-
const options: StripeConstructorOptions = {}
|
|
297
|
-
|
|
298
|
-
if (stripeAccount) {
|
|
299
|
-
options.stripeAccount = stripeAccount
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
return loadStripe(stripePublishableKey, options)
|
|
303
|
-
}, [reviewData, stripePublishableKey])
|
|
304
|
-
|
|
305
|
-
const themeMui = createTheme(themeOptions)
|
|
306
|
-
const hasTableTypes = Boolean(Number(orderData.guest_count))
|
|
307
|
-
const paymentFieldsData = hasTableTypes
|
|
308
|
-
? [
|
|
309
|
-
{
|
|
310
|
-
label: 'Event',
|
|
311
|
-
id: 'product_name',
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
label: '',
|
|
315
|
-
id: 'tableTypes',
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
label: 'Add-ons',
|
|
319
|
-
id: 'add_ons',
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
label: 'Total (incl. fees, card processing and taxes)',
|
|
323
|
-
id: 'total',
|
|
324
|
-
normalizer: (value: string, currency: string) =>
|
|
325
|
-
currencyNormalizerCreator(
|
|
326
|
-
createFixedFloatNormalizer(2)(parseFloat(value)),
|
|
327
|
-
currency
|
|
328
|
-
),
|
|
329
|
-
},
|
|
330
|
-
{
|
|
331
|
-
label: 'Pay Now',
|
|
332
|
-
id: 'pay_now',
|
|
333
|
-
normalizer: (value: string, currency: string) =>
|
|
334
|
-
currencyNormalizerCreator(
|
|
335
|
-
createFixedFloatNormalizer(2)(parseFloat(value)),
|
|
336
|
-
currency
|
|
337
|
-
),
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
label: 'Pay On Check-in',
|
|
341
|
-
id: 'debt',
|
|
342
|
-
normalizer: (value: string, currency: string) =>
|
|
343
|
-
currencyNormalizerCreator(
|
|
344
|
-
createFixedFloatNormalizer(2)(parseFloat(value)),
|
|
345
|
-
currency
|
|
346
|
-
),
|
|
347
|
-
},
|
|
348
|
-
]
|
|
349
|
-
: paymentFields
|
|
350
|
-
const isTable = orderData?.guest_count
|
|
351
|
-
|
|
352
|
-
useEffect(() => {
|
|
353
|
-
const paymentMethod = reviewData.payment_method || {}
|
|
354
|
-
const paymentPlanAvailable =
|
|
355
|
-
paymentMethod.stripe_payment_plan_enabled && enablePaymentPlan
|
|
356
|
-
setPaymentPlanIsAvailable(paymentPlanAvailable)
|
|
357
|
-
|
|
358
|
-
if (paymentPlanAvailable) {
|
|
359
|
-
const paymentPlanConfig =
|
|
360
|
-
paymentMethod.stripe_payment_plan_configuration || initialPaymentPlanConfiguration
|
|
361
|
-
setPaymentPlanConfig(paymentPlanConfig)
|
|
362
|
-
setPaymentPlanUseSavedCard(!!paymentPlanConfig.saved_card?.stripe_payment_method_id)
|
|
363
|
-
if (isBrowser) {
|
|
364
|
-
const sessionData = window.localStorage.getItem('paymentConfiguration')
|
|
365
|
-
const session = sessionData ? JSON.parse(sessionData) : {}
|
|
366
|
-
if (!!session && session?.orderId == reviewData.order_details?.id) {
|
|
367
|
-
setPaymentPlanUseSavedCard(session.paymentPlanUseSavedCard ?? false)
|
|
368
|
-
setShowPaymentPlanSection(session.showPaymentPlanSection ?? false)
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
}, [enablePaymentPlan, reviewData])
|
|
373
|
-
|
|
374
|
-
useEffect(() => {
|
|
375
|
-
if (isBrowser && !!orderData?.id) {
|
|
376
|
-
window.localStorage.setItem(
|
|
377
|
-
'paymentConfiguration',
|
|
378
|
-
JSON.stringify({
|
|
379
|
-
paymentPlanUseSavedCard,
|
|
380
|
-
showPaymentPlanSection,
|
|
381
|
-
orderId: orderData?.id,
|
|
382
|
-
})
|
|
383
|
-
)
|
|
384
|
-
}
|
|
385
|
-
}, [showPaymentPlanSection, paymentPlanUseSavedCard, orderData?.id])
|
|
386
|
-
|
|
387
|
-
return (
|
|
388
|
-
<ThemeProvider theme={themeMui}>
|
|
389
|
-
<div
|
|
390
|
-
className={`payment_page ${isSinglePageCheckout ? 'payment_page_single' : ''}`}
|
|
391
|
-
>
|
|
392
|
-
{enableTimer && (
|
|
393
|
-
<TimerWidget
|
|
394
|
-
expires_at={_get(reviewData, 'expires_at', 0)}
|
|
395
|
-
buyLoading={paymentIsLoading}
|
|
396
|
-
onCountdownFinish={onCountdownFinish}
|
|
397
|
-
/>
|
|
398
|
-
)}
|
|
399
|
-
{isSinglePageCheckout
|
|
400
|
-
? null
|
|
401
|
-
: error && (
|
|
402
|
-
<Alert severity="error" onClose={onErrorClose} variant="filled">
|
|
403
|
-
{error}
|
|
404
|
-
</Alert>
|
|
405
|
-
)}
|
|
406
|
-
{paymentDataIsLoading && <Loader />}
|
|
407
|
-
{!paymentDataIsLoading && (
|
|
408
|
-
<Container maxWidth="md">
|
|
409
|
-
{showFormTitle && <h1>{isTable ? 'Get Your Tables' : formTitle}</h1>}
|
|
410
|
-
<div className="order_info_text">{orderInfoLabel}</div>
|
|
411
|
-
{!hideFieldsBlock && (
|
|
412
|
-
<div
|
|
413
|
-
className="order_info_section"
|
|
414
|
-
style={{ display: hasTableTypes ? 'block' : 'grid' }}
|
|
415
|
-
>
|
|
416
|
-
{_map(paymentFieldsData, field => {
|
|
417
|
-
const { id, label, className = '', normalizer = _identity } = field
|
|
418
|
-
let value = orderData[id as keyof IOrderData] || ''
|
|
419
|
-
let component = null
|
|
420
|
-
|
|
421
|
-
if (field.id === 'add_ons' && _isEmpty(value)) {
|
|
422
|
-
return false
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
if (
|
|
426
|
-
field.id === 'total' &&
|
|
427
|
-
paymentPlanIsAvailable &&
|
|
428
|
-
showPaymentPlanSection
|
|
429
|
-
) {
|
|
430
|
-
value = '' + paymentPlanConfig.total
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
if (field.id === 'tableTypes') {
|
|
434
|
-
const valueArray = value as Array<any>
|
|
435
|
-
|
|
436
|
-
component = (
|
|
437
|
-
<div
|
|
438
|
-
key={id}
|
|
439
|
-
className="order_info_block"
|
|
440
|
-
style={{
|
|
441
|
-
display: 'flex',
|
|
442
|
-
flexDirection: 'column',
|
|
443
|
-
}}
|
|
444
|
-
>
|
|
445
|
-
{_map(valueArray, tableTypeItem => (
|
|
446
|
-
<div
|
|
447
|
-
key={tableTypeItem.id}
|
|
448
|
-
style={{
|
|
449
|
-
display: 'grid',
|
|
450
|
-
gridTemplateColumns: '33% 33% 33%',
|
|
451
|
-
gridColumnGap: '10%',
|
|
452
|
-
}}
|
|
453
|
-
>
|
|
454
|
-
<div className="order_info_block">
|
|
455
|
-
<div className="order_info_title">Table Type</div>
|
|
456
|
-
<div className={`${className} order_info_text`}>
|
|
457
|
-
{tableTypeItem.ticketType}
|
|
458
|
-
</div>
|
|
459
|
-
</div>
|
|
460
|
-
<div className="order_info_block">
|
|
461
|
-
<div className="order_info_title">Number of Tables</div>
|
|
462
|
-
<div className={`${className} order_info_text`}>
|
|
463
|
-
{tableTypeItem.count}
|
|
464
|
-
</div>
|
|
465
|
-
</div>
|
|
466
|
-
<div className="order_info_block">
|
|
467
|
-
<div className="order_info_title">Guest Count</div>
|
|
468
|
-
<div className={`${className} order_info_text`}>
|
|
469
|
-
{tableTypeItem.quantity}
|
|
470
|
-
</div>
|
|
471
|
-
</div>
|
|
472
|
-
</div>
|
|
473
|
-
))}
|
|
474
|
-
</div>
|
|
475
|
-
)
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
return (
|
|
479
|
-
component || (
|
|
480
|
-
<div key={id} className={`order_info_block ${className}`}>
|
|
481
|
-
<div className="order_info_title">{label}</div>
|
|
482
|
-
<div className={`${className} order_info_text`}>
|
|
483
|
-
{typeof value === 'string' || typeof value === 'number'
|
|
484
|
-
? normalizer(value, currency, orderData)
|
|
485
|
-
: _map(value, item => (
|
|
486
|
-
<div>
|
|
487
|
-
<div key={item.id} className="add-on-container">
|
|
488
|
-
<span>{item.quantity}</span>
|
|
489
|
-
<span className="add-on-x">{' x '}</span>
|
|
490
|
-
<span>
|
|
491
|
-
{item.groupName ? item.groupName + ' - ' : ''}
|
|
492
|
-
</span>
|
|
493
|
-
<span>{item.name}</span>
|
|
494
|
-
<span>{' - '}</span>
|
|
495
|
-
<span>
|
|
496
|
-
{CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL &&
|
|
497
|
-
currencyNormalizerCreator(
|
|
498
|
-
createFixedFloatNormalizer(2)(
|
|
499
|
-
parseFloat(item.price)
|
|
500
|
-
),
|
|
501
|
-
currency
|
|
502
|
-
) + ' (incl. fees)'}
|
|
503
|
-
{CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH &&
|
|
504
|
-
currencyNormalizerCreator(
|
|
505
|
-
createFixedFloatNormalizer(2)(
|
|
506
|
-
parseFloat(item.cost)
|
|
507
|
-
),
|
|
508
|
-
currency
|
|
509
|
-
)}
|
|
510
|
-
{CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN &&
|
|
511
|
-
currencyNormalizerCreator(
|
|
512
|
-
createFixedFloatNormalizer(2)(
|
|
513
|
-
parseFloat(item.price)
|
|
514
|
-
),
|
|
515
|
-
currency
|
|
516
|
-
)}
|
|
517
|
-
</span>
|
|
518
|
-
<span className="add-on-each">{' each'}</span>
|
|
519
|
-
</div>
|
|
520
|
-
{CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && (
|
|
521
|
-
<p className="fees">
|
|
522
|
-
{`(${currencyNormalizerCreator(
|
|
523
|
-
createFixedFloatNormalizer(2)(
|
|
524
|
-
parseFloat(String(item.price))
|
|
525
|
-
),
|
|
526
|
-
currency
|
|
527
|
-
)} with fees)`}
|
|
528
|
-
</p>
|
|
529
|
-
)}
|
|
530
|
-
{CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && parseFloat(item.price) - parseFloat(item.cost) > 0 && (
|
|
531
|
-
<p className="fees">
|
|
532
|
-
{`(${currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency)} + ${currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price) - parseFloat(item.cost)), currency)} fee)`}
|
|
533
|
-
</p>
|
|
534
|
-
)}
|
|
535
|
-
</div>
|
|
536
|
-
))}
|
|
537
|
-
</div>
|
|
538
|
-
</div>
|
|
539
|
-
)
|
|
540
|
-
)
|
|
541
|
-
})}
|
|
542
|
-
</div>
|
|
543
|
-
)}
|
|
544
|
-
{!isFreeTickets && paymentPlanIsAvailable && (
|
|
545
|
-
<div className="payment_toggle">
|
|
546
|
-
<Checkbox
|
|
547
|
-
label={
|
|
548
|
-
<span className="payment_plan_toggle_label">
|
|
549
|
-
Click to checkout using Payment Plan
|
|
550
|
-
</span>
|
|
551
|
-
}
|
|
552
|
-
required={true}
|
|
553
|
-
onChange={() => {
|
|
554
|
-
setShowPaymentPlanSection(!showPaymentPlanSection)
|
|
555
|
-
}}
|
|
556
|
-
checked={showPaymentPlanSection}
|
|
557
|
-
/>
|
|
558
|
-
</div>
|
|
559
|
-
)}
|
|
560
|
-
{showPaymentPlanSection && (
|
|
561
|
-
<PaymentPlanSection
|
|
562
|
-
paymentPlanConfig={paymentPlanConfig}
|
|
563
|
-
currency={currency}
|
|
564
|
-
paymentPlanUseSavedCard={paymentPlanUseSavedCard}
|
|
565
|
-
setPaymentPlanUseSavedCard={setPaymentPlanUseSavedCard}
|
|
566
|
-
/>
|
|
567
|
-
)}
|
|
568
|
-
{showPaymentForm() && !!getPublishableKey() ? (
|
|
569
|
-
<div className="payment_info">
|
|
570
|
-
<div className="payment_info_label">{paymentInfoLabel}</div>
|
|
571
|
-
{showErrorText && <p className="payment_info__error">{errorText}</p>}
|
|
572
|
-
<div>
|
|
573
|
-
{elementsOptions && (
|
|
574
|
-
<Elements stripe={getStripePromise()} options={elementsOptions}>
|
|
575
|
-
<StripeWrapper
|
|
576
|
-
onStripeReady={onStripeReady}
|
|
577
|
-
options={paymentElementOptions}
|
|
578
|
-
onPaymentElementChange={onPaymentElementChange}
|
|
579
|
-
/>
|
|
580
|
-
</Elements>
|
|
581
|
-
)}
|
|
582
|
-
</div>
|
|
583
|
-
</div>
|
|
584
|
-
) : displayPaymentButton ? (
|
|
585
|
-
<div
|
|
586
|
-
className={`payment_button ${
|
|
587
|
-
paymentIsLoading ? 'disabled-payment-button' : ''
|
|
588
|
-
}`}
|
|
589
|
-
>
|
|
590
|
-
<button
|
|
591
|
-
disabled={paymentIsLoading}
|
|
592
|
-
type="button"
|
|
593
|
-
onClick={() => {
|
|
594
|
-
setPaymentIsLoading(true)
|
|
595
|
-
|
|
596
|
-
let data
|
|
597
|
-
|
|
598
|
-
if (
|
|
599
|
-
paymentPlanIsAvailable &&
|
|
600
|
-
showPaymentPlanSection &&
|
|
601
|
-
paymentPlanUseSavedCard
|
|
602
|
-
) {
|
|
603
|
-
data = {
|
|
604
|
-
paymentMethodId:
|
|
605
|
-
paymentPlanConfig.saved_card?.stripe_payment_method_id,
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
handlePaymentMiddleWare(
|
|
610
|
-
data,
|
|
611
|
-
{},
|
|
612
|
-
{
|
|
613
|
-
reviewData,
|
|
614
|
-
isFreeTickets,
|
|
615
|
-
paymentPlanIsAvailable,
|
|
616
|
-
showPaymentPlanSection,
|
|
617
|
-
handlePayment,
|
|
618
|
-
setPaymentIsLoading,
|
|
619
|
-
setError,
|
|
620
|
-
orderData,
|
|
621
|
-
eventId,
|
|
622
|
-
isBrowser,
|
|
623
|
-
onPaymentError,
|
|
624
|
-
}
|
|
625
|
-
)
|
|
626
|
-
}}
|
|
627
|
-
>
|
|
628
|
-
{paymentIsLoading ? (
|
|
629
|
-
<CircularProgress size={26} />
|
|
630
|
-
) : isFreeTickets ? (
|
|
631
|
-
'Complete Registration'
|
|
632
|
-
) : (
|
|
633
|
-
'Confirm Payment Plan'
|
|
634
|
-
)}
|
|
635
|
-
</button>
|
|
636
|
-
</div>
|
|
637
|
-
) : null}
|
|
638
|
-
</Container>
|
|
639
|
-
)}
|
|
640
|
-
</div>
|
|
641
|
-
</ThemeProvider>
|
|
642
|
-
)
|
|
643
|
-
}
|