@blocklet/payment-react 1.13.214 → 1.13.216

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.
@@ -175,7 +175,6 @@ export default function CheckoutDonate({ settings, livemode, onPaid, onError })
175
175
  title: settings.title,
176
176
  maxWidth: "md",
177
177
  showCloseButton: true,
178
- disableBackdropClick: true,
179
178
  disableEscapeKeyDown: true,
180
179
  onClose: (e, reason) => setState({ open: reason === "backdropClick" }),
181
180
  children: /* @__PURE__ */ jsx(Box, { sx: { mb: 1, mt: -2 }, children: /* @__PURE__ */ jsx(
@@ -3,17 +3,19 @@ type Props = {
3
3
  customer_id?: string;
4
4
  subscription_id?: string;
5
5
  currency_id?: string;
6
+ include_staking?: boolean;
6
7
  status?: string;
7
8
  pageSize?: number;
8
9
  target?: string;
9
10
  action?: string;
10
11
  };
11
- declare function CustomerInvoiceList({ customer_id, subscription_id, currency_id, status, pageSize, target, action, }: Props): import("react").JSX.Element;
12
+ declare function CustomerInvoiceList({ customer_id, subscription_id, currency_id, include_staking, status, pageSize, target, action, }: Props): import("react").JSX.Element;
12
13
  declare namespace CustomerInvoiceList {
13
14
  var defaultProps: {
14
15
  customer_id: string;
15
16
  subscription_id: string;
16
17
  currency_id: string;
18
+ include_staking: boolean;
17
19
  status: string;
18
20
  pageSize: number;
19
21
  target: string;
@@ -48,6 +48,7 @@ export default function CustomerInvoiceList({
48
48
  customer_id,
49
49
  subscription_id,
50
50
  currency_id,
51
+ include_staking,
51
52
  status,
52
53
  pageSize,
53
54
  target,
@@ -58,7 +59,16 @@ export default function CustomerInvoiceList({
58
59
  const { data, loadMore, loadingMore, loading } = useInfiniteScroll(
59
60
  (d) => {
60
61
  const page = d ? Math.ceil(d.list.length / size) + 1 : 1;
61
- return fetchData({ page, pageSize: size, status, customer_id, currency_id, subscription_id, ignoreZero: true });
62
+ return fetchData({
63
+ page,
64
+ pageSize: size,
65
+ status,
66
+ customer_id,
67
+ currency_id,
68
+ subscription_id,
69
+ include_staking,
70
+ ignore_zero: true
71
+ });
62
72
  },
63
73
  {
64
74
  reloadDeps: [customer_id, subscription_id, status]
@@ -120,6 +130,7 @@ CustomerInvoiceList.defaultProps = {
120
130
  customer_id: "",
121
131
  subscription_id: "",
122
132
  currency_id: "",
133
+ include_staking: false,
123
134
  status: "open,paid,uncollectible",
124
135
  pageSize: 10,
125
136
  target: "_self",
@@ -53,7 +53,8 @@ export default function MiniInvoiceList() {
53
53
  status: "open,paid,uncollectible",
54
54
  subscription_id: subscriptionId,
55
55
  authToken,
56
- ignoreZero: true
56
+ ignore_zero: true,
57
+ include_staking: true
57
58
  })
58
59
  );
59
60
  if (error) {
@@ -70,14 +70,7 @@ export default function CustomerPaymentList({ customer_id }) {
70
70
  ] }) }),
71
71
  /* @__PURE__ */ jsx(Box, { flex: 3, children: /* @__PURE__ */ jsx(Status, { label: item.status, color: getPaymentIntentStatusColor(item.status) }) }),
72
72
  /* @__PURE__ */ jsx(Box, { flex: 3, children: /* @__PURE__ */ jsx(Typography, { children: item.description || "-" }) }),
73
- /* @__PURE__ */ jsx(Box, { flex: 3, sx: { minWidth: "220px" }, children: item.payment_details?.arcblock?.tx_hash && /* @__PURE__ */ jsx(
74
- TxLink,
75
- {
76
- details: item.payment_details,
77
- method: item.paymentMethod,
78
- mode: "customer"
79
- }
80
- ) })
73
+ /* @__PURE__ */ jsx(Box, { flex: 3, sx: { minWidth: "220px" }, children: (item.payment_details?.arcblock?.tx_hash || item.payment_details?.ethereum?.tx_hash) && /* @__PURE__ */ jsx(TxLink, { details: item.payment_details, method: item.paymentMethod, mode: "customer" }) })
81
74
  ]
82
75
  },
83
76
  item.id
@@ -171,6 +171,7 @@ export default function PaymentForm({
171
171
  containerEl: void 0,
172
172
  action: checkoutSession.mode,
173
173
  prefix: joinURL(window.location.origin, getPrefix(), "/api/did"),
174
+ saveConnect: false,
174
175
  extraParams: { checkoutSessionId: checkoutSession.id },
175
176
  onSuccess: async () => {
176
177
  connect.close();
@@ -262,7 +262,6 @@ function CheckoutDonate({
262
262
  title: settings.title,
263
263
  maxWidth: "md",
264
264
  showCloseButton: true,
265
- disableBackdropClick: true,
266
265
  disableEscapeKeyDown: true,
267
266
  onClose: (e, reason) => setState({
268
267
  open: reason === "backdropClick"
@@ -3,17 +3,19 @@ type Props = {
3
3
  customer_id?: string;
4
4
  subscription_id?: string;
5
5
  currency_id?: string;
6
+ include_staking?: boolean;
6
7
  status?: string;
7
8
  pageSize?: number;
8
9
  target?: string;
9
10
  action?: string;
10
11
  };
11
- declare function CustomerInvoiceList({ customer_id, subscription_id, currency_id, status, pageSize, target, action, }: Props): import("react").JSX.Element;
12
+ declare function CustomerInvoiceList({ customer_id, subscription_id, currency_id, include_staking, status, pageSize, target, action, }: Props): import("react").JSX.Element;
12
13
  declare namespace CustomerInvoiceList {
13
14
  var defaultProps: {
14
15
  customer_id: string;
15
16
  subscription_id: string;
16
17
  currency_id: string;
18
+ include_staking: boolean;
17
19
  status: string;
18
20
  pageSize: number;
19
21
  target: string;
@@ -51,6 +51,7 @@ function CustomerInvoiceList({
51
51
  customer_id,
52
52
  subscription_id,
53
53
  currency_id,
54
+ include_staking,
54
55
  status,
55
56
  pageSize,
56
57
  target,
@@ -74,7 +75,8 @@ function CustomerInvoiceList({
74
75
  customer_id,
75
76
  currency_id,
76
77
  subscription_id,
77
- ignoreZero: true
78
+ include_staking,
79
+ ignore_zero: true
78
80
  });
79
81
  }, {
80
82
  reloadDeps: [customer_id, subscription_id, status]
@@ -213,6 +215,7 @@ CustomerInvoiceList.defaultProps = {
213
215
  customer_id: "",
214
216
  subscription_id: "",
215
217
  currency_id: "",
218
+ include_staking: false,
216
219
  status: "open,paid,uncollectible",
217
220
  pageSize: 10,
218
221
  target: "_self",
@@ -47,7 +47,8 @@ function MiniInvoiceList() {
47
47
  status: "open,paid,uncollectible",
48
48
  subscription_id: subscriptionId,
49
49
  authToken,
50
- ignoreZero: true
50
+ ignore_zero: true,
51
+ include_staking: true
51
52
  }));
52
53
  if (error) {
53
54
  return /* @__PURE__ */(0, _jsxRuntime.jsx)(Position, {
@@ -120,7 +120,7 @@ function CustomerPaymentList({
120
120
  sx: {
121
121
  minWidth: "220px"
122
122
  },
123
- children: item.payment_details?.arcblock?.tx_hash && /* @__PURE__ */(0, _jsxRuntime.jsx)(_tx.default, {
123
+ children: (item.payment_details?.arcblock?.tx_hash || item.payment_details?.ethereum?.tx_hash) && /* @__PURE__ */(0, _jsxRuntime.jsx)(_tx.default, {
124
124
  details: item.payment_details,
125
125
  method: item.paymentMethod,
126
126
  mode: "customer"
@@ -206,6 +206,7 @@ function PaymentForm({
206
206
  containerEl: void 0,
207
207
  action: checkoutSession.mode,
208
208
  prefix: (0, _ufo.joinURL)(window.location.origin, (0, _util.getPrefix)(), "/api/did"),
209
+ saveConnect: false,
209
210
  extraParams: {
210
211
  checkoutSessionId: checkoutSession.id
211
212
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/payment-react",
3
- "version": "1.13.214",
3
+ "version": "1.13.216",
4
4
  "description": "Reusable react components for payment kit v2",
5
5
  "keywords": [
6
6
  "react",
@@ -90,7 +90,7 @@
90
90
  "@babel/core": "^7.23.9",
91
91
  "@babel/preset-env": "^7.23.9",
92
92
  "@babel/preset-react": "^7.23.3",
93
- "@blocklet/payment-types": "1.13.214",
93
+ "@blocklet/payment-types": "1.13.216",
94
94
  "@storybook/addon-essentials": "^7.6.13",
95
95
  "@storybook/addon-interactions": "^7.6.13",
96
96
  "@storybook/addon-links": "^7.6.13",
@@ -119,5 +119,5 @@
119
119
  "vite-plugin-babel": "^1.2.0",
120
120
  "vite-plugin-node-polyfills": "^0.21.0"
121
121
  },
122
- "gitHead": "430206bb27ea5749a12717d5bd3caf00a04b610a"
122
+ "gitHead": "bc5219c800ae2b18883ac598bf91d4c1c2e71523"
123
123
  }
@@ -234,7 +234,6 @@ export default function CheckoutDonate({ settings, livemode, onPaid, onError }:
234
234
  title={settings.title}
235
235
  maxWidth="md"
236
236
  showCloseButton
237
- disableBackdropClick
238
237
  disableEscapeKeyDown
239
238
  onClose={(e: any, reason: string) => setState({ open: reason === 'backdropClick' })}>
240
239
  <Box sx={{ mb: 1, mt: -2 }}>
@@ -39,6 +39,7 @@ type Props = {
39
39
  customer_id?: string;
40
40
  subscription_id?: string;
41
41
  currency_id?: string;
42
+ include_staking?: boolean;
42
43
  status?: string;
43
44
  pageSize?: number;
44
45
  target?: string;
@@ -67,6 +68,7 @@ export default function CustomerInvoiceList({
67
68
  customer_id,
68
69
  subscription_id,
69
70
  currency_id,
71
+ include_staking,
70
72
  status,
71
73
  pageSize,
72
74
  target,
@@ -78,7 +80,16 @@ export default function CustomerInvoiceList({
78
80
  const { data, loadMore, loadingMore, loading } = useInfiniteScroll<Result>(
79
81
  (d) => {
80
82
  const page = d ? Math.ceil(d.list.length / size) + 1 : 1;
81
- return fetchData({ page, pageSize: size, status, customer_id, currency_id, subscription_id, ignoreZero: true });
83
+ return fetchData({
84
+ page,
85
+ pageSize: size,
86
+ status,
87
+ customer_id,
88
+ currency_id,
89
+ subscription_id,
90
+ include_staking,
91
+ ignore_zero: true,
92
+ });
82
93
  },
83
94
  {
84
95
  reloadDeps: [customer_id, subscription_id, status],
@@ -183,6 +194,7 @@ CustomerInvoiceList.defaultProps = {
183
194
  customer_id: '',
184
195
  subscription_id: '',
185
196
  currency_id: '',
197
+ include_staking: false,
186
198
  status: 'open,paid,uncollectible',
187
199
  pageSize: 10,
188
200
  target: '_self',
@@ -61,7 +61,8 @@ export default function MiniInvoiceList() {
61
61
  status: 'open,paid,uncollectible',
62
62
  subscription_id: subscriptionId,
63
63
  authToken,
64
- ignoreZero: true,
64
+ ignore_zero: true,
65
+ include_staking: true,
65
66
  })
66
67
  );
67
68
 
@@ -58,14 +58,14 @@ export default function CustomerPaymentList({ customer_id }: Props) {
58
58
 
59
59
  const hasMore = data && data.list.length < data.count;
60
60
 
61
- const grouped = groupByDate(data.list as any);
61
+ const grouped = groupByDate(data.list);
62
62
 
63
63
  return (
64
64
  <Stack direction="column" gap={1} sx={{ mt: 1 }}>
65
65
  {Object.entries(grouped).map(([date, payments]) => (
66
66
  <Box key={date}>
67
67
  <Typography sx={{ fontWeight: 'bold', color: 'text.secondary', mt: 2, mb: 1 }}>{date}</Typography>
68
- {payments.map((item) => (
68
+ {payments.map((item: TPaymentIntentExpanded) => (
69
69
  <Stack
70
70
  key={item.id}
71
71
  direction={{
@@ -95,12 +95,8 @@ export default function CustomerPaymentList({ customer_id }: Props) {
95
95
  <Typography>{item.description || '-'}</Typography>
96
96
  </Box>
97
97
  <Box flex={3} sx={{ minWidth: '220px' }}>
98
- {(item as any).payment_details?.arcblock?.tx_hash && (
99
- <TxLink
100
- details={(item as any).payment_details}
101
- method={(item as any).paymentMethod}
102
- mode="customer"
103
- />
98
+ {(item.payment_details?.arcblock?.tx_hash || item.payment_details?.ethereum?.tx_hash) && (
99
+ <TxLink details={item.payment_details} method={item.paymentMethod} mode="customer" />
104
100
  )}
105
101
  </Box>
106
102
  </Stack>
@@ -224,6 +224,7 @@ export default function PaymentForm({
224
224
  containerEl: undefined as unknown as Element,
225
225
  action: checkoutSession.mode,
226
226
  prefix: joinURL(window.location.origin, getPrefix(), '/api/did'),
227
+ saveConnect: false,
227
228
  extraParams: { checkoutSessionId: checkoutSession.id },
228
229
  onSuccess: async () => {
229
230
  connect.close();