payment-kit 1.13.185 → 1.13.187

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.
@@ -2,6 +2,7 @@ import { isValid } from '@arcblock/did';
2
2
  import { Router } from 'express';
3
3
  import Joi from 'joi';
4
4
  import pick from 'lodash/pick';
5
+ import { Op } from 'sequelize';
5
6
 
6
7
  import { syncStripeInvoice } from '../integrations/stripe/handlers/invoice';
7
8
  import { syncStripePayment } from '../integrations/stripe/handlers/payment-intent';
@@ -41,6 +42,7 @@ const schema = Joi.object<{
41
42
  customer_did?: string;
42
43
  subscription_id?: string;
43
44
  currency_id?: string;
45
+ ignoreZero?: boolean;
44
46
  q?: string;
45
47
  o?: string;
46
48
  }>({
@@ -52,11 +54,12 @@ const schema = Joi.object<{
52
54
  customer_did: Joi.string().empty(''),
53
55
  subscription_id: Joi.string().empty(''),
54
56
  currency_id: Joi.string().empty(''),
57
+ ignoreZero: Joi.boolean().empty(false),
55
58
  q: Joi.string().empty(''), // query
56
59
  o: Joi.string().empty(''), // order
57
60
  });
58
61
  router.get('/', authMine, async (req, res) => {
59
- const { page, pageSize, livemode, status, ...query } = await schema.validateAsync(req.query, {
62
+ const { page, pageSize, livemode, status, ignoreZero, ...query } = await schema.validateAsync(req.query, {
60
63
  stripUnknown: false,
61
64
  allowUnknown: true,
62
65
  });
@@ -68,6 +71,9 @@ router.get('/', authMine, async (req, res) => {
68
71
  .map((x) => x.trim())
69
72
  .filter(Boolean);
70
73
  }
74
+ if (ignoreZero) {
75
+ where.total = { [Op.ne]: '0' };
76
+ }
71
77
  if (query.customer_id) {
72
78
  where.customer_id = query.customer_id;
73
79
  }
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.185
17
+ version: 1.13.187
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.185",
3
+ "version": "1.13.187",
4
4
  "scripts": {
5
5
  "dev": "cross-env COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev --open",
6
6
  "eject": "vite eject",
@@ -50,7 +50,7 @@
50
50
  "@arcblock/jwt": "^1.18.110",
51
51
  "@arcblock/ux": "^2.9.39",
52
52
  "@blocklet/logger": "1.16.23",
53
- "@blocklet/payment-react": "1.13.185",
53
+ "@blocklet/payment-react": "1.13.187",
54
54
  "@blocklet/sdk": "1.16.23",
55
55
  "@blocklet/ui-react": "^2.9.39",
56
56
  "@blocklet/uploader": "^0.0.74",
@@ -110,7 +110,7 @@
110
110
  "devDependencies": {
111
111
  "@abtnode/types": "1.16.23",
112
112
  "@arcblock/eslint-config-ts": "^0.2.4",
113
- "@blocklet/payment-types": "1.13.185",
113
+ "@blocklet/payment-types": "1.13.187",
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": "4780ee769cd4f0a7e4c415fd2209dea6711a6b74"
152
+ "gitHead": "1eba252975f6a974397c878738badaca8388bb7a"
153
153
  }
@@ -47,6 +47,7 @@ type ListProps = {
47
47
  customer_id?: string;
48
48
  subscription_id?: string;
49
49
  status?: string;
50
+ ignoreZero?: boolean;
50
51
 
51
52
  invoiceProps?: {
52
53
  onClick?: (invoice: TInvoiceExpanded) => void | Promise<void>;
@@ -74,24 +75,34 @@ InvoiceList.defaultProps = {
74
75
  customer_id: '',
75
76
  subscription_id: '',
76
77
  status: '',
78
+ ignoreZero: false,
77
79
 
78
80
  invoiceProps: {},
79
81
 
80
82
  mode: 'admin',
81
83
  };
82
84
 
83
- export default function InvoiceList({ customer_id, subscription_id, features, status, invoiceProps, mode }: ListProps) {
85
+ export default function InvoiceList({
86
+ customer_id,
87
+ subscription_id,
88
+ features,
89
+ status,
90
+ ignoreZero,
91
+ invoiceProps,
92
+ mode,
93
+ }: ListProps) {
84
94
  const listKey = getListKey({ customer_id, subscription_id });
85
95
  const persisted = getDurableData(listKey);
86
96
 
87
97
  const { t } = useLocaleContext();
88
98
  const navigate = useNavigate();
89
- const [search, setSearch] = useState<SearchProps>({
99
+ const [search, setSearch] = useState<SearchProps & { ignoreZero?: boolean }>({
90
100
  status: status as string,
91
101
  customer_id,
92
102
  subscription_id,
93
103
  pageSize: persisted.rowsPerPage || 20,
94
104
  page: persisted.page ? persisted.page + 1 : 1,
105
+ ignoreZero: !!ignoreZero,
95
106
  });
96
107
  const { startTransition } = useTransitionContext();
97
108
 
@@ -82,7 +82,7 @@ export default function InvoiceTable({ invoice, simple }: Props) {
82
82
  <TableCell align="right">
83
83
  <Stack direction="row" spacing={0.5} alignItems="center" justifyContent="flex-end">
84
84
  <Typography>{line.quantity}</Typography>
85
- {line.metadata && line.metadata.quantity && (
85
+ {line.metadata && !!line.metadata.quantity && (
86
86
  <Tooltip
87
87
  title={t('payment.customer.invoice.rawQuantity', { quantity: line.metadata.quantity })}
88
88
  placement="top">
@@ -17,7 +17,7 @@ export default function CustomerCancelForm({ data }: { data: TSubscriptionExpand
17
17
  name="cancel.feedback"
18
18
  control={control}
19
19
  render={({ field }) => (
20
- <RadioGroup {...field}>
20
+ <RadioGroup {...field} sx={{ ml: '5px !important' }}>
21
21
  <FormControlLabel
22
22
  value="too_expensive"
23
23
  control={<Radio checked={field.value === 'too_expensive'} />}
@@ -158,6 +158,7 @@ export default function CustomerSubscriptionDetail() {
158
158
  navigate(`/customer/invoice/${invoice.id}`);
159
159
  },
160
160
  }}
161
+ ignoreZero
161
162
  mode="customer"
162
163
  />
163
164
  </Box>