tf-checkout-react 1.0.62 → 1.0.66

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.
@@ -17,6 +17,7 @@ import { IOrderData, IPaymentField } from '../../types'
17
17
 
18
18
  import { getPaymentData, handlePaymentSuccess, getConditions } from '../../api'
19
19
  import { StripeCardNumberElementOptions } from '@stripe/stripe-js'
20
+ import { ThemeProvider, createTheme } from '@mui/material/styles'
20
21
 
21
22
  const testId = ENV.STRIPE_PUBLISHABLE_KEY || 'pk_test_3Ov1P1oP33A1cxaSjxWE0VjT'
22
23
  const stripePromise = loadStripe(
@@ -34,6 +35,7 @@ export interface IPaymentPage {
34
35
  onGetPaymentDataError: (value: AxiosError) => void;
35
36
  onPaymentError: (value: AxiosError) => void;
36
37
  stripeCardOptions?: StripeCardNumberElementOptions;
38
+ fontFamily?: string
37
39
  }
38
40
 
39
41
  const initialOrderValues: IOrderData = {
@@ -65,6 +67,7 @@ export const PaymentContainer = ({
65
67
  onGetPaymentDataError = () => {},
66
68
  onPaymentError = () => {},
67
69
  stripeCardOptions = {},
70
+ fontFamily,
68
71
  }: IPaymentPage) => {
69
72
  const [reviewData, setReviewData] = useState(initialReviewValues)
70
73
  const [orderData, setOrderData] = useState(initialOrderValues)
@@ -153,54 +156,64 @@ export const PaymentContainer = ({
153
156
  }
154
157
  }
155
158
 
159
+ const themeMui = createTheme({
160
+ typography: {
161
+ allVariants: {
162
+ fontFamily
163
+ },
164
+ },
165
+ })
166
+
156
167
  return (
157
- <div className="payment_page">
158
- {error && (
159
- <Alert severity="error" onClose={onErrorClose} variant="filled">
160
- {error}
161
- </Alert>
162
- )}
163
- <Container maxWidth="md">
164
- {showFormTitle && <h1>{formTitle}</h1>}
165
- <div className="order_info_text">Order Review</div>
166
- <div className="order_info_section">
167
- {_map(paymentFields, field => {
168
- const { id, label, className = '', normalizer = _identity } = field
169
- return (
170
- <div key={id} className="order_info_block">
171
- <div className="order_info_title">{label}</div>
172
- <div className={`${className} order_info_text`}>
173
- {normalizer(orderData[id], orderData.currency)}
168
+ <ThemeProvider theme={themeMui}>
169
+ <div className="payment_page">
170
+ {error && (
171
+ <Alert severity="error" onClose={onErrorClose} variant="filled">
172
+ {error}
173
+ </Alert>
174
+ )}
175
+ <Container maxWidth="md">
176
+ {showFormTitle && <h1>{formTitle}</h1>}
177
+ <div className="order_info_text">Order Review</div>
178
+ <div className="order_info_section">
179
+ {_map(paymentFields, field => {
180
+ const { id, label, className = '', normalizer = _identity } = field
181
+ return (
182
+ <div key={id} className="order_info_block">
183
+ <div className="order_info_title">{label}</div>
184
+ <div className={`${className} order_info_text`}>
185
+ {normalizer(orderData[id], orderData.currency)}
186
+ </div>
174
187
  </div>
175
- </div>
176
- )
177
- })}
178
- </div>
179
- <div className="payment_info">
180
- <div className="payment_info_label">
181
- Please provide your payment information
188
+ )
189
+ })}
182
190
  </div>
183
- {showErrorText && <p className="payment_info__error">{errorText}</p>}
184
- <div>
185
- <Elements stripe={stripePromise}>
186
- <StripePayment
187
- stripe_client_secret={
188
- reviewData.payment_method.stripe_client_secret
189
- }
190
- total={orderData.total}
191
- onSubmit={handlePaymentMiddleWare}
192
- error={error}
193
- currency={orderData.currency}
194
- billing_info={reviewData.billing_info}
195
- isLoading={paymentIsLoading}
196
- handleSetLoading={value => setPaymentIsLoading(value)}
197
- conditions={conditions}
198
- stripeCardOptions={stripeCardOptions}
199
- />
200
- </Elements>
191
+ <div className="payment_info">
192
+ <div className="payment_info_label">
193
+ Please provide your payment information
194
+ </div>
195
+ {showErrorText && <p className="payment_info__error">{errorText}</p>}
196
+ <div>
197
+ <Elements stripe={stripePromise}>
198
+ <StripePayment
199
+ stripe_client_secret={
200
+ reviewData.payment_method.stripe_client_secret
201
+ }
202
+ total={orderData.total}
203
+ onSubmit={handlePaymentMiddleWare}
204
+ error={error}
205
+ currency={orderData.currency}
206
+ billing_info={reviewData.billing_info}
207
+ isLoading={paymentIsLoading}
208
+ handleSetLoading={value => setPaymentIsLoading(value)}
209
+ conditions={conditions}
210
+ stripeCardOptions={stripeCardOptions}
211
+ />
212
+ </Elements>
213
+ </div>
201
214
  </div>
202
- </div>
203
- </Container>
204
- </div>
215
+ </Container>
216
+ </div>
217
+ </ThemeProvider>
205
218
  )
206
219
  }
@@ -41,6 +41,9 @@ export const TicketRow = ({
41
41
  <Box className="get-tickets__selectbox">
42
42
  <FormControl fullWidth>
43
43
  <Select
44
+ sx={{
45
+ borderRadius: 0,
46
+ }}
44
47
  value={
45
48
  selectedTickets[ticketTier.id]
46
49
  ? selectedTickets[ticketTier.id]
package/src/index.ts CHANGED
@@ -2,5 +2,10 @@ export { BillingInfoContainer } from './components/billing-info-container/index'
2
2
  export { PaymentContainer } from './components/paymentContainer/index'
3
3
  export { ConfirmationContainer } from './components/confirmationContainer/index'
4
4
  export { TicketsContainer } from './components/ticketsContainer/index'
5
- export { currencyNormalizerCreator, createFixedFloatNormalizer } from './normalizers'
6
- export { LoginModal } from './components/loginModal'
5
+ export {
6
+ currencyNormalizerCreator,
7
+ createFixedFloatNormalizer,
8
+ } from './normalizers'
9
+ export { LoginModal } from './components/loginModal'
10
+ export { MyTicketsContainer } from './components/myTicketsContainer'
11
+ export { OrderDetailsContainer } from './components/orderDetailsContainer'