payment-kit 1.13.152 → 1.13.154

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.152
17
+ version: 1.13.154
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.152",
3
+ "version": "1.13.154",
4
4
  "scripts": {
5
5
  "dev": "cross-env COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev --open",
6
6
  "eject": "vite eject",
@@ -50,7 +50,7 @@
50
50
  "@arcblock/jwt": "^1.18.110",
51
51
  "@arcblock/ux": "^2.9.29",
52
52
  "@blocklet/logger": "1.16.23",
53
- "@blocklet/payment-react": "1.13.152",
53
+ "@blocklet/payment-react": "1.13.154",
54
54
  "@blocklet/sdk": "1.16.23",
55
55
  "@blocklet/ui-react": "^2.9.29",
56
56
  "@blocklet/uploader": "^0.0.73",
@@ -110,7 +110,7 @@
110
110
  "devDependencies": {
111
111
  "@abtnode/types": "1.16.23",
112
112
  "@arcblock/eslint-config-ts": "^0.2.4",
113
- "@blocklet/payment-types": "1.13.152",
113
+ "@blocklet/payment-types": "1.13.154",
114
114
  "@types/cookie-parser": "^1.4.6",
115
115
  "@types/cors": "^2.8.17",
116
116
  "@types/dotenv-flow": "^3.3.3",
@@ -149,5 +149,5 @@
149
149
  "parser": "typescript"
150
150
  }
151
151
  },
152
- "gitHead": "5d6d2b6a8c0422e1055ddcec4e3179fd734cdbc5"
152
+ "gitHead": "a8afe51b21c4155ae14468c619dde09bfbda168d"
153
153
  }
package/src/app.tsx CHANGED
@@ -20,7 +20,7 @@ const HomePage = React.lazy(() => import('./pages/home'));
20
20
  const CheckoutPage = React.lazy(() => import('./pages/checkout'));
21
21
  const AdminPage = React.lazy(() => import('./pages/admin'));
22
22
  const CustomerHome = React.lazy(() => import('./pages/customer/index'));
23
- const CustomerInvoice = React.lazy(() => import('./pages/customer/invoice'));
23
+ const CustomerInvoiceDetail = React.lazy(() => import('./pages/customer/invoice/detail'));
24
24
  const CustomerInvoicePastDue = React.lazy(() => import('./pages/customer/invoice/past-due'));
25
25
  const CustomerSubscriptionDetail = React.lazy(() => import('./pages/customer/subscription/detail'));
26
26
  const CustomerSubscriptionUpdate = React.lazy(() => import('./pages/customer/subscription/update'));
@@ -94,7 +94,7 @@ function App() {
94
94
  path="/customer/invoice/:id"
95
95
  element={
96
96
  <Layout>
97
- <CustomerInvoice />
97
+ <CustomerInvoiceDetail />
98
98
  </Layout>
99
99
  }
100
100
  />
@@ -9,12 +9,12 @@ import { useRequest, useSetState } from 'ahooks';
9
9
  import { useEffect } from 'react';
10
10
  import { Link, useParams, useSearchParams } from 'react-router-dom';
11
11
 
12
- import Currency from '../../components/currency';
13
- import InfoRow from '../../components/info-row';
14
- import InvoiceTable from '../../components/invoice/table';
15
- import SectionHeader from '../../components/section/header';
16
- import { useSessionContext } from '../../contexts/session';
17
- import CustomerRefundList from './refund/list';
12
+ import Currency from '../../../components/currency';
13
+ import InfoRow from '../../../components/info-row';
14
+ import InvoiceTable from '../../../components/invoice/table';
15
+ import SectionHeader from '../../../components/section/header';
16
+ import { useSessionContext } from '../../../contexts/session';
17
+ import CustomerRefundList from '../refund/list';
18
18
 
19
19
  const fetchData = (id: string): Promise<TInvoiceExpanded> => {
20
20
  return api.get(`/api/invoices/${id}`).then((res) => res.data);
@@ -100,34 +100,34 @@ export default function CustomerInvoiceDetail() {
100
100
  </Typography>
101
101
  </Stack>
102
102
  </Link>
103
- <Stack direction="row" justifyContent="flex-end" alignItems="center">
104
- {['open', 'uncollectible'].includes(data.status) && (
105
- <Button variant="contained" color="primary" disabled={state.paying} onClick={onPay}>
106
- {t('payment.customer.invoice.pay')}
107
- </Button>
108
- )}
103
+ <Stack direction="row" spacing={1} justifyContent="flex-end" alignItems="center">
109
104
  {['open', 'paid', 'uncollectible'].includes(data.status) && (
110
105
  <Button
111
106
  variant="contained"
112
- color="primary"
107
+ color="secondary"
113
108
  size="small"
114
109
  disabled={state.downloading}
115
110
  onClick={() => setState({ downloading: true })}>
116
111
  {t('payment.customer.invoice.download')}
117
112
  </Button>
118
113
  )}
114
+ {['open', 'uncollectible'].includes(data.status) && (
115
+ <Button variant="contained" color="primary" size="small" disabled={state.paying} onClick={onPay}>
116
+ {t('payment.customer.invoice.pay')}
117
+ </Button>
118
+ )}
119
119
  </Stack>
120
120
  </Stack>
121
121
  <Box>
122
122
  <SectionHeader title={t('payment.customer.invoice.summary')} />
123
123
  <Stack sx={{ mt: 1, display: 'grid', gridTemplateColumns: '50% 50%' }}>
124
124
  <InfoRow label={t('admin.invoice.number')} value={data.number} />
125
- <InfoRow label={t('admin.invoice.from')} value={data.statement_descriptor || blocklet.appName} />
126
- <InfoRow label={t('admin.invoice.customer')} value={data.customer.name} />
127
125
  <InfoRow
128
126
  label={t('common.status')}
129
127
  value={<Status label={data.status} color={getInvoiceStatusColor(data.status)} />}
130
128
  />
129
+ <InfoRow label={t('admin.invoice.from')} value={data.statement_descriptor || blocklet.appName} />
130
+ <InfoRow label={t('admin.invoice.customer')} value={data.customer.name} />
131
131
  {data.period_start > 0 && data.period_end > 0 && (
132
132
  <InfoRow
133
133
  label={t('admin.subscription.currentPeriod')}
@@ -50,7 +50,7 @@ export default function CustomerRefundList({ invoice_id }: Props) {
50
50
  }
51
51
 
52
52
  if (data && data.list.length === 0) {
53
- return <Typography color="text.secondary">{t('payment.customer.payment.empty')}</Typography>;
53
+ return <Typography color="text.secondary">{t('payment.customer.refund.empty')}</Typography>;
54
54
  }
55
55
 
56
56
  const hasMore = data && data.list.length < data.count;