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