tf-checkout-react-native 1.0.20 → 1.0.22

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 (124) hide show
  1. package/README.md +351 -28
  2. package/assets/icons/ic_clock.png +0 -0
  3. package/assets/icons/ic_more.png +0 -0
  4. package/lib/api/ApiClient.d.ts +5 -1
  5. package/lib/api/ApiClient.js +142 -22
  6. package/lib/api/ApiClient.js.map +1 -1
  7. package/lib/api/Constants.js +1 -1
  8. package/lib/api/Constants.js.map +1 -1
  9. package/lib/api/types.d.ts +56 -2
  10. package/lib/components/bottomSheetModal/BottomSheetModal.d.ts +7 -0
  11. package/lib/components/bottomSheetModal/BottomSheetModal.js +54 -0
  12. package/lib/components/bottomSheetModal/BottomSheetModal.js.map +1 -0
  13. package/lib/components/bottomSheetModal/BottomSheetModalStyles.d.ts +38 -0
  14. package/lib/components/bottomSheetModal/BottomSheetModalStyles.js +41 -0
  15. package/lib/components/bottomSheetModal/BottomSheetModalStyles.js.map +1 -0
  16. package/lib/components/bottomSheetModal/BottomSheetModalTypes.d.ts +22 -0
  17. package/lib/components/bottomSheetModal/BottomSheetModalTypes.js +2 -0
  18. package/lib/components/bottomSheetModal/BottomSheetModalTypes.js.map +1 -0
  19. package/lib/components/cartTimer/CartTimer.d.ts +4 -0
  20. package/lib/components/cartTimer/CartTimer.js +45 -0
  21. package/lib/components/cartTimer/CartTimer.js.map +1 -0
  22. package/lib/components/cartTimer/styles.d.ts +46 -0
  23. package/lib/components/cartTimer/styles.js +42 -0
  24. package/lib/components/cartTimer/styles.js.map +1 -0
  25. package/lib/components/cartTimer/types.d.ts +18 -0
  26. package/lib/components/cartTimer/types.js +2 -0
  27. package/lib/components/cartTimer/types.js.map +1 -0
  28. package/lib/components/index.d.ts +3 -0
  29. package/lib/components/index.js +3 -0
  30. package/lib/components/index.js.map +1 -1
  31. package/lib/components/radioButton/RadioButton.d.ts +4 -0
  32. package/lib/components/radioButton/RadioButton.js +9 -0
  33. package/lib/components/radioButton/RadioButton.js.map +1 -0
  34. package/lib/components/radioButton/styles.d.ts +24 -0
  35. package/lib/components/radioButton/styles.js +30 -0
  36. package/lib/components/radioButton/styles.js.map +1 -0
  37. package/lib/components/radioButton/types.d.ts +15 -0
  38. package/lib/components/radioButton/types.js +2 -0
  39. package/lib/components/radioButton/types.js.map +1 -0
  40. package/lib/containers/billingInfo/Billing.js +115 -77
  41. package/lib/containers/billingInfo/Billing.js.map +1 -1
  42. package/lib/containers/billingInfo/types.d.ts +5 -0
  43. package/lib/containers/checkout/Checkout.js +21 -10
  44. package/lib/containers/checkout/Checkout.js.map +1 -1
  45. package/lib/containers/checkout/types.d.ts +6 -0
  46. package/lib/containers/index.d.ts +1 -0
  47. package/lib/containers/index.js +1 -0
  48. package/lib/containers/index.js.map +1 -1
  49. package/lib/containers/myOrderDetails/MyOrderDetails.js +98 -15
  50. package/lib/containers/myOrderDetails/MyOrderDetails.js.map +1 -1
  51. package/lib/containers/myOrderDetails/MyOrderDetailsView.d.ts +2 -2
  52. package/lib/containers/myOrderDetails/MyOrderDetailsView.js +65 -60
  53. package/lib/containers/myOrderDetails/MyOrderDetailsView.js.map +1 -1
  54. package/lib/containers/myOrderDetails/components/OrderListItem.d.ts +2 -0
  55. package/lib/containers/myOrderDetails/components/OrderListItem.js +8 -0
  56. package/lib/containers/myOrderDetails/components/OrderListItem.js.map +1 -0
  57. package/lib/containers/myOrderDetails/components/TicketActions/TicketActions.d.ts +4 -0
  58. package/lib/containers/myOrderDetails/components/TicketActions/TicketActions.js +25 -0
  59. package/lib/containers/myOrderDetails/components/TicketActions/TicketActions.js.map +1 -0
  60. package/lib/containers/myOrderDetails/components/TicketActions/TicketActionsTypes.d.ts +29 -0
  61. package/lib/containers/myOrderDetails/components/TicketActions/TicketActionsTypes.js +2 -0
  62. package/lib/containers/myOrderDetails/components/TicketActions/TicketActionsTypes.js.map +1 -0
  63. package/lib/containers/myOrderDetails/components/TicketListItem/TicketListItem.d.ts +7 -0
  64. package/lib/containers/myOrderDetails/components/TicketListItem/TicketListItem.js +29 -0
  65. package/lib/containers/myOrderDetails/components/TicketListItem/TicketListItem.js.map +1 -0
  66. package/lib/containers/myOrderDetails/components/TicketListItem/TicketListItemStyles.d.ts +32 -0
  67. package/lib/containers/myOrderDetails/components/TicketListItem/TicketListItemStyles.js +33 -0
  68. package/lib/containers/myOrderDetails/components/TicketListItem/TicketListItemStyles.js.map +1 -0
  69. package/lib/containers/myOrderDetails/components/TicketListItem/TicketListItemTypes.d.ts +29 -0
  70. package/lib/containers/myOrderDetails/components/TicketListItem/TicketListItemTypes.js +2 -0
  71. package/lib/containers/myOrderDetails/components/TicketListItem/TicketListItemTypes.js.map +1 -0
  72. package/lib/containers/myOrderDetails/types.d.ts +96 -76
  73. package/lib/containers/myOrders/types.d.ts +2 -0
  74. package/lib/containers/resaleTickets/ResaleTickets.d.ts +4 -0
  75. package/lib/containers/resaleTickets/ResaleTickets.js +149 -0
  76. package/lib/containers/resaleTickets/ResaleTickets.js.map +1 -0
  77. package/lib/containers/resaleTickets/ResaleTicketsView.d.ts +4 -0
  78. package/lib/containers/resaleTickets/ResaleTicketsView.js +182 -0
  79. package/lib/containers/resaleTickets/ResaleTicketsView.js.map +1 -0
  80. package/lib/containers/resaleTickets/types.d.ts +128 -0
  81. package/lib/containers/resaleTickets/types.js +11 -0
  82. package/lib/containers/resaleTickets/types.js.map +1 -0
  83. package/lib/containers/tickets/Tickets.js +6 -0
  84. package/lib/containers/tickets/Tickets.js.map +1 -1
  85. package/lib/core/BillingCore/BillingCore.d.ts +2 -3
  86. package/lib/core/BillingCore/BillingCore.js +52 -3
  87. package/lib/core/BillingCore/BillingCore.js.map +1 -1
  88. package/lib/core/BillingCore/BillingCoreTypes.d.ts +5 -0
  89. package/lib/core/CheckoutCore/CheckoutCore.d.ts +2 -3
  90. package/lib/core/CheckoutCore/CheckoutCore.js +46 -2
  91. package/lib/core/CheckoutCore/CheckoutCore.js.map +1 -1
  92. package/lib/core/CheckoutCore/CheckoutCoreTypes.d.ts +5 -0
  93. package/lib/core/LoginCore/LoginCore.js +4 -5
  94. package/lib/core/LoginCore/LoginCore.js.map +1 -1
  95. package/lib/core/LoginCore/LoginCoreTypes.d.ts +2 -1
  96. package/lib/core/OrderDetailsCore/OrderDetailsCore.d.ts +5 -0
  97. package/lib/core/OrderDetailsCore/OrderDetailsCore.js +15 -0
  98. package/lib/core/OrderDetailsCore/OrderDetailsCore.js.map +1 -0
  99. package/lib/core/OrderDetailsCore/OrderDetailsCoreTypes.d.ts +7 -0
  100. package/lib/core/OrderDetailsCore/OrderDetailsCoreTypes.js +2 -0
  101. package/lib/core/OrderDetailsCore/OrderDetailsCoreTypes.js.map +1 -0
  102. package/lib/core/TicketsCore/TicketsCore.js +6 -3
  103. package/lib/core/TicketsCore/TicketsCore.js.map +1 -1
  104. package/lib/core/TicketsCore/TicketsCoreTypes.d.ts +3 -2
  105. package/lib/core/index.d.ts +2 -0
  106. package/lib/core/index.js +1 -0
  107. package/lib/core/index.js.map +1 -1
  108. package/lib/helpers/Config.d.ts +3 -2
  109. package/lib/helpers/Config.js +3 -5
  110. package/lib/helpers/Config.js.map +1 -1
  111. package/lib/helpers/Domains.d.ts +2 -0
  112. package/lib/helpers/Domains.js +27 -0
  113. package/lib/helpers/Domains.js.map +1 -0
  114. package/lib/index.d.ts +3 -3
  115. package/lib/index.js +3 -3
  116. package/lib/index.js.map +1 -1
  117. package/lib/res/colors.d.ts +1 -0
  118. package/lib/res/colors.js +1 -0
  119. package/lib/res/colors.js.map +1 -1
  120. package/lib/res/icons.d.ts +2 -0
  121. package/lib/res/icons.js +2 -0
  122. package/lib/res/icons.js.map +1 -1
  123. package/lib/res/index.d.ts +3 -0
  124. package/package.json +7 -3
package/README.md CHANGED
@@ -95,27 +95,28 @@ Set appropriate style in your styles.xml file.
95
95
 
96
96
  Import the function from the library.
97
97
 
98
- ```js
98
+ ```ts
99
99
  import { setConfig } from 'tf-checkout-react-native'
100
100
  ```
101
101
 
102
102
  Use it in your initial useEffect function:
103
103
 
104
- ```js
104
+ ```ts
105
105
  useEffect(() => {
106
106
  setConfig({
107
107
  EVENT_ID: '4344',
108
- DOMAIN: 'https://yourdomain.mx',
108
+ CLIENT: 'ttf',
109
+ ENV: 'STAG'
109
110
  })
110
111
  }, [])
111
112
  ```
112
113
 
113
114
  `setConfig` set your event's configuration, with the following options:
114
115
 
115
- ````js
116
+ ````ts
116
117
  {
117
118
  EVENT_ID: string,
118
- DOMAIN?: string,
119
+ CLIENT?: string,
119
120
  ENV?: 'PROD' | 'DEV' | 'STAG',
120
121
  CLIENT_ID?: string,
121
122
  CLIENT_SECRET?: string,
@@ -128,7 +129,7 @@ useEffect(() => {
128
129
  | Property | Description |
129
130
  | -------- | ----------- |
130
131
  | EVENT_ID | Specify the event's ID. |
131
- | 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. |
132
+ | CLIENT | Specify your client designated name example `ttf`. |
132
133
  | ENV | Sets the environment to any of the following environments: Production, Staging or Development. Receives the following values: `PROD`, `DEV`, `STAG`. Defaults to `PROD`.|
133
134
  | CLIENT_ID | Set your CLIENT_ID. |
134
135
  | CLIENT_SECRET | Set your CLIENT_SECRET. |
@@ -182,9 +183,13 @@ Will show the purchased orders for the logged user.
182
183
 
183
184
  Will show the details for the selected Order, it also allows the user to download the Ticket PDF.
184
185
 
186
+ ### Tickets Resale
187
+
188
+ Let the user to resale their tickets. They can choose between selling them to a friend or to any other user.
189
+
185
190
  # Component styling
186
191
  ### Button
187
- ```js
192
+ ```ts
188
193
  interface IButtonStyles {
189
194
  container?: StyleProp<ViewStyle>
190
195
  button?: StyleProp<ViewStyle>
@@ -192,7 +197,7 @@ interface IButtonStyles {
192
197
  }
193
198
  ```
194
199
  ### Input
195
- ```js
200
+ ```ts
196
201
  interface IInputStyles {
197
202
  color?: ColorValue
198
203
  container?: StyleProp<ViewStyle>
@@ -203,6 +208,22 @@ interface IInputStyles {
203
208
  errorColor?: ColorValue
204
209
  }
205
210
  ```
211
+
212
+ ### Checkbox
213
+
214
+ ```ts
215
+ interface ICheckboxStyles {
216
+ container?: StyleProp<ViewStyle>
217
+ content?: StyleProp<ViewStyle>
218
+ indicator?: StyleProp<ViewStyle>
219
+ indicatorDisabled?: StyleProp<ViewStyle>
220
+ text?: StyleProp<TextStyle>
221
+ box?: StyleProp<ViewStyle>
222
+ icon?: StyleProp<ImageStyle>
223
+ }
224
+ ```
225
+
226
+
206
227
  # Exported components
207
228
  Depending on your needs, you can use the UI Components or the Core Components.
208
229
 
@@ -211,17 +232,35 @@ Depending on your needs, you can use the UI Components or the Core Components.
211
232
  [Core Components](#core-components) are wrappers that don't include any UI neither validation logics, they only act as a Middleware to retrieve and send data from the server and return it to your implementation components. They are useful when your design cannot be achieved by the UI components. You will need to use references to access their exposed functions.
212
233
 
213
234
  # UI Components
214
- ## Login
235
+
236
+ [Login](#login-ui)
237
+
238
+ [Tickets](#tickets-ui)
239
+
240
+ [BillingInfo](#billinginfo-ui)
241
+
242
+ [Checkout](#checkout-ui)
243
+
244
+ [Purchase Confirmation](#purchase-confirmation-ui)
245
+
246
+ [My Orders](#my-orders-ui)
247
+
248
+ [My Order Details](#myorder-details-ui)
249
+
250
+ [Resale](#resale-tickets-ui)
251
+
252
+ ---
253
+ ## Login UI
215
254
 
216
255
  Import the component from the library
217
256
 
218
- ```js
257
+ ```tsx
219
258
  import { Login } from 'tf-checkout-react-native'
220
259
  ```
221
260
 
222
261
  Then add it to the render function.
223
262
 
224
- ```js
263
+ ```tsx
225
264
  <Login
226
265
  onLoginSuccessful: (userProfile: IUserProfile, accessToken: string) => void
227
266
  onLoginError?: (error: IError) => void
@@ -339,7 +378,7 @@ interface ILoginViewStyles {
339
378
 
340
379
  ```
341
380
  ---
342
- ## Tickets
381
+ ## Tickets UI
343
382
 
344
383
  Import the component from the library
345
384
 
@@ -550,7 +589,7 @@ You can then call the `BillingInfo` component and pass them as props in the `car
550
589
  }
551
590
  ```
552
591
  ---
553
- ## BillingInfo
592
+ ## BillingInfo UI
554
593
 
555
594
  Import the component from the library
556
595
 
@@ -679,6 +718,9 @@ interface IBillingInfoViewTexts {
679
718
  label?: string
680
719
  customError?: string
681
720
  }
721
+ cartTimer?: {
722
+ message?: string
723
+ }
682
724
  }
683
725
  }
684
726
  ```
@@ -733,11 +775,20 @@ interface IBillingInfoViewStyles {
733
775
  }
734
776
  input?: IInputStyles
735
777
  }
778
+
779
+ cartTimer?: {
780
+ rootContainer?: StyleProp<ViewStyle>
781
+ contentContainer?: StyleProp<ViewStyle>
782
+ textsContainer?: StyleProp<ViewStyle>
783
+ icon?: StyleProp<ImageStyle>
784
+ message?: StyleProp<TextStyle>
785
+ time?: StyleProp<TextStyle>
786
+ }
736
787
  }
737
788
  ```
738
789
  ---
739
790
 
740
- ## Checkout
791
+ ## Checkout UI
741
792
 
742
793
  Import the component from the library
743
794
 
@@ -799,6 +850,9 @@ Add it to the render function.
799
850
  price?: string
800
851
  total?: string
801
852
  }
853
+ cartTimer?: {
854
+ message?: string
855
+ }
802
856
  }
803
857
 
804
858
  styles?: ICheckoutStyles
@@ -846,6 +900,14 @@ Add it to the render function.
846
900
  button?: IButtonStyles
847
901
  buttonDisabled?: IButtonStyles
848
902
  }
903
+ cartTimer?: {
904
+ rootContainer?: StyleProp<ViewStyle>
905
+ contentContainer?: StyleProp<ViewStyle>
906
+ textsContainer?: StyleProp<ViewStyle>
907
+ icon?: StyleProp<ImageStyle>
908
+ message?: StyleProp<TextStyle>
909
+ time?: StyleProp<TextStyle>
910
+ }
849
911
  }
850
912
  ```
851
913
 
@@ -859,7 +921,7 @@ Currently, Stripe card is not customizable. Please see the open issues in their
859
921
  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).
860
922
 
861
923
  ---
862
- ## Purchase Confirmation
924
+ ## Purchase Confirmation UI
863
925
 
864
926
  Import the component from the library
865
927
 
@@ -910,7 +972,7 @@ Add it to the render function.
910
972
 
911
973
 
912
974
  ---
913
- ## My Orders
975
+ ## My Orders UI
914
976
  If there is a valid session, there will appear a button to access `MyOrders` in the `Tickets` component.
915
977
 
916
978
  Import the component from the library.
@@ -1033,7 +1095,7 @@ import { MyOrders } from 'tf-checkout-react-native'
1033
1095
 
1034
1096
  ---
1035
1097
 
1036
- ## MyOrder Details
1098
+ ## MyOrder Details UI
1037
1099
 
1038
1100
  When user selects an order from the `MyOrders` component, will show it details.
1039
1101
 
@@ -1045,9 +1107,21 @@ import { MyOrderDetails } from 'tf-checkout-react-native'
1045
1107
 
1046
1108
  ### Props
1047
1109
 
1048
- ```js
1110
+ ```tsx
1049
1111
  {
1050
1112
  data: IMyOrderDetailsData
1113
+
1114
+ // Used to navigate to the Resale Tickets screen
1115
+ onPressResaleTicket: (
1116
+ ticket: IMyOrderDetailsTicket,
1117
+ isTicketTypeActive: boolean
1118
+ ) => void
1119
+
1120
+ onRemoveTicketFromResaleSuccess: (message: string) => void
1121
+
1122
+ onRemoveTicketFromResaleError?: (error: IError) => void
1123
+
1124
+
1051
1125
  config?: {
1052
1126
  areActivityIndicatorsEnabled?: boolean
1053
1127
  areAlertsEnabled?: boolean
@@ -1063,6 +1137,16 @@ import { MyOrderDetails } from 'tf-checkout-react-native'
1063
1137
  }
1064
1138
  onAndroidWritePermission?: (permission?: boolean) => void
1065
1139
  onLinkCopied?: (copied?: boolean) => void
1140
+
1141
+ moreButtonIcon?: StyleProp<ImageStyle>
1142
+
1143
+ ticketActionsIcons?: {
1144
+ downloadPdf?: ImageSourcePropType
1145
+ sell?: ImageSourcePropType
1146
+ removeFromSale?: ImageSourcePropType
1147
+ refund?: ImageSourcePropType
1148
+ }
1149
+
1066
1150
  styles?: {
1067
1151
  rootContainer?: StyleProp<ViewStyle>
1068
1152
  header?: {
@@ -1099,13 +1183,35 @@ import { MyOrderDetails } from 'tf-checkout-react-native'
1099
1183
  rowValue?: StyleProp<TextStyle>
1100
1184
  }
1101
1185
  ticketItem?: {
1102
- container?: StyleProp<ViewStyle>
1103
- innerLeftContainer?: StyleProp<ViewStyle>
1104
- innerRightContainer?: StyleProp<ViewStyle>
1186
+ rootContainer?: StyleProp<ViewStyle>
1187
+ leftContent?: StyleProp<ViewStyle>
1188
+ rightContent?: StyleProp<ViewStyle>
1105
1189
  rowPlaceholder?: StyleProp<TextStyle>
1106
1190
  rowValue?: StyleProp<TextStyle>
1191
+ downloadButton?: IButtonStyles
1192
+ moreButton?: StyleProp<ViewStyle>
1193
+ moreButtonIcon?: StyleProp<ImageStyle>
1194
+ }
1195
+ downloadButton?: {
1196
+ container?: StyleProp<ViewStyle>
1197
+ button?: StyleProp<ViewStyle>
1198
+ text?: StyleProp<TextStyle>
1107
1199
  }
1108
- downloadButton?: IButtonStyles
1200
+ bottomSheetModal?: {
1201
+ rootContainer?: StyleProp<ViewStyle>
1202
+ headerContainer?: StyleProp<ViewStyle>
1203
+ content?: StyleProp<ViewStyle>
1204
+ title?: StyleProp<TextStyle>
1205
+ closeButton?: StyleProp<ViewStyle>
1206
+ closeButtonIcon?: StyleProp<ImageStyle>
1207
+ contentContainer?: StyleProp<ViewStyle>
1208
+ }
1209
+ ticketActions?: {
1210
+ rootScrollViewContainer?: StyleProp<ViewStyle>
1211
+ buttonContainer?: StyleProp<ViewStyle>
1212
+ buttonContent?: StyleProp<ViewStyle>
1213
+ icon?: StyleProp<ImageStyle>
1214
+ text?: StyleProp<TextStyle>
1109
1215
  }
1110
1216
  texts?: {
1111
1217
  title?: string
@@ -1123,12 +1229,13 @@ import { MyOrderDetails } from 'tf-checkout-react-native'
1123
1229
  total?: string
1124
1230
  }
1125
1231
  ticketItem?: {
1126
- title?: string
1127
- ticketId?: string
1128
- ticketType?: string
1129
- ticketHolder?: string
1130
- status?: string
1131
- download?: string
1232
+ ticketType: string
1233
+ holderName: string
1234
+ ticketId: string
1235
+ status: string
1236
+ download: string
1237
+ sellTicket: string
1238
+ removeTicketFromResale: string
1132
1239
  }
1133
1240
  downloadNotification?: {
1134
1241
  successMessage?: string
@@ -1138,10 +1245,133 @@ import { MyOrderDetails } from 'tf-checkout-react-native'
1138
1245
  copy?: string
1139
1246
  copied?: string
1140
1247
  }
1248
+ sellTicket?: string
1249
+ removeTicketFromResale?: string
1250
+ ticketsTitle?: string
1251
+
1252
+ bottomSheetModal?: {
1253
+ title?: string
1254
+ }
1255
+ ticketActions?: {
1256
+ downloadPdf?: string
1257
+ sell?: string
1258
+ removeFromSale?: string
1259
+ refund?: string
1260
+ }
1141
1261
  }
1142
1262
  }
1143
1263
  ```
1144
1264
 
1265
+ ## Resale Tickets UI
1266
+
1267
+ Allows the user to resale the tickets they bought. They can decide wether sell it to a friend or to any other user.
1268
+
1269
+
1270
+ Import the component from the library.
1271
+
1272
+ ```js
1273
+ import { ResaleTickets } from 'tf-checkout-react-native'
1274
+ ```
1275
+
1276
+ ### Props
1277
+
1278
+ ```ts
1279
+ {
1280
+ ticket: {
1281
+ currency: string
1282
+ description: string
1283
+ descriptionPlain?: string
1284
+ eventName: string
1285
+ hash: string
1286
+ holderEmail?: string
1287
+ holderName: string
1288
+ holderPhone?: string
1289
+ isOnSale: boolean
1290
+ isSellable: boolean
1291
+ pdfLink: string
1292
+ qrData: string
1293
+ resaleFeeAmount: number
1294
+ status: string
1295
+ ticketType: string
1296
+ }
1297
+ styles?: {
1298
+ rootContainer?: StyleProp<ViewStyle>
1299
+ title?: StyleProp<TextStyle>
1300
+ terms?: IResaleTermsStyles
1301
+ resaleTicketsButton?: IButtonStyles
1302
+ resaleTicketsButtonDisabled?: IButtonStyles
1303
+ resaleTicketsButtonLoading?: IButtonStyles
1304
+ ticketOrderDetails?: ITicketOrderDetailsStyles
1305
+ ticketBuyerForm?: ITicketBuyerFormStyles
1306
+ termsCheckbox?: ICheckboxStyles
1307
+ }
1308
+ onResaleTicketsSuccess: (
1309
+ resaleTicketData: {
1310
+ message: string
1311
+ },
1312
+ ticket: {
1313
+ currency: string
1314
+ description: string
1315
+ descriptionPlain?: string
1316
+ eventName: string
1317
+ hash: string
1318
+ holderEmail?: string
1319
+ holderName: string
1320
+ holderPhone?: string
1321
+ isOnSale: boolean
1322
+ isSellable: boolean
1323
+ pdfLink: string
1324
+ qrData: string
1325
+ resaleFeeAmount: number
1326
+ status: string
1327
+ ticketType: string
1328
+ }
1329
+ ) => void
1330
+ onResaleTicketsError?: (error: {
1331
+ code?: number
1332
+ message: string
1333
+ extraData?: any
1334
+ }) => void
1335
+ config?: {
1336
+ areAlertsEnabled?: boolean
1337
+ areActivityIndicatorsEnabled?: boolean
1338
+ }
1339
+ texts?: {
1340
+ title?: string
1341
+ orderDetails?: {
1342
+ title?: string
1343
+ eventName?: string
1344
+ orderedBy?: string
1345
+ orderId?: string
1346
+ }
1347
+ sellToWhom?: {
1348
+ title?: string
1349
+ friend?: string
1350
+ anyone?: string
1351
+ }
1352
+ friendForm?: {
1353
+ firstName?: string
1354
+ lastName?: string
1355
+ email?: string
1356
+ emailConfirm?: string
1357
+ }
1358
+ terms?: {
1359
+ title?: string
1360
+ paragraph1?: string
1361
+ paragraph2_1?: string
1362
+ paragraph2_2?: string
1363
+ paragraph3_1?: string
1364
+ paragraph3_2?: string
1365
+ }
1366
+ agree?: string
1367
+ resaleTicketsButton?: string
1368
+ }
1369
+ }
1370
+ ```
1371
+
1372
+
1373
+
1374
+
1145
1375
  # Core Components
1146
1376
  **⚠️ Remember that you first need to set your configuration using the [setConfig](#set-your-configuration)
1147
1377
  function. ⚠️**
@@ -1160,6 +1390,8 @@ import { MyOrderDetails } from 'tf-checkout-react-native'
1160
1390
 
1161
1391
  [MyOrdersCore](#myorderscore)
1162
1392
 
1393
+ [OrderDetailsCore](#orderdetailscore)
1394
+
1163
1395
  [LoginCore](#logincore)
1164
1396
 
1165
1397
  ---
@@ -1175,6 +1407,8 @@ Exposes the following functions:
1175
1407
 
1176
1408
  `addToCart` Adds the selected tickets to the cart.
1177
1409
 
1410
+ `postReferralVisit` Posts a referral visit to the server.
1411
+
1178
1412
  ```js
1179
1413
  {
1180
1414
  // Fetches the tickets from the event set in the config function. It receives a promoCode parameter to apply to the tickets.
@@ -1326,6 +1560,18 @@ Exposes the following functions:
1326
1560
  minimumAge?: number
1327
1561
  isNameRequired?: boolean
1328
1562
  }
1563
+
1564
+ postReferralVisit(referralId: string): Promise<
1565
+ postReferralError?: {
1566
+ code?: number
1567
+ message: string
1568
+ extraData?: any
1569
+ }
1570
+ postReferralData?: {
1571
+ message: string
1572
+ status: number
1573
+ }
1574
+ >
1329
1575
  }>
1330
1576
  }
1331
1577
  ```
@@ -1817,6 +2063,74 @@ getOrderDetails(orderId: string): Promise<{
1817
2063
  }>
1818
2064
  ```
1819
2065
 
2066
+ ## OrderDetailsCore
2067
+ Allows to re-sale the tickets or to remove them from the re-sale system.
2068
+
2069
+ Import it from the library.
2070
+ ```ts
2071
+ import { OrderDetailsCore, OrderDetailsCoreHandle } from 'tf-checkout-react-native';
2072
+ ```
2073
+
2074
+ Create a ref
2075
+
2076
+ ```ts
2077
+ const myOrderDetailsCoreRef = useRef<OrderDetailsCoreHandle>(null)
2078
+ ```
2079
+
2080
+ Assign the ref to the wrapper component.
2081
+
2082
+ ```tsx
2083
+ <OrderDetailsCore ref={myOrderDetailsCoreRef}>
2084
+ ```
2085
+
2086
+ Access the exposed function through the current value.
2087
+ ```ts
2088
+ await myOrderDetailsCoreRef.current.removeTicketFromResale(ticket.hash)
2089
+ ```
2090
+
2091
+
2092
+ ```ts
2093
+ resaleTicket(
2094
+ /*
2095
+ formData.append('to', toWhom)
2096
+ formData.append('first_name', firstName)
2097
+ formData.append('last_name', lastName)
2098
+ formData.append('email', email)
2099
+ formData.append('confirm_email', emailConfirm)
2100
+ formData.append('confirm', String(isTermsAgreed))
2101
+ */
2102
+
2103
+ data: FormData,
2104
+ orderHash: string
2105
+ ): Promise<{
2106
+ {
2107
+ resaleTicketError?: {
2108
+ code?: number
2109
+ message: string
2110
+ extraData?: any
2111
+ }
2112
+ resaleTicketData?: {
2113
+ message: string
2114
+ }
2115
+ }
2116
+ }>
2117
+ ```
2118
+
2119
+ ```ts
2120
+ removeTicketFromResale(
2121
+ orderHash: string
2122
+ ): Promise<{
2123
+ removeTicketFromResaleError?: {
2124
+ code?: number
2125
+ message: string
2126
+ extraData?: any
2127
+ }
2128
+ removeTicketFromResaleData?: {
2129
+ message: string
2130
+ }
2131
+ }>
2132
+ ```
2133
+
1820
2134
  ## LoginCore
1821
2135
  Handles the login and logout process.
1822
2136
 
@@ -1861,3 +2175,12 @@ logout(): Promise<void>
1861
2175
 
1862
2176
  `deleteAllData` asynchronously deletes all the data stored in the local storage. Use this with caution, only in an edge case.
1863
2177
 
2178
+ # Changelog
2179
+ ## Version 1.0.22
2180
+ - Added cartTimer component, that will show the cart's remaining expiration time in the Billing screen.
2181
+ - setConfig not longer receives the `DOMAIN` prop, instead it receives the `CLIENT`
2182
+ - Added a three dot button to my orders to show the possible actions.
2183
+
2184
+
2185
+
2186
+
Binary file
Binary file
@@ -1,7 +1,7 @@
1
1
  import { IWaitingListFields } from '../components/waitingList/types';
2
2
  import { IError } from '../types';
3
3
  import { IAddToCartResponse } from '../types/ITicket';
4
- import { IAddToCartParams, IAddToWaitingListResponse, IAuthorizeResponse, ICartResponse, ICheckoutBody, ICheckoutResponse, IClientRequest, ICountriesResponse, IEventResponse, IFetchTicketsResponse, IFreeRegistrationResponse, IMyOrderDetailsResponse, IMyOrdersResponse, IOrderReviewResponse, IPurchaseConfirmationResponse, IRegisterNewUserResponse, IStatesResponse, IUserProfileResponse } from './types';
4
+ import { IAddToCartParams, IAddToWaitingListResponse, IAuthorizeResponse, ICartResponse, ICheckoutBody, ICheckoutResponse, IClientRequest, ICloseSessionResponse, ICountriesResponse, IEventResponse, IFetchTicketsResponse, IFreeRegistrationResponse, IMyOrderDetailsResponse, IMyOrdersResponse, IOrderReviewResponse, IPostReferralResponse, IPurchaseConfirmationResponse, IRegisterNewUserResponse, IRemoveTicketFromResaleResponse, IResaleTicketResponse, IStatesResponse, IUserProfileResponse } from './types';
5
5
  export declare const Client: IClientRequest;
6
6
  export declare const setCustomHeader: (response: any) => void;
7
7
  export declare const setAccessTokenHandler: (accessToken: string) => Promise<void>;
@@ -18,6 +18,7 @@ export declare const fetchOrderDetails: (orderId: string) => Promise<IMyOrderDet
18
18
  export declare const fetchTickets: (promoCode?: string | undefined) => Promise<IFetchTicketsResponse>;
19
19
  export declare const addToCart: (data: IAddToCartParams) => Promise<IAddToCartResponse>;
20
20
  export declare const fetchEvent: () => Promise<IEventResponse>;
21
+ export declare const postReferralVisit: (referralId: string) => Promise<IPostReferralResponse>;
21
22
  export declare const fetchCountries: () => Promise<ICountriesResponse>;
22
23
  export declare const fetchStates: (countryId: string) => Promise<IStatesResponse>;
23
24
  export declare const fetchCart: () => Promise<ICartResponse>;
@@ -33,3 +34,6 @@ export declare const postOnPaymentSuccess: (orderHash: string) => Promise<{
33
34
  }>;
34
35
  export declare const postOnFreeRegistration: (orderHash: string) => Promise<IFreeRegistrationResponse>;
35
36
  export declare const fetchPurchaseConfirmation: (orderHash: string) => Promise<IPurchaseConfirmationResponse>;
37
+ export declare const resaleTicket: (data: FormData, orderHash: string) => Promise<IResaleTicketResponse>;
38
+ export declare const removeTicketFromResale: (orderHash: string) => Promise<IRemoveTicketFromResaleResponse>;
39
+ export declare const closeSession: () => Promise<ICloseSessionResponse>;