payment-kit 1.13.293 → 1.13.294

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.
@@ -28,7 +28,7 @@ export default {
28
28
  const { checkoutSessionId, connectedDid } = extraParams;
29
29
  const { paymentIntent, paymentCurrency, paymentMethod } = await ensurePaymentIntent(
30
30
  checkoutSessionId,
31
- connectedDid || userDid
31
+ userDid || connectedDid
32
32
  );
33
33
  if (!paymentIntent) {
34
34
  throw new Error('Payment intent not found');
@@ -88,7 +88,7 @@ export default {
88
88
  const { checkoutSessionId, connectedDid } = extraParams;
89
89
  const { checkoutSession, customer, paymentIntent, paymentMethod } = await ensurePaymentIntent(
90
90
  checkoutSessionId,
91
- connectedDid || userDid
91
+ userDid || connectedDid
92
92
  );
93
93
  if (!paymentIntent) {
94
94
  throw new Error('Payment intent not found');
@@ -1,6 +1,7 @@
1
1
  import { Joi } from '@arcblock/validator';
2
2
  import { Router } from 'express';
3
3
 
4
+ import { BN } from '@ocap/util';
4
5
  import { createListParamSchema } from '../libs/api';
5
6
  import logger from '../libs/logger';
6
7
  import { CheckoutSession } from '../store/models/checkout-session';
@@ -143,11 +144,17 @@ router.get('/', async (req, res) => {
143
144
 
144
145
  const method = await PaymentMethod.findByPk(req.currency.payment_method_id);
145
146
 
147
+ const totalAmount: string = rows
148
+ .map((x) => x.toJSON())
149
+ .reduce((total, x) => total.add(new BN(x.amount_total)), new BN('0'))
150
+ .toString();
151
+
146
152
  res.json({
147
153
  supporters: rows,
148
154
  currency: req.currency,
149
155
  method,
150
156
  total: count,
157
+ totalAmount,
151
158
  paging: { page, pageSize },
152
159
  });
153
160
  } catch (err) {
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.293
17
+ version: 1.13.294
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.293",
3
+ "version": "1.13.294",
4
4
  "scripts": {
5
5
  "dev": "blocklet dev --open",
6
6
  "eject": "vite eject",
@@ -52,7 +52,7 @@
52
52
  "@arcblock/validator": "^1.18.124",
53
53
  "@blocklet/js-sdk": "1.16.28",
54
54
  "@blocklet/logger": "1.16.28",
55
- "@blocklet/payment-react": "1.13.293",
55
+ "@blocklet/payment-react": "1.13.294",
56
56
  "@blocklet/sdk": "1.16.28",
57
57
  "@blocklet/ui-react": "^2.10.3",
58
58
  "@blocklet/uploader": "^0.1.18",
@@ -118,7 +118,7 @@
118
118
  "devDependencies": {
119
119
  "@abtnode/types": "1.16.28",
120
120
  "@arcblock/eslint-config-ts": "^0.3.2",
121
- "@blocklet/payment-types": "1.13.293",
121
+ "@blocklet/payment-types": "1.13.294",
122
122
  "@types/cookie-parser": "^1.4.7",
123
123
  "@types/cors": "^2.8.17",
124
124
  "@types/debug": "^4.1.12",
@@ -158,5 +158,5 @@
158
158
  "parser": "typescript"
159
159
  }
160
160
  },
161
- "gitHead": "d2f0dd9b6c3c0ce4c4c8a1c7f1d2cc5e8a332e5c"
161
+ "gitHead": "94e507a512252badd0ee5b537cba5a1d52cc061b"
162
162
  }