payment-kit 1.18.15 → 1.18.16
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/api/src/index.ts +2 -0
- package/api/src/libs/invoice.ts +5 -3
- package/api/src/routes/connect/change-payment.ts +9 -1
- package/api/src/routes/connect/change-plan.ts +9 -1
- package/api/src/routes/connect/collect-batch.ts +7 -5
- package/api/src/routes/connect/recharge-account.ts +124 -0
- package/api/src/routes/connect/setup.ts +8 -1
- package/api/src/routes/connect/shared.ts +110 -48
- package/api/src/routes/connect/subscribe.ts +11 -1
- package/api/src/routes/customers.ts +149 -6
- package/api/src/routes/invoices.ts +46 -0
- package/api/src/routes/subscriptions.ts +0 -3
- package/blocklet.yml +1 -1
- package/package.json +8 -8
- package/src/app.tsx +11 -3
- package/src/components/info-card.tsx +3 -1
- package/src/components/info-row.tsx +1 -0
- package/src/components/invoice/recharge.tsx +85 -56
- package/src/components/invoice/table.tsx +7 -1
- package/src/components/subscription/portal/actions.tsx +1 -1
- package/src/components/subscription/portal/list.tsx +6 -0
- package/src/locales/en.tsx +9 -0
- package/src/locales/zh.tsx +9 -0
- package/src/pages/customer/index.tsx +160 -265
- package/src/pages/customer/invoice/detail.tsx +24 -16
- package/src/pages/customer/invoice/past-due.tsx +45 -23
- package/src/pages/customer/recharge/account.tsx +515 -0
- package/src/pages/customer/{recharge.tsx → recharge/subscription.tsx} +11 -11
- package/src/pages/customer/subscription/embed.tsx +16 -1
|
@@ -30,15 +30,15 @@ import { joinURL } from 'ufo';
|
|
|
30
30
|
import type { TSubscriptionExpanded } from '@blocklet/payment-types';
|
|
31
31
|
import { ArrowBackOutlined, ArrowForwardOutlined } from '@mui/icons-material';
|
|
32
32
|
import { BN, fromUnitToToken } from '@ocap/util';
|
|
33
|
-
import RechargeList from '
|
|
34
|
-
import SubscriptionDescription from '
|
|
35
|
-
import InfoRow from '
|
|
36
|
-
import Currency from '
|
|
37
|
-
import SubscriptionMetrics from '
|
|
38
|
-
import { getTokenBalanceLink, goBackOrFallback } from '
|
|
39
|
-
import CustomerLink from '
|
|
40
|
-
import { useSessionContext } from '
|
|
41
|
-
import { formatSmartDuration, TimeUnit } from '
|
|
33
|
+
import RechargeList from '../../../components/invoice/recharge';
|
|
34
|
+
import SubscriptionDescription from '../../../components/subscription/description';
|
|
35
|
+
import InfoRow from '../../../components/info-row';
|
|
36
|
+
import Currency from '../../../components/currency';
|
|
37
|
+
import SubscriptionMetrics from '../../../components/subscription/metrics';
|
|
38
|
+
import { getTokenBalanceLink, goBackOrFallback } from '../../../libs/util';
|
|
39
|
+
import CustomerLink from '../../../components/customer/link';
|
|
40
|
+
import { useSessionContext } from '../../../contexts/session';
|
|
41
|
+
import { formatSmartDuration, TimeUnit } from '../../../libs/dayjs';
|
|
42
42
|
|
|
43
43
|
const Root = styled(Stack)(({ theme }) => ({
|
|
44
44
|
marginBottom: theme.spacing(3),
|
|
@@ -328,7 +328,7 @@ export default function RechargePage() {
|
|
|
328
328
|
<Divider />
|
|
329
329
|
|
|
330
330
|
<Box sx={{ maxWidth: 600 }} ref={rechargeRef}>
|
|
331
|
-
<Typography variant="
|
|
331
|
+
<Typography variant="h4" gutterBottom>
|
|
332
332
|
{t('customer.recharge.title')}
|
|
333
333
|
</Typography>
|
|
334
334
|
|
|
@@ -492,7 +492,7 @@ export default function RechargePage() {
|
|
|
492
492
|
)}
|
|
493
493
|
</Box>
|
|
494
494
|
<Divider />
|
|
495
|
-
<Typography variant="
|
|
495
|
+
<Typography variant="h4" gutterBottom>
|
|
496
496
|
{t('customer.recharge.history')}
|
|
497
497
|
</Typography>
|
|
498
498
|
<RechargeList subscription_id={subscriptionId} currency_id={paymentCurrency?.id} />
|
|
@@ -216,6 +216,7 @@ export default function SubscriptionEmbed() {
|
|
|
216
216
|
)}
|
|
217
217
|
name={`${subscription.customer.name} (${subscription.customer.email})`}
|
|
218
218
|
description={<DidAddress did={subscription.customer.did} responsive={false} compact />}
|
|
219
|
+
className="owner-info-card"
|
|
219
220
|
/>
|
|
220
221
|
),
|
|
221
222
|
});
|
|
@@ -241,7 +242,21 @@ export default function SubscriptionEmbed() {
|
|
|
241
242
|
</Typography>
|
|
242
243
|
<Box sx={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>
|
|
243
244
|
{infoList.map(({ name, value }) => {
|
|
244
|
-
return
|
|
245
|
+
return (
|
|
246
|
+
<InfoRow
|
|
247
|
+
label={name}
|
|
248
|
+
value={value}
|
|
249
|
+
sx={{
|
|
250
|
+
mb: 0,
|
|
251
|
+
'.info-row-label': {
|
|
252
|
+
whiteSpace: 'nowrap',
|
|
253
|
+
},
|
|
254
|
+
'.info-row-value': {
|
|
255
|
+
flex: 'none',
|
|
256
|
+
},
|
|
257
|
+
}}
|
|
258
|
+
/>
|
|
259
|
+
);
|
|
245
260
|
})}
|
|
246
261
|
</Box>
|
|
247
262
|
<Divider />
|