tf-checkout-react-native 1.0.0

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 (285) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +168 -0
  3. package/android/build.gradle +42 -0
  4. package/android/src/main/AndroidManifest.xml +2 -0
  5. package/android/src/main/java/com/theticketfairy/tfcheckoutreactnative/TFCheckoutRNModule.kt +13 -0
  6. package/android/src/main/java/com/theticketfairy/tfcheckoutreactnative/TFCheckoutRNPackage.kt +19 -0
  7. package/ios/TFCheckoutRNModule-Bridging-Header.h +5 -0
  8. package/ios/TFCheckoutRNModule.m +11 -0
  9. package/ios/TFCheckoutRNModule.swift +21 -0
  10. package/ios/TFCheckoutRNModule.xcodeproj/project.pbxproj +314 -0
  11. package/lib/api/ApiClient.d.ts +62 -0
  12. package/lib/api/ApiClient.js +490 -0
  13. package/lib/api/ApiClient.js.map +1 -0
  14. package/lib/api/Constants.d.ts +7 -0
  15. package/lib/api/Constants.js +7 -0
  16. package/lib/api/Constants.js.map +1 -0
  17. package/lib/api/types.d.ts +164 -0
  18. package/lib/api/types.js +3 -0
  19. package/lib/api/types.js.map +1 -0
  20. package/lib/components/button/Button.d.ts +3 -0
  21. package/lib/components/button/Button.js +13 -0
  22. package/lib/components/button/Button.js.map +1 -0
  23. package/lib/components/button/styles.d.ts +27 -0
  24. package/lib/components/button/styles.js +29 -0
  25. package/lib/components/button/styles.js.map +1 -0
  26. package/lib/components/button/types.d.ts +14 -0
  27. package/lib/components/button/types.js +2 -0
  28. package/lib/components/button/types.js.map +1 -0
  29. package/lib/components/checkbox/Checkbox.d.ts +3 -0
  30. package/lib/components/checkbox/Checkbox.js +14 -0
  31. package/lib/components/checkbox/Checkbox.js.map +1 -0
  32. package/lib/components/checkbox/styles.d.ts +38 -0
  33. package/lib/components/checkbox/styles.js +40 -0
  34. package/lib/components/checkbox/styles.js.map +1 -0
  35. package/lib/components/checkbox/types.d.ts +18 -0
  36. package/lib/components/checkbox/types.js +2 -0
  37. package/lib/components/checkbox/types.js.map +1 -0
  38. package/lib/components/datePicker/DatePicker.d.ts +3 -0
  39. package/lib/components/datePicker/DatePicker.js +30 -0
  40. package/lib/components/datePicker/DatePicker.js.map +1 -0
  41. package/lib/components/datePicker/styles.d.ts +18 -0
  42. package/lib/components/datePicker/styles.js +20 -0
  43. package/lib/components/datePicker/styles.js.map +1 -0
  44. package/lib/components/datePicker/types.d.ts +8 -0
  45. package/lib/components/datePicker/types.js +2 -0
  46. package/lib/components/datePicker/types.js.map +1 -0
  47. package/lib/components/dropdown/Dropdown.d.ts +3 -0
  48. package/lib/components/dropdown/Dropdown.js +40 -0
  49. package/lib/components/dropdown/Dropdown.js.map +1 -0
  50. package/lib/components/dropdown/DropdownListItem.d.ts +3 -0
  51. package/lib/components/dropdown/DropdownListItem.js +12 -0
  52. package/lib/components/dropdown/DropdownListItem.js.map +1 -0
  53. package/lib/components/dropdown/styles.d.ts +72 -0
  54. package/lib/components/dropdown/styles.js +75 -0
  55. package/lib/components/dropdown/styles.js.map +1 -0
  56. package/lib/components/dropdown/types.d.ts +24 -0
  57. package/lib/components/dropdown/types.js +2 -0
  58. package/lib/components/dropdown/types.js.map +1 -0
  59. package/lib/components/formField/FormField.d.ts +3 -0
  60. package/lib/components/formField/FormField.js +35 -0
  61. package/lib/components/formField/FormField.js.map +1 -0
  62. package/lib/components/formField/styles.d.ts +34 -0
  63. package/lib/components/formField/styles.js +36 -0
  64. package/lib/components/formField/styles.js.map +1 -0
  65. package/lib/components/formField/types.d.ts +34 -0
  66. package/lib/components/formField/types.js +2 -0
  67. package/lib/components/formField/types.js.map +1 -0
  68. package/lib/components/index.d.ts +12 -0
  69. package/lib/components/index.js +13 -0
  70. package/lib/components/index.js.map +1 -0
  71. package/lib/components/input/Input.d.ts +3 -0
  72. package/lib/components/input/Input.js +13 -0
  73. package/lib/components/input/Input.js.map +1 -0
  74. package/lib/components/input/styles.d.ts +41 -0
  75. package/lib/components/input/styles.js +46 -0
  76. package/lib/components/input/styles.js.map +1 -0
  77. package/lib/components/input/types.d.ts +22 -0
  78. package/lib/components/input/types.js +2 -0
  79. package/lib/components/input/types.js.map +1 -0
  80. package/lib/components/loading/Loading.d.ts +3 -0
  81. package/lib/components/loading/Loading.js +14 -0
  82. package/lib/components/loading/Loading.js.map +1 -0
  83. package/lib/components/loading/styles.d.ts +29 -0
  84. package/lib/components/loading/styles.js +31 -0
  85. package/lib/components/loading/styles.js.map +1 -0
  86. package/lib/components/loading/types.d.ts +14 -0
  87. package/lib/components/loading/types.js +2 -0
  88. package/lib/components/loading/types.js.map +1 -0
  89. package/lib/components/loggedIn/LoggedIn.d.ts +4 -0
  90. package/lib/components/loggedIn/LoggedIn.js +21 -0
  91. package/lib/components/loggedIn/LoggedIn.js.map +1 -0
  92. package/lib/components/loggedIn/styles.d.ts +8 -0
  93. package/lib/components/loggedIn/styles.js +9 -0
  94. package/lib/components/loggedIn/styles.js.map +1 -0
  95. package/lib/components/loggedIn/types.d.ts +11 -0
  96. package/lib/components/loggedIn/types.js +2 -0
  97. package/lib/components/loggedIn/types.js.map +1 -0
  98. package/lib/components/login/Login.d.ts +3 -0
  99. package/lib/components/login/Login.js +68 -0
  100. package/lib/components/login/Login.js.map +1 -0
  101. package/lib/components/login/LoginView.d.ts +3 -0
  102. package/lib/components/login/LoginView.js +121 -0
  103. package/lib/components/login/LoginView.js.map +1 -0
  104. package/lib/components/login/styles.d.ts +50 -0
  105. package/lib/components/login/styles.js +52 -0
  106. package/lib/components/login/styles.js.map +1 -0
  107. package/lib/components/login/types.d.ts +63 -0
  108. package/lib/components/login/types.js +2 -0
  109. package/lib/components/login/types.js.map +1 -0
  110. package/lib/components/promoCode/PromoCode.d.ts +3 -0
  111. package/lib/components/promoCode/PromoCode.js +66 -0
  112. package/lib/components/promoCode/PromoCode.js.map +1 -0
  113. package/lib/components/promoCode/styles.d.ts +56 -0
  114. package/lib/components/promoCode/styles.js +58 -0
  115. package/lib/components/promoCode/styles.js.map +1 -0
  116. package/lib/components/promoCode/types.d.ts +33 -0
  117. package/lib/components/promoCode/types.js +2 -0
  118. package/lib/components/promoCode/types.js.map +1 -0
  119. package/lib/components/separator/Separator.d.ts +3 -0
  120. package/lib/components/separator/Separator.js +13 -0
  121. package/lib/components/separator/Separator.js.map +1 -0
  122. package/lib/components/separator/types.d.ts +8 -0
  123. package/lib/components/separator/types.js +2 -0
  124. package/lib/components/separator/types.js.map +1 -0
  125. package/lib/components/waitingList/WaitingList.d.ts +3 -0
  126. package/lib/components/waitingList/WaitingList.js +51 -0
  127. package/lib/components/waitingList/WaitingList.js.map +1 -0
  128. package/lib/components/waitingList/WaitingListView.d.ts +3 -0
  129. package/lib/components/waitingList/WaitingListView.js +19 -0
  130. package/lib/components/waitingList/WaitingListView.js.map +1 -0
  131. package/lib/components/waitingList/styles.d.ts +8 -0
  132. package/lib/components/waitingList/styles.js +9 -0
  133. package/lib/components/waitingList/styles.js.map +1 -0
  134. package/lib/components/waitingList/types.d.ts +49 -0
  135. package/lib/components/waitingList/types.js +2 -0
  136. package/lib/components/waitingList/types.js.map +1 -0
  137. package/lib/containers/billingInfo/BillingInfo.d.ts +3 -0
  138. package/lib/containers/billingInfo/BillingInfo.js +627 -0
  139. package/lib/containers/billingInfo/BillingInfo.js.map +1 -0
  140. package/lib/containers/billingInfo/BillingInfoData.d.ts +6 -0
  141. package/lib/containers/billingInfo/BillingInfoData.js +79 -0
  142. package/lib/containers/billingInfo/BillingInfoData.js.map +1 -0
  143. package/lib/containers/billingInfo/BillingInfoView.d.ts +3 -0
  144. package/lib/containers/billingInfo/BillingInfoView.js +23 -0
  145. package/lib/containers/billingInfo/BillingInfoView.js.map +1 -0
  146. package/lib/containers/billingInfo/styles.d.ts +20 -0
  147. package/lib/containers/billingInfo/styles.js +21 -0
  148. package/lib/containers/billingInfo/styles.js.map +1 -0
  149. package/lib/containers/billingInfo/types.d.ts +103 -0
  150. package/lib/containers/billingInfo/types.js +2 -0
  151. package/lib/containers/billingInfo/types.js.map +1 -0
  152. package/lib/containers/checkout/Checkout.d.ts +3 -0
  153. package/lib/containers/checkout/Checkout.js +162 -0
  154. package/lib/containers/checkout/Checkout.js.map +1 -0
  155. package/lib/containers/checkout/CheckoutData.d.ts +2 -0
  156. package/lib/containers/checkout/CheckoutData.js +28 -0
  157. package/lib/containers/checkout/CheckoutData.js.map +1 -0
  158. package/lib/containers/checkout/CheckoutView.d.ts +3 -0
  159. package/lib/containers/checkout/CheckoutView.js +34 -0
  160. package/lib/containers/checkout/CheckoutView.js.map +1 -0
  161. package/lib/containers/checkout/components/Conditions.d.ts +3 -0
  162. package/lib/containers/checkout/components/Conditions.js +11 -0
  163. package/lib/containers/checkout/components/Conditions.js.map +1 -0
  164. package/lib/containers/checkout/components/OrderReview.d.ts +3 -0
  165. package/lib/containers/checkout/components/OrderReview.js +10 -0
  166. package/lib/containers/checkout/components/OrderReview.js.map +1 -0
  167. package/lib/containers/checkout/components/styles.d.ts +25 -0
  168. package/lib/containers/checkout/components/styles.js +27 -0
  169. package/lib/containers/checkout/components/styles.js.map +1 -0
  170. package/lib/containers/checkout/styles.d.ts +29 -0
  171. package/lib/containers/checkout/styles.js +31 -0
  172. package/lib/containers/checkout/styles.js.map +1 -0
  173. package/lib/containers/checkout/types.d.ts +41 -0
  174. package/lib/containers/checkout/types.js +2 -0
  175. package/lib/containers/checkout/types.js.map +1 -0
  176. package/lib/containers/index.d.ts +6 -0
  177. package/lib/containers/index.js +7 -0
  178. package/lib/containers/index.js.map +1 -0
  179. package/lib/containers/myOrderDetails/MyOrderDetails.d.ts +4 -0
  180. package/lib/containers/myOrderDetails/MyOrderDetails.js +11 -0
  181. package/lib/containers/myOrderDetails/MyOrderDetails.js.map +1 -0
  182. package/lib/containers/myOrderDetails/MyOrderDetailsView.d.ts +4 -0
  183. package/lib/containers/myOrderDetails/MyOrderDetailsView.js +60 -0
  184. package/lib/containers/myOrderDetails/MyOrderDetailsView.js.map +1 -0
  185. package/lib/containers/myOrderDetails/styles.d.ts +0 -0
  186. package/lib/containers/myOrderDetails/styles.js +2 -0
  187. package/lib/containers/myOrderDetails/styles.js.map +1 -0
  188. package/lib/containers/myOrderDetails/types.d.ts +11 -0
  189. package/lib/containers/myOrderDetails/types.js +2 -0
  190. package/lib/containers/myOrderDetails/types.js.map +1 -0
  191. package/lib/containers/myOrders/MyOrders.d.ts +9 -0
  192. package/lib/containers/myOrders/MyOrders.js +62 -0
  193. package/lib/containers/myOrders/MyOrders.js.map +1 -0
  194. package/lib/containers/myOrders/MyOrdersView.d.ts +3 -0
  195. package/lib/containers/myOrders/MyOrdersView.js +30 -0
  196. package/lib/containers/myOrders/MyOrdersView.js.map +1 -0
  197. package/lib/containers/myOrders/components/OrderListItem.d.ts +4 -0
  198. package/lib/containers/myOrders/components/OrderListItem.js +29 -0
  199. package/lib/containers/myOrders/components/OrderListItem.js.map +1 -0
  200. package/lib/containers/myOrders/components/styles.d.ts +51 -0
  201. package/lib/containers/myOrders/components/styles.js +50 -0
  202. package/lib/containers/myOrders/components/styles.js.map +1 -0
  203. package/lib/containers/myOrders/components/types.d.ts +25 -0
  204. package/lib/containers/myOrders/components/types.js +2 -0
  205. package/lib/containers/myOrders/components/types.js.map +1 -0
  206. package/lib/containers/myOrders/styles.d.ts +21 -0
  207. package/lib/containers/myOrders/styles.js +23 -0
  208. package/lib/containers/myOrders/styles.js.map +1 -0
  209. package/lib/containers/myOrders/types.d.ts +27 -0
  210. package/lib/containers/myOrders/types.js +2 -0
  211. package/lib/containers/myOrders/types.js.map +1 -0
  212. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.d.ts +3 -0
  213. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js +17 -0
  214. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js.map +1 -0
  215. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.d.ts +3 -0
  216. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js +15 -0
  217. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js.map +1 -0
  218. package/lib/containers/purchaseConfirmation/styles.d.ts +73 -0
  219. package/lib/containers/purchaseConfirmation/styles.js +75 -0
  220. package/lib/containers/purchaseConfirmation/styles.js.map +1 -0
  221. package/lib/containers/purchaseConfirmation/types.d.ts +50 -0
  222. package/lib/containers/purchaseConfirmation/types.js +2 -0
  223. package/lib/containers/purchaseConfirmation/types.js.map +1 -0
  224. package/lib/containers/tickets/Tickets.d.ts +3 -0
  225. package/lib/containers/tickets/Tickets.js +143 -0
  226. package/lib/containers/tickets/Tickets.js.map +1 -0
  227. package/lib/containers/tickets/TicketsView.d.ts +3 -0
  228. package/lib/containers/tickets/TicketsView.js +35 -0
  229. package/lib/containers/tickets/TicketsView.js.map +1 -0
  230. package/lib/containers/tickets/components/TicketListItem.d.ts +3 -0
  231. package/lib/containers/tickets/components/TicketListItem.js +46 -0
  232. package/lib/containers/tickets/components/TicketListItem.js.map +1 -0
  233. package/lib/containers/tickets/components/styles.d.ts +50 -0
  234. package/lib/containers/tickets/components/styles.js +53 -0
  235. package/lib/containers/tickets/components/styles.js.map +1 -0
  236. package/lib/containers/tickets/components/types.d.ts +25 -0
  237. package/lib/containers/tickets/components/types.js +2 -0
  238. package/lib/containers/tickets/components/types.js.map +1 -0
  239. package/lib/containers/tickets/styles.d.ts +19 -0
  240. package/lib/containers/tickets/styles.js +21 -0
  241. package/lib/containers/tickets/styles.js.map +1 -0
  242. package/lib/containers/tickets/types.d.ts +69 -0
  243. package/lib/containers/tickets/types.js +2 -0
  244. package/lib/containers/tickets/types.js.map +1 -0
  245. package/lib/helpers/Debounced.d.ts +1 -0
  246. package/lib/helpers/Debounced.js +24 -0
  247. package/lib/helpers/Debounced.js.map +1 -0
  248. package/lib/helpers/LocalStorage.d.ts +16 -0
  249. package/lib/helpers/LocalStorage.js +58 -0
  250. package/lib/helpers/LocalStorage.js.map +1 -0
  251. package/lib/helpers/StringsHelper.d.ts +1 -0
  252. package/lib/helpers/StringsHelper.js +7 -0
  253. package/lib/helpers/StringsHelper.js.map +1 -0
  254. package/lib/helpers/Validators.d.ts +5 -0
  255. package/lib/helpers/Validators.js +36 -0
  256. package/lib/helpers/Validators.js.map +1 -0
  257. package/lib/index.d.ts +6 -0
  258. package/lib/index.js +6 -0
  259. package/lib/index.js.map +1 -0
  260. package/lib/res/colors.d.ts +12 -0
  261. package/lib/res/colors.js +27 -0
  262. package/lib/res/colors.js.map +1 -0
  263. package/lib/res/icons.d.ts +7 -0
  264. package/lib/res/icons.js +7 -0
  265. package/lib/res/icons.js.map +1 -0
  266. package/lib/res/images.d.ts +4 -0
  267. package/lib/res/images.js +4 -0
  268. package/lib/res/images.js.map +1 -0
  269. package/lib/res/index.d.ts +23 -0
  270. package/lib/res/index.js +10 -0
  271. package/lib/res/index.js.map +1 -0
  272. package/lib/types/IEvent.d.ts +64 -0
  273. package/lib/types/IEvent.js +2 -0
  274. package/lib/types/IEvent.js.map +1 -0
  275. package/lib/types/ITicket.d.ts +44 -0
  276. package/lib/types/ITicket.js +2 -0
  277. package/lib/types/ITicket.js.map +1 -0
  278. package/lib/types/IUserProfile.d.ts +24 -0
  279. package/lib/types/IUserProfile.js +2 -0
  280. package/lib/types/IUserProfile.js.map +1 -0
  281. package/lib/types/index.d.ts +3 -0
  282. package/lib/types/index.js +4 -0
  283. package/lib/types/index.js.map +1 -0
  284. package/package.json +80 -0
  285. package/tf-checkout-react-native.podspec +19 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 The Ticket Fairy
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,168 @@
1
+ # tf-checkout-react-native
2
+
3
+ React Native library for Ticket Fairy checkout
4
+
5
+ # Requirements
6
+
7
+ Configure [ReactNative environment](https://reactnative.dev/docs/environment-setup) for desired platforms (iOS, Android or both).
8
+
9
+ # Installation [🚧 WIP 🚧]
10
+
11
+ These are not the REAL library names.
12
+
13
+ `yarn add theticketfairy/tf-checkout-react-native`
14
+
15
+ or
16
+
17
+ `npm install theticketfairy/tf-checkout-react-native`
18
+
19
+ # Run the example app
20
+
21
+ 1. Clone this repo.
22
+ 2. In the App.tsx file, update the `EVENT_ID` const with the assigned ID to be able to retrieve data from the server.
23
+ 3. cd into the project folder and `yarn` or `npm install`.
24
+ 4. cd into the example folder and `yarn` or `npm install`.
25
+ - If running on iOS, cd into ios folder and `pod install && cd ..`.
26
+ 5. Run `yarn ios` or `npm run ios` to initialize and run in the iPhone simulator.
27
+ 6. If running on Android, run `yarn android` or `npm run android` to run it in the Android emulator or connected physical device.
28
+
29
+ # Features
30
+
31
+ This library exports 4 main components:
32
+
33
+ ## Tickets
34
+
35
+ 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.
36
+
37
+ User can select what ticket type wants to buy and the quantity of tickets.
38
+
39
+ ## Billing information
40
+
41
+ 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.
42
+
43
+ ## Checkout
44
+
45
+ Will show the order details and a card form that the user will need to fill with its card details.
46
+
47
+ TicketFairy doesn't store any card related data, we use [Stripe](https://stripe.com/) as payments solution.
48
+
49
+ ## Purchase confirmation
50
+
51
+ 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.
52
+
53
+ # Usage [🚧 WIP 🚧]
54
+
55
+ ## Tickets
56
+
57
+ Import the component from the library
58
+
59
+ ```js
60
+ import { Tickets } from 'tf-checkout-react-native'
61
+ ```
62
+
63
+ Then add it to the render function.
64
+
65
+ ```js
66
+ <Tickets eventId={EVENT_ID} onAddToCartSuccess={handleOnAddToCartSuccess} />
67
+ ```
68
+
69
+ `eventId` is required in order to fetch the tickets from this event.
70
+ `onAddToCartSuccess` is called after the Add to Cart was completed successfully, it will return the following data:
71
+
72
+ ```js
73
+ {
74
+ isBillingRequired: boolean
75
+ isNameRequired: boolean
76
+ isAgeRequired: boolean
77
+ }
78
+ ```
79
+
80
+ You can then call the `BillingInfo` component and pass them as props in the `cartProps` prop.
81
+
82
+ ## BillingInfo
83
+
84
+ Import the component from the library
85
+
86
+ ```js
87
+ import { BillingInfo } from 'tf-checkout-react-native'
88
+ ```
89
+
90
+ Add it to the render function.
91
+
92
+ ```js
93
+ <BillingInfo
94
+ cartProps={cartProps!}
95
+ onCheckoutSuccess={handleOnCheckoutSuccess}
96
+ />
97
+ ```
98
+
99
+ `cartProps` will receive
100
+
101
+ ```js
102
+ {
103
+ isBillingRequired: boolean
104
+ isNameRequired: boolean
105
+ isAgeRequired: boolean
106
+ }
107
+ ```
108
+
109
+ `onCheckoutSuccess` will be called when the user completes all the data required in the form. Will return the following data:
110
+
111
+ ```js
112
+ {
113
+ id: string
114
+ hash: string
115
+ total: string
116
+ status: string
117
+ }
118
+ ```
119
+
120
+ `hash` and `total` will be used in the `Checkout` component.
121
+
122
+ ## Checkout
123
+
124
+ Import the component from the library
125
+
126
+ ```js
127
+ import { Checkout } from 'tf-checkout-react-native'
128
+ ```
129
+
130
+ Add it to the render function.
131
+
132
+ ```js
133
+ <Checkout
134
+ eventId={EVENT_ID}
135
+ hash={checkoutProps!.hash}
136
+ total={checkoutProps!.total}
137
+ onPaymentSuccess={handleOnPaymentSuccess}
138
+ />
139
+ ```
140
+
141
+ `eventId` Same as used in the `Tickets` component.
142
+
143
+ `hash` retrieved from the `onCheckoutSuccess` callback in the `BillingInfo`component.
144
+
145
+ `total` retrieved from the `onCheckoutSuccess` callback in the `BillingInfo` component.
146
+
147
+ `onPaymentSuccess` will handle the success in the payment process. Will return the `hash`.
148
+
149
+ ## PurchaseConfirmation
150
+
151
+ Import the component from the library
152
+
153
+ ```js
154
+ import { PurchaseConfirmation } from 'tf-checkout-react-native'
155
+ ```
156
+
157
+ Add it to the render function.
158
+
159
+ ```js
160
+ <PurchaseConfirmation
161
+ orderHash={checkoutProps!.hash}
162
+ onComplete={handleOnComplete}
163
+ />
164
+ ```
165
+
166
+ `orderHash` the `hash` returned in the `BillingInfo` component.
167
+
168
+ `onComplete` to handle the completion of the flow. Here you can handle the unmount of the component or navigate to another screen.
@@ -0,0 +1,42 @@
1
+ buildscript {
2
+ ext.safeExtGet = { prop, fallback ->
3
+ return rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
4
+ }
5
+
6
+ repositories {
7
+ google()
8
+ mavenCentral()
9
+ }
10
+
11
+ dependencies {
12
+ classpath 'com.android.tools.build:gradle:4.2.2'
13
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.5.30')}"
14
+ }
15
+ }
16
+
17
+ def safeExtGet(prop, fallback) {
18
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
19
+ }
20
+
21
+ apply plugin: 'com.android.library'
22
+ apply plugin: 'kotlin-android'
23
+
24
+ android {
25
+ compileSdkVersion safeExtGet('compileSdkVersion', 30)
26
+ buildToolsVersion safeExtGet('buildToolsVersion', '30.0.2')
27
+
28
+ defaultConfig {
29
+ minSdkVersion safeExtGet('minSdkVersion', 21)
30
+ targetSdkVersion safeExtGet('targetSdkVersion', 30)
31
+ }
32
+ }
33
+
34
+ repositories {
35
+ google()
36
+ mavenCentral()
37
+ }
38
+
39
+ dependencies {
40
+ //noinspection GradleDynamicVersion
41
+ implementation 'com.facebook.react:react-native:+'
42
+ }
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.theticketfairy.tfcheckoutreactnative"></manifest>
@@ -0,0 +1,13 @@
1
+ package com.theticketfairy.tfcheckoutreactnative
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import com.facebook.react.bridge.ReactContextBaseJavaModule
5
+
6
+ class TFCheckoutRNModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(reactContext) {
7
+
8
+ override fun getName() = "TFCheckoutRNModule"
9
+
10
+ override fun getConstants(): MutableMap<String, Any> {
11
+ return hashMapOf("count" to 1)
12
+ }
13
+ }
@@ -0,0 +1,19 @@
1
+ package com.theticketfairy.tfcheckoutreactnative
2
+
3
+ import com.facebook.react.ReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.uimanager.ViewManager
7
+
8
+ class TFCheckoutRNPackage : ReactPackage {
9
+
10
+ override fun createViewManagers(reactContext: ReactApplicationContext):
11
+ MutableList<ViewManager<*, *>> {
12
+ return mutableListOf()
13
+ }
14
+
15
+ override fun createNativeModules(reactContext: ReactApplicationContext):
16
+ MutableList<NativeModule> {
17
+ return mutableListOf(TFCheckoutRNModule(reactContext))
18
+ }
19
+ }
@@ -0,0 +1,5 @@
1
+ //
2
+ // Use this file to import your target's public headers that you would like to expose to Swift.
3
+ //
4
+
5
+ #import <React/RCTBridgeModule.h>
@@ -0,0 +1,11 @@
1
+ //
2
+ // TFCheckoutRNModule.m
3
+ // TFCheckoutRNModule
4
+ //
5
+ // Copyright © 2021 TheTicketFairy. All rights reserved.
6
+ //
7
+
8
+ #import <React/RCTBridgeModule.h>
9
+
10
+ @interface RCT_EXTERN_MODULE(TFCheckoutRNModule, NSObject)
11
+ @end
@@ -0,0 +1,21 @@
1
+ //
2
+ // TFCheckoutRNModule.swift
3
+ // TFCheckoutRNModule
4
+ //
5
+ // Copyright © 2021 TheTicketFairy. All rights reserved.
6
+ //
7
+
8
+ import Foundation
9
+
10
+ @objc(TFCheckoutRNModule)
11
+ class TFCheckoutRNModule: NSObject {
12
+ @objc
13
+ func constantsToExport() -> [AnyHashable : Any]! {
14
+ return ["count": 1]
15
+ }
16
+
17
+ @objc
18
+ static func requiresMainQueueSetup() -> Bool {
19
+ return true
20
+ }
21
+ }
@@ -0,0 +1,314 @@
1
+ // !$*UTF8*$!
2
+ {
3
+ archiveVersion = 1;
4
+ classes = {
5
+ };
6
+ objectVersion = 50;
7
+ objects = {
8
+
9
+ /* Begin PBXBuildFile section */
10
+ FA4F9FE82512AA42002DB4D5 /* TFCheckoutRNModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA4F9FE72512AA42002DB4D5 /* TFCheckoutRNModule.swift */; };
11
+ FA4F9FEB2512ACC2002DB4D5 /* TFCheckoutRNModule.m in Sources */ = {isa = PBXBuildFile; fileRef = FA4F9FEA2512ACC2002DB4D5 /* TFCheckoutRNModule.m */; };
12
+ /* End PBXBuildFile section */
13
+
14
+ /* Begin PBXCopyFilesBuildPhase section */
15
+ FA0EFF5E236CC8FB00069FA8 /* CopyFiles */ = {
16
+ isa = PBXCopyFilesBuildPhase;
17
+ buildActionMask = 2147483647;
18
+ dstPath = "include/$(PRODUCT_NAME)";
19
+ dstSubfolderSpec = 16;
20
+ files = (
21
+ );
22
+ runOnlyForDeploymentPostprocessing = 0;
23
+ };
24
+ /* End PBXCopyFilesBuildPhase section */
25
+
26
+ /* Begin PBXFileReference section */
27
+ FA0EFF60236CC8FB00069FA8 /* libTFCheckoutRNModule.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libTFCheckoutRNModule.a; sourceTree = BUILT_PRODUCTS_DIR; };
28
+ FA4F9FE62512AA41002DB4D5 /* TFCheckoutRNModule-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TFCheckoutRNModule-Bridging-Header.h"; sourceTree = "<group>"; };
29
+ FA4F9FE72512AA42002DB4D5 /* TFCheckoutRNModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TFCheckoutRNModule.swift; sourceTree = "<group>"; };
30
+ FA4F9FEA2512ACC2002DB4D5 /* TFCheckoutRNModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TFCheckoutRNModule.m; sourceTree = "<group>"; };
31
+ /* End PBXFileReference section */
32
+
33
+ /* Begin PBXFrameworksBuildPhase section */
34
+ FA0EFF5D236CC8FB00069FA8 /* Frameworks */ = {
35
+ isa = PBXFrameworksBuildPhase;
36
+ buildActionMask = 2147483647;
37
+ files = (
38
+ );
39
+ runOnlyForDeploymentPostprocessing = 0;
40
+ };
41
+ /* End PBXFrameworksBuildPhase section */
42
+
43
+ /* Begin PBXGroup section */
44
+ FA0EFF57236CC8FB00069FA8 = {
45
+ isa = PBXGroup;
46
+ children = (
47
+ FA4F9FE62512AA41002DB4D5 /* TFCheckoutRNModule-Bridging-Header.h */,
48
+ FA4F9FEA2512ACC2002DB4D5 /* TFCheckoutRNModule.m */,
49
+ FA4F9FE72512AA42002DB4D5 /* TFCheckoutRNModule.swift */,
50
+ FA0EFF61236CC8FB00069FA8 /* Products */,
51
+ );
52
+ sourceTree = "<group>";
53
+ };
54
+ FA0EFF61236CC8FB00069FA8 /* Products */ = {
55
+ isa = PBXGroup;
56
+ children = (
57
+ FA0EFF60236CC8FB00069FA8 /* libTFCheckoutRNModule.a */,
58
+ );
59
+ name = Products;
60
+ sourceTree = "<group>";
61
+ };
62
+ /* End PBXGroup section */
63
+
64
+ /* Begin PBXNativeTarget section */
65
+ FA0EFF5F236CC8FB00069FA8 /* TFCheckoutRNModule */ = {
66
+ isa = PBXNativeTarget;
67
+ buildConfigurationList = FA0EFF69236CC8FB00069FA8 /* Build configuration list for PBXNativeTarget "TFCheckoutRNModule" */;
68
+ buildPhases = (
69
+ FA0EFF5C236CC8FB00069FA8 /* Sources */,
70
+ FA0EFF5D236CC8FB00069FA8 /* Frameworks */,
71
+ FA0EFF5E236CC8FB00069FA8 /* CopyFiles */,
72
+ );
73
+ buildRules = (
74
+ );
75
+ dependencies = (
76
+ );
77
+ name = TFCheckoutRNModule;
78
+ productName = TFCheckoutRNModule;
79
+ productReference = FA0EFF60236CC8FB00069FA8 /* libTFCheckoutRNModule.a */;
80
+ productType = "com.apple.product-type.library.static";
81
+ };
82
+ /* End PBXNativeTarget section */
83
+
84
+ /* Begin PBXProject section */
85
+ FA0EFF58236CC8FB00069FA8 /* Project object */ = {
86
+ isa = PBXProject;
87
+ attributes = {
88
+ LastUpgradeCheck = 1240;
89
+ ORGANIZATIONNAME = "TheTicketFairy";
90
+ TargetAttributes = {
91
+ FA0EFF5F236CC8FB00069FA8 = {
92
+ CreatedOnToolsVersion = 11.1;
93
+ LastSwiftMigration = 1170;
94
+ };
95
+ };
96
+ };
97
+ buildConfigurationList = FA0EFF5B236CC8FB00069FA8 /* Build configuration list for PBXProject "TFCheckoutRNModule" */;
98
+ compatibilityVersion = "Xcode 9.3";
99
+ developmentRegion = en;
100
+ hasScannedForEncodings = 0;
101
+ knownRegions = (
102
+ en,
103
+ Base,
104
+ );
105
+ mainGroup = FA0EFF57236CC8FB00069FA8;
106
+ productRefGroup = FA0EFF61236CC8FB00069FA8 /* Products */;
107
+ projectDirPath = "";
108
+ projectRoot = "";
109
+ targets = (
110
+ FA0EFF5F236CC8FB00069FA8 /* TFCheckoutRNModule */,
111
+ );
112
+ };
113
+ /* End PBXProject section */
114
+
115
+ /* Begin PBXSourcesBuildPhase section */
116
+ FA0EFF5C236CC8FB00069FA8 /* Sources */ = {
117
+ isa = PBXSourcesBuildPhase;
118
+ buildActionMask = 2147483647;
119
+ files = (
120
+ FA4F9FE82512AA42002DB4D5 /* TFCheckoutRNModule.swift in Sources */,
121
+ FA4F9FEB2512ACC2002DB4D5 /* TFCheckoutRNModule.m in Sources */,
122
+ );
123
+ runOnlyForDeploymentPostprocessing = 0;
124
+ };
125
+ /* End PBXSourcesBuildPhase section */
126
+
127
+ /* Begin XCBuildConfiguration section */
128
+ FA0EFF67236CC8FB00069FA8 /* Debug */ = {
129
+ isa = XCBuildConfiguration;
130
+ buildSettings = {
131
+ ALWAYS_SEARCH_USER_PATHS = NO;
132
+ CLANG_ANALYZER_NONNULL = YES;
133
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
134
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
135
+ CLANG_CXX_LIBRARY = "libc++";
136
+ CLANG_ENABLE_MODULES = YES;
137
+ CLANG_ENABLE_OBJC_ARC = YES;
138
+ CLANG_ENABLE_OBJC_WEAK = YES;
139
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
140
+ CLANG_WARN_BOOL_CONVERSION = YES;
141
+ CLANG_WARN_COMMA = YES;
142
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
143
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
144
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
145
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
146
+ CLANG_WARN_EMPTY_BODY = YES;
147
+ CLANG_WARN_ENUM_CONVERSION = YES;
148
+ CLANG_WARN_INFINITE_RECURSION = YES;
149
+ CLANG_WARN_INT_CONVERSION = YES;
150
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
151
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
152
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
153
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
154
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
155
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
156
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
157
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
158
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
159
+ CLANG_WARN_UNREACHABLE_CODE = YES;
160
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
161
+ COPY_PHASE_STRIP = NO;
162
+ DEBUG_INFORMATION_FORMAT = dwarf;
163
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
164
+ ENABLE_TESTABILITY = YES;
165
+ GCC_C_LANGUAGE_STANDARD = gnu11;
166
+ GCC_DYNAMIC_NO_PIC = NO;
167
+ GCC_NO_COMMON_BLOCKS = YES;
168
+ GCC_OPTIMIZATION_LEVEL = 0;
169
+ GCC_PREPROCESSOR_DEFINITIONS = (
170
+ "DEBUG=1",
171
+ "$(inherited)",
172
+ );
173
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
174
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
175
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
176
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
177
+ GCC_WARN_UNUSED_FUNCTION = YES;
178
+ GCC_WARN_UNUSED_VARIABLE = YES;
179
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
180
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
181
+ MTL_FAST_MATH = YES;
182
+ ONLY_ACTIVE_ARCH = YES;
183
+ SDKROOT = iphoneos;
184
+ };
185
+ name = Debug;
186
+ };
187
+ FA0EFF68236CC8FB00069FA8 /* Release */ = {
188
+ isa = XCBuildConfiguration;
189
+ buildSettings = {
190
+ ALWAYS_SEARCH_USER_PATHS = NO;
191
+ CLANG_ANALYZER_NONNULL = YES;
192
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
193
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
194
+ CLANG_CXX_LIBRARY = "libc++";
195
+ CLANG_ENABLE_MODULES = YES;
196
+ CLANG_ENABLE_OBJC_ARC = YES;
197
+ CLANG_ENABLE_OBJC_WEAK = YES;
198
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
199
+ CLANG_WARN_BOOL_CONVERSION = YES;
200
+ CLANG_WARN_COMMA = YES;
201
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
202
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
203
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
204
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
205
+ CLANG_WARN_EMPTY_BODY = YES;
206
+ CLANG_WARN_ENUM_CONVERSION = YES;
207
+ CLANG_WARN_INFINITE_RECURSION = YES;
208
+ CLANG_WARN_INT_CONVERSION = YES;
209
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
210
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
211
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
212
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
213
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
214
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
215
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
216
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
217
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
218
+ CLANG_WARN_UNREACHABLE_CODE = YES;
219
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
220
+ COPY_PHASE_STRIP = NO;
221
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
222
+ ENABLE_NS_ASSERTIONS = NO;
223
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
224
+ GCC_C_LANGUAGE_STANDARD = gnu11;
225
+ GCC_NO_COMMON_BLOCKS = YES;
226
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
227
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
228
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
229
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
230
+ GCC_WARN_UNUSED_FUNCTION = YES;
231
+ GCC_WARN_UNUSED_VARIABLE = YES;
232
+ IPHONEOS_DEPLOYMENT_TARGET = 11.0;
233
+ MTL_ENABLE_DEBUG_INFO = NO;
234
+ MTL_FAST_MATH = YES;
235
+ SDKROOT = iphoneos;
236
+ SWIFT_COMPILATION_MODE = wholemodule;
237
+ VALIDATE_PRODUCT = YES;
238
+ };
239
+ name = Release;
240
+ };
241
+ FA0EFF6A236CC8FB00069FA8 /* Debug */ = {
242
+ isa = XCBuildConfiguration;
243
+ buildSettings = {
244
+ CLANG_ENABLE_MODULES = YES;
245
+ CODE_SIGN_STYLE = Automatic;
246
+ HEADER_SEARCH_PATHS = (
247
+ "$(inherited)",
248
+ "$(SRCROOT)/../example/ios/Pods/Headers/Public/React-Core",
249
+ "$(SRCROOT)/../../../ios/Pods/Headers/Public/React-Core",
250
+ );
251
+ LD_RUNPATH_SEARCH_PATHS = (
252
+ "$(inherited)",
253
+ "@executable_path/Frameworks",
254
+ "@loader_path/Frameworks",
255
+ );
256
+ OTHER_LDFLAGS = "-ObjC";
257
+ PRODUCT_NAME = "$(TARGET_NAME)";
258
+ SKIP_INSTALL = YES;
259
+ SWIFT_OBJC_BRIDGING_HEADER = "TFCheckoutRNModule-Bridging-Header.h";
260
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
261
+ SWIFT_VERSION = 5.0;
262
+ TARGETED_DEVICE_FAMILY = "1,2";
263
+ };
264
+ name = Debug;
265
+ };
266
+ FA0EFF6B236CC8FB00069FA8 /* Release */ = {
267
+ isa = XCBuildConfiguration;
268
+ buildSettings = {
269
+ CLANG_ENABLE_MODULES = YES;
270
+ CODE_SIGN_STYLE = Automatic;
271
+ HEADER_SEARCH_PATHS = (
272
+ "$(inherited)",
273
+ "$(SRCROOT)/../example/ios/Pods/Headers/Public/React-Core",
274
+ "$(SRCROOT)/../../../ios/Pods/Headers/Public/React-Core",
275
+ );
276
+ LD_RUNPATH_SEARCH_PATHS = (
277
+ "$(inherited)",
278
+ "@executable_path/Frameworks",
279
+ "@loader_path/Frameworks",
280
+ );
281
+ OTHER_LDFLAGS = "-ObjC";
282
+ PRODUCT_NAME = "$(TARGET_NAME)";
283
+ SKIP_INSTALL = YES;
284
+ SWIFT_OBJC_BRIDGING_HEADER = "TFCheckoutRNModule-Bridging-Header.h";
285
+ SWIFT_VERSION = 5.0;
286
+ TARGETED_DEVICE_FAMILY = "1,2";
287
+ };
288
+ name = Release;
289
+ };
290
+ /* End XCBuildConfiguration section */
291
+
292
+ /* Begin XCConfigurationList section */
293
+ FA0EFF5B236CC8FB00069FA8 /* Build configuration list for PBXProject "TFCheckoutRNModule" */ = {
294
+ isa = XCConfigurationList;
295
+ buildConfigurations = (
296
+ FA0EFF67236CC8FB00069FA8 /* Debug */,
297
+ FA0EFF68236CC8FB00069FA8 /* Release */,
298
+ );
299
+ defaultConfigurationIsVisible = 0;
300
+ defaultConfigurationName = Release;
301
+ };
302
+ FA0EFF69236CC8FB00069FA8 /* Build configuration list for PBXNativeTarget "TFCheckoutRNModule" */ = {
303
+ isa = XCConfigurationList;
304
+ buildConfigurations = (
305
+ FA0EFF6A236CC8FB00069FA8 /* Debug */,
306
+ FA0EFF6B236CC8FB00069FA8 /* Release */,
307
+ );
308
+ defaultConfigurationIsVisible = 0;
309
+ defaultConfigurationName = Release;
310
+ };
311
+ /* End XCConfigurationList section */
312
+ };
313
+ rootObject = FA0EFF58236CC8FB00069FA8 /* Project object */;
314
+ }
@@ -0,0 +1,62 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { IWaitingListFields } from '../components/waitingList/types';
3
+ import { IUserProfile } from '../types';
4
+ import { IAuthorizeResponse, ICheckoutResponse, IClientRequest, IEventResponse, IFetchTicketsResponse, IMyOrderDetailsResponse, IMyOrdersResponse, IOrderReviewResponse, IRegisterNewUserResponse } from './types';
5
+ export declare const Client: IClientRequest;
6
+ export declare const setCustomHeader: (response: any) => void;
7
+ export declare const setAccessTokenHandler: (accessToken: string) => Promise<void>;
8
+ export declare const authorize: (data: FormData) => Promise<IAuthorizeResponse>;
9
+ export declare const fetchAccessToken: (data: FormData) => Promise<{
10
+ error: undefined;
11
+ accessToken: any;
12
+ }>;
13
+ export declare const fetchUserProfile: (accessToken: any) => Promise<{
14
+ error: undefined;
15
+ userProfile: IUserProfile | undefined;
16
+ }>;
17
+ export declare const registerNewUser: (data: FormData) => Promise<IRegisterNewUserResponse>;
18
+ export declare const addToWaitingList: (id: number, values: IWaitingListFields) => Promise<{
19
+ addToWaitingListError: string;
20
+ addToWaitingListData: any;
21
+ }>;
22
+ export declare const fetchMyOrders: () => Promise<IMyOrdersResponse>;
23
+ export declare const fetchOrderDetails: (orderId: string) => Promise<{
24
+ orderDetailsError: string;
25
+ orderDetailsData: IMyOrderDetailsResponse | undefined;
26
+ }>;
27
+ export declare const fetchTickets: (id: string | number, promoCode: string) => Promise<IFetchTicketsResponse>;
28
+ export declare const addToCart: (id: string | number, data: any) => Promise<{
29
+ data: {
30
+ isBillingRequired: boolean;
31
+ isNameRequired: any;
32
+ isAgeRequired: any;
33
+ } | undefined;
34
+ error: undefined;
35
+ }>;
36
+ export declare const fetchEvent: (id: string | number) => Promise<IEventResponse>;
37
+ export declare const fetchCountries: () => Promise<{
38
+ data: any;
39
+ error: string;
40
+ }>;
41
+ export declare const fetchStates: (countryId: string) => Promise<{
42
+ error: string;
43
+ data: any;
44
+ }>;
45
+ export declare const fetchCart: () => Promise<{
46
+ error: string;
47
+ data: any;
48
+ }>;
49
+ export declare const checkoutOrder: (data: any, accessToken: string) => Promise<ICheckoutResponse>;
50
+ export declare const fetchEventConditions: (eventId: string) => Promise<{
51
+ error: undefined;
52
+ data: any;
53
+ }>;
54
+ export declare const fetchOrderReview: (hash: string) => Promise<IOrderReviewResponse>;
55
+ export declare const postOnPaymentSuccess: (orderHash: string) => Promise<{
56
+ error: string;
57
+ data: any;
58
+ }>;
59
+ export declare const fetchPurchaseConfirmation: (orderHash: string) => Promise<{
60
+ error: undefined;
61
+ data: void | AxiosResponse<any, any>;
62
+ }>;