payment-kit 1.13.213 → 1.13.214

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/blocklet.yml CHANGED
@@ -14,7 +14,7 @@ repository:
14
14
  type: git
15
15
  url: git+https://github.com/blocklet/payment-kit.git
16
16
  specVersion: 1.2.8
17
- version: 1.13.213
17
+ version: 1.13.214
18
18
  logo: logo.png
19
19
  files:
20
20
  - dist
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "payment-kit",
3
- "version": "1.13.213",
3
+ "version": "1.13.214",
4
4
  "scripts": {
5
5
  "dev": "cross-env COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev --open",
6
6
  "eject": "vite eject",
@@ -51,7 +51,7 @@
51
51
  "@arcblock/ux": "^2.9.66",
52
52
  "@arcblock/validator": "^1.18.115",
53
53
  "@blocklet/logger": "1.16.25",
54
- "@blocklet/payment-react": "1.13.213",
54
+ "@blocklet/payment-react": "1.13.214",
55
55
  "@blocklet/sdk": "1.16.25",
56
56
  "@blocklet/ui-react": "^2.9.66",
57
57
  "@blocklet/uploader": "^0.0.76",
@@ -111,7 +111,7 @@
111
111
  "devDependencies": {
112
112
  "@abtnode/types": "1.16.25",
113
113
  "@arcblock/eslint-config-ts": "^0.3.0",
114
- "@blocklet/payment-types": "1.13.213",
114
+ "@blocklet/payment-types": "1.13.214",
115
115
  "@types/cookie-parser": "^1.4.6",
116
116
  "@types/cors": "^2.8.17",
117
117
  "@types/dotenv-flow": "^3.3.3",
@@ -150,5 +150,5 @@
150
150
  "parser": "typescript"
151
151
  }
152
152
  },
153
- "gitHead": "209467c5da3ab2fa17f5ce802bcd8b086e7c08e5"
153
+ "gitHead": "430206bb27ea5749a12717d5bd3caf00a04b610a"
154
154
  }
@@ -45,6 +45,7 @@ type ListProps = {
45
45
  filter?: boolean;
46
46
  footer?: boolean;
47
47
  };
48
+ status?: string;
48
49
  customer_id?: string;
49
50
  payment_intent_id?: string;
50
51
  };
@@ -60,23 +61,24 @@ const getListKey = (props: ListProps) => {
60
61
  return 'payouts';
61
62
  };
62
63
 
63
- PaymentList.defaultProps = {
64
+ PayoutList.defaultProps = {
64
65
  features: {
65
66
  customer: true,
66
67
  filter: true,
67
68
  },
69
+ status: '',
68
70
  customer_id: '',
69
71
  payment_intent_id: '',
70
72
  };
71
73
 
72
- export default function PaymentList({ customer_id, payment_intent_id, features }: ListProps) {
74
+ export default function PayoutList({ customer_id, payment_intent_id, status, features }: ListProps) {
73
75
  const { t } = useLocaleContext();
74
76
  const navigate = useNavigate();
75
77
 
76
78
  const listKey = getListKey({ customer_id, payment_intent_id });
77
79
  const [search, setSearch] = useLocalStorageState<SearchProps>(listKey, {
78
80
  defaultValue: {
79
- status: '',
81
+ status: status as string,
80
82
  customer_id,
81
83
  payment_intent_id,
82
84
  pageSize: 20,
@@ -47,6 +47,7 @@ type ListProps = {
47
47
  };
48
48
  customer_id?: string;
49
49
  invoice_id?: string;
50
+ status?: string;
50
51
  subscription_id?: string;
51
52
  };
52
53
 
@@ -71,10 +72,11 @@ RefundList.defaultProps = {
71
72
  },
72
73
  customer_id: '',
73
74
  invoice_id: '',
75
+ status: '',
74
76
  subscription_id: '',
75
77
  };
76
78
 
77
- export default function RefundList({ customer_id, invoice_id, subscription_id, features }: ListProps) {
79
+ export default function RefundList({ customer_id, invoice_id, subscription_id, status, features }: ListProps) {
78
80
  const { t } = useLocaleContext();
79
81
  const navigate = useNavigate();
80
82
  const { startTransition } = useTransitionContext();
@@ -82,7 +84,7 @@ export default function RefundList({ customer_id, invoice_id, subscription_id, f
82
84
 
83
85
  const [search, setSearch] = useLocalStorageState<SearchProps>(listKey, {
84
86
  defaultValue: {
85
- status: '',
87
+ status: status as string,
86
88
  customer_id,
87
89
  invoice_id,
88
90
  subscription_id,
@@ -1,7 +1,15 @@
1
1
  /* eslint-disable react/no-unstable-nested-components */
2
2
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
3
3
  import Toast from '@arcblock/ux/lib/Toast';
4
- import { Status, api, formatBNStr, formatError, formatTime, getInvoiceStatusColor } from '@blocklet/payment-react';
4
+ import {
5
+ Status,
6
+ TxLink,
7
+ api,
8
+ formatBNStr,
9
+ formatError,
10
+ formatTime,
11
+ getInvoiceStatusColor,
12
+ } from '@blocklet/payment-react';
5
13
  import type { TInvoice, TInvoiceExpanded } from '@blocklet/payment-types';
6
14
  import { ArrowBackOutlined, Edit } from '@mui/icons-material';
7
15
  import { Alert, Box, Button, CircularProgress, Stack, Typography } from '@mui/material';
@@ -131,6 +139,14 @@ export default function InvoiceDetail(props: { id: string }) {
131
139
  label={t('admin.paymentCurrency.name')}
132
140
  value={<Currency logo={data.paymentCurrency.logo} name={data.paymentCurrency.symbol} />}
133
141
  />
142
+ {data.paymentIntent && data.paymentIntent.payment_details && (
143
+ <InfoRow
144
+ label={t(`common.${data.paymentIntent.payment_details?.arcblock?.type || 'transfer'}TxHash`)}
145
+ value={
146
+ <TxLink details={data.paymentIntent.payment_details} method={data.paymentMethod} mode="customer" />
147
+ }
148
+ />
149
+ )}
134
150
  {data.subscription && (
135
151
  <InfoRow
136
152
  label={t('admin.subscription.name')}
@@ -22,6 +22,8 @@ import InfoRow from '../../../../components/info-row';
22
22
  import InvoiceList from '../../../../components/invoice/list';
23
23
  import MetadataEditor from '../../../../components/metadata/editor';
24
24
  import PaymentList from '../../../../components/payment-intent/list';
25
+ import PayoutList from '../../../../components/payouts/list';
26
+ import RefundList from '../../../../components/refund/list';
25
27
  import SectionHeader from '../../../../components/section/header';
26
28
  import SubscriptionList from '../../../../components/subscription/list';
27
29
 
@@ -242,7 +244,21 @@ export default function CustomerDetail(props: { id: string }) {
242
244
  <Box className="section">
243
245
  <SectionHeader title={t('admin.subscriptions')} mb={0} />
244
246
  <Box className="section-body">
245
- <SubscriptionList features={{ customer: false, toolbar: false }} customer_id={data.customer.id} />
247
+ <SubscriptionList
248
+ features={{ customer: false, toolbar: false }}
249
+ customer_id={data.customer.id}
250
+ status={['active', 'trialing', 'paused', 'past_due', 'canceled'].join(',')}
251
+ />
252
+ </Box>
253
+ </Box>
254
+ <Box className="section">
255
+ <SectionHeader title={t('admin.invoices')} mb={0} />
256
+ <Box className="section-body">
257
+ <InvoiceList
258
+ features={{ customer: false, toolbar: false }}
259
+ customer_id={data.customer.id}
260
+ status={['open', 'paid', 'uncollectible', 'draft', 'void'].join(',')}
261
+ />
246
262
  </Box>
247
263
  </Box>
248
264
  <Box className="section">
@@ -252,9 +268,23 @@ export default function CustomerDetail(props: { id: string }) {
252
268
  </Box>
253
269
  </Box>
254
270
  <Box className="section">
255
- <SectionHeader title={t('admin.invoices')} mb={0} />
271
+ <SectionHeader title={t('admin.payouts')} mb={0} />
256
272
  <Box className="section-body">
257
- <InvoiceList features={{ customer: false, toolbar: false }} customer_id={data.customer.id} />
273
+ <PayoutList
274
+ features={{ customer: false, toolbar: false }}
275
+ customer_id={data.customer.id}
276
+ status={['paid', 'pending', 'failed', 'canceled'].join(',')}
277
+ />
278
+ </Box>
279
+ </Box>
280
+ <Box className="section">
281
+ <SectionHeader title={t('admin.refunds')} mb={0} />
282
+ <Box className="section-body">
283
+ <RefundList
284
+ features={{ customer: false, toolbar: false }}
285
+ customer_id={data.customer.id}
286
+ status={['succeeded', 'canceled', 'failed', 'requires_action', 'pending'].join(',')}
287
+ />
258
288
  </Box>
259
289
  </Box>
260
290
  <Box className="section">