payment-kit 1.18.46 → 1.18.47
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/libs/pagination.ts +403 -0
- package/api/src/routes/invoices.ts +295 -103
- package/api/tests/libs/pagination.spec.ts +549 -0
- package/blocklet.yml +1 -1
- package/package.json +10 -10
- package/src/components/subscription/portal/list.tsx +36 -26
- package/src/libs/util.ts +11 -0
- package/src/pages/admin/billing/subscriptions/detail.tsx +2 -10
- package/src/pages/customer/invoice/past-due.tsx +1 -0
package/src/libs/util.ts
CHANGED
|
@@ -362,3 +362,14 @@ export function isWillCanceled(subscription: TSubscriptionExpanded) {
|
|
|
362
362
|
}
|
|
363
363
|
return false;
|
|
364
364
|
}
|
|
365
|
+
|
|
366
|
+
export function formatProxyUrl(url: string) {
|
|
367
|
+
if (url.startsWith('/')) {
|
|
368
|
+
return joinURL(window.location.origin, url);
|
|
369
|
+
}
|
|
370
|
+
const proxyUrl = new URL(url);
|
|
371
|
+
if (proxyUrl.host === window.location.host) {
|
|
372
|
+
return url;
|
|
373
|
+
}
|
|
374
|
+
return `${window.location.origin}/.well-known/service/proxy?url=${url}`;
|
|
375
|
+
}
|
|
@@ -1,15 +1,7 @@
|
|
|
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 {
|
|
5
|
-
TxLink,
|
|
6
|
-
api,
|
|
7
|
-
formatError,
|
|
8
|
-
formatSubscriptionProduct,
|
|
9
|
-
formatTime,
|
|
10
|
-
useMobile,
|
|
11
|
-
hasDelegateTxHash,
|
|
12
|
-
} from '@blocklet/payment-react';
|
|
4
|
+
import { TxLink, api, formatError, formatTime, useMobile, hasDelegateTxHash } from '@blocklet/payment-react';
|
|
13
5
|
import type { TProduct, TSubscriptionExpanded } from '@blocklet/payment-types';
|
|
14
6
|
import { ArrowBackOutlined } from '@mui/icons-material';
|
|
15
7
|
import { Alert, Box, Button, CircularProgress, Divider, Stack, Typography } from '@mui/material';
|
|
@@ -125,7 +117,7 @@ export default function SubscriptionDetail(props: { id: string }) {
|
|
|
125
117
|
<Stack direction="column" gap={1}>
|
|
126
118
|
<Stack direction="row" alignItems="center">
|
|
127
119
|
<Typography variant="h2" sx={{ fontWeight: 600 }}>
|
|
128
|
-
{data.
|
|
120
|
+
{data.description}
|
|
129
121
|
</Typography>
|
|
130
122
|
</Stack>
|
|
131
123
|
<Copyable text={props.id} />
|