payment-kit 1.13.85 → 1.13.87
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/queues/subscription.ts +4 -0
- package/api/src/routes/connect/shared.ts +1 -1
- package/api/src/store/models/index.ts +5 -1
- package/blocklet.yml +1 -1
- package/package.json +3 -3
- package/src/components/invoice/table.tsx +14 -2
- package/src/locales/en.tsx +1 -0
- package/src/locales/zh.tsx +1 -0
- package/src/pages/admin/customers/customers/detail.tsx +2 -5
|
@@ -173,6 +173,10 @@ export const handleSubscription = async (job: SubscriptionJob) => {
|
|
|
173
173
|
end: setup.period.end - duration,
|
|
174
174
|
usage: x.price.recurring?.aggregate_usage,
|
|
175
175
|
});
|
|
176
|
+
|
|
177
|
+
// record raw quantity in metadata
|
|
178
|
+
x.metadata = x.metadata || {};
|
|
179
|
+
x.metadata.quantity = rawQuantity;
|
|
176
180
|
}
|
|
177
181
|
|
|
178
182
|
return x;
|
|
@@ -95,7 +95,11 @@ export type TPriceExpanded = TPrice & {
|
|
|
95
95
|
};
|
|
96
96
|
};
|
|
97
97
|
|
|
98
|
-
export type TLineItemExpanded = LineItem & {
|
|
98
|
+
export type TLineItemExpanded = LineItem & {
|
|
99
|
+
price: TPriceExpanded;
|
|
100
|
+
upsell_price: TPriceExpanded;
|
|
101
|
+
metadata?: Record<string, any>;
|
|
102
|
+
};
|
|
99
103
|
|
|
100
104
|
export type TProductExpanded = TProduct & {
|
|
101
105
|
object: 'price';
|
package/blocklet.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payment-kit",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.87",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"@abtnode/types": "1.16.21-beta-e828f413",
|
|
111
111
|
"@arcblock/eslint-config": "^0.2.4",
|
|
112
112
|
"@arcblock/eslint-config-ts": "^0.2.4",
|
|
113
|
-
"@did-pay/types": "1.13.
|
|
113
|
+
"@did-pay/types": "1.13.87",
|
|
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": "
|
|
152
|
+
"gitHead": "e56e774ed27b74caa9b6ecdc8e02d7e0cc8d7fce"
|
|
153
153
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
2
2
|
import type { TInvoiceExpanded } from '@did-pay/types';
|
|
3
|
-
import {
|
|
3
|
+
import { InfoOutlined } from '@mui/icons-material';
|
|
4
|
+
import { Stack, Table, TableBody, TableCell, TableHead, TableRow, Tooltip, Typography } from '@mui/material';
|
|
4
5
|
import { styled } from '@mui/system';
|
|
5
6
|
import { toBN } from '@ocap/util';
|
|
6
7
|
|
|
@@ -78,7 +79,18 @@ export default function InvoiceTable({ invoice, simple }: Props) {
|
|
|
78
79
|
{line.description}
|
|
79
80
|
{line.price.product.unit_label ? ` (per ${line.price.product.unit_label})` : ''}
|
|
80
81
|
</TableCell>
|
|
81
|
-
<TableCell align="right">
|
|
82
|
+
<TableCell align="right">
|
|
83
|
+
<Stack direction="row" spacing={0.5} alignItems="center" justifyContent="flex-end">
|
|
84
|
+
<Typography>{line.quantity}</Typography>
|
|
85
|
+
{line.metadata && line.metadata.quantity && (
|
|
86
|
+
<Tooltip
|
|
87
|
+
title={t('customer.invoice.rawQuantity', { quantity: line.metadata.quantity })}
|
|
88
|
+
placement="top">
|
|
89
|
+
<InfoOutlined fontSize="small" sx={{ color: 'text.secondary', cursor: 'pointer' }} />
|
|
90
|
+
</Tooltip>
|
|
91
|
+
)}
|
|
92
|
+
</Stack>
|
|
93
|
+
</TableCell>
|
|
82
94
|
<TableCell align="right">
|
|
83
95
|
{!line.proration
|
|
84
96
|
? formatAmount(getPriceUintAmountByCurrency(line.price, invoice.paymentCurrency), invoice.paymentCurrency.decimal) // prettier-ignore
|
package/src/locales/en.tsx
CHANGED
package/src/locales/zh.tsx
CHANGED
|
@@ -37,12 +37,9 @@ function getTokenBalances(customer: TCustomerExpanded, paymentMethods: TPaymentM
|
|
|
37
37
|
const currencies = paymentMethods.reduce((acc, x) => acc.concat(x.payment_currencies), []);
|
|
38
38
|
|
|
39
39
|
if (customer.balance) {
|
|
40
|
-
const currency = currencies.find((x: any) => x.symbol === 'USD');
|
|
41
40
|
tokens.push({
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
balance: fromUnitToToken(customer.balance, currency.decimal),
|
|
41
|
+
currency: 'USD',
|
|
42
|
+
balance: fromUnitToToken(customer.balance, 2),
|
|
46
43
|
});
|
|
47
44
|
}
|
|
48
45
|
|