payment-kit 1.18.45 → 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/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.customer?.name} On {formatSubscriptionProduct(data.items)}
120
+ {data.description}
129
121
  </Typography>
130
122
  </Stack>
131
123
  <Copyable text={props.id} />
@@ -126,6 +126,7 @@ export default function CustomerInvoicePastDue() {
126
126
  {showOverduePayment && (
127
127
  <OverdueInvoicePayment
128
128
  customerId={session.user.did}
129
+ subscriptionId={subscriptionId}
129
130
  onPaid={() => {
130
131
  setShowOverduePayment(false);
131
132
  }}