tf-checkout-react 1.0.71 → 1.0.75

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.
Files changed (35) hide show
  1. package/dist/api/index.d.ts +1 -0
  2. package/dist/components/billing-info-container/index.d.ts +4 -2
  3. package/dist/components/common/CheckboxField.d.ts +1 -1
  4. package/dist/components/common/FormikPhoneNumberField.d.ts +1 -1
  5. package/dist/components/confirmationContainer/index.d.ts +2 -1
  6. package/dist/components/paymentContainer/index.d.ts +2 -1
  7. package/dist/components/stripePayment/index.d.ts +2 -1
  8. package/dist/components/ticketsContainer/PromoCodeSection.d.ts +12 -0
  9. package/dist/components/ticketsContainer/index.d.ts +2 -1
  10. package/dist/components/waitingList/index.d.ts +2 -1
  11. package/dist/env.d.ts +2 -2
  12. package/dist/images/done.svg +3 -0
  13. package/dist/tf-checkout-react.cjs.development.js +192 -122
  14. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  15. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  16. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  17. package/dist/tf-checkout-react.esm.js +197 -127
  18. package/dist/tf-checkout-react.esm.js.map +1 -1
  19. package/dist/tf-checkout-styles.css +1 -1
  20. package/dist/utils/setConfigs.d.ts +2 -1
  21. package/package.json +2 -2
  22. package/src/api/index.ts +6 -18
  23. package/src/assets/images/done.svg +3 -0
  24. package/src/components/billing-info-container/index.tsx +36 -21
  25. package/src/components/common/CheckboxField.tsx +1 -0
  26. package/src/components/common/FormikPhoneNumberField.tsx +1 -0
  27. package/src/components/confirmationContainer/index.tsx +59 -43
  28. package/src/components/paymentContainer/index.tsx +86 -45
  29. package/src/components/stripePayment/index.tsx +23 -15
  30. package/src/components/ticketsContainer/PromoCodeSection.tsx +82 -0
  31. package/src/components/ticketsContainer/index.tsx +51 -79
  32. package/src/components/ticketsContainer/style.css +6 -4
  33. package/src/components/waitingList/index.tsx +7 -4
  34. package/src/env.ts +4 -4
  35. package/src/utils/setConfigs.ts +7 -2
@@ -1 +1 @@
1
- .button-container{display:flex;justify-content:center;padding:20px}.billing-info-container{margin:0 auto;max-width:800px}.billing-info-container .is-half{width:49%}.billing-info-container p{color:#000}.billing-info-container .main-header{font-size:2rem;font-weight:600}.billing-info-container__twoFields{display:flex;justify-content:space-between;margin-top:15px}.billing-info-container__singleField{margin-top:15px}.account-actions-block{color:#182026;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif;margin-top:10px}.login-register-button,.MuiButtonBase-root.MuiButton-root,.MuiButtonBase-root.MuiButton-root:hover{background-color:#212529;border:#f28051;border-radius:5px;color:#fff;cursor:pointer;display:block;font-family:Inter-Bold;font-size:26px;font-weight:700;line-height:1.15;margin-top:10px;min-height:46px;outline:none;overflow:hidden;padding:14px 12px 12px;position:relative;text-align:center;text-overflow:ellipsis;text-transform:uppercase;width:49%}.logo-image-container{margin-top:5px;text-align:center;width:49%}.logo-image-container img{height:30px}.login-block{align-items:center;display:flex;flex-direction:column}.login-register-button:hover{background-color:#505050!important;border-color:#505050!important}.login-register-block{display:flex;justify-content:space-between}@media only screen and (max-width:820px){.billing-info-container{width:90%}.billing-info-container .main-header{font-size:1.5rem}}.email-checking{margin-bottom:15px}.modal-title{align-items:center;background-color:#fff;display:flex;font-family:Inter;font-size:18px;font-weight:700;height:49px;line-height:22px;padding-left:25px;position:relative}.login-modal-body{padding:15px 25px}.login-modal-body input{background:#fff!important}.login-modal-body__email,.login-modal-body__password{margin-bottom:20px}.login-action-button button{background-color:#212529;border:none;border-radius:0;color:#fff;cursor:pointer;font-size:26px;font-weight:600;height:45px;line-height:18px;margin:10px 0;outline:none;padding:10px;width:100%}.login-action-button button:hover{background-color:#505050;border-color:#505050}.server_auth__error{color:red;font-family:Inter;font-size:12px;font-style:normal;padding-left:25px;padding-top:15px}.info-text-for-login{font-size:14px;margin-bottom:4px;padding-left:10px}.register-container{margin:0 auto;max-width:800px}.register-container .is-half{width:49%}.register-container__twoFields{display:flex;justify-content:space-between;margin-top:15px}.register-container__singleField{margin-top:15px}button{margin-top:10px}.payment_page{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.payment_page .order_info_section{padding:15px 0}.payment_page .order_info_section .order_info_block{padding-bottom:15px;padding-top:15px}.payment_page .order_info_section .order_info_block .field-underline{border-bottom:1px solid #000;padding-bottom:15px}.payment_page .order_info_section .order_info_block .order_info_title{font-size:14px;font-weight:700;padding-bottom:3px}.payment_page .order_info_section .order_info_block .order_info_text{font-size:16px;line-height:1.15;outline:none}.payment_page .MuiBox-root{margin-left:auto;margin-right:auto;padding:20px;text-align:center}.payment_page .payment_info_label{padding:20px 0;text-align:center}.payment_page .payment_form{color:#fff;padding:20px}.payment_page .payment_form input,.payment_page .payment_form label{color:#fff}.payment_page .payment_button{padding-top:20px;text-align:center}.card_form_inner{background:#232323;border-radius:8px;margin:0 auto 20px;min-width:325px;padding:15px;width:50%}.card_form_inner .card_label_text{color:#fff}.card_form_inner .StripeElement{margin:5px 0 10px}.card_label_text{color:#fff}.payment_button{padding-top:15px;text-align:center}.payment_button button{background-color:#212529;border-radius:8px;color:#fff;cursor:pointer;font-size:26px;padding:15px 30px;transition:opacity .5s;width:200px}.payment_button button:hover{opacity:.7}.disabled-payment-button button{opacity:.3;pointer-events:none;user-select:none}.checkout_error_block{color:#e53935;font-weight:600;padding:15px 0}.zip_element p{margin-bottom:0}.zip_element input{background-color:#000;border:none;color:#fff;font-size:18px;margin-top:5px;outline:none;width:100%}.confirmation-page{margin:0 auto;max-width:1024px}.confirmation-page button{margin-top:inherit}.confirmation-page .strong-text{font-weight:700}.confirmation-page .title{color:#333;font-size:24px;font-weight:600}.confirmation-page .share-message-section{background:#dff0d8;border:1px solid #d6e9c6;border-radius:5px;color:#2c7221;display:flex;flex-direction:column;margin:20px 0;padding:15px}.confirmation-page .main{font-size:15px;font-weight:700}.confirmation-page .helper,.confirmation-page .main{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.confirmation-page .helper{font-size:14px;margin-top:5px}.confirmation-page .referral_text_image_section{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.confirmation-page .referral_text_section{margin:10px}.confirmation-page .referral_title_text{color:#f08057;font-size:28px;padding-bottom:10px}.confirmation-page .referral_text{font-size:18px}.confirmation-page .referral_text_image_section img{margin:10px;max-width:200px}.confirmation-page .share_wrapper{column-gap:5rem;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));margin:10px}.confirmation-page .invitation_title{font-size:22px;padding-bottom:12px;padding-top:12px}.confirmation-page .share_section{display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 -10px}.confirmation-page .invitation_section{flex:1 1;padding:0 5px}.confirmation-page .share_buttons{display:grid;flex-wrap:wrap;margin:0 -7px}.confirmation-page .convenient_buttons{margin-top:10px}.confirmation-page .social-media-btns{grid-gap:5px;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.confirmation-page .sharing-btn{background-color:#000;flex:1 1;min-width:130px}.confirmation-page .sharing-btn a{text-decoration:none}.confirmation-page .share-by-link{background:#000;color:#fff;padding:10px}.confirmation-page .share-by-link.label{margin:0;padding:0;text-align:left}.confirmation-page .share-btn-inner{align-items:center;background-color:#000;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-flex;padding:0;text-align:left;width:100%}.confirmation-page .share-input{background-color:#fff;border:none;outline:none;padding:5px;text-align:left;width:300px}.confirmation-page .share-text{display:block;font-size:13px;font-weight:600;padding-top:8px;width:100%}.confirmation-page .pricing-section_wrapper{background:#e3e3e3;border:1px solid #dcdcdc;display:grid;grid-template-columns:1fr 1fr;margin:10px 0;padding:15px}.confirmation-page .pricing-section_label{font-weight:600}.confirmation-page .pricing-section_sublabel{font-size:14px;font-weight:100}.confirmation-page .pricing-section_price{font-weight:600;text-align:right}.confirmation-page .share-by-link-copy-icon{align-items:center;background-color:#32325d;border-radius:4px;color:#fff;cursor:pointer;display:flex;justify-content:center;margin-left:8px;padding:10px;transition:all .15s ease}.confirmation-page .share-by-link-copy-icon:hover{background-color:#505050}.confirmation-page .share-by-link-copy-icon img{width:14px}.confirmation-page .social-media-sharing{background-color:#000;color:#fff;cursor:pointer;padding:10px;text-align:center}.confirmation-page .share-icon{border-radius:4px;display:inline-flex}@media only screen and (max-width:1050px){.confirmation-page .share_wrapper{column-gap:0;display:grid;grid-template-columns:unset;margin:15px}}@media only screen and (max-width:480px){.confirmation-page .social-media-btns{grid-template-columns:unset}.confirmation-page .share-input{width:250px}}body{margin:0;padding:0}.get-tickets-page{width:100%}.event-detail__tier{background-color:#fff;padding:17px 35px 20px}.event-detail__tier-name{color:#000;font-family:Inter-Bold;font-family:Bebas Neue;font-size:.85rem;font-weight:700;letter-spacing:.2em;line-height:1.3;margin-bottom:8px;margin-top:16px;padding-right:20%;text-transform:uppercase}.event-detail__tier-status{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;margin-top:8px;width:100%}.event-detail__tier-status.ticket-button{background-color:#212529;border:3px solid #000;border-radius:0;color:#fff;cursor:pointer;font-weight:700;letter-spacing:.2em;line-height:1.5;margin-bottom:10px;width:200px}.event-tickets-container{align-items:center;display:flex;justify-content:space-between}.event-detail__tier-status.ticket-button.true{background-color:#c1c3c6;border-color:#afb0b1}.event-detail__tier-price{color:#000;font-family:Inter-Bold;font-size:1.5rem;font-weight:700;line-height:1;text-align:center}.event-detail__tier-price p{margin:0}.event-detail__tier-price .fees{font-size:14px;font-weight:400;margin-top:4px;text-align:left}.event-detail__tier-price .old-price{color:red;font-size:1.3rem;margin-bottom:5px;text-decoration:line-through}.alert-info{background-color:#d9edf7;border:1px solid #bce8f1;border-radius:4px;color:#3a87ad;font-size:1em;margin:0 35px;padding:8px 15px;text-align:center;text-shadow:0 1px 0 hsla(0,0%,100%,.5)}.event-detail__tier-state{color:#30bc9d;font-family:Inter-Bold;font-size:.75rem;font-weight:300;line-height:1;text-align:right;text-transform:uppercase}.promo-code-block input{font-size:14px;padding:1px 8px}.book-button{background-color:#212529;border:3px solid #000;border-radius:0;color:#fff;cursor:pointer;display:block;font-size:26px;font-weight:700;height:50px;letter-spacing:.2em;line-height:1.5;margin:25px auto 10px;text-align:center;width:100%}.book-button:hover{background-color:#505050;border-color:#505050}.loader-container{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.get-tickets-paper::-webkit-scrollbar{width:5px}.get-tickets-paper::-webkit-scrollbar-track{background:#f1f1f1}.get-tickets-paper::-webkit-scrollbar-thumb{background:#888}.get-tickets-paper::-webkit-scrollbar-thumb:hover{background:#555}.get-tickets .get-tickets__selectbox{width:100%}.disabled{pointer-events:none;user-select:none}.hidden{display:none}.waiting-list{padding:17px 35px 20px}.waiting-list .field-item{margin-bottom:30px}.waiting-list .waiting-list-button{width:100%!important}.waiting-list .waiting-list-button:hover{background-color:#505050}.waiting-list .success-message h3{margin:10px 0}.waiting-list .success-message p{margin:0}.waiting-list .no-tickets-text{font-weight:700;text-align:center}.waiting-list .added-success-message{font-size:22px}.my-ticket{padding:30px}.my-ticket-table{margin-top:30px}.my-ticket .loading{background-color:rgba(0,0,0,.4);height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100%}.my-ticket .event-info,.my-ticket .loading{align-items:center;display:flex}.my-ticket thead th{font-weight:700}.my-ticket .event-info img{margin-right:10px;width:50px}.my-ticket .order-details-button{background-color:#32325d;border:none;border-radius:4px;color:#fff;cursor:pointer;padding:10px 14px;transition:all .15s ease}.my-ticket .order-details-button:hover{background-color:#505050}.order-details{margin:0 auto;max-width:940px}.order-details .loading{align-items:center;background-color:rgba(0,0,0,.4);display:flex;height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100%}.order-details .layout-title{font-size:24px;font-weight:400}.order-details .sub-title{font-size:18px;font-weight:400;margin:10px 0}.order-details .order-summary-box{margin-top:30px}.order-details .total-row td,.order-details th{color:#fff;font-weight:700}.order-details .tickets-box{margin-top:30px}.order-details .ticket-add-on-table{background-color:#fcf8e3}.order-details .download-button{background-color:#212529;border:1px solid #fff;border-radius:0;color:#fff;cursor:pointer;display:block;font-family:Bebas Neue;font-size:16px;font-weight:400;line-height:normal;margin-bottom:20px;margin-top:20px;min-height:auto;outline:none;overflow:hidden;padding:12px 0;position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:uppercase;width:100%}.order-details .download-button:hover{background-color:#505050}.order-details .personal-link{padding:20px 0}
1
+ .button-container{display:flex;justify-content:center;padding:20px}.billing-info-container{margin:0 auto;max-width:800px}.billing-info-container .is-half{width:49%}.billing-info-container p{color:#000}.billing-info-container .main-header{font-size:2rem;font-weight:600}.billing-info-container__twoFields{display:flex;justify-content:space-between;margin-top:15px}.billing-info-container__singleField{margin-top:15px}.account-actions-block{color:#182026;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif;margin-top:10px}.login-register-button,.MuiButtonBase-root.MuiButton-root,.MuiButtonBase-root.MuiButton-root:hover{background-color:#212529;border:#f28051;border-radius:5px;color:#fff;cursor:pointer;display:block;font-family:Inter-Bold;font-size:26px;font-weight:700;line-height:1.15;margin-top:10px;min-height:46px;outline:none;overflow:hidden;padding:14px 12px 12px;position:relative;text-align:center;text-overflow:ellipsis;text-transform:uppercase;width:49%}.logo-image-container{margin-top:5px;text-align:center;width:49%}.logo-image-container img{height:30px}.login-block{align-items:center;display:flex;flex-direction:column}.login-register-button:hover{background-color:#505050!important;border-color:#505050!important}.login-register-block{display:flex;justify-content:space-between}@media only screen and (max-width:820px){.billing-info-container{width:90%}.billing-info-container .main-header{font-size:1.5rem}}.email-checking{margin-bottom:15px}.modal-title{align-items:center;background-color:#fff;display:flex;font-family:Inter;font-size:18px;font-weight:700;height:49px;line-height:22px;padding-left:25px;position:relative}.login-modal-body{padding:15px 25px}.login-modal-body input{background:#fff!important}.login-modal-body__email,.login-modal-body__password{margin-bottom:20px}.login-action-button button{background-color:#212529;border:none;border-radius:0;color:#fff;cursor:pointer;font-size:26px;font-weight:600;height:45px;line-height:18px;margin:10px 0;outline:none;padding:10px;width:100%}.login-action-button button:hover{background-color:#505050;border-color:#505050}.server_auth__error{color:red;font-family:Inter;font-size:12px;font-style:normal;padding-left:25px;padding-top:15px}.info-text-for-login{font-size:14px;margin-bottom:4px;padding-left:10px}.register-container{margin:0 auto;max-width:800px}.register-container .is-half{width:49%}.register-container__twoFields{display:flex;justify-content:space-between;margin-top:15px}.register-container__singleField{margin-top:15px}button{margin-top:10px}.payment_page{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.payment_page .order_info_section{padding:15px 0}.payment_page .order_info_section .order_info_block{padding-bottom:15px;padding-top:15px}.payment_page .order_info_section .order_info_block .field-underline{border-bottom:1px solid #000;padding-bottom:15px}.payment_page .order_info_section .order_info_block .order_info_title{font-size:14px;font-weight:700;padding-bottom:3px}.payment_page .order_info_section .order_info_block .order_info_text{font-size:16px;line-height:1.15;outline:none}.payment_page .MuiBox-root{margin-left:auto;margin-right:auto;padding:20px;text-align:center}.payment_page .payment_info_label{padding:20px 0;text-align:center}.payment_page .payment_form{color:#fff;padding:20px}.payment_page .payment_form input,.payment_page .payment_form label{color:#fff}.payment_page .payment_button{padding-top:20px;text-align:center}.card_form_inner{background:#232323;border-radius:8px;margin:0 auto 20px;min-width:325px;padding:15px;width:50%}.card_form_inner .card_label_text{color:#fff}.card_form_inner .StripeElement{margin:5px 0 10px}.card_label_text{color:#fff}.payment_button{padding-top:15px;text-align:center}.payment_button button{background-color:#212529;border-radius:8px;color:#fff;cursor:pointer;font-size:26px;padding:15px 30px;transition:opacity .5s;width:200px}.payment_button button:hover{opacity:.7}.disabled-payment-button button{opacity:.3;pointer-events:none;user-select:none}.checkout_error_block{color:#e53935;font-weight:600;padding:15px 0}.zip_element p{margin-bottom:0}.zip_element input{background-color:#000;border:none;color:#fff;font-size:18px;margin-top:5px;outline:none;width:100%}.confirmation-page{margin:0 auto;max-width:1024px}.confirmation-page button{margin-top:inherit}.confirmation-page .strong-text{font-weight:700}.confirmation-page .title{color:#333;font-size:24px;font-weight:600}.confirmation-page .share-message-section{background:#dff0d8;border:1px solid #d6e9c6;border-radius:5px;color:#2c7221;display:flex;flex-direction:column;margin:20px 0;padding:15px}.confirmation-page .main{font-size:15px;font-weight:700}.confirmation-page .helper,.confirmation-page .main{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.confirmation-page .helper{font-size:14px;margin-top:5px}.confirmation-page .referral_text_image_section{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.confirmation-page .referral_text_section{margin:10px}.confirmation-page .referral_title_text{color:#f08057;font-size:28px;padding-bottom:10px}.confirmation-page .referral_text{font-size:18px}.confirmation-page .referral_text_image_section img{margin:10px;max-width:200px}.confirmation-page .share_wrapper{column-gap:5rem;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));margin:10px}.confirmation-page .invitation_title{font-size:22px;padding-bottom:12px;padding-top:12px}.confirmation-page .share_section{display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 -10px}.confirmation-page .invitation_section{flex:1 1;padding:0 5px}.confirmation-page .share_buttons{display:grid;flex-wrap:wrap;margin:0 -7px}.confirmation-page .convenient_buttons{margin-top:10px}.confirmation-page .social-media-btns{grid-gap:5px;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.confirmation-page .sharing-btn{background-color:#000;flex:1 1;min-width:130px}.confirmation-page .sharing-btn a{text-decoration:none}.confirmation-page .share-by-link{background:#000;color:#fff;padding:10px}.confirmation-page .share-by-link.label{margin:0;padding:0;text-align:left}.confirmation-page .share-btn-inner{align-items:center;background-color:#000;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-flex;padding:0;text-align:left;width:100%}.confirmation-page .share-input{background-color:#fff;border:none;outline:none;padding:5px;text-align:left;width:300px}.confirmation-page .share-text{display:block;font-size:13px;font-weight:600;padding-top:8px;width:100%}.confirmation-page .pricing-section_wrapper{background:#e3e3e3;border:1px solid #dcdcdc;display:grid;grid-template-columns:1fr 1fr;margin:10px 0;padding:15px}.confirmation-page .pricing-section_label{font-weight:600}.confirmation-page .pricing-section_sublabel{font-size:14px;font-weight:100}.confirmation-page .pricing-section_price{font-weight:600;text-align:right}.confirmation-page .share-by-link-copy-icon{align-items:center;background-color:#32325d;border-radius:4px;color:#fff;cursor:pointer;display:flex;justify-content:center;margin-left:8px;padding:10px;transition:all .15s ease}.confirmation-page .share-by-link-copy-icon:hover{background-color:#505050}.confirmation-page .share-by-link-copy-icon img{width:14px}.confirmation-page .social-media-sharing{background-color:#000;color:#fff;cursor:pointer;padding:10px;text-align:center}.confirmation-page .share-icon{border-radius:4px;display:inline-flex}@media only screen and (max-width:1050px){.confirmation-page .share_wrapper{column-gap:0;display:grid;grid-template-columns:unset;margin:15px}}@media only screen and (max-width:480px){.confirmation-page .social-media-btns{grid-template-columns:unset}.confirmation-page .share-input{width:250px}}body{margin:0;padding:0}.get-tickets-page{width:100%}.event-detail__tier{background-color:#fff;padding:17px 35px 20px}.event-detail__tier-name{color:#000;font-family:Inter-Bold;font-family:Bebas Neue;font-size:.85rem;font-weight:700;letter-spacing:.2em;line-height:1.3;margin-bottom:8px;margin-top:16px;padding-right:20%;text-transform:uppercase}.event-detail__tier-status{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;margin-top:8px;width:100%}.event-detail__tier-status.ticket-button{background-color:#212529;border:3px solid #000;border-radius:0;color:#fff;cursor:pointer;font-weight:700;letter-spacing:.2em;line-height:1.5;margin-bottom:10px;width:200px}.event-tickets-container{align-items:center;display:flex;justify-content:space-between}.event-detail__tier-status.ticket-button.true{background-color:#c1c3c6;border-color:#afb0b1}.event-detail__tier-price{color:#000;font-family:Inter-Bold;font-size:1.5rem;line-height:1;text-align:center}.event-detail__tier-price p{margin:0}.event-detail__tier-price .fees{font-size:14px;margin-top:4px;text-align:left}.event-detail__tier-price .old-price{color:red;font-size:1.3rem;margin-bottom:5px;text-decoration:line-through}.alert-info{align-items:center;background-color:#d9edf7;border:1px solid #bce8f1;border-radius:4px;color:#3a87ad;display:flex;font-size:1em;justify-content:center;margin:0 35px;padding:8px 15px;text-shadow:0 1px 0 hsla(0,0%,100%,.5)}.alert-info svg{margin-right:4px}.event-detail__tier-state{color:#30bc9d;font-family:Inter-Bold;font-size:.75rem;font-weight:300;line-height:1;text-align:right;text-transform:uppercase}.promo-code-block input{font-size:14px;padding:1px 8px}.book-button{background-color:#212529;border:3px solid #000;border-radius:0;color:#fff;cursor:pointer;display:block;font-size:26px;font-weight:700;height:50px;letter-spacing:.2em;line-height:1.5;margin:25px auto 10px;text-align:center;width:100%}.book-button:hover{background-color:#505050;border-color:#505050}.loader-container{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.get-tickets-paper::-webkit-scrollbar{width:5px}.get-tickets-paper::-webkit-scrollbar-track{background:#f1f1f1}.get-tickets-paper::-webkit-scrollbar-thumb{background:#888}.get-tickets-paper::-webkit-scrollbar-thumb:hover{background:#555}.get-tickets .get-tickets__selectbox{width:100%}.disabled{pointer-events:none;user-select:none}.hidden{display:none}.waiting-list{padding:17px 35px 20px}.waiting-list .field-item{margin-bottom:30px}.waiting-list .waiting-list-button{width:100%!important}.waiting-list .waiting-list-button:hover{background-color:#505050}.waiting-list .success-message h3{margin:10px 0}.waiting-list .success-message p{margin:0}.waiting-list .no-tickets-text{font-weight:700;text-align:center}.waiting-list .added-success-message{font-size:22px}.my-ticket{padding:30px}.my-ticket-table{margin-top:30px}.my-ticket .loading{background-color:rgba(0,0,0,.4);height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100%}.my-ticket .event-info,.my-ticket .loading{align-items:center;display:flex}.my-ticket thead th{font-weight:700}.my-ticket .event-info img{margin-right:10px;width:50px}.my-ticket .order-details-button{background-color:#32325d;border:none;border-radius:4px;color:#fff;cursor:pointer;padding:10px 14px;transition:all .15s ease}.my-ticket .order-details-button:hover{background-color:#505050}.order-details{margin:0 auto;max-width:940px}.order-details .loading{align-items:center;background-color:rgba(0,0,0,.4);display:flex;height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100%}.order-details .layout-title{font-size:24px;font-weight:400}.order-details .sub-title{font-size:18px;font-weight:400;margin:10px 0}.order-details .order-summary-box{margin-top:30px}.order-details .total-row td,.order-details th{color:#fff;font-weight:700}.order-details .tickets-box{margin-top:30px}.order-details .ticket-add-on-table{background-color:#fcf8e3}.order-details .download-button{background-color:#212529;border:1px solid #fff;border-radius:0;color:#fff;cursor:pointer;display:block;font-family:Bebas Neue;font-size:16px;font-weight:400;line-height:normal;margin-bottom:20px;margin-top:20px;min-height:auto;outline:none;overflow:hidden;padding:12px 0;position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:uppercase;width:100%}.order-details .download-button:hover{background-color:#505050}.order-details .personal-link{padding:20px 0}
@@ -3,7 +3,8 @@ interface IConfigs {
3
3
  CLIENT_ID: string;
4
4
  CLIENT_SECRET: string;
5
5
  STRIPE_PUBLISHABLE_KEY: string;
6
- [key: string]: string;
6
+ X_SOURCE_ORIGIN: string;
7
+ [key: string]: string | number;
7
8
  }
8
9
  export declare const CONFIGS: IConfigs;
9
10
  export declare const setConfigs: (configs: IConfigs) => void;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.71",
2
+ "version": "1.0.75",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  "@types/lodash": "^4.14.176",
52
52
  "@types/react": "^17.0.34",
53
53
  "@types/react-dom": "^17.0.11",
54
- "@typescript-eslint/parser": "^5.4.0",
54
+ "@typescript-eslint/parser": "5.4.0",
55
55
  "husky": "^7.0.4",
56
56
  "react": "^17.0.2",
57
57
  "react-dom": "^17.0.2",
package/src/api/index.ts CHANGED
@@ -4,14 +4,6 @@ import _get from 'lodash/get'
4
4
  import { CONFIGS } from '../utils'
5
5
 
6
6
  const isWindowDefined = typeof window !== 'undefined'
7
- const discardedOrigins = [
8
- 'http://localhost',
9
- 'gtsb.io',
10
- 'gatsbyjs.io',
11
- 'https://www.houseofx.nyc',
12
- 'https://tickets-staging.houseofx.nyc']
13
-
14
- const origin = isWindowDefined && window.location.origin
15
7
 
16
8
  const ttfHeaders: { [key: string]: any } = {
17
9
  Accept: 'application/vnd.api+json',
@@ -21,12 +13,6 @@ const ttfHeaders: { [key: string]: any } = {
21
13
  if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
22
14
  ttfHeaders['Authorization-Guest'] = localStorage.getItem('auth_guest_token')
23
15
  }
24
- if (
25
- isWindowDefined &&
26
- !discardedOrigins.some(el => origin && origin.includes(el))
27
- ) {
28
- ttfHeaders['X-Source-Origin'] = 'houseofx.nyc'
29
- }
30
16
 
31
17
  interface IPublicRequest extends AxiosInstance {
32
18
  setGuestToken: (token: string) => void;
@@ -81,12 +67,10 @@ publicRequest.interceptors.request.use((config: AxiosRequestConfig) => {
81
67
  config.headers = updatedHeaders
82
68
  }
83
69
 
84
- if (
85
- isWindowDefined &&
86
- !discardedOrigins.some(el => origin && origin.includes(el))) {
70
+ if (CONFIGS.X_SOURCE_ORIGIN) {
87
71
  const updatedHeaders = {
88
72
  ...config.headers,
89
- 'X-Source-Origin': 'houseofx.nyc',
73
+ 'X-Source-Origin': CONFIGS.X_SOURCE_ORIGIN,
90
74
  }
91
75
  config.headers = updatedHeaders
92
76
  }
@@ -107,6 +91,10 @@ publicRequest.setBaseUrl = (baseUrl: string) =>
107
91
  publicRequest.setAccessToken = token =>
108
92
  (publicRequest.defaults.headers.common.Authorization = token)
109
93
 
94
+ export const setXSourceOrigin = (sourceOrigin: string) => {
95
+ ttfHeaders['X-Source-Origin'] = sourceOrigin
96
+ }
97
+
110
98
  export const setCustomHeader = (response: any) => {
111
99
  const guestHeaderResponseValue = _get(
112
100
  response,
@@ -0,0 +1,3 @@
1
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47717 15.5228 0 10 0C4.47717 0 0 4.47717 0 10C0 15.5228 4.47717 20 10 20ZM8.14661 15.8678L16.8782 6.39722C16.9561 6.31335 17 6.19922 17 6.08008C17 5.96094 16.9561 5.8468 16.8782 5.76282L16.3016 5.12854C16.1386 4.95715 15.8796 4.95715 15.7167 5.12854L7.85004 13.661L4.28326 9.79236C4.20593 9.70776 4.10071 9.66016 3.99084 9.66016C3.9353 9.66016 3.88086 9.67236 3.83069 9.69531C3.78168 9.71777 3.73663 9.75061 3.69843 9.79236L3.12183 10.4177C3.07635 10.4667 3.04248 10.5259 3.02216 10.5905C3.00763 10.6365 3 10.6853 3 10.735C3 10.8541 3.04388 10.9683 3.12183 11.0521L7.56177 15.8678C7.6391 15.9524 7.74438 16 7.85419 16C7.96399 16 8.06927 15.9524 8.14661 15.8678Z" fill="#569F44"/>
3
+ </svg>
@@ -46,11 +46,8 @@ import { getQueryVariable } from '../../utils/getQueryVariable'
46
46
  import { SelectField } from '../common/SelectField'
47
47
  import { ErrorFocus } from '../../utils/formikErrorFocus'
48
48
  import { FormikPhoneNumberField } from '../common/FormikPhoneNumberField'
49
- import { getImage } from '../../utils/getImage'
50
49
  import { ThemeProvider, createTheme } from '@mui/material/styles'
51
50
 
52
- const TTFLOGO = getImage('logo-ttf.png')
53
-
54
51
  export interface IBillingInfoPage {
55
52
  data?: IBillingInfoData[];
56
53
  ticketHoldersFields?: IBillingInfoData;
@@ -66,7 +63,7 @@ export interface IBillingInfoPage {
66
63
  refreshToken: string;
67
64
  }) => void;
68
65
 
69
- onRegisterError?: (e: AxiosError) => void;
66
+ onRegisterError?: (e: AxiosError, email: string) => void;
70
67
 
71
68
  onSubmitError?: (e: AxiosError) => void;
72
69
 
@@ -97,7 +94,9 @@ export interface IBillingInfoPage {
97
94
  buttonName?: string;
98
95
  theme?: 'light' | 'dark';
99
96
  isLoggedIn?: boolean;
100
- fontFamily?: string
97
+ accountInfoTitle?: string | JSX.Element;
98
+ fontFamily?: string;
99
+ hideLogo?: boolean;
101
100
  }
102
101
 
103
102
  const LogicRunner: FC<{
@@ -200,15 +199,17 @@ export const BillingInfoContainer = ({
200
199
  onGetProfileDataError = () => {},
201
200
  onAuthorizeSuccess = () => {},
202
201
  onAuthorizeError = () => {},
203
- onLogin = () => {},
202
+ onLogin,
204
203
  onLoginSuccess = () => {},
205
204
  isLoggedIn: pIsLoggedIn = false,
206
- fontFamily
205
+ accountInfoTitle = '',
206
+ fontFamily,
207
+ hideLogo,
207
208
  }: IBillingInfoPage) => {
208
209
  const themeMui = createTheme({
209
210
  typography: {
210
211
  allVariants: {
211
- fontFamily
212
+ fontFamily,
212
213
  },
213
214
  },
214
215
  })
@@ -279,9 +280,11 @@ export const BillingInfoContainer = ({
279
280
  }, [])
280
281
 
281
282
  useEffect(() => {
282
- isWindowDefined && window.document.addEventListener("auth_error", handleAuthErrors)
283
+ isWindowDefined &&
284
+ window.document.addEventListener('auth_error', handleAuthErrors)
283
285
  return () => {
284
- isWindowDefined && window.document.removeEventListener("auth_error", handleAuthErrors)
286
+ isWindowDefined &&
287
+ window.document.removeEventListener('auth_error', handleAuthErrors)
285
288
  }
286
289
  }, [handleAuthErrors])
287
290
 
@@ -449,11 +452,12 @@ export const BillingInfoContainer = ({
449
452
  )
450
453
  }
451
454
 
452
- if (error?.email) {
455
+ if (error?.email && !onLogin) {
456
+ // False will stand for outside controll
453
457
  setAlreadyHasUser(true)
454
458
  setShowModalLogin(true)
455
459
  }
456
- onRegisterError(e)
460
+ onRegisterError(e, values.email)
457
461
  }
458
462
  return
459
463
  }
@@ -514,24 +518,35 @@ export const BillingInfoContainer = ({
514
518
  <div className={`billing-info-container ${theme}`}>
515
519
  {!isLoggedIn && (
516
520
  <div className="account-actions-block">
517
- <div>
518
- Got a <strong>TICKET</strong>FAIRY account?
519
- </div>
521
+ <div>{accountInfoTitle}</div>
520
522
  <div>Login & skip ahead:</div>
521
523
  <div className="login-block">
522
524
  <button
523
525
  className="login-register-button"
524
526
  type="button"
525
527
  onClick={() => {
526
- onLogin()
527
- setShowModalLogin(true)
528
+ // If outside login needed to skip package login functionallity
529
+ if (onLogin) {
530
+ onLogin()
531
+ } else {
532
+ setShowModalLogin(true)
533
+ }
528
534
  }}
529
535
  >
530
536
  Login
531
537
  </button>
532
- <div className="logo-image-container">
533
- <img src={TTFLOGO} alt="nodata" />
534
- </div>
538
+ {!hideLogo && (
539
+ <div className="logo-image-container">
540
+ <img
541
+ src={
542
+ theme === 'dark'
543
+ ? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg'
544
+ : 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg'
545
+ }
546
+ alt="nodata"
547
+ />
548
+ </div>
549
+ )}
535
550
  </div>
536
551
  </div>
537
552
  )}
@@ -582,7 +597,7 @@ export const BillingInfoContainer = ({
582
597
  ? CheckboxField
583
598
  : element.type === 'select'
584
599
  ? SelectField
585
- : element.type === 'phone'
600
+ : element.type === 'phone'
586
601
  ? FormikPhoneNumberField
587
602
  : CustomField
588
603
  }
@@ -18,6 +18,7 @@ export const CheckboxField = ({
18
18
  field,
19
19
  selectOptions,
20
20
  theme,
21
+ setFieldValue,
21
22
  ...rest
22
23
  }: ICheckboxField & IOtherProps) => (
23
24
  <FormGroup>
@@ -18,6 +18,7 @@ export const FormikPhoneNumberField = ({
18
18
  field,
19
19
  form: { touched, errors },
20
20
  setFieldValue,
21
+ selectOptions,
21
22
  ...rest
22
23
  }: INumberInField & IOtherProps) => {
23
24
  const error = _get(errors, field.name)
@@ -22,6 +22,7 @@ export interface IConfirmationPage {
22
22
  shareButtons: IShareButton[];
23
23
  onGetConfirmationDataSuccess: (res: any) => void;
24
24
  onGetConfirmationDataError: (e: AxiosError) => void;
25
+ orderHash?: string;
25
26
  }
26
27
 
27
28
  export const ConfirmationContainer = ({
@@ -31,6 +32,7 @@ export const ConfirmationContainer = ({
31
32
  shareButtons = [],
32
33
  onGetConfirmationDataSuccess = () => {},
33
34
  onGetConfirmationDataError = () => {},
35
+ orderHash,
34
36
  }: IConfirmationPage) => {
35
37
  const inputRef = useRef(null)
36
38
  const [data, setData] = useState<any>(null)
@@ -40,28 +42,40 @@ export const ConfirmationContainer = ({
40
42
  useEffect(() => {
41
43
  (async () => {
42
44
  const dataEncoded =
43
- typeof window !== 'undefined' &&
44
- window.localStorage.getItem('checkoutData')
45
- if (dataEncoded) {
46
- const dataDecoded = JSON.parse(dataEncoded)
47
- const { hash } = dataDecoded
45
+ (typeof window !== 'undefined' &&
46
+ window.localStorage.getItem('checkoutData')) ||
47
+ ''
48
48
 
49
+ const dataDecoded = dataEncoded
50
+ ? JSON.parse(dataEncoded)
51
+ : { hash: orderHash }
52
+ const { hash } = dataDecoded
53
+
54
+ if (hash) {
49
55
  try {
50
56
  const response = await getConfirmationData(hash)
51
57
  const data = _get(response, 'data.data.attributes')
52
- data.personal_share_sales = data.personal_share_sales.map((d: any) => {
53
- const salesData: IReferralPromotion = { label: `If your friends buy ${d.sales} tickets`, price: '' }
54
- if(d.price === 0) {
55
- salesData.subLabel = 'Your ticket becomes'
56
- salesData.price = 'FREE!'
57
- } else {
58
- salesData.subLabel = 'Your ticket goes down to'
59
- salesData.price = data.currency.symbol + d.price?.toFixed(2)
60
- }
58
+ data.personal_share_sales = data.personal_share_sales.map(
59
+ (d: any) => {
60
+ const salesData: IReferralPromotion = {
61
+ label: `If your friends buy ${d.sales} tickets`,
62
+ price: '',
63
+ }
64
+ if (d.price === 0) {
65
+ salesData.subLabel = 'Your ticket becomes'
66
+ salesData.price = 'FREE!'
67
+ } else {
68
+ salesData.subLabel = 'Your ticket goes down to'
69
+ salesData.price = data.currency.symbol + d.price?.toFixed(2)
70
+ }
61
71
 
62
- return salesData
72
+ return salesData
73
+ }
74
+ )
75
+ data.personal_share_sales.unshift({
76
+ label: 'Your ticket is currently',
77
+ price: data.currency.symbol + data.product_price?.toFixed(2),
63
78
  })
64
- data.personal_share_sales.unshift({ label: 'Your ticket is currently', price: data.currency.symbol + data.product_price?.toFixed(2) })
65
79
  setData(data)
66
80
  onGetConfirmationDataSuccess(response.data)
67
81
  } catch (error) {
@@ -75,7 +89,7 @@ export const ConfirmationContainer = ({
75
89
  const newData = { ...data, personal_share_link: e.target.value }
76
90
  setData(newData)
77
91
  }
78
-
92
+
79
93
  return (
80
94
  <div className="confirmation-page">
81
95
  {data && (
@@ -83,9 +97,11 @@ export const ConfirmationContainer = ({
83
97
  <p className="title">Your Tickets are Confirmed!</p>
84
98
  <div className="share-message-section">
85
99
  <span className="main">Your tickets have been emailed to you</span>
86
- <span className="helper">Please bring them with you to the event</span>
100
+ <span className="helper">
101
+ Please bring them with you to the event
102
+ </span>
87
103
  </div>
88
- { data.disable_referral === false && isReferralEnabled && (
104
+ {data.disable_referral === false && isReferralEnabled && (
89
105
  <>
90
106
  <div className="referral_text_image_section">
91
107
  <div className="referral_text_section">
@@ -123,12 +139,17 @@ export const ConfirmationContainer = ({
123
139
  onChange={onChangeShareLink}
124
140
  />
125
141
  <div
126
- className='share-by-link-copy-icon'
127
- onClick={() => navigator.clipboard.writeText(
142
+ className="share-by-link-copy-icon"
143
+ onClick={() =>
144
+ navigator.clipboard.writeText(
128
145
  _get(inputRef, 'current.value')
129
- )}
146
+ )
147
+ }
130
148
  >
131
- <img src="https://img.icons8.com/office/50/000000/copy.png" alt='copy' />
149
+ <img
150
+ src="https://img.icons8.com/office/50/000000/copy.png"
151
+ alt="copy"
152
+ />
132
153
  </div>
133
154
  </div>
134
155
  </div>
@@ -146,27 +167,22 @@ export const ConfirmationContainer = ({
146
167
  </div>
147
168
  <div className="pricing-section">
148
169
  <div className="invitation_title">How much cheaper?</div>
149
- {_map(data.personal_share_sales, (pricing, index) => {
150
- return (
151
- <div
152
- key={index}
153
- className='pricing-section_wrapper'
154
- >
155
- <div className="pricing-section_label">
156
- {pricing.label}
157
- {pricing.subLabel && (
158
- <div className="pricing-section_sublabel">
159
- {pricing.subLabel}
160
- </div>
161
- )}
162
- </div>
163
- <div className="pricing-section_price">
164
- {' '}
165
- {pricing.price}
166
- </div>
170
+ {_map(data.personal_share_sales, (pricing, index) => (
171
+ <div key={index} className="pricing-section_wrapper">
172
+ <div className="pricing-section_label">
173
+ {pricing.label}
174
+ {pricing.subLabel && (
175
+ <div className="pricing-section_sublabel">
176
+ {pricing.subLabel}
177
+ </div>
178
+ )}
167
179
  </div>
168
- )
169
- })}
180
+ <div className="pricing-section_price">
181
+ {' '}
182
+ {pricing.price}
183
+ </div>
184
+ </div>
185
+ ))}
170
186
  </div>
171
187
  </div>
172
188
  </>
@@ -1,9 +1,10 @@
1
1
  import React, { useEffect, useState } from 'react'
2
2
  import { AxiosError } from 'axios'
3
3
  import Container from '@mui/material/Container'
4
+ import CircularProgress from '@mui/material/CircularProgress'
4
5
  import Alert from '@mui/material/Alert'
5
6
  import { Elements } from '@stripe/react-stripe-js'
6
- import { loadStripe } from '@stripe/stripe-js'
7
+ import { loadStripe, StripeConstructorOptions } from '@stripe/stripe-js'
7
8
  import _map from 'lodash/map'
8
9
  import _get from 'lodash/get'
9
10
  import _identity from 'lodash/identity'
@@ -19,10 +20,33 @@ import { getPaymentData, handlePaymentSuccess, getConditions } from '../../api'
19
20
  import { StripeCardNumberElementOptions } from '@stripe/stripe-js'
20
21
  import { ThemeProvider, createTheme } from '@mui/material/styles'
21
22
 
22
- const publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || 'pk_test_3Ov1P1oP33A1cxaSjxWE0VjT'
23
- const stripePromise = loadStripe(
24
- publishableKey
25
- )
23
+ const publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || ''
24
+
25
+ const getStripePromise = (reviewData: any) => {
26
+ const stripePublishableKey = _get(
27
+ reviewData,
28
+ 'payment_method.stripe_publishable_key'
29
+ ) || publishableKey
30
+ const stripeAccount = _get(
31
+ reviewData,
32
+ 'payment_method.stripe_connected_account'
33
+ )
34
+
35
+ const options: StripeConstructorOptions = {}
36
+ if (stripeAccount) {
37
+ options.stripeAccount = stripeAccount
38
+ }
39
+
40
+ return loadStripe(stripePublishableKey, options)
41
+ }
42
+
43
+ function Loader() {
44
+ return (
45
+ <div className="loader-container">
46
+ <CircularProgress />
47
+ </div>
48
+ )
49
+ }
26
50
  export interface IPaymentPage {
27
51
  paymentFields: IPaymentField[];
28
52
  handlePayment: any;
@@ -34,7 +58,8 @@ export interface IPaymentPage {
34
58
  onGetPaymentDataError: (value: AxiosError) => void;
35
59
  onPaymentError: (value: AxiosError) => void;
36
60
  stripeCardOptions?: StripeCardNumberElementOptions;
37
- fontFamily?: string
61
+ disableZipSection: boolean;
62
+ fontFamily?: string;
38
63
  }
39
64
 
40
65
  const initialOrderValues: IOrderData = {
@@ -66,12 +91,14 @@ export const PaymentContainer = ({
66
91
  onGetPaymentDataError = () => {},
67
92
  onPaymentError = () => {},
68
93
  stripeCardOptions = {},
94
+ disableZipSection = false,
69
95
  fontFamily,
70
96
  }: IPaymentPage) => {
71
97
  const [reviewData, setReviewData] = useState(initialReviewValues)
72
98
  const [orderData, setOrderData] = useState(initialOrderValues)
73
99
  const [error, setError] = useState(null)
74
100
  const [paymentIsLoading, setPaymentIsLoading] = useState(false)
101
+ const [paymentDataIsLoading, setPaymentDataIsLoading] = useState(true)
75
102
  const [conditions, setConditions] = useState<{ id: string; text: string }[]>(
76
103
  []
77
104
  )
@@ -107,6 +134,8 @@ export const PaymentContainer = ({
107
134
  } catch (e) {
108
135
  setError(_get(e, 'response.data.message'))
109
136
  onGetPaymentDataError(e.response)
137
+ } finally {
138
+ setPaymentDataIsLoading(false)
110
139
  }
111
140
  })()
112
141
  }, [checkoutData])
@@ -158,7 +187,7 @@ export const PaymentContainer = ({
158
187
  const themeMui = createTheme({
159
188
  typography: {
160
189
  allVariants: {
161
- fontFamily
190
+ fontFamily,
162
191
  },
163
192
  },
164
193
  })
@@ -171,47 +200,59 @@ export const PaymentContainer = ({
171
200
  {error}
172
201
  </Alert>
173
202
  )}
174
- <Container maxWidth="md">
175
- {showFormTitle && <h1>{formTitle}</h1>}
176
- <div className="order_info_text">Order Review</div>
177
- <div className="order_info_section">
178
- {_map(paymentFields, field => {
179
- const { id, label, className = '', normalizer = _identity } = field
180
- return (
181
- <div key={id} className="order_info_block">
182
- <div className="order_info_title">{label}</div>
183
- <div className={`${className} order_info_text`}>
184
- {normalizer(orderData[id], orderData.currency)}
203
+ {paymentDataIsLoading && <Loader />}
204
+ {!paymentDataIsLoading && (
205
+ <Container maxWidth="md">
206
+ {showFormTitle && <h1>{formTitle}</h1>}
207
+ <div className="order_info_text">Order Review</div>
208
+ <div className="order_info_section">
209
+ {_map(paymentFields, field => {
210
+ const {
211
+ id,
212
+ label,
213
+ className = '',
214
+ normalizer = _identity,
215
+ } = field
216
+ return (
217
+ <div key={id} className="order_info_block">
218
+ <div className="order_info_title">{label}</div>
219
+ <div className={`${className} order_info_text`}>
220
+ {normalizer(orderData[id], orderData.currency)}
221
+ </div>
185
222
  </div>
186
- </div>
187
- )
188
- })}
189
- </div>
190
- <div className="payment_info">
191
- <div className="payment_info_label">
192
- Please provide your payment information
223
+ )
224
+ })}
193
225
  </div>
194
- {showErrorText && <p className="payment_info__error">{errorText}</p>}
195
- <div>
196
- <Elements stripe={stripePromise}>
197
- <StripePayment
198
- stripe_client_secret={
199
- reviewData.payment_method.stripe_client_secret
200
- }
201
- total={orderData.total}
202
- onSubmit={handlePaymentMiddleWare}
203
- error={error}
204
- currency={orderData.currency}
205
- billing_info={reviewData.billing_info}
206
- isLoading={paymentIsLoading}
207
- handleSetLoading={value => setPaymentIsLoading(value)}
208
- conditions={conditions}
209
- stripeCardOptions={stripeCardOptions}
210
- />
211
- </Elements>
226
+ <div className="payment_info">
227
+ <div className="payment_info_label">
228
+ Please provide your payment information
229
+ </div>
230
+ {showErrorText && (
231
+ <p className="payment_info__error">{errorText}</p>
232
+ )}
233
+ <div>
234
+ <Elements stripe={getStripePromise(reviewData)}>
235
+ <StripePayment
236
+ stripe_client_secret={_get(
237
+ reviewData,
238
+ 'payment_method.stripe_client_secret'
239
+ )}
240
+ total={orderData.total}
241
+ onSubmit={handlePaymentMiddleWare}
242
+ error={error}
243
+ currency={orderData.currency}
244
+ billing_info={reviewData.billing_info}
245
+ isLoading={paymentIsLoading}
246
+ handleSetLoading={value => setPaymentIsLoading(value)}
247
+ conditions={conditions}
248
+ stripeCardOptions={stripeCardOptions}
249
+ disableZipSection={disableZipSection}
250
+ />
251
+ </Elements>
252
+ </div>
212
253
  </div>
213
- </div>
214
- </Container>
254
+ </Container>
255
+ )}
215
256
  </div>
216
257
  </ThemeProvider>
217
258
  )