@oxyhq/services 5.17.18 → 5.18.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.
- package/lib/commonjs/core/mixins/OxyServices.features.js +372 -0
- package/lib/commonjs/core/mixins/OxyServices.features.js.map +1 -0
- package/lib/commonjs/core/mixins/index.js +3 -2
- package/lib/commonjs/core/mixins/index.js.map +1 -1
- package/lib/commonjs/ui/components/GroupedItem.js +11 -1
- package/lib/commonjs/ui/components/GroupedItem.js.map +1 -1
- package/lib/commonjs/ui/components/SettingRow.js +17 -4
- package/lib/commonjs/ui/components/SettingRow.js.map +1 -1
- package/lib/commonjs/ui/components/feedback/FormInput.js +72 -0
- package/lib/commonjs/ui/components/feedback/FormInput.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/ProgressIndicator.js +33 -0
- package/lib/commonjs/ui/components/feedback/ProgressIndicator.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/constants.js +59 -0
- package/lib/commonjs/ui/components/feedback/constants.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js +262 -0
- package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/index.js +54 -0
- package/lib/commonjs/ui/components/feedback/index.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/types.js +6 -0
- package/lib/commonjs/ui/components/feedback/types.js.map +1 -0
- package/lib/commonjs/ui/components/feedback/useFeedbackForm.js +52 -0
- package/lib/commonjs/ui/components/feedback/useFeedbackForm.js.map +1 -0
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +282 -0
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -0
- package/lib/commonjs/ui/components/modals/index.js +14 -0
- package/lib/commonjs/ui/components/modals/index.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js +309 -0
- package/lib/commonjs/ui/components/payment/PaymentDetailsStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js +79 -0
- package/lib/commonjs/ui/components/payment/PaymentMethodStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js +108 -0
- package/lib/commonjs/ui/components/payment/PaymentReviewStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js +79 -0
- package/lib/commonjs/ui/components/payment/PaymentSuccessStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js +176 -0
- package/lib/commonjs/ui/components/payment/PaymentSummaryStep.js.map +1 -0
- package/lib/commonjs/ui/components/payment/constants.js +53 -0
- package/lib/commonjs/ui/components/payment/constants.js.map +1 -0
- package/lib/commonjs/ui/components/payment/index.js +80 -0
- package/lib/commonjs/ui/components/payment/index.js.map +1 -0
- package/lib/commonjs/ui/components/payment/paymentStyles.js +409 -0
- package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -0
- package/lib/commonjs/ui/components/payment/types.js +6 -0
- package/lib/commonjs/ui/components/payment/types.js.map +1 -0
- package/lib/commonjs/ui/hooks/index.js +26 -0
- package/lib/commonjs/ui/hooks/index.js.map +1 -1
- package/lib/commonjs/ui/hooks/useAsyncAction.js +95 -0
- package/lib/commonjs/ui/hooks/useAsyncAction.js.map +1 -0
- package/lib/commonjs/ui/hooks/useSettingToggle.js +126 -0
- package/lib/commonjs/ui/hooks/useSettingToggle.js.map +1 -0
- package/lib/commonjs/ui/navigation/routes.js +1 -0
- package/lib/commonjs/ui/navigation/routes.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +4 -2
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +33 -30
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FAQScreen.js +315 -0
- package/lib/commonjs/ui/screens/FAQScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/FeedbackScreen.js +73 -590
- package/lib/commonjs/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HelpSupportScreen.js +8 -7
- package/lib/commonjs/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js +67 -1395
- package/lib/commonjs/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ProfileScreen.js +13 -5
- package/lib/commonjs/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js +16 -10
- package/lib/commonjs/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +23 -11
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/core/mixins/OxyServices.features.js +369 -0
- package/lib/module/core/mixins/OxyServices.features.js.map +1 -0
- package/lib/module/core/mixins/index.js +3 -2
- package/lib/module/core/mixins/index.js.map +1 -1
- package/lib/module/ui/components/GroupedItem.js +11 -1
- package/lib/module/ui/components/GroupedItem.js.map +1 -1
- package/lib/module/ui/components/SettingRow.js +17 -4
- package/lib/module/ui/components/SettingRow.js.map +1 -1
- package/lib/module/ui/components/feedback/FormInput.js +67 -0
- package/lib/module/ui/components/feedback/FormInput.js.map +1 -0
- package/lib/module/ui/components/feedback/ProgressIndicator.js +28 -0
- package/lib/module/ui/components/feedback/ProgressIndicator.js.map +1 -0
- package/lib/module/ui/components/feedback/constants.js +55 -0
- package/lib/module/ui/components/feedback/constants.js.map +1 -0
- package/lib/module/ui/components/feedback/feedbackStyles.js +257 -0
- package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -0
- package/lib/module/ui/components/feedback/index.js +8 -0
- package/lib/module/ui/components/feedback/index.js.map +1 -0
- package/lib/module/ui/components/feedback/types.js +4 -0
- package/lib/module/ui/components/feedback/types.js.map +1 -0
- package/lib/module/ui/components/feedback/useFeedbackForm.js +47 -0
- package/lib/module/ui/components/feedback/useFeedbackForm.js.map +1 -0
- package/lib/module/ui/components/modals/DeleteAccountModal.js +276 -0
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -0
- package/lib/module/ui/components/modals/index.js +4 -0
- package/lib/module/ui/components/modals/index.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentDetailsStep.js +303 -0
- package/lib/module/ui/components/payment/PaymentDetailsStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentMethodStep.js +73 -0
- package/lib/module/ui/components/payment/PaymentMethodStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentReviewStep.js +102 -0
- package/lib/module/ui/components/payment/PaymentReviewStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentSuccessStep.js +73 -0
- package/lib/module/ui/components/payment/PaymentSuccessStep.js.map +1 -0
- package/lib/module/ui/components/payment/PaymentSummaryStep.js +170 -0
- package/lib/module/ui/components/payment/PaymentSummaryStep.js.map +1 -0
- package/lib/module/ui/components/payment/constants.js +47 -0
- package/lib/module/ui/components/payment/constants.js.map +1 -0
- package/lib/module/ui/components/payment/index.js +10 -0
- package/lib/module/ui/components/payment/index.js.map +1 -0
- package/lib/module/ui/components/payment/paymentStyles.js +404 -0
- package/lib/module/ui/components/payment/paymentStyles.js.map +1 -0
- package/lib/module/ui/components/payment/types.js +4 -0
- package/lib/module/ui/components/payment/types.js.map +1 -0
- package/lib/module/ui/hooks/index.js +2 -0
- package/lib/module/ui/hooks/index.js.map +1 -1
- package/lib/module/ui/hooks/useAsyncAction.js +89 -0
- package/lib/module/ui/hooks/useAsyncAction.js.map +1 -0
- package/lib/module/ui/hooks/useSettingToggle.js +120 -0
- package/lib/module/ui/hooks/useSettingToggle.js.map +1 -0
- package/lib/module/ui/navigation/routes.js +1 -0
- package/lib/module/ui/navigation/routes.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +4 -2
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +33 -30
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/FAQScreen.js +310 -0
- package/lib/module/ui/screens/FAQScreen.js.map +1 -0
- package/lib/module/ui/screens/FeedbackScreen.js +64 -581
- package/lib/module/ui/screens/FeedbackScreen.js.map +1 -1
- package/lib/module/ui/screens/HelpSupportScreen.js +8 -7
- package/lib/module/ui/screens/HelpSupportScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentGatewayScreen.js +67 -1397
- package/lib/module/ui/screens/PaymentGatewayScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +13 -5
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SavesCollectionsScreen.js +16 -10
- package/lib/module/ui/screens/SavesCollectionsScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +23 -11
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/typescript/core/mixins/OxyServices.features.d.ts +229 -0
- package/lib/typescript/core/mixins/OxyServices.features.d.ts.map +1 -0
- package/lib/typescript/core/mixins/index.d.ts +71 -1
- package/lib/typescript/core/mixins/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts +5 -1
- package/lib/typescript/ui/components/GroupedItem.d.ts.map +1 -1
- package/lib/typescript/ui/components/SettingRow.d.ts +6 -0
- package/lib/typescript/ui/components/SettingRow.d.ts.map +1 -1
- package/lib/typescript/ui/components/feedback/FormInput.d.ts +20 -0
- package/lib/typescript/ui/components/feedback/FormInput.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/ProgressIndicator.d.ts +11 -0
- package/lib/typescript/ui/components/feedback/ProgressIndicator.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/constants.d.ts +5 -0
- package/lib/typescript/ui/components/feedback/constants.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/feedbackStyles.d.ts +280 -0
- package/lib/typescript/ui/components/feedback/feedbackStyles.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/index.d.ts +7 -0
- package/lib/typescript/ui/components/feedback/index.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/types.d.ts +46 -0
- package/lib/typescript/ui/components/feedback/types.d.ts.map +1 -0
- package/lib/typescript/ui/components/feedback/useFeedbackForm.d.ts +9 -0
- package/lib/typescript/ui/components/feedback/useFeedbackForm.d.ts.map +1 -0
- package/lib/typescript/ui/components/modals/DeleteAccountModal.d.ts +19 -0
- package/lib/typescript/ui/components/modals/DeleteAccountModal.d.ts.map +1 -0
- package/lib/typescript/ui/components/modals/index.d.ts +2 -0
- package/lib/typescript/ui/components/modals/index.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentDetailsStep.d.ts +21 -0
- package/lib/typescript/ui/components/payment/PaymentDetailsStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentMethodStep.d.ts +14 -0
- package/lib/typescript/ui/components/payment/PaymentMethodStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentReviewStep.d.ts +16 -0
- package/lib/typescript/ui/components/payment/PaymentReviewStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentSuccessStep.d.ts +10 -0
- package/lib/typescript/ui/components/payment/PaymentSuccessStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/PaymentSummaryStep.d.ts +15 -0
- package/lib/typescript/ui/components/payment/PaymentSummaryStep.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/constants.d.ts +7 -0
- package/lib/typescript/ui/components/payment/constants.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/index.d.ts +9 -0
- package/lib/typescript/ui/components/payment/index.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/paymentStyles.d.ts +396 -0
- package/lib/typescript/ui/components/payment/paymentStyles.d.ts.map +1 -0
- package/lib/typescript/ui/components/payment/types.d.ts +40 -0
- package/lib/typescript/ui/components/payment/types.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/index.d.ts +2 -0
- package/lib/typescript/ui/hooks/index.d.ts.map +1 -1
- package/lib/typescript/ui/hooks/useAsyncAction.d.ts +51 -0
- package/lib/typescript/ui/hooks/useAsyncAction.d.ts.map +1 -0
- package/lib/typescript/ui/hooks/useSettingToggle.d.ts +55 -0
- package/lib/typescript/ui/hooks/useSettingToggle.d.ts.map +1 -0
- package/lib/typescript/ui/navigation/routes.d.ts +1 -1
- package/lib/typescript/ui/navigation/routes.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FAQScreen.d.ts +5 -0
- package/lib/typescript/ui/screens/FAQScreen.d.ts.map +1 -0
- package/lib/typescript/ui/screens/FeedbackScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/HelpSupportScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts +3 -15
- package/lib/typescript/ui/screens/PaymentGatewayScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/ProfileScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SavesCollectionsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaCenterScreen.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/mixins/OxyServices.features.ts +428 -0
- package/src/core/mixins/index.ts +20 -17
- package/src/ui/components/GroupedItem.tsx +19 -1
- package/src/ui/components/SettingRow.tsx +26 -4
- package/src/ui/components/feedback/FormInput.tsx +84 -0
- package/src/ui/components/feedback/ProgressIndicator.tsx +35 -0
- package/src/ui/components/feedback/constants.ts +22 -0
- package/src/ui/components/feedback/feedbackStyles.ts +247 -0
- package/src/ui/components/feedback/index.ts +6 -0
- package/src/ui/components/feedback/types.ts +52 -0
- package/src/ui/components/feedback/useFeedbackForm.ts +44 -0
- package/src/ui/components/modals/DeleteAccountModal.tsx +294 -0
- package/src/ui/components/modals/index.ts +1 -0
- package/src/ui/components/payment/PaymentDetailsStep.tsx +222 -0
- package/src/ui/components/payment/PaymentMethodStep.tsx +89 -0
- package/src/ui/components/payment/PaymentReviewStep.tsx +126 -0
- package/src/ui/components/payment/PaymentSuccessStep.tsx +71 -0
- package/src/ui/components/payment/PaymentSummaryStep.tsx +159 -0
- package/src/ui/components/payment/constants.ts +39 -0
- package/src/ui/components/payment/index.ts +9 -0
- package/src/ui/components/payment/paymentStyles.ts +397 -0
- package/src/ui/components/payment/types.ts +45 -0
- package/src/ui/hooks/index.ts +3 -1
- package/src/ui/hooks/useAsyncAction.ts +129 -0
- package/src/ui/hooks/useSettingToggle.ts +147 -0
- package/src/ui/navigation/routes.ts +2 -0
- package/src/ui/screens/AccountCenterScreen.tsx +2 -2
- package/src/ui/screens/AccountOverviewScreen.tsx +35 -37
- package/src/ui/screens/FAQScreen.tsx +332 -0
- package/src/ui/screens/FeedbackScreen.tsx +91 -626
- package/src/ui/screens/HelpSupportScreen.tsx +7 -5
- package/src/ui/screens/PaymentGatewayScreen.tsx +96 -1275
- package/src/ui/screens/ProfileScreen.tsx +11 -6
- package/src/ui/screens/SavesCollectionsScreen.tsx +19 -10
- package/src/ui/screens/karma/KarmaCenterScreen.tsx +10 -10
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { View, Text, Animated, TouchableOpacity, Clipboard, Linking } from 'react-native';
|
|
3
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
+
import GroupedPillButtons from '../internal/GroupedPillButtons';
|
|
5
|
+
import TextField from '../TextField';
|
|
6
|
+
import { FAIRWalletIcon } from '../icon';
|
|
7
|
+
import { createPaymentStyles } from './paymentStyles';
|
|
8
|
+
import { toast } from '../../../lib/sonner';
|
|
9
|
+
import type { CardDetails, PaymentColors, PaymentStepAnimations } from './types';
|
|
10
|
+
|
|
11
|
+
interface PaymentDetailsStepProps {
|
|
12
|
+
paymentMethod: string;
|
|
13
|
+
cardDetails: CardDetails;
|
|
14
|
+
onCardDetailsChange: (details: CardDetails) => void;
|
|
15
|
+
colors: PaymentColors;
|
|
16
|
+
animations: PaymentStepAnimations;
|
|
17
|
+
faircoinAddress: string;
|
|
18
|
+
isMobile: boolean;
|
|
19
|
+
qrSize: number;
|
|
20
|
+
onBack: () => void;
|
|
21
|
+
onNext: () => void;
|
|
22
|
+
QRCodeComponent?: React.ComponentType<{ value?: string; size?: number }>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const PaymentDetailsStep: React.FC<PaymentDetailsStepProps> = ({
|
|
26
|
+
paymentMethod,
|
|
27
|
+
cardDetails,
|
|
28
|
+
onCardDetailsChange,
|
|
29
|
+
colors,
|
|
30
|
+
animations,
|
|
31
|
+
faircoinAddress,
|
|
32
|
+
isMobile,
|
|
33
|
+
qrSize,
|
|
34
|
+
onBack,
|
|
35
|
+
onNext,
|
|
36
|
+
QRCodeComponent,
|
|
37
|
+
}) => {
|
|
38
|
+
const styles = useMemo(() => createPaymentStyles(colors), [colors]);
|
|
39
|
+
const { fadeAnim, slideAnim, scaleAnim } = animations;
|
|
40
|
+
|
|
41
|
+
const handleCopyAddress = () => {
|
|
42
|
+
Clipboard.setString(faircoinAddress);
|
|
43
|
+
toast('Address copied to clipboard!');
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const handleOpenFairWallet = () => {
|
|
47
|
+
const url = `fairwallet://pay?address=${faircoinAddress}`;
|
|
48
|
+
Linking.openURL(url);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const isCardValid = cardDetails.number && cardDetails.expiry && cardDetails.cvv;
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Animated.View
|
|
55
|
+
style={[
|
|
56
|
+
styles.stepContainer,
|
|
57
|
+
{
|
|
58
|
+
opacity: fadeAnim,
|
|
59
|
+
transform: [
|
|
60
|
+
{ translateY: slideAnim },
|
|
61
|
+
{ scale: scaleAnim },
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
]}
|
|
65
|
+
accessibilityRole="none"
|
|
66
|
+
accessibilityLabel="Enter payment details step"
|
|
67
|
+
>
|
|
68
|
+
<View style={styles.section}>
|
|
69
|
+
<Text style={styles.sectionTitle}>
|
|
70
|
+
{paymentMethod === 'card' ? 'Card Details' :
|
|
71
|
+
paymentMethod === 'oxy' ? 'Oxy Pay' :
|
|
72
|
+
paymentMethod === 'faircoin' ? 'FairCoin Payment' : 'Payment Details'}
|
|
73
|
+
</Text>
|
|
74
|
+
|
|
75
|
+
{paymentMethod === 'card' && (
|
|
76
|
+
<View style={styles.cardPaymentCard}>
|
|
77
|
+
<View style={styles.cardPaymentContent}>
|
|
78
|
+
<Ionicons name="card-outline" size={64} color={colors.primary} style={styles.cardPaymentIcon} />
|
|
79
|
+
<Text style={styles.cardPaymentMainTitle}>Credit Card</Text>
|
|
80
|
+
<Text style={styles.cardPaymentSubtitle}>Enter your card details securely</Text>
|
|
81
|
+
|
|
82
|
+
<View style={styles.cardPaymentFields}>
|
|
83
|
+
<View style={styles.cardRowInfo}>
|
|
84
|
+
<Ionicons name="card-outline" size={24} color={colors.primary} style={styles.cardRowIcon} />
|
|
85
|
+
<Text style={styles.cardRowText}>We accept Visa, Mastercard, and more</Text>
|
|
86
|
+
</View>
|
|
87
|
+
<TextField
|
|
88
|
+
value={cardDetails.number}
|
|
89
|
+
onChangeText={text => {
|
|
90
|
+
const formatted = text.replace(/\s/g, '').replace(/(\d{4})/g, '$1 ').trim();
|
|
91
|
+
onCardDetailsChange({ ...cardDetails, number: formatted });
|
|
92
|
+
}}
|
|
93
|
+
placeholder="1234 5678 9012 3456"
|
|
94
|
+
keyboardType="numeric"
|
|
95
|
+
maxLength={19}
|
|
96
|
+
style={styles.cardFieldContainer}
|
|
97
|
+
left={<Ionicons name="card-outline" size={18} color={colors.primary} />}
|
|
98
|
+
accessibilityLabel="Card number"
|
|
99
|
+
accessibilityHint="Enter your 16-digit card number"
|
|
100
|
+
/>
|
|
101
|
+
<View style={styles.cardFieldRow}>
|
|
102
|
+
<TextField
|
|
103
|
+
value={cardDetails.expiry}
|
|
104
|
+
onChangeText={text => {
|
|
105
|
+
const formatted = text.replace(/\D/g, '').replace(/(\d{2})(\d)/, '$1/$2');
|
|
106
|
+
onCardDetailsChange({ ...cardDetails, expiry: formatted });
|
|
107
|
+
}}
|
|
108
|
+
placeholder="MM/YY"
|
|
109
|
+
maxLength={5}
|
|
110
|
+
style={styles.cardFieldHalfLeft}
|
|
111
|
+
left={<Ionicons name="calendar-outline" size={16} color={colors.primary} />}
|
|
112
|
+
accessibilityLabel="Expiry date"
|
|
113
|
+
accessibilityHint="Enter expiry date in MM/YY format"
|
|
114
|
+
/>
|
|
115
|
+
<TextField
|
|
116
|
+
value={cardDetails.cvv}
|
|
117
|
+
onChangeText={text => {
|
|
118
|
+
const formatted = text.replace(/\D/g, '');
|
|
119
|
+
onCardDetailsChange({ ...cardDetails, cvv: formatted });
|
|
120
|
+
}}
|
|
121
|
+
placeholder="123"
|
|
122
|
+
keyboardType="numeric"
|
|
123
|
+
maxLength={4}
|
|
124
|
+
style={styles.cardFieldHalfRight}
|
|
125
|
+
left={<Ionicons name="lock-closed-outline" size={16} color={colors.primary} />}
|
|
126
|
+
accessibilityLabel="CVV"
|
|
127
|
+
accessibilityHint="Enter 3 or 4 digit security code"
|
|
128
|
+
/>
|
|
129
|
+
</View>
|
|
130
|
+
</View>
|
|
131
|
+
|
|
132
|
+
<View style={{ height: 18 }} />
|
|
133
|
+
<Text style={styles.cardPaymentWaiting}>Ready to process payment...</Text>
|
|
134
|
+
</View>
|
|
135
|
+
</View>
|
|
136
|
+
)}
|
|
137
|
+
|
|
138
|
+
{paymentMethod === 'oxy' && (
|
|
139
|
+
<View style={styles.oxyPayCard}>
|
|
140
|
+
<View style={styles.oxyPayContent}>
|
|
141
|
+
<Ionicons name="wallet-outline" size={64} color={colors.primary} style={styles.oxyPayIcon} />
|
|
142
|
+
<Text style={styles.oxyPayMainTitle}>Oxy Pay</Text>
|
|
143
|
+
<Text style={styles.oxyPaySubtitle}>Pay with your in-app wallet</Text>
|
|
144
|
+
<View style={styles.oxyPayBalanceBox}>
|
|
145
|
+
<Text style={styles.oxyPayBalanceText}>Balance: ⊜ 123.45</Text>
|
|
146
|
+
</View>
|
|
147
|
+
<View style={{ height: 18 }} />
|
|
148
|
+
<Text style={styles.oxyPayWaiting}>Ready to process payment...</Text>
|
|
149
|
+
</View>
|
|
150
|
+
</View>
|
|
151
|
+
)}
|
|
152
|
+
|
|
153
|
+
{paymentMethod === 'faircoin' && (
|
|
154
|
+
<View style={styles.faircoinCard}>
|
|
155
|
+
<View style={styles.faircoinContent}>
|
|
156
|
+
<FAIRWalletIcon size={64} style={styles.faircoinIcon} />
|
|
157
|
+
<Text style={styles.faircoinMainTitle}>FAIRWallet</Text>
|
|
158
|
+
<Text style={styles.faircoinSubtitle}>Pay with FairCoin</Text>
|
|
159
|
+
{!isMobile && QRCodeComponent ? (
|
|
160
|
+
<>
|
|
161
|
+
<Text style={styles.faircoinScanText}>Scan to Pay</Text>
|
|
162
|
+
<View style={styles.faircoinQRCard}>
|
|
163
|
+
<QRCodeComponent value={faircoinAddress} size={qrSize - 32} />
|
|
164
|
+
<View style={styles.faircoinQRBadge}>
|
|
165
|
+
<FAIRWalletIcon size={28} />
|
|
166
|
+
</View>
|
|
167
|
+
</View>
|
|
168
|
+
</>
|
|
169
|
+
) : (
|
|
170
|
+
<>
|
|
171
|
+
<Text style={styles.faircoinTitle}>Use the options below to pay with FAIRWallet</Text>
|
|
172
|
+
<Text style={styles.faircoinAddress}>{faircoinAddress}</Text>
|
|
173
|
+
<TouchableOpacity
|
|
174
|
+
style={[styles.faircoinButton, { backgroundColor: '#9ffb50', borderRadius: 18, marginTop: 12, width: '90%', flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }]}
|
|
175
|
+
onPress={handleOpenFairWallet}
|
|
176
|
+
accessibilityRole="button"
|
|
177
|
+
accessibilityLabel="Open in FAIRWallet"
|
|
178
|
+
>
|
|
179
|
+
<FAIRWalletIcon size={20} style={{ marginRight: 8 }} />
|
|
180
|
+
<Text style={[styles.faircoinButtonText, { color: '#1b1f0a', fontWeight: 'bold', fontSize: 16 }]}>Open in FAIRWallet</Text>
|
|
181
|
+
</TouchableOpacity>
|
|
182
|
+
<TouchableOpacity
|
|
183
|
+
style={[styles.faircoinButton, { backgroundColor: '#9ffb50', borderRadius: 18, marginTop: 10, width: '90%', flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }]}
|
|
184
|
+
onPress={handleCopyAddress}
|
|
185
|
+
accessibilityRole="button"
|
|
186
|
+
accessibilityLabel="Copy FairCoin address"
|
|
187
|
+
>
|
|
188
|
+
<FAIRWalletIcon size={20} style={{ marginRight: 8 }} />
|
|
189
|
+
<Text style={[styles.faircoinButtonText, { color: '#1b1f0a', fontWeight: 'bold', fontSize: 16 }]}>Copy Address</Text>
|
|
190
|
+
</TouchableOpacity>
|
|
191
|
+
</>
|
|
192
|
+
)}
|
|
193
|
+
<View style={{ height: 18 }} />
|
|
194
|
+
<Text style={styles.faircoinWaiting}>Waiting for payment...</Text>
|
|
195
|
+
</View>
|
|
196
|
+
</View>
|
|
197
|
+
)}
|
|
198
|
+
</View>
|
|
199
|
+
|
|
200
|
+
<GroupedPillButtons
|
|
201
|
+
buttons={[
|
|
202
|
+
{
|
|
203
|
+
text: 'Back',
|
|
204
|
+
onPress: onBack,
|
|
205
|
+
icon: 'arrow-back',
|
|
206
|
+
variant: 'transparent',
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
text: 'Continue',
|
|
210
|
+
onPress: onNext,
|
|
211
|
+
icon: 'arrow-forward',
|
|
212
|
+
variant: 'primary',
|
|
213
|
+
disabled: paymentMethod === 'card' && !isCardValid,
|
|
214
|
+
},
|
|
215
|
+
]}
|
|
216
|
+
colors={colors}
|
|
217
|
+
/>
|
|
218
|
+
</Animated.View>
|
|
219
|
+
);
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
export default PaymentDetailsStep;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { View, Text, Animated } from 'react-native';
|
|
3
|
+
import { GroupedSection } from '../index';
|
|
4
|
+
import GroupedPillButtons from '../internal/GroupedPillButtons';
|
|
5
|
+
import { FAIRWalletIcon } from '../icon';
|
|
6
|
+
import { createPaymentStyles } from './paymentStyles';
|
|
7
|
+
import type { PaymentMethod, PaymentColors, PaymentStepAnimations } from './types';
|
|
8
|
+
|
|
9
|
+
interface PaymentMethodStepProps {
|
|
10
|
+
availablePaymentMethods: PaymentMethod[];
|
|
11
|
+
selectedMethod: string;
|
|
12
|
+
onSelectMethod: (method: string) => void;
|
|
13
|
+
colors: PaymentColors;
|
|
14
|
+
animations: PaymentStepAnimations;
|
|
15
|
+
onBack: () => void;
|
|
16
|
+
onNext: () => void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const PaymentMethodStep: React.FC<PaymentMethodStepProps> = ({
|
|
20
|
+
availablePaymentMethods,
|
|
21
|
+
selectedMethod,
|
|
22
|
+
onSelectMethod,
|
|
23
|
+
colors,
|
|
24
|
+
animations,
|
|
25
|
+
onBack,
|
|
26
|
+
onNext,
|
|
27
|
+
}) => {
|
|
28
|
+
const styles = useMemo(() => createPaymentStyles(colors), [colors]);
|
|
29
|
+
const { fadeAnim, slideAnim, scaleAnim } = animations;
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Animated.View
|
|
33
|
+
style={[
|
|
34
|
+
styles.stepContainer,
|
|
35
|
+
{
|
|
36
|
+
opacity: fadeAnim,
|
|
37
|
+
transform: [
|
|
38
|
+
{ translateY: slideAnim },
|
|
39
|
+
{ scale: scaleAnim },
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
]}
|
|
43
|
+
accessibilityRole="none"
|
|
44
|
+
accessibilityLabel="Choose payment method step"
|
|
45
|
+
>
|
|
46
|
+
<View style={styles.section}>
|
|
47
|
+
<Text style={styles.sectionTitle}>Choose Payment Method</Text>
|
|
48
|
+
|
|
49
|
+
<GroupedSection
|
|
50
|
+
items={availablePaymentMethods.map(method => ({
|
|
51
|
+
id: method.key,
|
|
52
|
+
icon: method.key === 'faircoin' ? undefined : method.icon,
|
|
53
|
+
iconColor: method.key === 'card' ? '#007AFF' :
|
|
54
|
+
method.key === 'oxy' ? '#32D74B' :
|
|
55
|
+
method.key === 'faircoin' ? '#9ffb50' : colors.primary,
|
|
56
|
+
title: method.label,
|
|
57
|
+
subtitle: method.description,
|
|
58
|
+
onPress: () => onSelectMethod(method.key),
|
|
59
|
+
selected: selectedMethod === method.key,
|
|
60
|
+
showChevron: false,
|
|
61
|
+
customIcon: method.key === 'faircoin' ? (
|
|
62
|
+
<FAIRWalletIcon size={20} />
|
|
63
|
+
) : undefined,
|
|
64
|
+
}))}
|
|
65
|
+
/>
|
|
66
|
+
</View>
|
|
67
|
+
|
|
68
|
+
<GroupedPillButtons
|
|
69
|
+
buttons={[
|
|
70
|
+
{
|
|
71
|
+
text: 'Back',
|
|
72
|
+
onPress: onBack,
|
|
73
|
+
icon: 'arrow-back',
|
|
74
|
+
variant: 'transparent',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
text: 'Continue',
|
|
78
|
+
onPress: onNext,
|
|
79
|
+
icon: 'arrow-forward',
|
|
80
|
+
variant: 'primary',
|
|
81
|
+
},
|
|
82
|
+
]}
|
|
83
|
+
colors={colors}
|
|
84
|
+
/>
|
|
85
|
+
</Animated.View>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default PaymentMethodStep;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { View, Text, Animated } from 'react-native';
|
|
3
|
+
import { GroupedSection } from '../index';
|
|
4
|
+
import GroupedPillButtons from '../internal/GroupedPillButtons';
|
|
5
|
+
import { createPaymentStyles } from './paymentStyles';
|
|
6
|
+
import { PAYMENT_METHODS, getCurrencySymbol } from './constants';
|
|
7
|
+
import type { CardDetails, PaymentColors, PaymentStepAnimations } from './types';
|
|
8
|
+
|
|
9
|
+
interface PaymentReviewStepProps {
|
|
10
|
+
amount: string | number;
|
|
11
|
+
currency: string;
|
|
12
|
+
paymentMethod: string;
|
|
13
|
+
cardDetails: CardDetails;
|
|
14
|
+
colors: PaymentColors;
|
|
15
|
+
animations: PaymentStepAnimations;
|
|
16
|
+
isPaying: boolean;
|
|
17
|
+
onBack: () => void;
|
|
18
|
+
onPay: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const PaymentReviewStep: React.FC<PaymentReviewStepProps> = ({
|
|
22
|
+
amount,
|
|
23
|
+
currency,
|
|
24
|
+
paymentMethod,
|
|
25
|
+
cardDetails,
|
|
26
|
+
colors,
|
|
27
|
+
animations,
|
|
28
|
+
isPaying,
|
|
29
|
+
onBack,
|
|
30
|
+
onPay,
|
|
31
|
+
}) => {
|
|
32
|
+
const styles = useMemo(() => createPaymentStyles(colors), [colors]);
|
|
33
|
+
const currencySymbol = getCurrencySymbol(currency);
|
|
34
|
+
const { fadeAnim, slideAnim, scaleAnim } = animations;
|
|
35
|
+
|
|
36
|
+
const selectedMethod = PAYMENT_METHODS.find(m => m.key === paymentMethod);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Animated.View
|
|
40
|
+
style={[
|
|
41
|
+
styles.stepContainer,
|
|
42
|
+
{
|
|
43
|
+
opacity: fadeAnim,
|
|
44
|
+
transform: [
|
|
45
|
+
{ translateY: slideAnim },
|
|
46
|
+
{ scale: scaleAnim },
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
]}
|
|
50
|
+
accessibilityRole="none"
|
|
51
|
+
accessibilityLabel="Review payment step"
|
|
52
|
+
>
|
|
53
|
+
<View style={styles.section}>
|
|
54
|
+
<Text style={styles.sectionTitle}>Review Payment</Text>
|
|
55
|
+
|
|
56
|
+
<GroupedSection
|
|
57
|
+
items={[
|
|
58
|
+
{
|
|
59
|
+
id: 'secure-payment',
|
|
60
|
+
icon: 'shield-check',
|
|
61
|
+
iconColor: colors.success || '#4BB543',
|
|
62
|
+
title: 'Secure payment',
|
|
63
|
+
subtitle: 'Your payment is protected by industry-standard encryption',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'amount',
|
|
67
|
+
icon: 'cash',
|
|
68
|
+
iconColor: colors.primary,
|
|
69
|
+
title: 'Amount',
|
|
70
|
+
subtitle: `${currencySymbol} ${amount}`,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'payment-method',
|
|
74
|
+
icon: selectedMethod?.icon as any,
|
|
75
|
+
iconColor: colors.primary,
|
|
76
|
+
title: 'Payment Method',
|
|
77
|
+
subtitle: selectedMethod?.label,
|
|
78
|
+
},
|
|
79
|
+
...(paymentMethod === 'card' ? [{
|
|
80
|
+
id: 'card-details',
|
|
81
|
+
icon: 'card' as const,
|
|
82
|
+
iconColor: colors.primary,
|
|
83
|
+
title: 'Card',
|
|
84
|
+
subtitle: cardDetails.number.replace(/.(?=.{4})/g, '*'),
|
|
85
|
+
}] : []),
|
|
86
|
+
...(paymentMethod === 'oxy' ? [{
|
|
87
|
+
id: 'oxy-balance',
|
|
88
|
+
icon: 'wallet' as const,
|
|
89
|
+
iconColor: colors.primary,
|
|
90
|
+
title: 'Oxy Pay Account',
|
|
91
|
+
subtitle: 'Balance: ⊜ 123.45',
|
|
92
|
+
}] : []),
|
|
93
|
+
...(paymentMethod === 'faircoin' ? [{
|
|
94
|
+
id: 'faircoin-wallet',
|
|
95
|
+
icon: 'qr-code' as const,
|
|
96
|
+
iconColor: colors.primary,
|
|
97
|
+
title: 'FairCoin Wallet',
|
|
98
|
+
subtitle: 'Paid via QR',
|
|
99
|
+
}] : []),
|
|
100
|
+
]}
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
103
|
+
|
|
104
|
+
<GroupedPillButtons
|
|
105
|
+
buttons={[
|
|
106
|
+
{
|
|
107
|
+
text: 'Back',
|
|
108
|
+
onPress: onBack,
|
|
109
|
+
icon: 'arrow-back',
|
|
110
|
+
variant: 'transparent',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
text: isPaying ? 'Processing...' : 'Pay Now',
|
|
114
|
+
onPress: onPay,
|
|
115
|
+
icon: 'checkmark',
|
|
116
|
+
variant: 'primary',
|
|
117
|
+
loading: isPaying,
|
|
118
|
+
},
|
|
119
|
+
]}
|
|
120
|
+
colors={colors}
|
|
121
|
+
/>
|
|
122
|
+
</Animated.View>
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
export default PaymentReviewStep;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { View, Text, Animated } from 'react-native';
|
|
3
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
+
import GroupedPillButtons from '../internal/GroupedPillButtons';
|
|
5
|
+
import { createPaymentStyles } from './paymentStyles';
|
|
6
|
+
import type { PaymentColors, PaymentStepAnimations } from './types';
|
|
7
|
+
|
|
8
|
+
interface PaymentSuccessStepProps {
|
|
9
|
+
colors: PaymentColors;
|
|
10
|
+
animations: PaymentStepAnimations;
|
|
11
|
+
onDone: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const PaymentSuccessStep: React.FC<PaymentSuccessStepProps> = ({
|
|
15
|
+
colors,
|
|
16
|
+
animations,
|
|
17
|
+
onDone,
|
|
18
|
+
}) => {
|
|
19
|
+
const styles = useMemo(() => createPaymentStyles(colors), [colors]);
|
|
20
|
+
const { fadeAnim, slideAnim, scaleAnim } = animations;
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Animated.View
|
|
24
|
+
style={[
|
|
25
|
+
styles.stepContainer,
|
|
26
|
+
{
|
|
27
|
+
opacity: fadeAnim,
|
|
28
|
+
transform: [
|
|
29
|
+
{ translateY: slideAnim },
|
|
30
|
+
{ scale: scaleAnim },
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
]}
|
|
34
|
+
accessibilityRole="none"
|
|
35
|
+
accessibilityLabel="Payment complete"
|
|
36
|
+
>
|
|
37
|
+
<View style={styles.section}>
|
|
38
|
+
<Text style={styles.sectionTitle}>Payment Complete</Text>
|
|
39
|
+
|
|
40
|
+
<View style={styles.successCard}>
|
|
41
|
+
<View style={styles.successContent}>
|
|
42
|
+
<Ionicons
|
|
43
|
+
name="checkmark-circle"
|
|
44
|
+
size={64}
|
|
45
|
+
color={colors.success || '#4BB543'}
|
|
46
|
+
style={styles.successIcon}
|
|
47
|
+
/>
|
|
48
|
+
<Text style={styles.successMainTitle}>Payment Successful!</Text>
|
|
49
|
+
<Text style={styles.successSubtitle}>Thank you for your payment.</Text>
|
|
50
|
+
<View style={{ height: 18 }} />
|
|
51
|
+
<Text style={styles.successMessage}>Your transaction has been processed successfully.</Text>
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
</View>
|
|
55
|
+
|
|
56
|
+
<GroupedPillButtons
|
|
57
|
+
buttons={[
|
|
58
|
+
{
|
|
59
|
+
text: 'Done',
|
|
60
|
+
onPress: onDone,
|
|
61
|
+
icon: 'checkmark',
|
|
62
|
+
variant: 'primary',
|
|
63
|
+
},
|
|
64
|
+
]}
|
|
65
|
+
colors={colors}
|
|
66
|
+
/>
|
|
67
|
+
</Animated.View>
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export default PaymentSuccessStep;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { View, Text, Animated } from 'react-native';
|
|
3
|
+
import { Ionicons } from '@expo/vector-icons';
|
|
4
|
+
import { GroupedSection } from '../index';
|
|
5
|
+
import GroupedPillButtons from '../internal/GroupedPillButtons';
|
|
6
|
+
import { createPaymentStyles } from './paymentStyles';
|
|
7
|
+
import { getCurrencySymbol, CURRENCY_SYMBOLS } from './constants';
|
|
8
|
+
import type { PaymentItem, PaymentColors, PaymentStepAnimations } from './types';
|
|
9
|
+
|
|
10
|
+
interface PaymentSummaryStepProps {
|
|
11
|
+
paymentItems: PaymentItem[];
|
|
12
|
+
amount: string | number;
|
|
13
|
+
currency: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
colors: PaymentColors;
|
|
16
|
+
animations: PaymentStepAnimations;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
onNext: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const getItemTypeIcon = (type: string): string => {
|
|
22
|
+
switch (type) {
|
|
23
|
+
case 'product': return 'cart-outline';
|
|
24
|
+
case 'subscription': return 'repeat-outline';
|
|
25
|
+
case 'service': return 'construct-outline';
|
|
26
|
+
case 'fee': return 'cash-outline';
|
|
27
|
+
default: return 'pricetag-outline';
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const PaymentSummaryStep: React.FC<PaymentSummaryStepProps> = ({
|
|
32
|
+
paymentItems,
|
|
33
|
+
amount,
|
|
34
|
+
currency,
|
|
35
|
+
description,
|
|
36
|
+
colors,
|
|
37
|
+
animations,
|
|
38
|
+
onClose,
|
|
39
|
+
onNext,
|
|
40
|
+
}) => {
|
|
41
|
+
const styles = useMemo(() => createPaymentStyles(colors), [colors]);
|
|
42
|
+
const currencySymbol = getCurrencySymbol(currency);
|
|
43
|
+
const { fadeAnim, slideAnim, scaleAnim } = animations;
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<Animated.View
|
|
47
|
+
style={[
|
|
48
|
+
styles.stepContainer,
|
|
49
|
+
{
|
|
50
|
+
opacity: fadeAnim,
|
|
51
|
+
transform: [
|
|
52
|
+
{ translateY: slideAnim },
|
|
53
|
+
{ scale: scaleAnim },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
]}
|
|
57
|
+
accessibilityRole="none"
|
|
58
|
+
accessibilityLabel="Payment summary step"
|
|
59
|
+
>
|
|
60
|
+
<View style={styles.section}>
|
|
61
|
+
<Text style={styles.sectionTitle}>Payment Summary</Text>
|
|
62
|
+
|
|
63
|
+
<View style={styles.summaryCard}>
|
|
64
|
+
<View style={styles.summaryCardContent}>
|
|
65
|
+
<Ionicons
|
|
66
|
+
name="receipt-outline"
|
|
67
|
+
size={64}
|
|
68
|
+
color={colors.primary}
|
|
69
|
+
style={styles.summaryCardIcon}
|
|
70
|
+
/>
|
|
71
|
+
<Text style={styles.summaryCardMainTitle}>
|
|
72
|
+
{paymentItems.length > 0 ? 'Order Summary' : 'Payment'}
|
|
73
|
+
</Text>
|
|
74
|
+
<Text style={styles.summaryCardSubtitle}>
|
|
75
|
+
{paymentItems.length > 0 ? 'Review your payment details' : 'Complete your payment'}
|
|
76
|
+
</Text>
|
|
77
|
+
|
|
78
|
+
{paymentItems.length > 0 ? (
|
|
79
|
+
<>
|
|
80
|
+
<View style={styles.summaryCardItems}>
|
|
81
|
+
<GroupedSection
|
|
82
|
+
items={paymentItems.map((item, idx) => ({
|
|
83
|
+
id: `item-${idx}`,
|
|
84
|
+
icon: getItemTypeIcon(item.type) as any,
|
|
85
|
+
iconColor: colors.primary,
|
|
86
|
+
title: `${item.type === 'product' && item.quantity ? `${item.quantity} × ` : ''}${item.name}${item.type === 'subscription' && item.period ? ` (${item.period})` : ''}`,
|
|
87
|
+
subtitle: item.description || `${item.currency ? (CURRENCY_SYMBOLS[item.currency.toUpperCase()] || item.currency) : currencySymbol} ${item.price * (item.quantity ?? 1)}`,
|
|
88
|
+
customContent: (
|
|
89
|
+
<Text style={styles.summaryItemPrice}>
|
|
90
|
+
{item.currency ? (CURRENCY_SYMBOLS[item.currency.toUpperCase()] || item.currency) : currencySymbol} {item.price * (item.quantity ?? 1)}
|
|
91
|
+
</Text>
|
|
92
|
+
),
|
|
93
|
+
}))}
|
|
94
|
+
/>
|
|
95
|
+
</View>
|
|
96
|
+
|
|
97
|
+
<View style={styles.summaryCardDivider} />
|
|
98
|
+
|
|
99
|
+
<View style={styles.summaryCardTotalSection}>
|
|
100
|
+
<View style={styles.summaryCardTotalRow}>
|
|
101
|
+
<Text style={styles.summaryCardTotalLabel}>Subtotal</Text>
|
|
102
|
+
<Text style={styles.summaryCardTotalValue}>{currencySymbol} {amount}</Text>
|
|
103
|
+
</View>
|
|
104
|
+
<View style={styles.summaryCardTotalRow}>
|
|
105
|
+
<Text style={styles.summaryCardTotalLabel}>Tax</Text>
|
|
106
|
+
<Text style={styles.summaryCardTotalValue}>{currencySymbol} 0.00</Text>
|
|
107
|
+
</View>
|
|
108
|
+
<View style={styles.summaryCardTotalRow}>
|
|
109
|
+
<Text style={styles.summaryCardTotalLabel}>Total</Text>
|
|
110
|
+
<Text style={styles.summaryCardTotalValue}>{currencySymbol} {amount}</Text>
|
|
111
|
+
</View>
|
|
112
|
+
</View>
|
|
113
|
+
</>
|
|
114
|
+
) : (
|
|
115
|
+
<>
|
|
116
|
+
<View style={styles.summaryCardAmount}>
|
|
117
|
+
<Text style={styles.summaryCardAmountLabel}>Amount to Pay</Text>
|
|
118
|
+
<Text style={styles.summaryCardAmountValue}>{currencySymbol} {amount}</Text>
|
|
119
|
+
{description && (
|
|
120
|
+
<Text style={styles.summaryCardAmountDescription}>{description}</Text>
|
|
121
|
+
)}
|
|
122
|
+
</View>
|
|
123
|
+
|
|
124
|
+
<View style={styles.summaryCardDivider} />
|
|
125
|
+
|
|
126
|
+
<View style={styles.summaryCardTotalSection}>
|
|
127
|
+
<View style={styles.summaryCardTotalRow}>
|
|
128
|
+
<Text style={styles.summaryCardTotalLabel}>Total</Text>
|
|
129
|
+
<Text style={styles.summaryCardTotalValue}>{currencySymbol} {amount}</Text>
|
|
130
|
+
</View>
|
|
131
|
+
</View>
|
|
132
|
+
</>
|
|
133
|
+
)}
|
|
134
|
+
</View>
|
|
135
|
+
</View>
|
|
136
|
+
</View>
|
|
137
|
+
|
|
138
|
+
<GroupedPillButtons
|
|
139
|
+
buttons={[
|
|
140
|
+
{
|
|
141
|
+
text: 'Close',
|
|
142
|
+
onPress: onClose,
|
|
143
|
+
icon: 'close',
|
|
144
|
+
variant: 'transparent',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
text: 'Continue',
|
|
148
|
+
onPress: onNext,
|
|
149
|
+
icon: 'arrow-forward',
|
|
150
|
+
variant: 'primary',
|
|
151
|
+
},
|
|
152
|
+
]}
|
|
153
|
+
colors={colors}
|
|
154
|
+
/>
|
|
155
|
+
</Animated.View>
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
export default PaymentSummaryStep;
|