tf-checkout-react-native 1.0.11 → 1.0.14
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/README.md +595 -294
- package/android/build.gradle +3 -3
- package/lib/api/ApiClient.d.ts +13 -21
- package/lib/api/ApiClient.js +122 -51
- package/lib/api/ApiClient.js.map +1 -1
- package/lib/api/types.d.ts +21 -11
- package/lib/components/login/Login.d.ts +1 -1
- package/lib/components/login/Login.js +22 -10
- package/lib/components/login/Login.js.map +1 -1
- package/lib/components/login/LoginView.d.ts +1 -1
- package/lib/components/login/LoginView.js +16 -13
- package/lib/components/login/LoginView.js.map +1 -1
- package/lib/components/login/styles.d.ts +2 -1
- package/lib/components/login/styles.js +2 -1
- package/lib/components/login/styles.js.map +1 -1
- package/lib/components/login/types.d.ts +19 -9
- package/lib/components/waitingList/WaitingList.d.ts +1 -1
- package/lib/components/waitingList/WaitingList.js +20 -3
- package/lib/components/waitingList/WaitingList.js.map +1 -1
- package/lib/components/waitingList/WaitingListView.js +19 -7
- package/lib/components/waitingList/WaitingListView.js.map +1 -1
- package/lib/components/waitingList/types.d.ts +10 -0
- package/lib/containers/billingInfo/Billing.d.ts +2 -1
- package/lib/containers/billingInfo/Billing.js +100 -66
- package/lib/containers/billingInfo/Billing.js.map +1 -1
- package/lib/containers/billingInfo/types.d.ts +42 -93
- package/lib/containers/checkout/Checkout.d.ts +1 -1
- package/lib/containers/checkout/Checkout.js +146 -50
- package/lib/containers/checkout/Checkout.js.map +1 -1
- package/lib/containers/checkout/styles.d.ts +2 -0
- package/lib/containers/checkout/styles.js +4 -2
- package/lib/containers/checkout/styles.js.map +1 -1
- package/lib/containers/checkout/types.d.ts +32 -8
- package/lib/containers/myOrderDetails/MyOrderDetails.js +21 -3
- package/lib/containers/myOrderDetails/MyOrderDetails.js.map +1 -1
- package/lib/containers/myOrderDetails/MyOrderDetailsView.js +10 -7
- package/lib/containers/myOrderDetails/MyOrderDetailsView.js.map +1 -1
- package/lib/containers/myOrderDetails/components/Notification.d.ts +10 -2
- package/lib/containers/myOrderDetails/components/Notification.js +5 -7
- package/lib/containers/myOrderDetails/components/Notification.js.map +1 -1
- package/lib/containers/myOrderDetails/types.d.ts +18 -0
- package/lib/containers/myOrders/MyOrders.js +37 -9
- package/lib/containers/myOrders/MyOrders.js.map +1 -1
- package/lib/containers/myOrders/MyOrdersView.d.ts +1 -1
- package/lib/containers/myOrders/MyOrdersView.js +3 -3
- package/lib/containers/myOrders/MyOrdersView.js.map +1 -1
- package/lib/containers/myOrders/types.d.ts +13 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.d.ts +1 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js +21 -5
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js.map +1 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.d.ts +2 -2
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js +4 -3
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js.map +1 -1
- package/lib/containers/purchaseConfirmation/types.d.ts +12 -1
- package/lib/containers/tickets/Tickets.d.ts +1 -1
- package/lib/containers/tickets/Tickets.js +59 -9
- package/lib/containers/tickets/Tickets.js.map +1 -1
- package/lib/containers/tickets/TicketsView.d.ts +1 -1
- package/lib/containers/tickets/TicketsView.js +5 -4
- package/lib/containers/tickets/TicketsView.js.map +1 -1
- package/lib/containers/tickets/components/TicketListItem.js +14 -7
- package/lib/containers/tickets/components/TicketListItem.js.map +1 -1
- package/lib/containers/tickets/components/types.d.ts +6 -0
- package/lib/containers/tickets/types.d.ts +28 -11
- package/lib/helpers/LocalStorage.d.ts +1 -1
- package/lib/helpers/LocalStorage.js +1 -3
- package/lib/helpers/LocalStorage.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/res/colors.d.ts +2 -2
- package/lib/res/colors.js +2 -18
- package/lib/res/colors.js.map +1 -1
- package/lib/types/IError.d.ts +5 -0
- package/lib/types/IError.js +2 -0
- package/lib/types/IError.js.map +1 -0
- package/lib/types/ITicket.d.ts +12 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/package.json +3 -3
- package/lib/containers/checkout/CheckoutView.d.ts +0 -3
- package/lib/containers/checkout/CheckoutView.js +0 -48
- package/lib/containers/checkout/CheckoutView.js.map +0 -1
package/README.md
CHANGED
|
@@ -6,50 +6,58 @@ React Native library for Ticket Fairy checkout.
|
|
|
6
6
|
|
|
7
7
|
Configure [ReactNative environment](https://reactnative.dev/docs/environment-setup) for desired platforms (iOS, Android or both).
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### React Native
|
|
10
|
+
|
|
11
|
+
- Suggested ReactNative version `0.66.3`
|
|
12
|
+
- Suggested Flipper version `0.66`
|
|
13
|
+
- React version `0.17.1`
|
|
14
|
+
|
|
15
|
+
### Android
|
|
10
16
|
|
|
11
17
|
- Android 5.0 (API level 21) and above
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- Compile Sdk Version and Target Sdk Version `
|
|
15
|
-
- Build Tools Version `30.0.
|
|
18
|
+
- Gradle plugin version `4.2.2`
|
|
19
|
+
- Gradle version `6.7.1`
|
|
20
|
+
- Compile Sdk Version and Target Sdk Version `30`
|
|
21
|
+
- Build Tools Version `30.0.2`
|
|
22
|
+
- Java version `1.8`
|
|
23
|
+
- Kotlin version `1.5.31`
|
|
16
24
|
|
|
17
25
|
Add the following to your Android Manifest as activity property.
|
|
18
26
|
|
|
19
|
-
```
|
|
20
|
-
android:exported="true"
|
|
21
|
-
```
|
|
22
|
-
|
|
23
27
|
To download the PDFs, add the `WRITE_EXTERNAL_STORAGE` permission to the Android's Manifest file.
|
|
24
28
|
|
|
25
29
|
```xml
|
|
26
30
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
|
27
31
|
```
|
|
28
32
|
|
|
29
|
-
|
|
33
|
+
### iOS
|
|
30
34
|
|
|
31
35
|
- Compatible with apps targeting iOS 11 or above.
|
|
36
|
+
- Pods version `1.10.1`
|
|
37
|
+
- Command Line Tools version `13.0`
|
|
32
38
|
|
|
33
39
|
To download the PDFs, add the following flags to `Info.plist` file:
|
|
34
40
|
|
|
41
|
+
```
|
|
35
42
|
- UIFileSharingEnabled: Application supports iTunes file sharing
|
|
36
43
|
- LSSupportsOpeningDocumentsInPlace: Supports opening documents in place
|
|
44
|
+
```
|
|
37
45
|
|
|
38
46
|
# Installation
|
|
39
47
|
|
|
40
|
-
```
|
|
48
|
+
```sh
|
|
41
49
|
yarn add tf-checkout-react-native
|
|
42
50
|
```
|
|
43
51
|
|
|
44
52
|
or
|
|
45
53
|
|
|
46
|
-
```
|
|
54
|
+
```sh
|
|
47
55
|
npm install tf-checkout-react-native
|
|
48
56
|
```
|
|
49
57
|
|
|
50
58
|
Make sure to install all the required dependencies in your project.
|
|
51
59
|
|
|
52
|
-
|
|
60
|
+
### Required for Android
|
|
53
61
|
|
|
54
62
|
Add below dependency to your `app/build.gradle` file with specified version (in our example we are using `1.4.0`).
|
|
55
63
|
|
|
@@ -61,7 +69,7 @@ Set appropriate style in your styles.xml file.
|
|
|
61
69
|
|
|
62
70
|
```xml
|
|
63
71
|
<style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
|
64
|
-
|
|
72
|
+
<!-- ... -->
|
|
65
73
|
</style>
|
|
66
74
|
```
|
|
67
75
|
|
|
@@ -79,7 +87,6 @@ Use it in your initial useEffect function:
|
|
|
79
87
|
useEffect(() => {
|
|
80
88
|
setConfig({
|
|
81
89
|
DOMAIN: 'https://yourdomain.mx',
|
|
82
|
-
IS_BILLING_STREET_NAME_REQUIRED: false,
|
|
83
90
|
})
|
|
84
91
|
}, [])
|
|
85
92
|
```
|
|
@@ -97,27 +104,23 @@ useEffect(() => {
|
|
|
97
104
|
ARE_SUB_BRANDS_INCLUDED?: boolean
|
|
98
105
|
}
|
|
99
106
|
```
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
`
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
`TIMEOUT` Set custom timeout for the APIs requests.
|
|
112
|
-
|
|
113
|
-
`ARE_SUB_BRANDS_INCLUDED` If true will include orders from the `BRAND` sub-brands.
|
|
107
|
+
### Props
|
|
108
|
+
| Property | Description |
|
|
109
|
+
| -------- | ----------- |
|
|
110
|
+
| DOMAIN | Specify your domains name example: `https://google.com` this is important to maintain cart session active and prevent it from expiring when user login in the BillingInfo component. |
|
|
111
|
+
| BASE_URL | If our dev team gives you a custom BASE_URL.|
|
|
112
|
+
| CLIENT_ID | Set your CLIENT_ID. |
|
|
113
|
+
| CLIENT_SECRET | Set your CLIENT_SECRET. |
|
|
114
|
+
| BRAND | Set your BRAND so users can only see this brand in their orders. |
|
|
115
|
+
| TIMEOUT | Set custom timeout for the APIs requests. |
|
|
116
|
+
| ARE_SUB_BRANDS_INCLUDED | If true will include orders from the `BRAND` sub-brands. Default `false`. |
|
|
114
117
|
|
|
115
118
|
# Run the example app
|
|
116
119
|
|
|
117
120
|
1. Clone this repo.
|
|
118
121
|
2. In the App.tsx file, update the `EVENT_ID` const with the assigned ID to be able to retrieve data from the server.
|
|
119
|
-
3. cd into the
|
|
120
|
-
4. cd into the
|
|
122
|
+
3. cd into the _root project_ folder and `yarn` or `npm install`.
|
|
123
|
+
4. cd into the _example_ folder and `yarn` or `npm install`.
|
|
121
124
|
- If running on iOS, cd into ios folder and `pod install && cd ..`.
|
|
122
125
|
5. Run `yarn ios` or `npm run ios` to initialize and run in the iPhone simulator.
|
|
123
126
|
6. If running on Android, run `yarn android` or `npm run android` to run it in the Android emulator or connected physical device.
|
|
@@ -126,41 +129,61 @@ useEffect(() => {
|
|
|
126
129
|
|
|
127
130
|
This library exports the following components:
|
|
128
131
|
|
|
129
|
-
|
|
132
|
+
### Login
|
|
130
133
|
|
|
131
134
|
Used to authenticate the user.
|
|
132
135
|
|
|
133
|
-
|
|
136
|
+
### Tickets
|
|
134
137
|
|
|
135
138
|
Will retrieve and show a list of tickets corresponding to `eventId`. It also includes a PromoCode component that validates it and updates the tickets list.
|
|
136
139
|
|
|
137
140
|
User can select what ticket type wants to buy and the quantity of tickets.
|
|
138
141
|
|
|
139
|
-
|
|
142
|
+
### Billing information
|
|
140
143
|
|
|
141
144
|
User will need to enter its data into a form to create a Ticket Fairy account. Also, depending on the number of tickets selected, will need to fill the information of each one of them.
|
|
142
145
|
|
|
143
|
-
|
|
146
|
+
### Checkout
|
|
144
147
|
|
|
145
148
|
Will show the order details and a card form that the user will need to fill with its card details.
|
|
146
149
|
|
|
147
150
|
TicketFairy doesn't store any card related data, we use [Stripe](https://stripe.com/) as payments solution.
|
|
148
151
|
|
|
149
|
-
|
|
152
|
+
### Purchase confirmation
|
|
150
153
|
|
|
151
154
|
This is shown once the payment is successfully completed, could show components to share the purchase in social media or refer it with friends to get discounts on the purchase.
|
|
152
155
|
|
|
153
|
-
|
|
156
|
+
### My Orders
|
|
154
157
|
|
|
155
158
|
Will show the purchased orders for the logged user.
|
|
156
159
|
|
|
157
|
-
|
|
160
|
+
### My Order details
|
|
158
161
|
|
|
159
162
|
Will show the details for the selected Order, it also allows the user to download the Ticket PDF.
|
|
160
163
|
|
|
161
|
-
#
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
# Component styling
|
|
165
|
+
### Button
|
|
166
|
+
```js
|
|
167
|
+
interface IButtonStyles {
|
|
168
|
+
container?: StyleProp<ViewStyle>
|
|
169
|
+
button?: StyleProp<ViewStyle>
|
|
170
|
+
text?: StyleProp<TextStyle>
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
### Input
|
|
174
|
+
```js
|
|
175
|
+
interface IInputStyles {
|
|
176
|
+
color?: ColorValue
|
|
177
|
+
container?: StyleProp<ViewStyle>
|
|
178
|
+
input?: StyleProp<TextStyle>
|
|
179
|
+
lineWidth?: number
|
|
180
|
+
activeLineWidth?: number
|
|
181
|
+
baseColor?: ColorValue
|
|
182
|
+
errorColor?: ColorValue
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
# Exported components
|
|
186
|
+
## Login
|
|
164
187
|
|
|
165
188
|
Import the component from the library
|
|
166
189
|
|
|
@@ -172,10 +195,23 @@ Then add it to the render function.
|
|
|
172
195
|
|
|
173
196
|
```js
|
|
174
197
|
<Login
|
|
175
|
-
onLoginSuccessful
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
198
|
+
onLoginSuccessful: (userProfile: IUserProfile, accessToken: string) => void
|
|
199
|
+
onLoginError?: (error: IError) => void
|
|
200
|
+
|
|
201
|
+
onFetchUserProfileError?: (error: IError) => void
|
|
202
|
+
onFetchUserProfileSuccess?: (data: any) => void
|
|
203
|
+
|
|
204
|
+
onFetchAccessTokenError?: (error: IError) => void
|
|
205
|
+
onFetchAccessTokenSuccess?: () => void
|
|
206
|
+
|
|
207
|
+
isLoginDialogVisible: boolean
|
|
208
|
+
showLoginDialog: () => void
|
|
209
|
+
hideLoginDialog: () => void
|
|
210
|
+
|
|
211
|
+
//Logout
|
|
212
|
+
onLogoutSuccess?: () => void
|
|
213
|
+
onLogoutError?: () => void
|
|
214
|
+
|
|
179
215
|
userFirstName={loggedUserName}
|
|
180
216
|
refs={{
|
|
181
217
|
inputs?: {
|
|
@@ -189,48 +225,36 @@ Then add it to the render function.
|
|
|
189
225
|
activityIndicator?: any
|
|
190
226
|
loadingText?: any
|
|
191
227
|
}}
|
|
228
|
+
brandImages={
|
|
229
|
+
containerStyle?: StyleProp<ViewStyle>
|
|
230
|
+
image1?: ImageSourcePropType
|
|
231
|
+
image1Style?: StyleProp<ImageStyle>
|
|
232
|
+
image2?: ImageSourcePropType
|
|
233
|
+
image2Style?: StyleProp<ImageStyle>
|
|
234
|
+
}
|
|
235
|
+
styles?: ILoginViewStyles
|
|
236
|
+
texts?: ILoginViewTexts
|
|
192
237
|
/>
|
|
193
238
|
```
|
|
194
239
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
When login was successful, return userProfile data and the access token to use if for future API requests.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
`showLoginDialog: () => void`
|
|
213
|
-
Callback to show the Login dialog.
|
|
214
|
-
|
|
215
|
-
`hideLoginDialog: () => void`
|
|
216
|
-
Callback to hide the login dialog.
|
|
217
|
-
|
|
218
|
-
`onLogoutSuccess?: () => void`
|
|
219
|
-
Use it to logout the authenticated user. It will delete all the stored data, including access token. Please make sure to update the `userFirstName` prop so the component will show the logged out view.
|
|
220
|
-
|
|
221
|
-
`onLogoutFail?: () => void`
|
|
222
|
-
Will be called if something went wrong while deleting the local data.
|
|
223
|
-
|
|
224
|
-
`styles?: ILoginViewStyles`
|
|
225
|
-
Use this to style your components.
|
|
226
|
-
|
|
227
|
-
`texts?: ILoginViewTexts`
|
|
228
|
-
Use this to change some texts that appear in this component.
|
|
229
|
-
|
|
230
|
-
`userFirstName?: string`
|
|
231
|
-
Once authenticated send the received firstName data to this prop, so the component can render the Logged in view.
|
|
240
|
+
### Props
|
|
241
|
+
| Property | Description |
|
|
242
|
+
|----------|-------------|
|
|
243
|
+
| onLoginSuccessful: (userProfile: IUserProfile, accessToken: string)` |When login was successful, return userProfile data and the access token to use if for future API requests.
|
|
244
|
+
| onLoginFailure?: (error: string) | When login fails will return the error received. |
|
|
245
|
+
| onFetchUserProfileFailure?: (error: string) | This is used if the authentication worked but the fetch of the userProfile failed. |
|
|
246
|
+
| onFetchAccessTokenFailure?: (error: string) | When the fetch of the access token failed. |
|
|
247
|
+
| isLoginDialogVisible: boolean | Flag to show or hide the login dialog. |
|
|
248
|
+
| showLoginDialog: () => void | Callback to show the Login dialog. |
|
|
249
|
+
| hideLoginDialog: () => void | Callback to hide the Login dialog. |
|
|
250
|
+
| onLogoutSuccess?: () => void | Use it to logout the authenticated user. It will delete all the stored data, including access token. Please make sure to update the `userFirstName` prop so the component will show the logged out view. |
|
|
251
|
+
|onLogoutFail?: () => void | Will be called if something went wrong while deleting the local data. |
|
|
252
|
+
|styles?: ILoginViewStyles | Use this to style your components. |
|
|
253
|
+
|texts?: ILoginViewTexts | Use this to change some texts that appear in this component. |
|
|
254
|
+
|userFirstName?: string | Once authenticated send the received firstName data to this prop, so the component can render the Logged in view. |
|
|
255
|
+
|brandImages?: ILoginBrandImages | Receives up to 2 images with their styles and the container style for the images. |
|
|
232
256
|
|
|
233
|
-
|
|
257
|
+
### styles
|
|
234
258
|
|
|
235
259
|
```js
|
|
236
260
|
interface ILoginViewStyles {
|
|
@@ -248,7 +272,6 @@ interface ILoginViewStyles {
|
|
|
248
272
|
input?: IInputStyles
|
|
249
273
|
title?: StyleProp<TextStyle>
|
|
250
274
|
message?: StyleProp<TextStyle>
|
|
251
|
-
logo?: StyleProp<ImageStyle>
|
|
252
275
|
}
|
|
253
276
|
loggedIn?: {
|
|
254
277
|
container?: StyleProp<ViewStyle>
|
|
@@ -258,16 +281,32 @@ interface ILoginViewStyles {
|
|
|
258
281
|
message?: StyleProp<TextStyle>
|
|
259
282
|
}
|
|
260
283
|
}
|
|
261
|
-
|
|
262
284
|
```
|
|
263
285
|
|
|
264
|
-
|
|
286
|
+
\*Note: Logos images styles are passed from the `brandImages` prop.
|
|
265
287
|
|
|
288
|
+
### texts
|
|
289
|
+
```js
|
|
290
|
+
{
|
|
291
|
+
loginButton?: string
|
|
292
|
+
logoutButton?: string
|
|
293
|
+
line1?: string
|
|
294
|
+
line2?: string
|
|
295
|
+
message?: string
|
|
296
|
+
dialog?: {
|
|
297
|
+
loginButton?: string
|
|
298
|
+
message?: string
|
|
299
|
+
}
|
|
300
|
+
logoutDialog?: {
|
|
301
|
+
title?: string
|
|
302
|
+
message?: string
|
|
303
|
+
confirm?: string
|
|
304
|
+
cancel?: string
|
|
305
|
+
}
|
|
306
|
+
```
|
|
266
307
|
---
|
|
267
308
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-

|
|
309
|
+
## Tickets
|
|
271
310
|
|
|
272
311
|
Import the component from the library
|
|
273
312
|
|
|
@@ -281,7 +320,72 @@ Then add it to the render function.
|
|
|
281
320
|
<Tickets eventId={EVENT_ID} onAddToCartSuccess={handleOnAddToCartSuccess} />
|
|
282
321
|
```
|
|
283
322
|
|
|
284
|
-
|
|
323
|
+
### Props
|
|
324
|
+
|
|
325
|
+
```js
|
|
326
|
+
{
|
|
327
|
+
eventId: number
|
|
328
|
+
|
|
329
|
+
// Callbacks for when user taps on GET Tickets button
|
|
330
|
+
onAddToCartSuccess: (data: {
|
|
331
|
+
isBillingRequired: boolean
|
|
332
|
+
isPhoneRequired?: boolean
|
|
333
|
+
isAgeRequired?: boolean
|
|
334
|
+
minimumAge?: number
|
|
335
|
+
isNameRequired?: boolean
|
|
336
|
+
}) => void
|
|
337
|
+
onAddToCartError?: (error: {
|
|
338
|
+
code: number
|
|
339
|
+
message: string
|
|
340
|
+
extraData?: any
|
|
341
|
+
}) => void
|
|
342
|
+
|
|
343
|
+
// Callbacks for fetching the tickets
|
|
344
|
+
onFetchTicketsError?: (error: {
|
|
345
|
+
code: number
|
|
346
|
+
message: string
|
|
347
|
+
extraData?: any
|
|
348
|
+
}) => void
|
|
349
|
+
|
|
350
|
+
// Callbacks for fetching the Event base on the eventId prop
|
|
351
|
+
onFetchTicketsSuccess?: (data: {
|
|
352
|
+
tickets: ITicket[]
|
|
353
|
+
promoCodeResponse: {
|
|
354
|
+
success?: boolean
|
|
355
|
+
message?: string
|
|
356
|
+
}
|
|
357
|
+
isInWaitingList: boolean
|
|
358
|
+
isAccessCodeRequired: boolean
|
|
359
|
+
}) => void
|
|
360
|
+
onFetchEventError?: (error: {
|
|
361
|
+
code: number
|
|
362
|
+
message: string
|
|
363
|
+
extraData?: any
|
|
364
|
+
}) => void
|
|
365
|
+
|
|
366
|
+
// Callbacks for Waiting list
|
|
367
|
+
onAddToWaitingListSuccess?: (data: any) => void
|
|
368
|
+
onAddToWaitingListError?: (error: {
|
|
369
|
+
code: number
|
|
370
|
+
message: string
|
|
371
|
+
extraData?: any
|
|
372
|
+
}) => void
|
|
373
|
+
|
|
374
|
+
styles?: ITicketsViewStyles
|
|
375
|
+
texts?: ITicketsViewTexts
|
|
376
|
+
|
|
377
|
+
isPromoEnabled?: boolean
|
|
378
|
+
isAccessCodeEnabled?: boolean
|
|
379
|
+
|
|
380
|
+
onPressMyOrders: () => void
|
|
381
|
+
onPressLogout?: () => void
|
|
382
|
+
|
|
383
|
+
// With the following 3 props you can control the visibility of the stock loading indicators and alerts, so you can use your own.
|
|
384
|
+
onLoadingChange?: (isLoading: boolean) => void
|
|
385
|
+
areAlertsEnabled?: boolean
|
|
386
|
+
areLoadingIndicatorsEnabled?: boolean
|
|
387
|
+
}
|
|
388
|
+
```
|
|
285
389
|
|
|
286
390
|
`eventId` is required in order to fetch the tickets from this event.
|
|
287
391
|
`onAddToCartSuccess` is called after the Add to Cart was completed successfully, it will return the following data:
|
|
@@ -289,17 +393,18 @@ Then add it to the render function.
|
|
|
289
393
|
```js
|
|
290
394
|
{
|
|
291
395
|
isBillingRequired: boolean
|
|
292
|
-
|
|
293
|
-
isAgeRequired
|
|
396
|
+
isPhoneRequired?: boolean
|
|
397
|
+
isAgeRequired?: boolean
|
|
398
|
+
minimumAge?: number
|
|
399
|
+
isNameRequired?: boolean
|
|
294
400
|
}
|
|
295
401
|
```
|
|
296
402
|
|
|
297
403
|
You can then call the `BillingInfo` component and pass them as props in the `cartProps` prop.
|
|
298
404
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
Receives several props to style its sub-components.
|
|
405
|
+
`onFetchTicketsSuccess` When tickets fetching was successful, will return fetched data, including `promoCodeResponse`.
|
|
302
406
|
|
|
407
|
+
### styles
|
|
303
408
|
```js
|
|
304
409
|
{
|
|
305
410
|
rootContainer?: ViewStyle
|
|
@@ -307,23 +412,109 @@ Receives several props to style its sub-components.
|
|
|
307
412
|
title?: TextStyle
|
|
308
413
|
getTicketsButtonDisabled?: IButtonStyles
|
|
309
414
|
getTicketsButtonActive?: IButtonStyles
|
|
310
|
-
promoCode?:
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
<img width="790" alt="props" src="https://user-images.githubusercontent.com/66479719/153976200-4bd6b254-6e80-49d6-bacc-076c59873434.png">
|
|
415
|
+
promoCode?: {
|
|
416
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
417
|
+
contentWrapper?: StyleProp<ViewStyle>
|
|
418
|
+
content?: StyleProp<ViewStyle>
|
|
419
|
+
input?: TextInputProps['style']
|
|
420
|
+
inputPlaceholderColor?: string
|
|
421
|
+
title?: StyleProp<TextStyle>
|
|
319
422
|
|
|
320
|
-
|
|
423
|
+
mainButton?: IButtonStyles
|
|
424
|
+
cancelButton?: IButtonStyles
|
|
425
|
+
applyButton?: IButtonStyles
|
|
426
|
+
applyDisabledButton?: IButtonStyles
|
|
321
427
|
|
|
322
|
-
<
|
|
428
|
+
messageContainer?: StyleProp<ViewStyle>
|
|
429
|
+
message?: StyleProp<TextStyle>
|
|
430
|
+
}
|
|
431
|
+
ticketList?: {
|
|
432
|
+
listContainer?: ViewStyle
|
|
433
|
+
item?: {
|
|
434
|
+
container?: ViewStyle
|
|
435
|
+
ticketName?: TextStyle
|
|
436
|
+
price?: TextStyle
|
|
437
|
+
oldPrice?: TextStyle
|
|
438
|
+
fees?: TextStyle
|
|
439
|
+
soldOutText?: TextStyle
|
|
440
|
+
soldOutContainer?: ViewStyle
|
|
441
|
+
dropdown?: IDropdownStyles
|
|
442
|
+
pricesContainer?: StyleProp<ViewStyle>
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
loading?: {
|
|
446
|
+
animation?: {
|
|
447
|
+
color?: ActivityIndicatorProps['color']
|
|
448
|
+
size?: ActivityIndicatorProps['size']
|
|
449
|
+
}
|
|
450
|
+
content?: ViewStyle
|
|
451
|
+
text?: TextStyle
|
|
452
|
+
}
|
|
453
|
+
waitingList?: {
|
|
454
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
455
|
+
title?: StyleProp<TextStyle>
|
|
456
|
+
button?: IButtonStyles
|
|
457
|
+
input?: IInputStyles
|
|
458
|
+
buttonDisabled?: IButtonStyles
|
|
459
|
+
success?: {
|
|
460
|
+
container?: StyleProp<ViewStyle>
|
|
461
|
+
title?: StyleProp<ViewStyle>
|
|
462
|
+
message?: StyleProp<ViewStyle>
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
loggedIn?: {
|
|
466
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
467
|
+
myOrdersButton?: IButtonStyles
|
|
468
|
+
logOutButton?: IButtonStyles
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
```
|
|
323
472
|
|
|
473
|
+
### texts
|
|
474
|
+
```js
|
|
475
|
+
{
|
|
476
|
+
promoCode?: {
|
|
477
|
+
promoCodeButton?: string
|
|
478
|
+
inputPlaceHolder?: string
|
|
479
|
+
apply?: string
|
|
480
|
+
cancel?: string
|
|
481
|
+
mainButton?: string
|
|
482
|
+
title?: string
|
|
483
|
+
}
|
|
484
|
+
getTicketsButton?: string
|
|
485
|
+
title?: string
|
|
486
|
+
waitingList?: {
|
|
487
|
+
title?: string
|
|
488
|
+
firstName?: string
|
|
489
|
+
lastName?: string
|
|
490
|
+
email?: string
|
|
491
|
+
button?: string
|
|
492
|
+
successTitle?: string
|
|
493
|
+
successMessage?: string
|
|
494
|
+
}
|
|
495
|
+
loggedInTexts?: {
|
|
496
|
+
logoutDialog?: {
|
|
497
|
+
title?: string
|
|
498
|
+
message?: string
|
|
499
|
+
confirmButton?: string
|
|
500
|
+
cancelButton?: string
|
|
501
|
+
}
|
|
502
|
+
myOrderButtonText?: string
|
|
503
|
+
logOutButtonText?: string
|
|
504
|
+
}
|
|
505
|
+
listItem?: {
|
|
506
|
+
soldOut?: string
|
|
507
|
+
salesNotStarted?: string
|
|
508
|
+
salesEnded?: string
|
|
509
|
+
inclFees?: string
|
|
510
|
+
exclFees?: string
|
|
511
|
+
free?: string
|
|
512
|
+
ticket?: string
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
```
|
|
324
516
|
---
|
|
325
|
-
|
|
326
|
-
# BillingInfo
|
|
517
|
+
## BillingInfo
|
|
327
518
|
|
|
328
519
|
Import the component from the library
|
|
329
520
|
|
|
@@ -335,73 +526,89 @@ Add it to the render function.
|
|
|
335
526
|
|
|
336
527
|
```js
|
|
337
528
|
<BillingInfo
|
|
338
|
-
cartProps:
|
|
529
|
+
cartProps: {
|
|
530
|
+
isBillingRequired: boolean
|
|
531
|
+
isNameRequired: boolean
|
|
532
|
+
isAgeRequired: boolean
|
|
533
|
+
isPhoneRequired: boolean
|
|
534
|
+
minimumAge: number
|
|
535
|
+
}
|
|
536
|
+
// registerNewUser
|
|
339
537
|
onRegisterSuccess?: (tokens: ITokens) => void
|
|
340
|
-
|
|
538
|
+
onRegisterError?: (error: string) => void
|
|
341
539
|
|
|
342
|
-
onCheckoutSuccess: (data:
|
|
343
|
-
|
|
540
|
+
onCheckoutSuccess: (data: {
|
|
541
|
+
id: string
|
|
542
|
+
hash: string
|
|
543
|
+
total: string
|
|
544
|
+
status: string
|
|
545
|
+
}) => void
|
|
546
|
+
onCheckoutError?: (error: IError) => void
|
|
344
547
|
|
|
345
548
|
onLoginSuccess: (data: any) => void
|
|
346
|
-
|
|
549
|
+
onLoginError?: (error: IError) => void
|
|
550
|
+
|
|
347
551
|
|
|
348
552
|
onFetchUserProfileSuccess?: (data: any) => void
|
|
349
|
-
|
|
553
|
+
onFetchUserProfileError?: (error: IError) => void
|
|
350
554
|
|
|
351
|
-
|
|
555
|
+
//fetchCart
|
|
556
|
+
onFetchCartError?: (error: IError) => void
|
|
557
|
+
onFetchCartSuccess?: () => void
|
|
352
558
|
|
|
353
|
-
|
|
354
|
-
|
|
559
|
+
// fetchCountries
|
|
560
|
+
onFetchCountriesError?: (error: IError) => void
|
|
561
|
+
onFetchCountriesSuccess?: () => void
|
|
355
562
|
|
|
356
|
-
|
|
563
|
+
// fetchState
|
|
564
|
+
onFetchStatesError?: (error: IError) => void
|
|
565
|
+
onFetchStatesSuccess?: () => void
|
|
357
566
|
|
|
358
|
-
|
|
359
|
-
|
|
567
|
+
// fetch Token
|
|
568
|
+
onFetchAccessTokenError?: (error: IError) => void
|
|
569
|
+
onFetchAccessTokenSuccess?: () => void
|
|
360
570
|
|
|
361
571
|
styles?: IBillingInfoViewStyles
|
|
362
572
|
texts?: IBillingInfoViewTexts
|
|
363
|
-
/>
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
## Props
|
|
367
|
-
|
|
368
|
-
### cartProps
|
|
369
|
-
|
|
370
|
-
will receive
|
|
371
|
-
|
|
372
|
-
```js
|
|
373
|
-
{
|
|
374
|
-
isBillingRequired: boolean
|
|
375
|
-
isNameRequired: boolean
|
|
376
|
-
isAgeRequired: boolean
|
|
377
|
-
}
|
|
378
|
-
```
|
|
379
573
|
|
|
380
|
-
|
|
574
|
+
styles?: IBillingInfoViewStyles
|
|
575
|
+
texts?: IBillingInfoViewTexts
|
|
381
576
|
|
|
382
|
-
|
|
577
|
+
// Configure the skipping component visible, when isBillingRequired is false
|
|
578
|
+
skipBillingConfig?: {
|
|
579
|
+
styles?: {
|
|
580
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
581
|
+
dialogContainer?: StyleProp<ViewStyle>
|
|
582
|
+
brandImage?: StyleProp<ImageStyle>
|
|
583
|
+
text?: StyleProp<TextStyle>
|
|
584
|
+
activityIndicator?: {
|
|
585
|
+
color?: ColorValue
|
|
586
|
+
size?: 'large' | 'small'
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
brandImage?: ImageSourcePropType
|
|
590
|
+
isActivityIndicatorVisible?: boolean
|
|
591
|
+
}
|
|
383
592
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
593
|
+
loginBrandImages?: {
|
|
594
|
+
containerStyle?: StyleProp<ViewStyle>
|
|
595
|
+
image1?: ImageSourcePropType
|
|
596
|
+
image1Style?: StyleProp<ImageStyle>
|
|
597
|
+
image2?: ImageSourcePropType
|
|
598
|
+
image2Style?: StyleProp<ImageStyle>
|
|
599
|
+
}
|
|
600
|
+
/>
|
|
391
601
|
```
|
|
392
602
|
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
Will skip the need of holder names information and will be automatically filled with the logged user data.
|
|
603
|
+
### Props
|
|
604
|
+
| Property | Description |
|
|
605
|
+
|----------|-------------|
|
|
606
|
+
| cartProps | Received from the Tickets component |
|
|
607
|
+
| onCheckoutSuccess | Will return Order data from the Checkout action |
|
|
608
|
+
| loginBrandImages | Receives styles and images sources to show in the `Login` component |
|
|
609
|
+
| skipBillingConfig | Configure the skipping component, visible when `isBillingRequired` is set to false |
|
|
402
610
|
|
|
403
611
|
### texts
|
|
404
|
-
|
|
405
612
|
```js
|
|
406
613
|
interface IBillingInfoViewTexts {
|
|
407
614
|
loginTexts?: ILoginViewTexts
|
|
@@ -451,28 +658,22 @@ interface IBillingInfoViewStyles {
|
|
|
451
658
|
dropdownStyles?: IDropdownStyles
|
|
452
659
|
checkboxStyles?: ICheckboxStyles
|
|
453
660
|
|
|
454
|
-
|
|
455
|
-
|
|
661
|
+
screenTitle?: StyleProp<TextStyle>
|
|
662
|
+
ticketHoldersTitle?: StyleProp<TextStyle>
|
|
663
|
+
ticketHolderItemHeader?: StyleProp<TextStyle>
|
|
664
|
+
|
|
456
665
|
texts?: StyleProp<TextStyle>
|
|
457
666
|
customCheckbox?: ICheckboxStyles
|
|
458
667
|
|
|
459
668
|
datePicker?: IDatePickerStyles
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
dialogContainer?: StyleProp<ViewStyle>
|
|
463
|
-
brandImage?: StyleProp<ImageStyle>
|
|
464
|
-
message?: StyleProp<TextStyle>
|
|
465
|
-
spinner?: {
|
|
466
|
-
color: ColorValue
|
|
467
|
-
size: 'large' | 'small'
|
|
468
|
-
}
|
|
469
|
-
}
|
|
669
|
+
|
|
670
|
+
privacyPolicyLinkStyle?: StyleProp<TextStyle>
|
|
470
671
|
}
|
|
471
672
|
```
|
|
472
673
|
|
|
473
674
|
---
|
|
474
675
|
|
|
475
|
-
|
|
676
|
+
## Checkout
|
|
476
677
|
|
|
477
678
|
Import the component from the library
|
|
478
679
|
|
|
@@ -485,23 +686,68 @@ Add it to the render function.
|
|
|
485
686
|
```js
|
|
486
687
|
<Checkout
|
|
487
688
|
eventId={EVENT_ID}
|
|
488
|
-
hash={
|
|
489
|
-
total={
|
|
689
|
+
hash={hash}
|
|
690
|
+
total={total}
|
|
490
691
|
onPaymentSuccess={handleOnPaymentSuccess}
|
|
692
|
+
onPressExit={handleStripeError}
|
|
693
|
+
areLoadingIndicatorsEnabled={false}
|
|
694
|
+
styles={styles}
|
|
695
|
+
{...props}
|
|
491
696
|
/>
|
|
492
697
|
```
|
|
493
698
|
|
|
494
|
-
|
|
699
|
+
### Props
|
|
700
|
+
|
|
701
|
+
```js
|
|
702
|
+
{
|
|
703
|
+
eventId: number
|
|
704
|
+
hash: string
|
|
705
|
+
total: string
|
|
706
|
+
|
|
707
|
+
onFetchOrderReviewError?: (error: IError) => void
|
|
708
|
+
onFetchOrderReviewSuccess?: (data: any) => void
|
|
709
|
+
|
|
710
|
+
onFetchEventConditionsError?: (error: IError) => void
|
|
711
|
+
onFetchEventConditionsSuccess?: (data: any) => void
|
|
712
|
+
|
|
713
|
+
onCheckoutCompletedSuccess?: (data: any) => void
|
|
714
|
+
onCheckoutCompletedError?: (error: IError) => void
|
|
715
|
+
|
|
716
|
+
onPaymentSuccess: (data: any) => void
|
|
717
|
+
onPaymentError?: (error: IError) => void
|
|
718
|
+
|
|
719
|
+
onStripeInitializeError?: (error: string) => void
|
|
495
720
|
|
|
496
|
-
|
|
721
|
+
onPressExit: () => void
|
|
497
722
|
|
|
498
|
-
|
|
723
|
+
texts?: {
|
|
724
|
+
title?: string
|
|
725
|
+
subTitle?: string
|
|
726
|
+
missingStripeConfigMessage?: string
|
|
727
|
+
exitButton?: string
|
|
728
|
+
payButton?: string
|
|
729
|
+
freeRegistrationButton?: string
|
|
730
|
+
}
|
|
499
731
|
|
|
500
|
-
|
|
732
|
+
styles?: ICheckoutStyles
|
|
733
|
+
|
|
734
|
+
onLoadingChange?: (isLoading: boolean) => void
|
|
735
|
+
areAlertsEnabled?: boolean
|
|
736
|
+
areLoadingIndicatorsEnabled?: boolean
|
|
737
|
+
}
|
|
738
|
+
```
|
|
739
|
+
| Property | Description |
|
|
740
|
+
|----------|-------------|
|
|
741
|
+
| eventId | Same as used in the `Tickets` component. |
|
|
742
|
+
| hash | retrieved from the `onCheckoutSuccess` callback in the `BillingInfo`component. |
|
|
743
|
+
| total | retrieved from the `onCheckoutSuccess` callback in the `BillingInfo` component. |
|
|
744
|
+
| onPaymentSuccess | will handle the success in the payment process. Will return the `hash`. |
|
|
745
|
+
| areLoadingIndicatorsEnabled | whether or not show the Loading Indicator, `default: true`. |
|
|
746
|
+
| areAlertsEnabled | whether or not show the Error Alerts, `default: true`. |
|
|
501
747
|
|
|
502
|
-
If the you need to modify the card container, use the `styles.payment.cardContainer` prop. Useful if the card is to short and the zip code is not visible
|
|
748
|
+
*Note: If the you need to modify the card container, use the `styles.payment.cardContainer` prop. Useful if the card is to short and the zip code is not visible.*
|
|
503
749
|
|
|
504
|
-
|
|
750
|
+
### styles
|
|
505
751
|
|
|
506
752
|
```js
|
|
507
753
|
{
|
|
@@ -525,9 +771,17 @@ If the you need to modify the card container, use the `styles.payment.cardContai
|
|
|
525
771
|
}
|
|
526
772
|
```
|
|
527
773
|
|
|
528
|
-
|
|
774
|
+
### Stripe
|
|
775
|
+
|
|
776
|
+
Currently, Stripe card is not customizable. Please see the open issues in their Github.
|
|
529
777
|
|
|
530
|
-
|
|
778
|
+
- [563](https://github.com/stripe/stripe-react-native/issues/563)
|
|
779
|
+
- [285](https://github.com/stripe/stripe-react-native/issues/285)
|
|
780
|
+
|
|
781
|
+
Additionally, if you are encountering problems with building your project, please take a look at the [Stripe troubleshooting](https://github.com/stripe/stripe-react-native#troubleshooting).
|
|
782
|
+
|
|
783
|
+
---
|
|
784
|
+
## Purchase Confirmation
|
|
531
785
|
|
|
532
786
|
Import the component from the library
|
|
533
787
|
|
|
@@ -541,19 +795,44 @@ Add it to the render function.
|
|
|
541
795
|
<PurchaseConfirmation
|
|
542
796
|
orderHash={checkoutProps!.hash}
|
|
543
797
|
onComplete={handleOnComplete}
|
|
544
|
-
/>
|
|
545
|
-
```
|
|
546
|
-
|
|
547
|
-
`orderHash` the `hash` returned in the `BillingInfo` component.
|
|
548
798
|
|
|
549
|
-
|
|
799
|
+
styles?: {
|
|
800
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
801
|
+
title?: StyleProp<TextStyle>
|
|
550
802
|
|
|
551
|
-
|
|
803
|
+
message?: {
|
|
804
|
+
container?: StyleProp<ViewStyle>
|
|
805
|
+
line1?: StyleProp<TextStyle>
|
|
806
|
+
line2?: StyleProp<TextStyle>
|
|
807
|
+
}
|
|
808
|
+
exitButton?: {
|
|
809
|
+
container?: StyleProp<ViewStyle>
|
|
810
|
+
button?: StyleProp<ViewStyle>
|
|
811
|
+
text?: StyleProp<TextStyle>
|
|
812
|
+
}
|
|
813
|
+
}
|
|
552
814
|
|
|
553
|
-
|
|
815
|
+
texts?: {
|
|
816
|
+
title?: string
|
|
817
|
+
message?: {
|
|
818
|
+
line1?: string
|
|
819
|
+
line2?: string
|
|
820
|
+
}
|
|
821
|
+
exitButton?: string
|
|
822
|
+
}
|
|
823
|
+
/>
|
|
824
|
+
```
|
|
825
|
+
### Props
|
|
826
|
+
| Property | Description |
|
|
827
|
+
|----------|-------------|
|
|
828
|
+
| orderHash | The `hash` returned in the `BillingInfo` component |
|
|
829
|
+
| onComplete | To handle the completion of the flow. Here you can handle the unmount of the component or navigate to another screen |
|
|
830
|
+
| styles | Styles for the component |
|
|
831
|
+
| texts | Texts for the component |
|
|
554
832
|
|
|
555
|
-

|
|
556
833
|
|
|
834
|
+
---
|
|
835
|
+
## My Orders
|
|
557
836
|
If there is a valid session, there will appear a button to access `MyOrders` in the `Tickets` component.
|
|
558
837
|
|
|
559
838
|
Import the component from the library.
|
|
@@ -562,80 +841,116 @@ Import the component from the library.
|
|
|
562
841
|
import { MyOrders } from 'tf-checkout-react-native'
|
|
563
842
|
```
|
|
564
843
|
|
|
565
|
-
There is no need to pass any data prop to it.
|
|
566
844
|
|
|
567
845
|
### Props
|
|
568
846
|
|
|
569
|
-
|
|
847
|
+
```js
|
|
848
|
+
{
|
|
849
|
+
onSelectOrder: (order: {
|
|
850
|
+
order: {
|
|
851
|
+
header: {
|
|
852
|
+
isReferralDisabled: boolean
|
|
853
|
+
shareLink: string
|
|
854
|
+
total: string
|
|
855
|
+
salesReferred: string
|
|
856
|
+
},
|
|
857
|
+
items: [
|
|
858
|
+
{
|
|
859
|
+
name: string
|
|
860
|
+
currency: string
|
|
861
|
+
price: string
|
|
862
|
+
discount: string
|
|
863
|
+
quantity: string
|
|
864
|
+
total: string
|
|
865
|
+
},
|
|
866
|
+
{...}
|
|
867
|
+
],
|
|
868
|
+
tickets: [
|
|
869
|
+
{
|
|
870
|
+
hash: string
|
|
871
|
+
ticketType: string
|
|
872
|
+
holderName: string
|
|
873
|
+
status: string
|
|
874
|
+
pdfLink: string
|
|
875
|
+
},
|
|
876
|
+
{...}
|
|
877
|
+
]
|
|
878
|
+
}
|
|
879
|
+
}) => void
|
|
570
880
|
|
|
571
|
-
|
|
881
|
+
onFetchMyOrdersSuccess?: () => void
|
|
882
|
+
onFetchMyOrdersError?: (error: IError) => void
|
|
572
883
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
isEventsDropdownHidden: true,
|
|
576
|
-
}}
|
|
577
|
-
```
|
|
884
|
+
onFetchOrderDetailsSuccess?: () => void
|
|
885
|
+
onFetchOrderDetailsError?: (error: IError) => void
|
|
578
886
|
|
|
579
|
-
|
|
887
|
+
onLoadingChange?: (isLoading: boolean) => void
|
|
580
888
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
{
|
|
591
|
-
name: string
|
|
592
|
-
currency: string
|
|
593
|
-
price: string
|
|
594
|
-
discount: string
|
|
595
|
-
quantity: string
|
|
596
|
-
total: string
|
|
597
|
-
},
|
|
598
|
-
{...}
|
|
599
|
-
],
|
|
600
|
-
tickets: [
|
|
601
|
-
{
|
|
602
|
-
hash: string
|
|
603
|
-
ticketType: string
|
|
604
|
-
holderName: string
|
|
605
|
-
status: string
|
|
606
|
-
pdfLink: string
|
|
607
|
-
},
|
|
608
|
-
{...}
|
|
609
|
-
]
|
|
889
|
+
styles?: IMyOrdersStyles
|
|
890
|
+
config?: {
|
|
891
|
+
isEventsDropdownHidden?: boolean
|
|
892
|
+
areActivityIndicatorsEnabled?: boolean
|
|
893
|
+
areAlertsEnabled?: boolean
|
|
894
|
+
}
|
|
895
|
+
texts?: {
|
|
896
|
+
selectEventPlaceholder?: string
|
|
897
|
+
}
|
|
610
898
|
}
|
|
611
899
|
```
|
|
612
900
|
|
|
613
|
-
|
|
614
|
-
|
|
901
|
+
### styles
|
|
615
902
|
```js
|
|
616
|
-
|
|
617
|
-
orderListItem?:
|
|
903
|
+
{
|
|
904
|
+
orderListItem?: {
|
|
905
|
+
rootContainer?: StyleProp<ViewStyle>
|
|
906
|
+
contentContainer?: StyleProp<ViewStyle>
|
|
907
|
+
infoContainer?: StyleProp<ViewStyle>
|
|
908
|
+
infoTopContainer?: StyleProp<ViewStyle>
|
|
909
|
+
infoBottomContainer?: StyleProp<ViewStyle>
|
|
910
|
+
imageContainer?: StyleProp<ViewStyle>
|
|
911
|
+
image?: StyleProp<ImageStyle>
|
|
912
|
+
infoRootContainer?: StyleProp<ViewStyle>
|
|
913
|
+
iconNextContainer?: StyleProp<ViewStyle>
|
|
914
|
+
iconNext?: StyleProp<ImageStyle>
|
|
915
|
+
orderId?: StyleProp<TextStyle>
|
|
916
|
+
orderDate?: StyleProp<TextStyle>
|
|
917
|
+
eventName?: StyleProp<TextStyle>
|
|
918
|
+
priceContainer?: StyleProp<ViewStyle>
|
|
919
|
+
price?: StyleProp<TextStyle>
|
|
920
|
+
currency?: StyleProp<TextStyle>
|
|
921
|
+
}
|
|
618
922
|
safeArea?: StyleProp<ViewStyle>
|
|
619
923
|
listContainer?: StyleProp<ViewStyle>
|
|
620
924
|
eventsContainer?: StyleProp<ViewStyle>
|
|
621
925
|
eventsTitle?: StyleProp<TextStyle>
|
|
622
926
|
refreshControlColor?: ColorValue
|
|
623
|
-
eventsDropdown?:
|
|
927
|
+
eventsDropdown?: {
|
|
928
|
+
container?: StyleProp<ViewStyle>
|
|
929
|
+
button?: StyleProp<ViewStyle>
|
|
930
|
+
icon?: StyleProp<ImageStyle>
|
|
931
|
+
label?: StyleProp<TextStyle>
|
|
932
|
+
dialog?: StyleProp<ViewStyle>
|
|
933
|
+
flatListContainer?: StyleProp<ViewStyle>
|
|
934
|
+
listItem?: {
|
|
935
|
+
container?: StyleProp<ViewStyle>
|
|
936
|
+
button?: StyleProp<ViewStyle>
|
|
937
|
+
buttonSelected?: StyleProp<ViewStyle>
|
|
938
|
+
text?: StyleProp<TextStyle>
|
|
939
|
+
textSelected?: StyleProp<TextStyle>
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
}
|
|
624
943
|
rootContainer?: StyleProp<ViewStyle>
|
|
625
944
|
eventsSelectionContainer?: StyleProp<ViewStyle>
|
|
626
945
|
clearEventSelectionIcon?: StyleProp<ImageStyle>
|
|
627
946
|
}
|
|
628
947
|
```
|
|
629
948
|
|
|
630
|
-
`onFetchOrderDetailsFail` if the fetching fails, you can use this to know what happened.
|
|
631
|
-
|
|
632
949
|
---
|
|
633
950
|
|
|
634
|
-
|
|
951
|
+
## MyOrderDetails
|
|
635
952
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
When user selects an order from the `MyOrders`component, will show it details.
|
|
953
|
+
When user selects an order from the `MyOrders` component, will show it details.
|
|
639
954
|
|
|
640
955
|
Import the component from the library.
|
|
641
956
|
|
|
@@ -645,44 +960,25 @@ import { MyOrderDetails } from 'tf-checkout-react-native'
|
|
|
645
960
|
|
|
646
961
|
### Props
|
|
647
962
|
|
|
648
|
-
`data` receives same data as the one of the object received from the `onSelectOrder` handler in `MyOrders`component:
|
|
649
|
-
|
|
650
963
|
```js
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
tickets: [
|
|
670
|
-
{
|
|
671
|
-
hash: string
|
|
672
|
-
ticketType: string
|
|
673
|
-
holderName: string
|
|
674
|
-
status: string
|
|
675
|
-
pdfLink: string
|
|
676
|
-
},
|
|
677
|
-
{...}
|
|
678
|
-
]
|
|
679
|
-
}
|
|
680
|
-
```
|
|
681
|
-
|
|
682
|
-
`styles` optional, to customize the component look & feel.
|
|
683
|
-
|
|
684
|
-
```
|
|
685
|
-
styles?: {
|
|
964
|
+
{
|
|
965
|
+
data: IMyOrderDetailsResponse
|
|
966
|
+
config?: {
|
|
967
|
+
areActivityIndicatorsEnabled?: boolean
|
|
968
|
+
areAlertsEnabled?: boolean
|
|
969
|
+
}
|
|
970
|
+
onDownloadStatusChange?: (status?:
|
|
971
|
+
'downloading' |
|
|
972
|
+
'downloaded' |
|
|
973
|
+
'failed'
|
|
974
|
+
) => void
|
|
975
|
+
downloadStatusIcons?: {
|
|
976
|
+
success?: ImageSourcePropType
|
|
977
|
+
error?: ImageSourcePropType
|
|
978
|
+
}
|
|
979
|
+
onAndroidWritePermission?: (permission?: boolean) => void
|
|
980
|
+
onLinkCopied?: (copied?: boolean) => void
|
|
981
|
+
styles?: {
|
|
686
982
|
rootContainer?: StyleProp<ViewStyle>
|
|
687
983
|
header?: {
|
|
688
984
|
container?: StyleProp<ViewStyle>
|
|
@@ -726,29 +1022,34 @@ styles?: {
|
|
|
726
1022
|
}
|
|
727
1023
|
downloadButton?: IButtonStyles
|
|
728
1024
|
}
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
`texts` optional, to customize the texts that shows on the labels.
|
|
732
|
-
|
|
733
|
-
```js
|
|
734
|
-
texts?: {
|
|
735
|
-
title?: string
|
|
736
|
-
subTitle?: string
|
|
737
|
-
referralLink?: string
|
|
738
|
-
listItem?: {
|
|
739
|
-
title?: string
|
|
740
|
-
ticketType?: string
|
|
741
|
-
price?: string
|
|
742
|
-
quantity?: string
|
|
743
|
-
total?: string
|
|
744
|
-
}
|
|
745
|
-
ticketItem?: {
|
|
1025
|
+
texts?: {
|
|
746
1026
|
title?: string
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
1027
|
+
subTitle?: string
|
|
1028
|
+
referralLink?: string
|
|
1029
|
+
listItem?: {
|
|
1030
|
+
title?: string
|
|
1031
|
+
ticketType?: string
|
|
1032
|
+
price?: string
|
|
1033
|
+
quantity?: string
|
|
1034
|
+
total?: string
|
|
1035
|
+
}
|
|
1036
|
+
ticketItem?: {
|
|
1037
|
+
title?: string
|
|
1038
|
+
ticketId?: string
|
|
1039
|
+
ticketType?: string
|
|
1040
|
+
ticketHolder?: string
|
|
1041
|
+
status?: string
|
|
1042
|
+
download?: string
|
|
1043
|
+
}
|
|
1044
|
+
downloadNotification?: {
|
|
1045
|
+
successMessage?: string
|
|
1046
|
+
errorMessage?: string
|
|
1047
|
+
}
|
|
1048
|
+
copyText?: {
|
|
1049
|
+
copy?: string
|
|
1050
|
+
copied?: string
|
|
1051
|
+
}
|
|
752
1052
|
}
|
|
753
1053
|
}
|
|
754
1054
|
```
|
|
1055
|
+
|