@oxyhq/services 5.5.9 → 5.6.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 (393) hide show
  1. package/README.md +16 -2
  2. package/lib/commonjs/core/index.js +69 -82
  3. package/lib/commonjs/core/index.js.map +1 -1
  4. package/lib/commonjs/index.js +24 -183
  5. package/lib/commonjs/index.js.map +1 -1
  6. package/lib/commonjs/node/index.js +0 -2
  7. package/lib/commonjs/node/index.js.map +1 -1
  8. package/lib/commonjs/ui/components/FollowButton.js +100 -229
  9. package/lib/commonjs/ui/components/FollowButton.js.map +1 -1
  10. package/lib/commonjs/ui/components/OxyPayButton.js +131 -0
  11. package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -0
  12. package/lib/commonjs/ui/components/OxyProvider.js +41 -198
  13. package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
  14. package/lib/commonjs/ui/components/OxySignInButton.js +15 -2
  15. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  16. package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js +66 -0
  17. package/lib/commonjs/ui/components/icon/FAIRWalletIcon.js.map +1 -0
  18. package/lib/commonjs/ui/components/icon/index.js +7 -0
  19. package/lib/commonjs/ui/components/icon/index.js.map +1 -1
  20. package/lib/commonjs/ui/components/index.js +7 -0
  21. package/lib/commonjs/ui/components/index.js.map +1 -1
  22. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -7
  23. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  24. package/lib/commonjs/ui/components/internal/PinInput.js +108 -0
  25. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -0
  26. package/lib/commonjs/ui/components/internal/TextField.js +20 -0
  27. package/lib/commonjs/ui/components/internal/TextField.js.map +1 -1
  28. package/lib/commonjs/ui/context/OxyContext.js +26 -36
  29. package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
  30. package/lib/commonjs/ui/hooks/index.js +2 -15
  31. package/lib/commonjs/ui/hooks/index.js.map +1 -1
  32. package/lib/commonjs/ui/hooks/useFollow.js +52 -136
  33. package/lib/commonjs/ui/hooks/useFollow.js.map +1 -1
  34. package/lib/commonjs/ui/hooks/useSessionSocket.js +52 -0
  35. package/lib/commonjs/ui/hooks/useSessionSocket.js.map +1 -0
  36. package/lib/commonjs/ui/index.js +8 -191
  37. package/lib/commonjs/ui/index.js.map +1 -1
  38. package/lib/commonjs/ui/navigation/OxyRouter.js +52 -60
  39. package/lib/commonjs/ui/navigation/OxyRouter.js.map +1 -1
  40. package/lib/commonjs/ui/screens/AccountCenterScreen.js +18 -30
  41. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  42. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +4 -22
  43. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  44. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +6 -14
  45. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  46. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +37 -66
  47. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  48. package/lib/commonjs/ui/screens/AppInfoScreen.js +21 -44
  49. package/lib/commonjs/ui/screens/AppInfoScreen.js.map +1 -1
  50. package/lib/commonjs/ui/screens/FeedbackScreen.js +44 -23
  51. package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
  52. package/lib/commonjs/ui/screens/FileManagementScreen.js +59 -78
  53. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  54. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +1588 -0
  55. package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -0
  56. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +22 -36
  57. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  58. package/lib/commonjs/ui/screens/RecoverAccountScreen.js +269 -0
  59. package/lib/commonjs/ui/screens/RecoverAccountScreen.js.map +1 -0
  60. package/lib/commonjs/ui/screens/SessionManagementScreen.js +47 -69
  61. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  62. package/lib/commonjs/ui/screens/SignInScreen.js +99 -333
  63. package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
  64. package/lib/commonjs/ui/screens/SignUpScreen.js +136 -340
  65. package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
  66. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js +192 -0
  67. package/lib/commonjs/ui/screens/internal/SignInPasswordStep.js.map +1 -0
  68. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +135 -0
  69. package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -0
  70. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js +108 -0
  71. package/lib/commonjs/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
  72. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js +126 -0
  73. package/lib/commonjs/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
  74. package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js +84 -0
  75. package/lib/commonjs/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
  76. package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js +59 -0
  77. package/lib/commonjs/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
  78. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js +15 -2
  79. package/lib/commonjs/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  80. package/lib/commonjs/ui/stores/authStore.js +31 -0
  81. package/lib/commonjs/ui/stores/authStore.js.map +1 -0
  82. package/lib/commonjs/ui/stores/followStore.js +124 -0
  83. package/lib/commonjs/ui/stores/followStore.js.map +1 -0
  84. package/lib/commonjs/ui/styles/index.js +0 -11
  85. package/lib/commonjs/ui/styles/index.js.map +1 -1
  86. package/lib/commonjs/ui/utils/confirmAction.js +28 -0
  87. package/lib/commonjs/ui/utils/confirmAction.js.map +1 -0
  88. package/lib/module/core/index.js +69 -81
  89. package/lib/module/core/index.js.map +1 -1
  90. package/lib/module/index.js +14 -17
  91. package/lib/module/index.js.map +1 -1
  92. package/lib/module/node/index.js +0 -3
  93. package/lib/module/node/index.js.map +1 -1
  94. package/lib/module/ui/components/FollowButton.js +100 -229
  95. package/lib/module/ui/components/FollowButton.js.map +1 -1
  96. package/lib/module/ui/components/OxyPayButton.js +125 -0
  97. package/lib/module/ui/components/OxyPayButton.js.map +1 -0
  98. package/lib/module/ui/components/OxyProvider.js +42 -199
  99. package/lib/module/ui/components/OxyProvider.js.map +1 -1
  100. package/lib/module/ui/components/OxySignInButton.js +15 -2
  101. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  102. package/lib/module/ui/components/icon/FAIRWalletIcon.js +60 -0
  103. package/lib/module/ui/components/icon/FAIRWalletIcon.js.map +1 -0
  104. package/lib/module/ui/components/icon/index.js +1 -0
  105. package/lib/module/ui/components/icon/index.js.map +1 -1
  106. package/lib/module/ui/components/index.js +1 -0
  107. package/lib/module/ui/components/index.js.map +1 -1
  108. package/lib/module/ui/components/internal/GroupedPillButtons.js +15 -8
  109. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  110. package/lib/module/ui/components/internal/PinInput.js +103 -0
  111. package/lib/module/ui/components/internal/PinInput.js.map +1 -0
  112. package/lib/module/ui/components/internal/TextField.js +20 -0
  113. package/lib/module/ui/components/internal/TextField.js.map +1 -1
  114. package/lib/module/ui/context/OxyContext.js +26 -36
  115. package/lib/module/ui/context/OxyContext.js.map +1 -1
  116. package/lib/module/ui/hooks/index.js +1 -2
  117. package/lib/module/ui/hooks/index.js.map +1 -1
  118. package/lib/module/ui/hooks/useFollow.js +52 -137
  119. package/lib/module/ui/hooks/useFollow.js.map +1 -1
  120. package/lib/module/ui/hooks/useSessionSocket.js +47 -0
  121. package/lib/module/ui/hooks/useSessionSocket.js.map +1 -0
  122. package/lib/module/ui/index.js +2 -13
  123. package/lib/module/ui/index.js.map +1 -1
  124. package/lib/module/ui/navigation/OxyRouter.js +53 -61
  125. package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
  126. package/lib/module/ui/screens/AccountCenterScreen.js +6 -18
  127. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  128. package/lib/module/ui/screens/AccountOverviewScreen.js +5 -23
  129. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  130. package/lib/module/ui/screens/AccountSettingsScreen.js +7 -15
  131. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  132. package/lib/module/ui/screens/AccountSwitcherScreen.js +38 -67
  133. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  134. package/lib/module/ui/screens/AppInfoScreen.js +22 -45
  135. package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
  136. package/lib/module/ui/screens/FeedbackScreen.js +44 -23
  137. package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
  138. package/lib/module/ui/screens/FileManagementScreen.js +59 -78
  139. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  140. package/lib/module/ui/screens/PaymentGatewayScreen.js +1583 -0
  141. package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -0
  142. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +23 -37
  143. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  144. package/lib/module/ui/screens/RecoverAccountScreen.js +263 -0
  145. package/lib/module/ui/screens/RecoverAccountScreen.js.map +1 -0
  146. package/lib/module/ui/screens/SessionManagementScreen.js +47 -69
  147. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  148. package/lib/module/ui/screens/SignInScreen.js +100 -334
  149. package/lib/module/ui/screens/SignInScreen.js.map +1 -1
  150. package/lib/module/ui/screens/SignUpScreen.js +137 -341
  151. package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
  152. package/lib/module/ui/screens/internal/SignInPasswordStep.js +186 -0
  153. package/lib/module/ui/screens/internal/SignInPasswordStep.js.map +1 -0
  154. package/lib/module/ui/screens/internal/SignInUsernameStep.js +129 -0
  155. package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -0
  156. package/lib/module/ui/screens/internal/SignUpIdentityStep.js +102 -0
  157. package/lib/module/ui/screens/internal/SignUpIdentityStep.js.map +1 -0
  158. package/lib/module/ui/screens/internal/SignUpSecurityStep.js +120 -0
  159. package/lib/module/ui/screens/internal/SignUpSecurityStep.js.map +1 -0
  160. package/lib/module/ui/screens/internal/SignUpSummaryStep.js +79 -0
  161. package/lib/module/ui/screens/internal/SignUpSummaryStep.js.map +1 -0
  162. package/lib/module/ui/screens/internal/SignUpWelcomeStep.js +54 -0
  163. package/lib/module/ui/screens/internal/SignUpWelcomeStep.js.map +1 -0
  164. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js +16 -3
  165. package/lib/module/ui/screens/karma/KarmaRewardsScreen.js.map +1 -1
  166. package/lib/module/ui/stores/authStore.js +27 -0
  167. package/lib/module/ui/stores/authStore.js.map +1 -0
  168. package/lib/module/ui/stores/followStore.js +120 -0
  169. package/lib/module/ui/stores/followStore.js.map +1 -0
  170. package/lib/module/ui/styles/index.js +0 -1
  171. package/lib/module/ui/styles/index.js.map +1 -1
  172. package/lib/module/ui/utils/confirmAction.js +25 -0
  173. package/lib/module/ui/utils/confirmAction.js.map +1 -0
  174. package/lib/typescript/core/index.d.ts +28 -10
  175. package/lib/typescript/core/index.d.ts.map +1 -1
  176. package/lib/typescript/index.d.ts +5 -4
  177. package/lib/typescript/index.d.ts.map +1 -1
  178. package/lib/typescript/models/secureSession.d.ts +0 -1
  179. package/lib/typescript/models/secureSession.d.ts.map +1 -1
  180. package/lib/typescript/node/index.d.ts +0 -1
  181. package/lib/typescript/node/index.d.ts.map +1 -1
  182. package/lib/typescript/ui/components/FollowButton.d.ts +1 -77
  183. package/lib/typescript/ui/components/FollowButton.d.ts.map +1 -1
  184. package/lib/typescript/ui/components/OxyPayButton.d.ts +29 -0
  185. package/lib/typescript/ui/components/OxyPayButton.d.ts.map +1 -0
  186. package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
  187. package/lib/typescript/ui/components/OxySignInButton.d.ts.map +1 -1
  188. package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts +8 -0
  189. package/lib/typescript/ui/components/icon/FAIRWalletIcon.d.ts.map +1 -0
  190. package/lib/typescript/ui/components/icon/index.d.ts +1 -0
  191. package/lib/typescript/ui/components/icon/index.d.ts.map +1 -1
  192. package/lib/typescript/ui/components/index.d.ts +1 -0
  193. package/lib/typescript/ui/components/index.d.ts.map +1 -1
  194. package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  195. package/lib/typescript/ui/components/internal/PinInput.d.ts +12 -0
  196. package/lib/typescript/ui/components/internal/PinInput.d.ts.map +1 -0
  197. package/lib/typescript/ui/components/internal/TextField.d.ts +1 -0
  198. package/lib/typescript/ui/components/internal/TextField.d.ts.map +1 -1
  199. package/lib/typescript/ui/context/OxyContext.d.ts +0 -2
  200. package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
  201. package/lib/typescript/ui/hooks/index.d.ts +1 -2
  202. package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
  203. package/lib/typescript/ui/hooks/useFollow.d.ts +14 -15
  204. package/lib/typescript/ui/hooks/useFollow.d.ts.map +1 -1
  205. package/lib/typescript/ui/hooks/useSessionSocket.d.ts +11 -0
  206. package/lib/typescript/ui/hooks/useSessionSocket.d.ts.map +1 -0
  207. package/lib/typescript/ui/index.d.ts +2 -5
  208. package/lib/typescript/ui/index.d.ts.map +1 -1
  209. package/lib/typescript/ui/navigation/OxyRouter.d.ts.map +1 -1
  210. package/lib/typescript/ui/navigation/types.d.ts +5 -23
  211. package/lib/typescript/ui/navigation/types.d.ts.map +1 -1
  212. package/lib/typescript/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  213. package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  214. package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  215. package/lib/typescript/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  216. package/lib/typescript/ui/screens/AppInfoScreen.d.ts.map +1 -1
  217. package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
  218. package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
  219. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +27 -0
  220. package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -0
  221. package/lib/typescript/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  222. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts +8 -0
  223. package/lib/typescript/ui/screens/RecoverAccountScreen.d.ts.map +1 -0
  224. package/lib/typescript/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  225. package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
  226. package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
  227. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts +27 -0
  228. package/lib/typescript/ui/screens/internal/SignInPasswordStep.d.ts.map +1 -0
  229. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts +26 -0
  230. package/lib/typescript/ui/screens/internal/SignInUsernameStep.d.ts.map +1 -0
  231. package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts +20 -0
  232. package/lib/typescript/ui/screens/internal/SignUpIdentityStep.d.ts.map +1 -0
  233. package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts +24 -0
  234. package/lib/typescript/ui/screens/internal/SignUpSecurityStep.d.ts.map +1 -0
  235. package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts +15 -0
  236. package/lib/typescript/ui/screens/internal/SignUpSummaryStep.d.ts.map +1 -0
  237. package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts +13 -0
  238. package/lib/typescript/ui/screens/internal/SignUpWelcomeStep.d.ts.map +1 -0
  239. package/lib/typescript/ui/screens/karma/KarmaRewardsScreen.d.ts.map +1 -1
  240. package/lib/typescript/ui/stores/authStore.d.ts +14 -0
  241. package/lib/typescript/ui/stores/authStore.d.ts.map +1 -0
  242. package/lib/typescript/ui/stores/followStore.d.ts +15 -0
  243. package/lib/typescript/ui/stores/followStore.d.ts.map +1 -0
  244. package/lib/typescript/ui/styles/index.d.ts +0 -1
  245. package/lib/typescript/ui/styles/index.d.ts.map +1 -1
  246. package/lib/typescript/ui/utils/confirmAction.d.ts +7 -0
  247. package/lib/typescript/ui/utils/confirmAction.d.ts.map +1 -0
  248. package/package.json +12 -7
  249. package/src/core/index.ts +78 -88
  250. package/src/index.ts +8 -45
  251. package/src/models/secureSession.ts +1 -2
  252. package/src/node/index.ts +0 -3
  253. package/src/ui/components/FollowButton.tsx +100 -322
  254. package/src/ui/components/OxyPayButton.tsx +133 -0
  255. package/src/ui/components/OxyProvider.tsx +39 -201
  256. package/src/ui/components/OxySignInButton.tsx +13 -2
  257. package/src/ui/components/icon/FAIRWalletIcon.tsx +49 -0
  258. package/src/ui/components/icon/index.ts +1 -0
  259. package/src/ui/components/index.ts +1 -0
  260. package/src/ui/components/internal/GroupedPillButtons.tsx +12 -8
  261. package/src/ui/components/internal/PinInput.tsx +102 -0
  262. package/src/ui/components/internal/TextField.tsx +9 -0
  263. package/src/ui/context/OxyContext.tsx +26 -40
  264. package/src/ui/hooks/index.ts +1 -2
  265. package/src/ui/hooks/useFollow.ts +58 -129
  266. package/src/ui/hooks/useSessionSocket.ts +50 -0
  267. package/src/ui/index.ts +2 -37
  268. package/src/ui/navigation/OxyRouter.tsx +47 -63
  269. package/src/ui/navigation/types.ts +5 -26
  270. package/src/ui/screens/AccountCenterScreen.tsx +12 -21
  271. package/src/ui/screens/AccountOverviewScreen.tsx +6 -30
  272. package/src/ui/screens/AccountSettingsScreen.tsx +7 -22
  273. package/src/ui/screens/AccountSwitcherScreen.tsx +46 -88
  274. package/src/ui/screens/AppInfoScreen.tsx +27 -47
  275. package/src/ui/screens/FeedbackScreen.tsx +34 -19
  276. package/src/ui/screens/FileManagementScreen.tsx +293 -321
  277. package/src/ui/screens/PaymentGatewayScreen.tsx +1315 -0
  278. package/src/ui/screens/PremiumSubscriptionScreen.tsx +109 -124
  279. package/src/ui/screens/RecoverAccountScreen.tsx +260 -0
  280. package/src/ui/screens/SessionManagementScreen.tsx +65 -137
  281. package/src/ui/screens/SignInScreen.tsx +89 -283
  282. package/src/ui/screens/SignUpScreen.tsx +138 -291
  283. package/src/ui/screens/internal/SignInPasswordStep.tsx +179 -0
  284. package/src/ui/screens/internal/SignInUsernameStep.tsx +139 -0
  285. package/src/ui/screens/internal/SignUpIdentityStep.tsx +114 -0
  286. package/src/ui/screens/internal/SignUpSecurityStep.tsx +132 -0
  287. package/src/ui/screens/internal/SignUpSummaryStep.tsx +66 -0
  288. package/src/ui/screens/internal/SignUpWelcomeStep.tsx +52 -0
  289. package/src/ui/screens/karma/KarmaRewardsScreen.tsx +13 -3
  290. package/src/ui/stores/authStore.ts +24 -0
  291. package/src/ui/stores/followStore.ts +80 -0
  292. package/src/ui/styles/index.ts +0 -1
  293. package/src/ui/utils/confirmAction.ts +23 -0
  294. package/lib/commonjs/ui/components/bottomSheet/index.js +0 -37
  295. package/lib/commonjs/ui/components/bottomSheet/index.js.map +0 -1
  296. package/lib/commonjs/ui/hooks/useAuthFetch.js +0 -217
  297. package/lib/commonjs/ui/hooks/useAuthFetch.js.map +0 -1
  298. package/lib/commonjs/ui/hooks/useOxyFollow.js +0 -190
  299. package/lib/commonjs/ui/hooks/useOxyFollow.js.map +0 -1
  300. package/lib/commonjs/ui/screens/BillingManagementScreen.js +0 -636
  301. package/lib/commonjs/ui/screens/BillingManagementScreen.js.map +0 -1
  302. package/lib/commonjs/ui/store/index.js +0 -67
  303. package/lib/commonjs/ui/store/index.js.map +0 -1
  304. package/lib/commonjs/ui/store/setupOxyStore.js +0 -63
  305. package/lib/commonjs/ui/store/setupOxyStore.js.map +0 -1
  306. package/lib/commonjs/ui/store/slices/authSlice.js +0 -56
  307. package/lib/commonjs/ui/store/slices/authSlice.js.map +0 -1
  308. package/lib/commonjs/ui/store/slices/followSlice.js +0 -238
  309. package/lib/commonjs/ui/store/slices/followSlice.js.map +0 -1
  310. package/lib/commonjs/ui/store/slices/index.js +0 -129
  311. package/lib/commonjs/ui/store/slices/index.js.map +0 -1
  312. package/lib/commonjs/ui/store/slices/types.js +0 -19
  313. package/lib/commonjs/ui/store/slices/types.js.map +0 -1
  314. package/lib/commonjs/ui/styles/shadows.js +0 -123
  315. package/lib/commonjs/ui/styles/shadows.js.map +0 -1
  316. package/lib/commonjs/utils/polyfills.js +0 -42
  317. package/lib/commonjs/utils/polyfills.js.map +0 -1
  318. package/lib/module/ui/components/bottomSheet/index.js +0 -5
  319. package/lib/module/ui/components/bottomSheet/index.js.map +0 -1
  320. package/lib/module/ui/hooks/useAuthFetch.js +0 -212
  321. package/lib/module/ui/hooks/useAuthFetch.js.map +0 -1
  322. package/lib/module/ui/hooks/useOxyFollow.js +0 -186
  323. package/lib/module/ui/hooks/useOxyFollow.js.map +0 -1
  324. package/lib/module/ui/screens/BillingManagementScreen.js +0 -631
  325. package/lib/module/ui/screens/BillingManagementScreen.js.map +0 -1
  326. package/lib/module/ui/store/index.js +0 -33
  327. package/lib/module/ui/store/index.js.map +0 -1
  328. package/lib/module/ui/store/setupOxyStore.js +0 -59
  329. package/lib/module/ui/store/setupOxyStore.js.map +0 -1
  330. package/lib/module/ui/store/slices/authSlice.js +0 -48
  331. package/lib/module/ui/store/slices/authSlice.js.map +0 -1
  332. package/lib/module/ui/store/slices/followSlice.js +0 -232
  333. package/lib/module/ui/store/slices/followSlice.js.map +0 -1
  334. package/lib/module/ui/store/slices/index.js +0 -11
  335. package/lib/module/ui/store/slices/index.js.map +0 -1
  336. package/lib/module/ui/store/slices/types.js +0 -15
  337. package/lib/module/ui/store/slices/types.js.map +0 -1
  338. package/lib/module/ui/styles/shadows.js +0 -119
  339. package/lib/module/ui/styles/shadows.js.map +0 -1
  340. package/lib/module/utils/polyfills.js +0 -36
  341. package/lib/module/utils/polyfills.js.map +0 -1
  342. package/lib/typescript/types/react-redux.d.ts +0 -5
  343. package/lib/typescript/ui/components/bottomSheet/index.d.ts +0 -4
  344. package/lib/typescript/ui/components/bottomSheet/index.d.ts.map +0 -1
  345. package/lib/typescript/ui/hooks/useAuthFetch.d.ts +0 -34
  346. package/lib/typescript/ui/hooks/useAuthFetch.d.ts.map +0 -1
  347. package/lib/typescript/ui/hooks/useOxyFollow.d.ts +0 -81
  348. package/lib/typescript/ui/hooks/useOxyFollow.d.ts.map +0 -1
  349. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts +0 -5
  350. package/lib/typescript/ui/screens/BillingManagementScreen.d.ts.map +0 -1
  351. package/lib/typescript/ui/store/index.d.ts +0 -27
  352. package/lib/typescript/ui/store/index.d.ts.map +0 -1
  353. package/lib/typescript/ui/store/setupOxyStore.d.ts +0 -29
  354. package/lib/typescript/ui/store/setupOxyStore.d.ts.map +0 -1
  355. package/lib/typescript/ui/store/slices/authSlice.d.ts +0 -32
  356. package/lib/typescript/ui/store/slices/authSlice.d.ts.map +0 -1
  357. package/lib/typescript/ui/store/slices/followSlice.d.ts +0 -120
  358. package/lib/typescript/ui/store/slices/followSlice.d.ts.map +0 -1
  359. package/lib/typescript/ui/store/slices/index.d.ts +0 -9
  360. package/lib/typescript/ui/store/slices/index.d.ts.map +0 -1
  361. package/lib/typescript/ui/store/slices/types.d.ts +0 -16
  362. package/lib/typescript/ui/store/slices/types.d.ts.map +0 -1
  363. package/lib/typescript/ui/styles/shadows.d.ts +0 -233
  364. package/lib/typescript/ui/styles/shadows.d.ts.map +0 -1
  365. package/lib/typescript/utils/polyfills.d.ts +0 -6
  366. package/lib/typescript/utils/polyfills.d.ts.map +0 -1
  367. package/src/__tests__/backend-middleware.test.ts +0 -209
  368. package/src/__tests__/polyfills.test.ts +0 -30
  369. package/src/__tests__/setup.ts +0 -43
  370. package/src/__tests__/ui/hooks/authfetch-integration.test.ts +0 -197
  371. package/src/__tests__/ui/hooks/backward-compatibility.test.ts +0 -159
  372. package/src/__tests__/ui/hooks/real-world-scenarios.test.ts +0 -224
  373. package/src/__tests__/ui/hooks/url-resolution.test.ts +0 -129
  374. package/src/__tests__/ui/hooks/useAuthFetch-separation.test.ts +0 -69
  375. package/src/__tests__/ui/hooks/useAuthFetch.test.ts +0 -70
  376. package/src/__tests__/ui/hooks/useOxyFollow.test.tsx +0 -92
  377. package/src/__tests__/ui/screens/AccountSettingsScreen.test.tsx +0 -112
  378. package/src/__tests__/ui/store/setupOxyStore.test.ts +0 -50
  379. package/src/__tests__/validate-structure.js +0 -91
  380. package/src/__tests__/validation.js +0 -42
  381. package/src/types/react-redux.d.ts +0 -5
  382. package/src/ui/components/bottomSheet/index.tsx +0 -14
  383. package/src/ui/hooks/useAuthFetch.ts +0 -238
  384. package/src/ui/hooks/useOxyFollow.ts +0 -188
  385. package/src/ui/screens/BillingManagementScreen.tsx +0 -589
  386. package/src/ui/store/index.ts +0 -36
  387. package/src/ui/store/setupOxyStore.ts +0 -58
  388. package/src/ui/store/slices/authSlice.ts +0 -43
  389. package/src/ui/store/slices/followSlice.ts +0 -207
  390. package/src/ui/store/slices/index.ts +0 -31
  391. package/src/ui/store/slices/types.ts +0 -33
  392. package/src/ui/styles/shadows.ts +0 -112
  393. package/src/utils/polyfills.ts +0 -34
@@ -0,0 +1,1588 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _styles = require("../styles");
10
+ var _OxyLogo = _interopRequireDefault(require("../components/OxyLogo"));
11
+ var _GroupedPillButtons = _interopRequireDefault(require("../components/internal/GroupedPillButtons"));
12
+ var _TextField = _interopRequireDefault(require("../components/internal/TextField"));
13
+ var _vectorIcons = require("@expo/vector-icons");
14
+ var _icon = require("../components/icon");
15
+ var _sonner = require("sonner");
16
+ var _reactNativeQrcodeSvg = _interopRequireDefault(require("react-native-qrcode-svg"));
17
+ var RNIap = _interopRequireWildcard(require("react-native-iap"));
18
+ var _jsxRuntime = require("react/jsx-runtime");
19
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
21
+ // Restrict payment methods to Card, Oxy Pay, and FairCoin (QR)
22
+ const PAYMENT_METHODS = [{
23
+ key: 'card',
24
+ label: 'Credit/Debit Card',
25
+ icon: 'card-outline',
26
+ description: 'Pay securely with your credit or debit card.'
27
+ }, {
28
+ key: 'oxy',
29
+ label: 'Oxy Pay',
30
+ icon: 'wallet-outline',
31
+ description: 'Use your Oxy Pay in-app balance.'
32
+ }, {
33
+ key: 'faircoin',
34
+ label: 'FAIRWallet',
35
+ icon: 'qr-code-outline',
36
+ description: 'Pay with FairCoin by scanning a QR code.'
37
+ }];
38
+
39
+ // Add Google Play Billing to payment methods if Android
40
+ const ANDROID_IAP_METHOD = {
41
+ key: 'googleplay',
42
+ label: 'Google Play Billing',
43
+ icon: 'logo-google-playstore',
44
+ description: 'Pay securely with your Google Play account.'
45
+ };
46
+ if (_reactNative.Platform.OS === 'android' && !PAYMENT_METHODS.find(m => m.key === 'googleplay')) {
47
+ PAYMENT_METHODS.push(ANDROID_IAP_METHOD);
48
+ }
49
+
50
+ // Add PaymentItem type
51
+
52
+ // Extend props to accept onPaymentResult, amount, and currency
53
+
54
+ // Currency symbol map
55
+ const CURRENCY_SYMBOLS = {
56
+ FAIR: '⊜',
57
+ INR: '₹',
58
+ USD: '$',
59
+ EUR: '€',
60
+ GBP: '£',
61
+ JPY: '¥',
62
+ CNY: '¥',
63
+ AUD: 'A$',
64
+ CAD: 'C$'
65
+ // Add more as needed
66
+ };
67
+ const CURRENCY_NAMES = {
68
+ FAIR: 'FairCoin',
69
+ INR: 'Indian Rupee',
70
+ USD: 'US Dollar',
71
+ EUR: 'Euro',
72
+ GBP: 'British Pound',
73
+ JPY: 'Japanese Yen',
74
+ CNY: 'Chinese Yuan',
75
+ AUD: 'Australian Dollar',
76
+ CAD: 'Canadian Dollar'
77
+ // Add more as needed
78
+ };
79
+
80
+ // Helper: icon for item type (Ionicons only)
81
+ const getItemTypeIcon = (type, color) => {
82
+ switch (type) {
83
+ case 'product':
84
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
85
+ name: "cart-outline",
86
+ size: 22,
87
+ color: color,
88
+ style: {
89
+ marginRight: 8
90
+ }
91
+ });
92
+ case 'subscription':
93
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
94
+ name: "repeat-outline",
95
+ size: 22,
96
+ color: color,
97
+ style: {
98
+ marginRight: 8
99
+ }
100
+ });
101
+ case 'service':
102
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
103
+ name: "construct-outline",
104
+ size: 22,
105
+ color: color,
106
+ style: {
107
+ marginRight: 8
108
+ }
109
+ });
110
+ case 'fee':
111
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
112
+ name: "cash-outline",
113
+ size: 22,
114
+ color: color,
115
+ style: {
116
+ marginRight: 8
117
+ }
118
+ });
119
+ default:
120
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
121
+ name: "pricetag-outline",
122
+ size: 22,
123
+ color: color,
124
+ style: {
125
+ marginRight: 8
126
+ }
127
+ });
128
+ }
129
+ };
130
+ const IAP_PRODUCT_IDS = ['test_product_1', 'test_product_2']; // TODO: Replace with real product IDs
131
+
132
+ // Helper to get unique item types (move to top-level, before component)
133
+ const getUniqueItemTypes = items => {
134
+ const types = items.map(item => item.type);
135
+ return Array.from(new Set(types));
136
+ };
137
+ const PaymentGatewayScreen = props => {
138
+ const {
139
+ navigate,
140
+ goBack,
141
+ theme,
142
+ onPaymentResult,
143
+ amount,
144
+ currency = 'FAIR',
145
+ onClose,
146
+ paymentItems = [],
147
+ // NEW
148
+ description = '' // NEW
149
+ } = props;
150
+
151
+ // DEV ENFORCEMENT: Only allow one type of payment item
152
+ if (process.env.NODE_ENV !== 'production' && paymentItems.length > 0) {
153
+ const uniqueTypes = getUniqueItemTypes(paymentItems);
154
+ if (uniqueTypes.length > 1) {
155
+ throw new Error(`PaymentGatewayScreen: paymentItems contains mixed types (${uniqueTypes.join(', ')}). Only one type is allowed per payment.`);
156
+ }
157
+ }
158
+
159
+ // Step states
160
+ const [currentStep, setCurrentStep] = (0, _react.useState)(0);
161
+ const [paymentMethod, setPaymentMethod] = (0, _react.useState)('card');
162
+ const [cardDetails, setCardDetails] = (0, _react.useState)({
163
+ number: '',
164
+ expiry: '',
165
+ cvv: ''
166
+ });
167
+ const [upiId, setUpiId] = (0, _react.useState)('');
168
+ const [isPaying, setIsPaying] = (0, _react.useState)(false);
169
+ const [success, setSuccess] = (0, _react.useState)(false);
170
+
171
+ // IAP state
172
+ const [iapProducts, setIapProducts] = (0, _react.useState)([]);
173
+ const [iapError, setIapError] = (0, _react.useState)(null);
174
+ const [iapLoading, setIapLoading] = (0, _react.useState)(false);
175
+ const [iapPurchase, setIapPurchase] = (0, _react.useState)(null);
176
+
177
+ // Animations
178
+ const fadeAnim = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
179
+ const slideAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
180
+ const scaleAnim = (0, _react.useRef)(new _reactNative.Animated.Value(1)).current;
181
+ const progressAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0.2)).current;
182
+ const colors = (0, _styles.useThemeColors)(theme);
183
+ const commonStyles = (0, _styles.createCommonStyles)(theme);
184
+ const styles = (0, _react.useMemo)(() => createStyles(colors, theme), [colors, theme]);
185
+
186
+ // Get symbol and name for currency
187
+ const currencySymbol = CURRENCY_SYMBOLS[currency.toUpperCase()] || currency;
188
+ const currencyName = CURRENCY_NAMES[currency.toUpperCase()] || currency;
189
+
190
+ // Calculate total from items if provided, else use amount
191
+ const computedTotal = (0, _react.useMemo)(() => {
192
+ if (paymentItems && paymentItems.length > 0) {
193
+ return paymentItems.reduce((sum, item) => {
194
+ const qty = item.quantity ?? 1;
195
+ return sum + item.price * qty;
196
+ }, 0);
197
+ }
198
+ return Number(amount) || 0;
199
+ }, [paymentItems, amount]);
200
+
201
+ // Determine if the payment is for a recurring item (subscription)
202
+ const isRecurring = paymentItems.length > 0 && paymentItems[0].type === 'subscription';
203
+
204
+ // Filter payment methods: remove 'faircoin' if recurring
205
+ const availablePaymentMethods = (0, _react.useMemo)(() => {
206
+ if (isRecurring) {
207
+ return PAYMENT_METHODS.filter(m => m.key !== 'faircoin');
208
+ }
209
+ return PAYMENT_METHODS;
210
+ }, [isRecurring]);
211
+
212
+ // Add after useState declarations
213
+ // Remove itemTypeError state, useEffect, and user-facing error in renderSummaryStep
214
+
215
+ // Helper to get unique item types
216
+ // Remove itemTypeError state, useEffect, and user-facing error in renderSummaryStep
217
+
218
+ // Validate item types on paymentItems change
219
+ // Remove itemTypeError state, useEffect, and user-facing error in renderSummaryStep
220
+
221
+ // Animation transitions
222
+ const animateTransition = (0, _react.useCallback)(nextStep => {
223
+ _reactNative.Animated.timing(scaleAnim, {
224
+ toValue: 0.95,
225
+ duration: 150,
226
+ useNativeDriver: true
227
+ }).start();
228
+ _reactNative.Animated.timing(fadeAnim, {
229
+ toValue: 0,
230
+ duration: 200,
231
+ useNativeDriver: true
232
+ }).start(() => {
233
+ setCurrentStep(nextStep);
234
+ slideAnim.setValue(-50);
235
+ scaleAnim.setValue(0.95);
236
+ _reactNative.Animated.parallel([_reactNative.Animated.timing(fadeAnim, {
237
+ toValue: 1,
238
+ duration: 300,
239
+ useNativeDriver: true
240
+ }), _reactNative.Animated.spring(slideAnim, {
241
+ toValue: 0,
242
+ tension: 80,
243
+ friction: 8,
244
+ useNativeDriver: true
245
+ }), _reactNative.Animated.spring(scaleAnim, {
246
+ toValue: 1,
247
+ tension: 80,
248
+ friction: 8,
249
+ useNativeDriver: true
250
+ })]).start();
251
+ });
252
+ }, [fadeAnim, slideAnim, scaleAnim]);
253
+ const nextStep = (0, _react.useCallback)(() => {
254
+ if (currentStep < 4) {
255
+ _reactNative.Animated.timing(progressAnim, {
256
+ toValue: (currentStep + 2) / 5,
257
+ duration: 300,
258
+ useNativeDriver: false
259
+ }).start();
260
+ animateTransition(currentStep + 1);
261
+ }
262
+ }, [currentStep, progressAnim, animateTransition]);
263
+ const prevStep = (0, _react.useCallback)(() => {
264
+ if (currentStep > 0) {
265
+ _reactNative.Animated.timing(progressAnim, {
266
+ toValue: currentStep / 5,
267
+ duration: 300,
268
+ useNativeDriver: false
269
+ }).start();
270
+ animateTransition(currentStep - 1);
271
+ }
272
+ }, [currentStep, progressAnim, animateTransition]);
273
+
274
+ // Dummy pay handler
275
+ const handlePay = (0, _react.useCallback)(() => {
276
+ setIsPaying(true);
277
+ setTimeout(() => {
278
+ setIsPaying(false);
279
+ setSuccess(true);
280
+ nextStep();
281
+ }, 1500);
282
+ }, [nextStep]);
283
+
284
+ // Success handler for Done button
285
+ const handleDone = (0, _react.useCallback)(() => {
286
+ if (onPaymentResult) {
287
+ onPaymentResult({
288
+ success: true
289
+ });
290
+ }
291
+ navigate('AccountOverviewScreen');
292
+ }, [onPaymentResult, navigate]);
293
+
294
+ // Handle close/cancel: return failure result if payment is not completed
295
+ const handleClose = (0, _react.useCallback)(() => {
296
+ if (onPaymentResult) {
297
+ onPaymentResult({
298
+ success: false,
299
+ error: 'cancelled'
300
+ });
301
+ }
302
+ if (onClose) {
303
+ onClose();
304
+ } else if (goBack) {
305
+ goBack();
306
+ }
307
+ }, [onPaymentResult, onClose, goBack]);
308
+
309
+ // Optionally, intercept goBack/onClose if user tries to close the screen
310
+ // (You may want to use useEffect to listen for unmount or navigation away)
311
+
312
+ // If amount is missing or invalid, show error
313
+ if (!amount || isNaN(Number(amount)) || Number(amount) <= 0) {
314
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
315
+ style: styles.errorContainer,
316
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
317
+ style: styles.errorText,
318
+ children: "Invalid or missing payment amount."
319
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, {
320
+ buttons: [{
321
+ text: 'Close',
322
+ onPress: handleClose,
323
+ icon: 'close',
324
+ variant: 'primary'
325
+ }],
326
+ colors: (0, _styles.useThemeColors)(theme)
327
+ })]
328
+ });
329
+ }
330
+
331
+ // Example FairCoin address (replace with real one)
332
+ const faircoinAddress = 'f1abc1234FAIRCOINADDRESS';
333
+ const {
334
+ width: windowWidth
335
+ } = (0, _reactNative.useWindowDimensions)();
336
+ const isMobile = windowWidth < 600;
337
+ const qrSize = !isMobile ? Math.min(windowWidth * 0.3, 220) : Math.min(windowWidth * 0.8, 300);
338
+ const handleCopyAddress = () => {
339
+ _reactNative.Clipboard.setString(faircoinAddress);
340
+ (0, _sonner.toast)('Address copied to clipboard!');
341
+ };
342
+ const handleOpenFairWallet = () => {
343
+ const url = `fairwallet://pay?address=${faircoinAddress}`;
344
+ _reactNative.Linking.openURL(url);
345
+ };
346
+
347
+ // IAP setup (Android only)
348
+ (0, _react.useEffect)(() => {
349
+ if (paymentMethod !== 'googleplay' || _reactNative.Platform.OS !== 'android') return;
350
+ let purchaseUpdateSub, purchaseErrorSub;
351
+ setIapLoading(true);
352
+ RNIap.initConnection().then(() => RNIap.getProducts({
353
+ skus: IAP_PRODUCT_IDS
354
+ })).then(setIapProducts).catch(e => setIapError(e.message)).finally(() => setIapLoading(false));
355
+ purchaseUpdateSub = RNIap.purchaseUpdatedListener(purchase => {
356
+ setIapPurchase(purchase);
357
+ setSuccess(true);
358
+ nextStep();
359
+ });
360
+ purchaseErrorSub = RNIap.purchaseErrorListener(err => {
361
+ setIapError(err.message);
362
+ });
363
+ return () => {
364
+ purchaseUpdateSub && purchaseUpdateSub.remove();
365
+ purchaseErrorSub && purchaseErrorSub.remove();
366
+ RNIap.endConnection();
367
+ };
368
+ }, [paymentMethod]);
369
+ const handleIapBuy = async sku => {
370
+ setIapError(null);
371
+ setIapLoading(true);
372
+ try {
373
+ await RNIap.requestPurchase({
374
+ sku
375
+ });
376
+ } catch (e) {
377
+ setIapError(e.message);
378
+ } finally {
379
+ setIapLoading(false);
380
+ }
381
+ };
382
+
383
+ // Helper for dynamic styles
384
+ const getStepIndicatorStyle = active => [styles.stepIndicator, active ? styles.stepIndicatorActive : styles.stepIndicatorInactive];
385
+ const getPaymentMethodButtonStyle = active => [styles.paymentMethodButton, active ? styles.paymentMethodButtonActive : styles.paymentMethodButtonInactive];
386
+ const getPaymentMethodIconColor = active => active ? colors.primary : colors.text;
387
+
388
+ // Step indicator
389
+ const renderStepIndicator = () => {
390
+ const totalSteps = 5;
391
+ const activeStep = currentStep + 1;
392
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
393
+ style: styles.stepIndicatorContainer,
394
+ children: Array.from({
395
+ length: totalSteps
396
+ }).map((_, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
397
+ style: getStepIndicatorStyle(activeStep === idx + 1)
398
+ }, idx))
399
+ });
400
+ };
401
+
402
+ // PaymentGatewayHeader component
403
+ const stepTitles = ['Complete Your Payment', 'Select Payment Method', 'Enter Payment Details', 'Review & Pay', 'Success'];
404
+ const PaymentGatewayHeader = ({
405
+ currentStep,
406
+ totalSteps,
407
+ title
408
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
409
+ style: styles.headerWrapper,
410
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_OxyLogo.default, {
411
+ style: styles.logo
412
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
413
+ style: styles.headerTitle,
414
+ children: title
415
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
416
+ style: styles.headerStepIndicatorContainer,
417
+ children: Array.from({
418
+ length: totalSteps
419
+ }).map((_, idx) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
420
+ style: getStepIndicatorStyle(currentStep + 1 === idx + 1)
421
+ }, idx))
422
+ })]
423
+ });
424
+
425
+ // Card container for main content
426
+ const Card = ({
427
+ children,
428
+ style
429
+ }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
430
+ style: [styles.card, style],
431
+ children: children
432
+ });
433
+
434
+ // Product/Item summary card for step 1
435
+ const renderItemSummary = () => {
436
+ if (paymentItems && paymentItems.length > 0) {
437
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Card, {
438
+ style: {
439
+ marginBottom: 10
440
+ },
441
+ children: [paymentItems.map((item, idx) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
442
+ style: {
443
+ marginBottom: 8
444
+ },
445
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
446
+ style: {
447
+ flexDirection: 'row',
448
+ justifyContent: 'space-between',
449
+ alignItems: 'center'
450
+ },
451
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
452
+ style: {
453
+ fontWeight: '600',
454
+ color: colors.text
455
+ },
456
+ children: [item.type === 'product' && item.quantity ? `${item.quantity} × ` : '', item.name, item.type === 'subscription' && item.period ? ` (${item.period})` : '']
457
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
458
+ style: {
459
+ color: colors.text
460
+ },
461
+ children: [item.currency ? CURRENCY_SYMBOLS[item.currency.toUpperCase()] || item.currency : currencySymbol, " ", item.price * (item.quantity ?? 1)]
462
+ })]
463
+ }), item.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
464
+ style: {
465
+ color: colors.secondaryText,
466
+ fontSize: 13
467
+ },
468
+ children: item.description
469
+ }) : null]
470
+ }, idx)), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
471
+ style: {
472
+ borderTopWidth: 1,
473
+ borderColor: colors.border,
474
+ marginTop: 8,
475
+ paddingTop: 8,
476
+ flexDirection: 'row',
477
+ justifyContent: 'space-between',
478
+ alignItems: 'center'
479
+ },
480
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
481
+ style: {
482
+ fontWeight: '700',
483
+ color: colors.text
484
+ },
485
+ children: "Total"
486
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
487
+ style: {
488
+ fontWeight: '700',
489
+ color: colors.primary,
490
+ fontSize: 18
491
+ },
492
+ children: [currencySymbol, " ", computedTotal]
493
+ })]
494
+ })]
495
+ });
496
+ } else if (description) {
497
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Card, {
498
+ style: {
499
+ marginBottom: 10
500
+ },
501
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
502
+ style: {
503
+ color: colors.text
504
+ },
505
+ children: description
506
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
507
+ style: {
508
+ borderTopWidth: 1,
509
+ borderColor: colors.border,
510
+ marginTop: 8,
511
+ paddingTop: 8,
512
+ flexDirection: 'row',
513
+ justifyContent: 'space-between',
514
+ alignItems: 'center'
515
+ },
516
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
517
+ style: {
518
+ fontWeight: '700',
519
+ color: colors.text
520
+ },
521
+ children: "Total"
522
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
523
+ style: {
524
+ fontWeight: '700',
525
+ color: colors.primary,
526
+ fontSize: 18
527
+ },
528
+ children: [currencySymbol, " ", computedTotal]
529
+ })]
530
+ })]
531
+ });
532
+ }
533
+ return null;
534
+ };
535
+
536
+ // Step 1: Summary step (new first step, no header/dots here)
537
+ const renderSummaryStep = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Animated.View, {
538
+ style: [styles.stepContainer, {
539
+ opacity: fadeAnim,
540
+ transform: [{
541
+ translateY: slideAnim
542
+ }, {
543
+ scale: scaleAnim
544
+ }]
545
+ }],
546
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Card, {
547
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
548
+ style: {
549
+ color: colors.secondaryText,
550
+ fontSize: 15,
551
+ marginBottom: 16
552
+ },
553
+ children: "You're about to pay for the following:"
554
+ }), paymentItems && paymentItems.length > 0 ? paymentItems.map((item, idx) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
555
+ style: {
556
+ marginBottom: 12,
557
+ flexDirection: 'row',
558
+ alignItems: 'flex-start'
559
+ },
560
+ children: [getItemTypeIcon(item.type, colors.primary), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
561
+ style: {
562
+ flex: 1
563
+ },
564
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
565
+ style: {
566
+ fontWeight: '600',
567
+ color: colors.text,
568
+ fontSize: 16
569
+ },
570
+ children: [item.type === 'product' && item.quantity ? `${item.quantity} × ` : '', item.name, item.type === 'subscription' && item.period ? ` (${item.period})` : '']
571
+ }), item.description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
572
+ style: {
573
+ color: colors.secondaryText,
574
+ fontSize: 13,
575
+ marginTop: 2
576
+ },
577
+ children: item.description
578
+ }) : null]
579
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
580
+ style: {
581
+ color: colors.text,
582
+ fontWeight: '600',
583
+ fontSize: 16,
584
+ marginLeft: 8
585
+ },
586
+ children: [item.currency ? CURRENCY_SYMBOLS[item.currency.toUpperCase()] || item.currency : currencySymbol, " ", item.price * (item.quantity ?? 1)]
587
+ })]
588
+ }, idx)) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
589
+ style: {
590
+ color: colors.text
591
+ },
592
+ children: description
593
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, {
594
+ buttons: [{
595
+ text: 'Close',
596
+ onPress: handleClose,
597
+ icon: 'close',
598
+ variant: 'transparent'
599
+ }, {
600
+ text: 'Continue',
601
+ onPress: nextStep,
602
+ icon: 'arrow-forward',
603
+ variant: 'primary'
604
+ }],
605
+ colors: colors
606
+ })]
607
+ })
608
+ });
609
+
610
+ // Step 2: Choose Payment Method (now the second step, no header/dots here)
611
+ const renderMethodStep = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
612
+ style: [styles.stepContainer, {
613
+ opacity: fadeAnim,
614
+ transform: [{
615
+ translateY: slideAnim
616
+ }, {
617
+ scale: scaleAnim
618
+ }]
619
+ }],
620
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Card, {
621
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
622
+ style: styles.circleListContainer,
623
+ children: availablePaymentMethods.map(method => {
624
+ const isSelected = paymentMethod === method.key;
625
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
626
+ onPress: () => setPaymentMethod(method.key),
627
+ activeOpacity: 0.85,
628
+ style: [styles.circleMethod, isSelected && styles.circleMethodSelected],
629
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
630
+ style: styles.circleIconWrapper,
631
+ children: [method.key === 'faircoin' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FAIRWalletIcon, {
632
+ size: 28
633
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
634
+ name: method.icon,
635
+ size: 28,
636
+ color: isSelected ? colors.primary : colors.text
637
+ }), isSelected && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
638
+ style: styles.circleCheckOverlay,
639
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
640
+ name: "checkmark-circle",
641
+ size: 28,
642
+ color: colors.primary
643
+ })
644
+ })]
645
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
646
+ style: [styles.circleLabel, isSelected && styles.circleLabelSelected],
647
+ children: method.label
648
+ })]
649
+ }, method.key);
650
+ })
651
+ })
652
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, {
653
+ buttons: [{
654
+ text: 'Back',
655
+ onPress: prevStep,
656
+ icon: 'arrow-back',
657
+ variant: 'transparent'
658
+ }, {
659
+ text: 'Continue',
660
+ onPress: nextStep,
661
+ icon: 'arrow-forward',
662
+ variant: 'primary'
663
+ }],
664
+ colors: colors
665
+ })]
666
+ });
667
+
668
+ // Step 2: Enter Payment Details
669
+ const renderDetailsStep = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
670
+ style: [styles.stepContainer, {
671
+ opacity: fadeAnim,
672
+ transform: [{
673
+ translateY: slideAnim
674
+ }, {
675
+ scale: scaleAnim
676
+ }]
677
+ }],
678
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Card, {
679
+ style: paymentMethod === 'faircoin' ? {
680
+ backgroundColor: '#f6fff0',
681
+ paddingVertical: 24,
682
+ paddingHorizontal: 0
683
+ } : undefined,
684
+ children: [paymentMethod === 'card' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
685
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
686
+ style: styles.cardRowInfo,
687
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
688
+ name: "card-outline",
689
+ size: 24,
690
+ color: colors.primary,
691
+ style: styles.cardRowIcon
692
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
693
+ style: styles.cardRowText,
694
+ children: "We accept Visa, Mastercard, and more"
695
+ })]
696
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
697
+ value: cardDetails.number,
698
+ onChangeText: text => setCardDetails({
699
+ ...cardDetails,
700
+ number: text
701
+ }),
702
+ placeholder: "Card Number",
703
+ keyboardType: "numeric",
704
+ containerStyle: styles.cardFieldContainer,
705
+ leftComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
706
+ name: "card-outline",
707
+ size: 18,
708
+ color: colors.primary
709
+ })
710
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
711
+ style: styles.cardFieldRow,
712
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
713
+ value: cardDetails.expiry,
714
+ onChangeText: text => setCardDetails({
715
+ ...cardDetails,
716
+ expiry: text
717
+ }),
718
+ placeholder: "MM/YY",
719
+ containerStyle: styles.cardFieldHalfLeft,
720
+ leftComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
721
+ name: "calendar-outline",
722
+ size: 16,
723
+ color: colors.primary
724
+ })
725
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_TextField.default, {
726
+ value: cardDetails.cvv,
727
+ onChangeText: text => setCardDetails({
728
+ ...cardDetails,
729
+ cvv: text
730
+ }),
731
+ placeholder: "CVV",
732
+ keyboardType: "numeric",
733
+ containerStyle: styles.cardFieldHalfRight,
734
+ leftComponent: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
735
+ name: "lock-closed-outline",
736
+ size: 16,
737
+ color: colors.primary
738
+ })
739
+ })]
740
+ })]
741
+ }), paymentMethod === 'oxy' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
742
+ style: styles.oxyPayContainer,
743
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
744
+ name: "wallet-outline",
745
+ size: 48,
746
+ color: colors.primary,
747
+ style: styles.oxyPayIcon
748
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
749
+ style: styles.oxyPayTitle,
750
+ children: "Pay with Oxy Pay"
751
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
752
+ style: styles.oxyPaySubtitle,
753
+ children: "(Oxy Pay is your in-app wallet. Make sure you have enough balance.)"
754
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
755
+ style: styles.oxyPayBalanceBox,
756
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
757
+ style: styles.oxyPayBalanceText,
758
+ children: "Balance: \u229C 123.45"
759
+ })
760
+ })]
761
+ }), paymentMethod === 'faircoin' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
762
+ style: {
763
+ alignItems: 'center',
764
+ width: '100%'
765
+ },
766
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FAIRWalletIcon, {
767
+ size: 64,
768
+ style: [styles.faircoinIcon, {
769
+ shadowColor: '#1b1f0a',
770
+ shadowOpacity: 0.18,
771
+ shadowRadius: 12,
772
+ elevation: 6,
773
+ marginBottom: 12
774
+ }]
775
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
776
+ style: {
777
+ fontFamily: _styles.fontFamilies.phuduBold,
778
+ fontWeight: 'bold',
779
+ fontSize: 28,
780
+ color: '#1b1f0a',
781
+ marginBottom: 2,
782
+ textAlign: 'center',
783
+ letterSpacing: 0.5
784
+ },
785
+ children: "FAIRWallet"
786
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
787
+ style: {
788
+ color: '#1b1f0a',
789
+ fontWeight: '700',
790
+ fontSize: 17,
791
+ marginBottom: 18,
792
+ textAlign: 'center',
793
+ letterSpacing: 0.2
794
+ },
795
+ children: "Pay with FairCoin"
796
+ }), !isMobile ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
797
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
798
+ style: {
799
+ color: '#1b1f0a',
800
+ fontWeight: '600',
801
+ fontSize: 15,
802
+ marginBottom: 8
803
+ },
804
+ children: "Scan to Pay"
805
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
806
+ style: [styles.faircoinQRBox, {
807
+ width: qrSize,
808
+ height: qrSize,
809
+ borderColor: '#9ffb50',
810
+ borderWidth: 3,
811
+ position: 'relative',
812
+ backgroundColor: '#fff',
813
+ boxShadow: '0 2px 12px #9ffb5040',
814
+ justifyContent: 'center',
815
+ alignItems: 'center'
816
+ }],
817
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNativeQrcodeSvg.default, {
818
+ value: faircoinAddress,
819
+ size: qrSize - 32
820
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
821
+ style: {
822
+ position: 'absolute',
823
+ bottom: 8,
824
+ right: 8
825
+ },
826
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FAIRWalletIcon, {
827
+ size: 28
828
+ })
829
+ })]
830
+ })]
831
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
832
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
833
+ style: styles.faircoinTitle,
834
+ children: "Use the options below to pay with FAIRWallet"
835
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
836
+ style: styles.faircoinAddress,
837
+ children: faircoinAddress
838
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
839
+ style: [styles.faircoinButton, {
840
+ backgroundColor: '#9ffb50',
841
+ borderRadius: 18,
842
+ marginTop: 12,
843
+ width: '90%',
844
+ flexDirection: 'row',
845
+ alignItems: 'center',
846
+ justifyContent: 'center'
847
+ }],
848
+ onPress: handleOpenFairWallet,
849
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FAIRWalletIcon, {
850
+ size: 20,
851
+ style: {
852
+ marginRight: 8
853
+ }
854
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
855
+ style: [styles.faircoinButtonText, {
856
+ color: '#1b1f0a',
857
+ fontWeight: 'bold',
858
+ fontSize: 16
859
+ }],
860
+ children: "Open in FAIRWallet"
861
+ })]
862
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
863
+ style: [styles.faircoinButton, {
864
+ backgroundColor: '#9ffb50',
865
+ borderRadius: 18,
866
+ marginTop: 10,
867
+ width: '90%',
868
+ flexDirection: 'row',
869
+ alignItems: 'center',
870
+ justifyContent: 'center'
871
+ }],
872
+ onPress: handleCopyAddress,
873
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icon.FAIRWalletIcon, {
874
+ size: 20,
875
+ style: {
876
+ marginRight: 8
877
+ }
878
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
879
+ style: [styles.faircoinButtonText, {
880
+ color: '#1b1f0a',
881
+ fontWeight: 'bold',
882
+ fontSize: 16
883
+ }],
884
+ children: "Copy Address"
885
+ })]
886
+ })]
887
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
888
+ style: {
889
+ height: 18
890
+ }
891
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
892
+ style: styles.faircoinWaiting,
893
+ children: "Waiting for payment..."
894
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
895
+ style: styles.faircoinPlaceholder,
896
+ children: "(This is a placeholder. Integrate with a QR code generator for production.)"
897
+ })]
898
+ })]
899
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, {
900
+ buttons: [{
901
+ text: 'Back',
902
+ onPress: prevStep,
903
+ icon: 'arrow-back',
904
+ variant: 'transparent'
905
+ }, {
906
+ text: 'Continue',
907
+ onPress: nextStep,
908
+ icon: 'arrow-forward',
909
+ variant: 'primary',
910
+ disabled: paymentMethod === 'card' && (!cardDetails.number || !cardDetails.expiry || !cardDetails.cvv)
911
+ }],
912
+ colors: colors
913
+ })]
914
+ });
915
+
916
+ // Step 4: Review & Pay
917
+ const renderReviewStep = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
918
+ style: [styles.stepContainer, {
919
+ opacity: fadeAnim,
920
+ transform: [{
921
+ translateY: slideAnim
922
+ }, {
923
+ scale: scaleAnim
924
+ }]
925
+ }],
926
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Card, {
927
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
928
+ style: styles.reviewSecureRow,
929
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
930
+ name: "shield-checkmark",
931
+ size: 20,
932
+ color: colors.success || '#4BB543',
933
+ style: styles.reviewSecureIcon
934
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
935
+ style: styles.reviewSecureText,
936
+ children: "Secure payment"
937
+ })]
938
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
939
+ style: styles.reviewRow,
940
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
941
+ style: styles.reviewLabel,
942
+ children: "Amount"
943
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
944
+ style: styles.reviewValue,
945
+ children: [currencySymbol, " ", amount]
946
+ })]
947
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
948
+ style: styles.reviewRow,
949
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
950
+ style: styles.reviewLabel,
951
+ children: "Method"
952
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
953
+ style: styles.reviewMethodRow,
954
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
955
+ name: PAYMENT_METHODS.find(m => m.key === paymentMethod)?.icon,
956
+ size: 18,
957
+ color: colors.primary,
958
+ style: styles.reviewMethodIcon
959
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
960
+ style: styles.reviewMethodText,
961
+ children: PAYMENT_METHODS.find(m => m.key === paymentMethod)?.label
962
+ })]
963
+ })]
964
+ }), paymentMethod === 'card' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
965
+ style: styles.reviewRow,
966
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
967
+ style: styles.reviewLabel,
968
+ children: "Card"
969
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
970
+ style: styles.reviewValue,
971
+ children: cardDetails.number.replace(/.(?=.{4})/g, '*')
972
+ })]
973
+ }), paymentMethod === 'oxy' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
974
+ style: styles.reviewRow,
975
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
976
+ style: styles.reviewLabel,
977
+ children: "Oxy Pay Account"
978
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
979
+ style: styles.reviewValue,
980
+ children: "Balance: \u229C 123.45"
981
+ })]
982
+ }), paymentMethod === 'faircoin' && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
983
+ style: styles.reviewRow,
984
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
985
+ style: styles.reviewLabel,
986
+ children: "FairCoin Wallet"
987
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
988
+ style: styles.reviewValue,
989
+ children: "Paid via QR"
990
+ })]
991
+ })]
992
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, {
993
+ buttons: [{
994
+ text: 'Back',
995
+ onPress: prevStep,
996
+ icon: 'arrow-back',
997
+ variant: 'transparent'
998
+ }, {
999
+ text: isPaying ? 'Processing...' : 'Pay Now',
1000
+ onPress: handlePay,
1001
+ icon: 'checkmark',
1002
+ variant: 'primary',
1003
+ loading: isPaying
1004
+ }],
1005
+ colors: colors
1006
+ })]
1007
+ });
1008
+
1009
+ // Step 5: Success
1010
+ const renderSuccessStep = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
1011
+ style: [styles.stepContainer, {
1012
+ opacity: fadeAnim,
1013
+ transform: [{
1014
+ translateY: slideAnim
1015
+ }, {
1016
+ scale: scaleAnim
1017
+ }]
1018
+ }],
1019
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
1020
+ style: styles.successContainer,
1021
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
1022
+ style: styles.successIconBox,
1023
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_vectorIcons.Ionicons, {
1024
+ name: "checkmark-circle",
1025
+ size: 64,
1026
+ color: colors.success || '#4BB543'
1027
+ })
1028
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1029
+ style: styles.successTitle,
1030
+ children: "Payment Successful!"
1031
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1032
+ style: styles.successSubtitle,
1033
+ children: "Thank you for your payment."
1034
+ })]
1035
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, {
1036
+ buttons: [{
1037
+ text: 'Done',
1038
+ onPress: handleDone,
1039
+ icon: 'checkmark',
1040
+ variant: 'primary'
1041
+ }],
1042
+ colors: colors
1043
+ })]
1044
+ });
1045
+
1046
+ // Step: Google Play Billing (Android only)
1047
+ const renderGooglePlayStep = () => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Animated.View, {
1048
+ style: [styles.stepContainer, {
1049
+ opacity: fadeAnim,
1050
+ transform: [{
1051
+ translateY: slideAnim
1052
+ }, {
1053
+ scale: scaleAnim
1054
+ }]
1055
+ }],
1056
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Card, {
1057
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1058
+ style: {
1059
+ color: colors.text,
1060
+ fontWeight: '600',
1061
+ fontSize: 16,
1062
+ marginBottom: 12
1063
+ },
1064
+ children: "Select a product to purchase:"
1065
+ }), iapLoading && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1066
+ style: {
1067
+ color: colors.secondaryText
1068
+ },
1069
+ children: "Loading products..."
1070
+ }), iapError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1071
+ style: {
1072
+ color: 'red'
1073
+ },
1074
+ children: iapError
1075
+ }), iapProducts.map(product => /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
1076
+ style: [styles.paymentMethodButton, {
1077
+ marginBottom: 8
1078
+ }],
1079
+ onPress: () => handleIapBuy(product.productId),
1080
+ disabled: iapLoading,
1081
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
1082
+ style: {
1083
+ color: colors.text,
1084
+ fontSize: 16
1085
+ },
1086
+ children: [product.title, " - ", product.localizedPrice]
1087
+ })
1088
+ }, product.productId)), iapPurchase && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
1089
+ style: {
1090
+ color: colors.success,
1091
+ marginTop: 10
1092
+ },
1093
+ children: "Purchase successful!"
1094
+ })]
1095
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_GroupedPillButtons.default, {
1096
+ buttons: [{
1097
+ text: 'Back',
1098
+ onPress: prevStep,
1099
+ icon: 'arrow-back',
1100
+ variant: 'transparent'
1101
+ }],
1102
+ colors: colors
1103
+ })]
1104
+ });
1105
+ const renderCurrentStep = () => {
1106
+ switch (currentStep) {
1107
+ case 0:
1108
+ return renderSummaryStep();
1109
+ case 1:
1110
+ return renderMethodStep();
1111
+ case 2:
1112
+ if (paymentMethod === 'googleplay') return renderGooglePlayStep();
1113
+ return renderDetailsStep();
1114
+ case 3:
1115
+ return renderReviewStep();
1116
+ case 4:
1117
+ return renderSuccessStep();
1118
+ default:
1119
+ return renderSummaryStep();
1120
+ }
1121
+ };
1122
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.KeyboardAvoidingView, {
1123
+ style: [styles.container, {
1124
+ backgroundColor: colors.background
1125
+ }],
1126
+ behavior: _reactNative.Platform.OS === 'ios' ? 'padding' : 'height',
1127
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.StatusBar, {
1128
+ barStyle: theme === 'dark' ? 'light-content' : 'dark-content',
1129
+ backgroundColor: colors.background
1130
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(PaymentGatewayHeader, {
1131
+ currentStep: currentStep,
1132
+ totalSteps: 5,
1133
+ title: stepTitles[currentStep]
1134
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ScrollView, {
1135
+ contentContainerStyle: styles.scrollContent,
1136
+ showsVerticalScrollIndicator: false,
1137
+ keyboardShouldPersistTaps: "handled",
1138
+ children: renderCurrentStep()
1139
+ })]
1140
+ });
1141
+ };
1142
+ const createStyles = (colors, theme) => _reactNative.StyleSheet.create({
1143
+ container: {
1144
+ flex: 1
1145
+ },
1146
+ scrollContent: {
1147
+ flexGrow: 1,
1148
+ paddingHorizontal: 24,
1149
+ paddingBottom: 20
1150
+ },
1151
+ stepContainer: {
1152
+ flex: 1,
1153
+ justifyContent: 'flex-start',
1154
+ alignItems: 'flex-start',
1155
+ width: '100%'
1156
+ },
1157
+ stepIndicatorContainer: {
1158
+ flexDirection: 'row',
1159
+ justifyContent: 'center',
1160
+ alignItems: 'center',
1161
+ marginVertical: 16
1162
+ },
1163
+ stepIndicator: {
1164
+ height: 10,
1165
+ borderRadius: 5,
1166
+ marginHorizontal: 4
1167
+ },
1168
+ stepIndicatorActive: {
1169
+ width: 28,
1170
+ backgroundColor: colors.primary
1171
+ },
1172
+ stepIndicatorInactive: {
1173
+ width: 10,
1174
+ backgroundColor: colors.border
1175
+ },
1176
+ logo: {
1177
+ width: 40,
1178
+ height: 20,
1179
+ alignSelf: 'center',
1180
+ resizeMode: 'contain'
1181
+ },
1182
+ headerTitle: {
1183
+ fontFamily: _styles.fontFamilies.phuduBold,
1184
+ fontSize: 22,
1185
+ fontWeight: _reactNative.Platform.OS === 'web' ? 'bold' : undefined,
1186
+ color: colors.text,
1187
+ letterSpacing: -0.5
1188
+ },
1189
+ headerWrapper: {
1190
+ flexDirection: 'column',
1191
+ alignItems: 'center',
1192
+ justifyContent: 'center',
1193
+ width: '100%',
1194
+ gap: 8,
1195
+ paddingVertical: 8
1196
+ },
1197
+ card: {
1198
+ backgroundColor: '#fff',
1199
+ borderRadius: 20,
1200
+ padding: 28,
1201
+ shadowColor: '#000',
1202
+ shadowOffset: {
1203
+ width: 0,
1204
+ height: 2
1205
+ },
1206
+ shadowOpacity: 0.08,
1207
+ shadowRadius: 8,
1208
+ elevation: 3,
1209
+ marginVertical: 8,
1210
+ width: '100%',
1211
+ alignSelf: 'center'
1212
+ },
1213
+ paymentMethodButton: {
1214
+ flexDirection: 'row',
1215
+ alignItems: 'center',
1216
+ borderRadius: 16,
1217
+ padding: 14,
1218
+ marginBottom: 10,
1219
+ width: '90%',
1220
+ alignSelf: 'center',
1221
+ borderWidth: 1
1222
+ },
1223
+ paymentMethodButtonActive: {
1224
+ backgroundColor: colors.primary + '22',
1225
+ borderColor: colors.primary,
1226
+ borderWidth: 2
1227
+ },
1228
+ paymentMethodButtonInactive: {
1229
+ backgroundColor: 'transparent',
1230
+ borderColor: colors.border,
1231
+ borderWidth: 1
1232
+ },
1233
+ paymentMethodLabel: {
1234
+ fontFamily: _styles.fontFamilies.phudu,
1235
+ fontSize: 18,
1236
+ color: colors.text,
1237
+ fontWeight: '600'
1238
+ },
1239
+ paymentMethodDescription: {
1240
+ fontFamily: _styles.fontFamilies.phudu,
1241
+ fontSize: 15,
1242
+ color: colors.secondaryText,
1243
+ marginTop: 8,
1244
+ minHeight: 36,
1245
+ textAlign: 'center'
1246
+ },
1247
+ errorContainer: {
1248
+ flex: 1,
1249
+ justifyContent: 'center',
1250
+ alignItems: 'center',
1251
+ padding: 32
1252
+ },
1253
+ errorText: {
1254
+ fontSize: 18,
1255
+ color: 'red',
1256
+ marginBottom: 24
1257
+ },
1258
+ methodListContainer: {
1259
+ width: '100%',
1260
+ alignItems: 'center'
1261
+ },
1262
+ methodIcon: {
1263
+ marginRight: 12
1264
+ },
1265
+ methodCheckIcon: {
1266
+ marginLeft: 'auto'
1267
+ },
1268
+ cardRowInfo: {
1269
+ flexDirection: 'row',
1270
+ alignItems: 'center',
1271
+ marginBottom: 16
1272
+ },
1273
+ cardRowIcon: {
1274
+ marginRight: 8
1275
+ },
1276
+ cardRowText: {
1277
+ fontSize: 15,
1278
+ color: colors.secondaryText
1279
+ },
1280
+ cardFieldContainer: {
1281
+ marginBottom: 16
1282
+ },
1283
+ cardFieldRow: {
1284
+ flexDirection: 'row',
1285
+ gap: 12
1286
+ },
1287
+ cardFieldHalfLeft: {
1288
+ flex: 1,
1289
+ marginRight: 6
1290
+ },
1291
+ cardFieldHalfRight: {
1292
+ flex: 1,
1293
+ marginLeft: 6
1294
+ },
1295
+ oxyPayContainer: {
1296
+ alignItems: 'center'
1297
+ },
1298
+ oxyPayIcon: {
1299
+ marginBottom: 8
1300
+ },
1301
+ oxyPayTitle: {
1302
+ fontSize: 16,
1303
+ marginBottom: 8,
1304
+ color: colors.text,
1305
+ fontWeight: '600',
1306
+ textAlign: 'center'
1307
+ },
1308
+ oxyPaySubtitle: {
1309
+ fontSize: 14,
1310
+ color: colors.secondaryText,
1311
+ marginBottom: 8,
1312
+ textAlign: 'center'
1313
+ },
1314
+ oxyPayBalanceBox: {
1315
+ backgroundColor: colors.primary + '22',
1316
+ borderRadius: 12,
1317
+ padding: 8,
1318
+ marginTop: 8
1319
+ },
1320
+ oxyPayBalanceText: {
1321
+ color: colors.primary,
1322
+ fontWeight: '600'
1323
+ },
1324
+ faircoinContainer: {
1325
+ alignItems: 'center',
1326
+ marginBottom: 24,
1327
+ width: '100%'
1328
+ },
1329
+ faircoinIcon: {
1330
+ marginBottom: 8
1331
+ },
1332
+ faircoinTitle: {
1333
+ fontSize: 16,
1334
+ marginBottom: 8,
1335
+ color: colors.text,
1336
+ fontWeight: '600',
1337
+ textAlign: 'center'
1338
+ },
1339
+ faircoinQRBox: {
1340
+ width: 160,
1341
+ height: 160,
1342
+ backgroundColor: '#eee',
1343
+ borderRadius: 16,
1344
+ justifyContent: 'center',
1345
+ alignItems: 'center',
1346
+ marginBottom: 12,
1347
+ borderWidth: 2,
1348
+ borderColor: colors.primary
1349
+ },
1350
+ faircoinQRText: {
1351
+ color: '#aaa'
1352
+ },
1353
+ faircoinWaiting: {
1354
+ fontSize: 14,
1355
+ color: colors.secondaryText,
1356
+ textAlign: 'center',
1357
+ marginBottom: 8
1358
+ },
1359
+ faircoinPlaceholder: {
1360
+ fontSize: 13,
1361
+ color: colors.secondaryText,
1362
+ textAlign: 'center'
1363
+ },
1364
+ reviewSecureRow: {
1365
+ flexDirection: 'row',
1366
+ alignItems: 'center',
1367
+ marginBottom: 12
1368
+ },
1369
+ reviewSecureIcon: {
1370
+ marginRight: 8
1371
+ },
1372
+ reviewSecureText: {
1373
+ color: colors.success || '#4BB543',
1374
+ fontWeight: '600',
1375
+ fontSize: 15
1376
+ },
1377
+ reviewRow: {
1378
+ flexDirection: 'row',
1379
+ justifyContent: 'space-between',
1380
+ alignItems: 'center',
1381
+ marginBottom: 8
1382
+ },
1383
+ reviewLabel: {
1384
+ fontSize: 15,
1385
+ color: colors.secondaryText
1386
+ },
1387
+ reviewValue: {
1388
+ fontSize: 18,
1389
+ fontWeight: '700',
1390
+ color: colors.text
1391
+ },
1392
+ reviewMethodRow: {
1393
+ flexDirection: 'row',
1394
+ alignItems: 'center'
1395
+ },
1396
+ reviewMethodIcon: {
1397
+ marginRight: 6
1398
+ },
1399
+ reviewMethodText: {
1400
+ fontSize: 16,
1401
+ color: colors.text
1402
+ },
1403
+ successContainer: {
1404
+ alignItems: 'center',
1405
+ justifyContent: 'center',
1406
+ marginBottom: 24,
1407
+ width: '100%'
1408
+ },
1409
+ successIconBox: {
1410
+ backgroundColor: colors.success + '22',
1411
+ borderRadius: 48,
1412
+ padding: 18,
1413
+ marginBottom: 12,
1414
+ alignItems: 'center',
1415
+ justifyContent: 'center'
1416
+ },
1417
+ successTitle: {
1418
+ fontSize: 26,
1419
+ fontWeight: '700',
1420
+ color: colors.success || '#4BB543',
1421
+ marginBottom: 8,
1422
+ textAlign: 'center',
1423
+ width: '100%'
1424
+ },
1425
+ successSubtitle: {
1426
+ fontSize: 16,
1427
+ color: colors.text,
1428
+ textAlign: 'center',
1429
+ marginBottom: 8,
1430
+ width: '100%'
1431
+ },
1432
+ methodCard: {
1433
+ flexDirection: 'row',
1434
+ alignItems: 'center',
1435
+ backgroundColor: '#fff',
1436
+ borderRadius: 18,
1437
+ paddingVertical: 18,
1438
+ paddingHorizontal: 18,
1439
+ marginBottom: 14,
1440
+ borderWidth: 1.5,
1441
+ borderColor: colors.border,
1442
+ shadowColor: '#000',
1443
+ shadowOffset: {
1444
+ width: 0,
1445
+ height: 2
1446
+ },
1447
+ shadowOpacity: 0.06,
1448
+ shadowRadius: 6,
1449
+ elevation: 2,
1450
+ minHeight: 72
1451
+ },
1452
+ methodCardSelected: {
1453
+ backgroundColor: colors.primary + '11',
1454
+ borderColor: colors.primary,
1455
+ shadowOpacity: 0.13,
1456
+ shadowRadius: 10,
1457
+ elevation: 4
1458
+ },
1459
+ methodCardContent: {
1460
+ flexDirection: 'row',
1461
+ alignItems: 'center',
1462
+ flex: 1
1463
+ },
1464
+ methodCardIcon: {
1465
+ marginRight: 18,
1466
+ marginLeft: 2
1467
+ },
1468
+ methodCardTextContainer: {
1469
+ flex: 1,
1470
+ flexDirection: 'column',
1471
+ justifyContent: 'center'
1472
+ },
1473
+ methodCardDescription: {
1474
+ fontSize: 14,
1475
+ color: colors.secondaryText,
1476
+ marginTop: 2,
1477
+ opacity: 0.85
1478
+ },
1479
+ methodCardCheckIcon: {
1480
+ marginLeft: 12
1481
+ },
1482
+ paymentMethodLabelSelected: {
1483
+ color: colors.primary
1484
+ },
1485
+ circleListContainer: {
1486
+ flexDirection: 'row',
1487
+ flexWrap: 'nowrap',
1488
+ justifyContent: 'center',
1489
+ alignItems: 'flex-start',
1490
+ paddingHorizontal: 4,
1491
+ width: '100%',
1492
+ marginBottom: 0
1493
+ },
1494
+ circleMethod: {
1495
+ alignItems: 'center',
1496
+ marginHorizontal: 0,
1497
+ flex: 1,
1498
+ minWidth: 62,
1499
+ paddingVertical: 2,
1500
+ paddingHorizontal: 2
1501
+ },
1502
+ circleMethodSelected: {
1503
+ // No extra margin, but highlight below
1504
+ },
1505
+ circleIconWrapper: {
1506
+ width: 48,
1507
+ // restored padding
1508
+ height: 48,
1509
+ // restored padding
1510
+ borderRadius: 24,
1511
+ // half of width/height
1512
+ backgroundColor: '#fff',
1513
+ borderWidth: 2,
1514
+ borderColor: colors.border,
1515
+ alignItems: 'center',
1516
+ justifyContent: 'center',
1517
+ marginBottom: 8,
1518
+ // spacing below icon
1519
+ shadowColor: '#000',
1520
+ shadowOffset: {
1521
+ width: 0,
1522
+ height: 2
1523
+ },
1524
+ shadowOpacity: 0.07,
1525
+ shadowRadius: 6,
1526
+ elevation: 2
1527
+ },
1528
+ circleLabel: {
1529
+ fontFamily: _styles.fontFamilies.phudu,
1530
+ fontSize: 16,
1531
+ color: colors.text,
1532
+ fontWeight: '600',
1533
+ textAlign: 'center',
1534
+ marginBottom: 4,
1535
+ marginTop: 2
1536
+ },
1537
+ circleLabelSelected: {
1538
+ color: colors.primary
1539
+ },
1540
+ circleDescription: {
1541
+ fontSize: 13,
1542
+ color: colors.secondaryText,
1543
+ textAlign: 'center',
1544
+ opacity: 0.85,
1545
+ minHeight: 36,
1546
+ marginBottom: 2
1547
+ },
1548
+ circleCheckOverlay: {
1549
+ position: 'absolute',
1550
+ bottom: -8,
1551
+ right: -8,
1552
+ backgroundColor: '#fff',
1553
+ borderRadius: 16,
1554
+ padding: 0,
1555
+ zIndex: 2
1556
+ },
1557
+ headerStepIndicatorContainer: {
1558
+ marginVertical: 2,
1559
+ flexDirection: 'row',
1560
+ justifyContent: 'center',
1561
+ alignItems: 'center'
1562
+ },
1563
+ faircoinButton: {
1564
+ flexDirection: 'row',
1565
+ alignItems: 'center',
1566
+ alignSelf: 'center',
1567
+ backgroundColor: colors.primary + '11',
1568
+ borderRadius: 16,
1569
+ paddingHorizontal: 16,
1570
+ paddingVertical: 8,
1571
+ marginTop: 6,
1572
+ marginBottom: 2
1573
+ },
1574
+ faircoinButtonText: {
1575
+ color: colors.primary,
1576
+ fontWeight: '600',
1577
+ fontSize: 15
1578
+ },
1579
+ faircoinAddress: {
1580
+ color: colors.secondaryText,
1581
+ fontSize: 13,
1582
+ textAlign: 'center',
1583
+ marginTop: 6,
1584
+ marginBottom: 2
1585
+ }
1586
+ });
1587
+ var _default = exports.default = PaymentGatewayScreen;
1588
+ //# sourceMappingURL=PaymentGatewayScreen.js.map