payment-kit 1.18.3 → 1.18.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/api/src/integrations/stripe/setup.ts +27 -0
  2. package/api/src/routes/payment-methods.ts +28 -2
  3. package/api/src/routes/settings.ts +251 -2
  4. package/api/src/store/migrations/20250211-setting.ts +10 -0
  5. package/api/src/store/migrations/20250214-setting-component.ts +22 -0
  6. package/api/src/store/models/index.ts +6 -1
  7. package/api/src/store/models/payment-method.ts +12 -6
  8. package/api/src/store/models/setting.ts +84 -0
  9. package/api/src/store/models/types.ts +2 -0
  10. package/blocklet.yml +13 -1
  11. package/package.json +8 -8
  12. package/src/app.tsx +6 -1
  13. package/src/components/invoice/list.tsx +1 -3
  14. package/src/components/payment-intent/list.tsx +5 -6
  15. package/src/components/payouts/list.tsx +3 -3
  16. package/src/components/refund/list.tsx +3 -6
  17. package/src/components/subscription/list.tsx +1 -2
  18. package/src/locales/en.tsx +100 -1
  19. package/src/locales/zh.tsx +96 -0
  20. package/src/pages/admin/customers/customers/index.tsx +27 -16
  21. package/src/pages/admin/developers/webhooks/index.tsx +14 -12
  22. package/src/pages/admin/products/links/index.tsx +22 -15
  23. package/src/pages/admin/products/pricing-tables/index.tsx +16 -14
  24. package/src/pages/admin/products/products/index.tsx +19 -15
  25. package/src/pages/admin/settings/payment-methods/edit.tsx +3 -0
  26. package/src/pages/home.tsx +1 -1
  27. package/src/pages/integrations/donations/edit-form.tsx +349 -0
  28. package/src/pages/integrations/donations/index.tsx +360 -0
  29. package/src/pages/integrations/donations/preview.tsx +229 -0
  30. package/src/pages/integrations/index.tsx +80 -0
  31. package/src/pages/integrations/overview.tsx +121 -0
@@ -0,0 +1,121 @@
1
+ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
2
+ import { Box, Card, CardActionArea, CardContent, Grid, Typography, Divider } from '@mui/material';
3
+ import { useNavigate } from 'react-router-dom';
4
+ import { Favorite, Inventory, Link as LinkIcon, TableChart, Payment, Code } from '@mui/icons-material';
5
+
6
+ const basicFeatures = [
7
+ {
8
+ title: 'integrations.features.products.title',
9
+ description: 'integrations.features.products.intro',
10
+ icon: <Inventory color="primary" sx={{ fontSize: 40 }} />,
11
+ path: '/admin/products',
12
+ },
13
+ {
14
+ title: 'integrations.features.paymentLinks.title',
15
+ description: 'integrations.features.paymentLinks.intro',
16
+ icon: <LinkIcon color="primary" sx={{ fontSize: 40 }} />,
17
+ path: '/admin/products/links',
18
+ },
19
+ {
20
+ title: 'integrations.features.pricingTables.title',
21
+ description: 'integrations.features.pricingTables.intro',
22
+ icon: <TableChart color="primary" sx={{ fontSize: 40 }} />,
23
+ path: '/admin/products/pricing-tables',
24
+ },
25
+ ];
26
+
27
+ const advancedFeatures = [
28
+ {
29
+ title: 'integrations.features.donate.title',
30
+ description: 'integrations.features.donate.intro',
31
+ icon: <Favorite color="primary" sx={{ fontSize: 40 }} />,
32
+ path: '/integrations/donations',
33
+ },
34
+ {
35
+ title: 'integrations.features.paymentMethods.title',
36
+ description: 'integrations.features.paymentMethods.intro',
37
+ icon: <Payment color="primary" sx={{ fontSize: 40 }} />,
38
+ path: '/admin/settings/payment-methods',
39
+ },
40
+ {
41
+ title: 'integrations.features.api.title',
42
+ description: 'integrations.features.api.intro',
43
+ icon: <Code color="primary" sx={{ fontSize: 40 }} />,
44
+ path: 'https://www.npmjs.com/package/@blocklet/payment-js',
45
+ external: true,
46
+ },
47
+ ];
48
+
49
+ export default function Overview() {
50
+ const { t } = useLocaleContext();
51
+ const navigate = useNavigate();
52
+
53
+ const handleClick = (item: any) => {
54
+ if (item.external) {
55
+ window.open(item.path, '_blank');
56
+ } else {
57
+ navigate(item.path);
58
+ }
59
+ };
60
+
61
+ return (
62
+ <Box>
63
+ <Box mb={4}>
64
+ <Typography variant="h2" gutterBottom fontWeight="bold" mb={2}>
65
+ {t('common.welcome')}
66
+ </Typography>
67
+ <Typography variant="body1" color="text.secondary" mb={2}>
68
+ {t('common.welcomeDesc')}
69
+ </Typography>
70
+ </Box>
71
+
72
+ <Typography variant="h5" gutterBottom>
73
+ {t('integrations.basicFeatures')} 🚀
74
+ </Typography>
75
+ <Grid container spacing={3} mb={4}>
76
+ {basicFeatures.map((item) => (
77
+ <Grid item xs={12} sm={6} md={4} key={item.path}>
78
+ <Card sx={{ height: '100%' }}>
79
+ <CardActionArea onClick={() => handleClick(item)} sx={{ height: '100%' }}>
80
+ <CardContent>
81
+ <Box display="flex" alignItems="center" gap={2} mb={2}>
82
+ {item.icon}
83
+ <Typography variant="h6">{t(item.title)}</Typography>
84
+ </Box>
85
+ <Typography variant="body2" color="text.secondary">
86
+ {t(item.description)}
87
+ </Typography>
88
+ </CardContent>
89
+ </CardActionArea>
90
+ </Card>
91
+ </Grid>
92
+ ))}
93
+ </Grid>
94
+
95
+ <Divider sx={{ my: 4 }} />
96
+
97
+ <Typography variant="h5" gutterBottom>
98
+ {t('integrations.advancedFeatures')} 🔥
99
+ </Typography>
100
+ <Grid container spacing={3}>
101
+ {advancedFeatures.map((item) => (
102
+ <Grid item xs={12} sm={6} md={4} key={item.path}>
103
+ <Card sx={{ height: '100%' }}>
104
+ <CardActionArea onClick={() => handleClick(item)} sx={{ height: '100%' }}>
105
+ <CardContent>
106
+ <Box display="flex" alignItems="center" gap={2} mb={2}>
107
+ {item.icon}
108
+ <Typography variant="h6">{t(item.title)}</Typography>
109
+ </Box>
110
+ <Typography variant="body2" color="text.secondary">
111
+ {t(item.description)}
112
+ </Typography>
113
+ </CardContent>
114
+ </CardActionArea>
115
+ </Card>
116
+ </Grid>
117
+ ))}
118
+ </Grid>
119
+ </Box>
120
+ );
121
+ }