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.
- package/dist/api/index.d.ts +1 -1
- package/dist/components/billing-info-container/index.d.ts +2 -1
- package/dist/components/myTicketsContainer/index.d.ts +2 -1
- package/dist/components/orderDetailsContainer/index.d.ts +1 -1
- package/dist/components/paymentContainer/index.d.ts +2 -1
- package/dist/index.d.ts +3 -1
- package/dist/tf-checkout-react.cjs.development.js +408 -32
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +408 -34
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/package.json +2 -3
- package/src/api/index.ts +6 -0
- package/src/components/billing-info-container/index.tsx +24 -4
- package/src/components/common/CustomField.tsx +10 -25
- package/src/components/common/SelectField.tsx +0 -13
- package/src/components/myTicketsContainer/index.tsx +22 -10
- package/src/components/orderDetailsContainer/index.tsx +63 -29
- package/src/components/orderDetailsContainer/style.css +27 -8
- package/src/components/paymentContainer/index.tsx +58 -45
- package/src/components/ticketsContainer/TicketRow.tsx +3 -0
- package/src/index.ts +7 -2
|
@@ -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
|
-
<
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
{
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
<div className="
|
|
172
|
-
|
|
173
|
-
{
|
|
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
|
-
|
|
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
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
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
|
-
</
|
|
203
|
-
</
|
|
204
|
-
</
|
|
215
|
+
</Container>
|
|
216
|
+
</div>
|
|
217
|
+
</ThemeProvider>
|
|
205
218
|
)
|
|
206
219
|
}
|
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 {
|
|
6
|
-
|
|
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'
|