payment-kit 1.13.232 → 1.13.233

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.232
17
+ version: 1.13.233
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.232",
3
+ "version": "1.13.233",
4
4
  "scripts": {
5
5
  "dev": "cross-env COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev --open",
6
6
  "eject": "vite eject",
@@ -51,7 +51,7 @@
51
51
  "@arcblock/ux": "^2.9.68",
52
52
  "@arcblock/validator": "^1.18.115",
53
53
  "@blocklet/logger": "1.16.25",
54
- "@blocklet/payment-react": "1.13.232",
54
+ "@blocklet/payment-react": "1.13.233",
55
55
  "@blocklet/sdk": "1.16.25",
56
56
  "@blocklet/ui-react": "^2.9.68",
57
57
  "@blocklet/uploader": "^0.0.76",
@@ -116,7 +116,7 @@
116
116
  "devDependencies": {
117
117
  "@abtnode/types": "1.16.25",
118
118
  "@arcblock/eslint-config-ts": "^0.3.0",
119
- "@blocklet/payment-types": "1.13.232",
119
+ "@blocklet/payment-types": "1.13.233",
120
120
  "@types/cookie-parser": "^1.4.7",
121
121
  "@types/cors": "^2.8.17",
122
122
  "@types/dotenv-flow": "^3.3.3",
@@ -155,5 +155,5 @@
155
155
  "parser": "typescript"
156
156
  }
157
157
  },
158
- "gitHead": "250cff1f7b3b483e089a5f19587e58556d7ef063"
158
+ "gitHead": "854b8c4502657675e5d08279d2efca31bafa0a88"
159
159
  }
@@ -128,7 +128,6 @@ export default function InvoiceTable({ invoice, simple }: Props) {
128
128
  {t('payment.customer.invoice.amountPaid')}
129
129
  </TableCell>
130
130
  <TableCell align="right" sx={{ fontWeight: 600 }}>
131
- {invoice.amount_paid === '0' ? '' : '-'}
132
131
  {formatAmount(invoice.amount_paid, invoice.paymentCurrency.decimal)}
133
132
  </TableCell>
134
133
  <TableCell>&nbsp;</TableCell>
@@ -1,5 +1,6 @@
1
1
  import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
2
2
  import { formatAmount, formatTime, getPrefix, getPriceUintAmountByCurrency } from '@blocklet/payment-react';
3
+ import type { TInvoiceExpanded, TInvoiceItemExpanded } from '@blocklet/payment-types';
3
4
  import { Button } from '@mui/material';
4
5
  import {
5
6
  Font,
@@ -44,7 +45,7 @@ function Page({ className, children }: any) {
44
45
  );
45
46
  }
46
47
 
47
- export function Download({ data }: any) {
48
+ export function Download({ data }: { data: TInvoiceExpanded }) {
48
49
  const { t } = useLocaleContext();
49
50
  const title = data.number;
50
51
  return (
@@ -78,7 +79,7 @@ function InvoicePage({ data, t }: any) {
78
79
  let temp = 0;
79
80
 
80
81
  data.lines
81
- .map((line: any) => {
82
+ .map((line: TInvoiceItemExpanded) => {
82
83
  return {
83
84
  description:
84
85
  line.description + (line.price.product.unit_label ? ` (per ${line.price.product.unit_label})` : ''),
@@ -88,9 +89,9 @@ function InvoicePage({ data, t }: any) {
88
89
  : '',
89
90
  };
90
91
  })
91
- .forEach((productLine: any) => {
92
- const quantityNumber = parseFloat(productLine.quantity);
93
- const rateNumber = parseFloat(productLine.rate);
92
+ .forEach((line: any) => {
93
+ const quantityNumber = parseFloat(line.quantity);
94
+ const rateNumber = parseFloat(line.rate);
94
95
  const amount = quantityNumber && rateNumber ? quantityNumber * rateNumber : 0;
95
96
 
96
97
  temp += amount;
@@ -121,7 +122,7 @@ function InvoicePage({ data, t }: any) {
121
122
  <View className="w-60">
122
123
  <Text2 className="bold dark mb-5" value={t('admin.invoice.billTo')} />
123
124
  <Text2 value={data.customer.name} />
124
- <Text2 className="blod fs-12" value={`DID:ABT: ${data.customer.did}`} />
125
+ <Text2 className="bold fs-12" value={`DID:ABT:${data.customer.did}`} />
125
126
  </View>
126
127
  <View className="w-45">
127
128
  <View className="flex mb-5">
@@ -177,23 +178,23 @@ function InvoicePage({ data, t }: any) {
177
178
  : '',
178
179
  };
179
180
  })
180
- .map((productLine: any) => {
181
+ .map((line: any) => {
181
182
  return (
182
- <View key={productLine.description} className="row flex">
183
+ <View key={line.description} className="row flex">
183
184
  <View className="w-48 p-4-8 pb-10">
184
- <Text2 className="dark" value={productLine.description} />
185
+ <Text2 className="dark" value={line.description} />
185
186
  </View>
186
187
  <View className="w-17 p-4-8 pb-10">
187
- <Text2 className="dark right" value={productLine.quantity} />
188
+ <Text2 className="dark right" value={line.quantity} />
188
189
  </View>
189
190
  <View className="w-17 p-4-8 pb-10">
190
191
  <Text className="dark right">
191
- {productLine.rate} {data.paymentCurrency.symbol}
192
+ {line.rate} {data.paymentCurrency.symbol}
192
193
  </Text>
193
194
  </View>
194
195
  <View className="w-18 p-4-8 pb-10">
195
196
  <Text className="dark right">
196
- {calculateAmount(productLine.quantity, productLine.rate)} {data.paymentCurrency.symbol}
197
+ {calculateAmount(line.quantity, line.rate)} {data.paymentCurrency.symbol}
197
198
  </Text>
198
199
  </View>
199
200
  </View>
@@ -149,7 +149,7 @@ export default function InvoiceDetail(props: { id: string }) {
149
149
  />
150
150
  }
151
151
  />
152
- {!!data.paymentIntent.payment_details?.ethereum && (
152
+ {!!data.paymentIntent?.payment_details?.ethereum && (
153
153
  <InfoRow
154
154
  label={t('common.txGas')}
155
155
  value={<TxGas details={data.paymentIntent.payment_details as any} method={data.paymentMethod} />}
@@ -149,7 +149,7 @@ export default function CustomerInvoiceDetail() {
149
149
  />
150
150
  }
151
151
  />
152
- {!!data.paymentIntent.payment_details?.ethereum && (
152
+ {!!data.paymentIntent?.payment_details?.ethereum && (
153
153
  <InfoRow
154
154
  label={t('common.txGas')}
155
155
  value={<TxGas details={data.paymentIntent.payment_details as any} method={data.paymentMethod} />}