payment-kit 1.13.152 → 1.13.153

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.153
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.153",
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.153",
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.153",
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": "db16f61414e8f72da55dfa2faf9c17d79fcb6655"
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);
@@ -101,33 +101,39 @@ export default function CustomerInvoiceDetail() {
101
101
  </Stack>
102
102
  </Link>
103
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
- )}
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
116
+ variant="contained"
117
+ color="primary"
118
+ size="small"
119
+ disabled={state.paying}
120
+ sx={{ mr: 1 }}
121
+ onClick={onPay}>
122
+ {t('payment.customer.invoice.pay')}
123
+ </Button>
124
+ )}
119
125
  </Stack>
120
126
  </Stack>
121
127
  <Box>
122
128
  <SectionHeader title={t('payment.customer.invoice.summary')} />
123
129
  <Stack sx={{ mt: 1, display: 'grid', gridTemplateColumns: '50% 50%' }}>
124
130
  <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
131
  <InfoRow
128
132
  label={t('common.status')}
129
133
  value={<Status label={data.status} color={getInvoiceStatusColor(data.status)} />}
130
134
  />
135
+ <InfoRow label={t('admin.invoice.from')} value={data.statement_descriptor || blocklet.appName} />
136
+ <InfoRow label={t('admin.invoice.customer')} value={data.customer.name} />
131
137
  {data.period_start > 0 && data.period_end > 0 && (
132
138
  <InfoRow
133
139
  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;