payment-kit 1.13.88 → 1.13.89

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.
@@ -458,10 +458,6 @@ router.put('/:id', auth, async (req, res) => {
458
458
  updates.proration_behavior = req.body.proration_behavior;
459
459
  }
460
460
 
461
- const lastInvoice = await Invoice.findByPk(subscription.latest_invoice_id);
462
- if (!lastInvoice) {
463
- throw new Error('Subscription should have latest invoice');
464
- }
465
461
  const paymentCurrency = await PaymentCurrency.findByPk(subscription.currency_id);
466
462
  if (!paymentCurrency) {
467
463
  throw new Error('Subscription should have payment currency');
@@ -562,6 +558,11 @@ router.put('/:id', auth, async (req, res) => {
562
558
  // handle proration
563
559
  const prorationBehavior = updates.proration_behavior || subscription.proration_behavior || 'none';
564
560
  if (prorationBehavior === 'create_prorations') {
561
+ const lastInvoice = await Invoice.findByPk(subscription.latest_invoice_id);
562
+ if (!lastInvoice) {
563
+ throw new Error('Subscription should have latest invoice');
564
+ }
565
+
565
566
  // 0. get last invoice, and invoice items, filter invoice items that are in licensed recurring mode
566
567
  const invoiceItems = await InvoiceItem.findAll({ where: { invoice_id: lastInvoice.id } });
567
568
  const invoiceItemsExpanded = await Price.expand(invoiceItems.map((x) => x.toJSON()));
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.88
17
+ version: 1.13.89
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.88",
3
+ "version": "1.13.89",
4
4
  "scripts": {
5
5
  "dev": "COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev",
6
6
  "eject": "vite eject",
@@ -42,27 +42,27 @@
42
42
  ]
43
43
  },
44
44
  "dependencies": {
45
- "@abtnode/cron": "1.16.21-beta-e828f413",
46
- "@arcblock/did": "^1.18.106",
45
+ "@abtnode/cron": "1.16.21",
46
+ "@arcblock/did": "^1.18.108",
47
47
  "@arcblock/did-auth-storage-nedb": "^1.7.1",
48
- "@arcblock/did-connect": "^2.8.23",
49
- "@arcblock/did-util": "^1.18.106",
50
- "@arcblock/jwt": "^1.18.106",
51
- "@arcblock/ux": "^2.8.23",
52
- "@blocklet/logger": "1.16.21-beta-e828f413",
53
- "@blocklet/sdk": "1.16.21-beta-e828f413",
54
- "@blocklet/ui-react": "^2.8.23",
55
- "@blocklet/uploader": "^0.0.56",
48
+ "@arcblock/did-connect": "^2.9.6",
49
+ "@arcblock/did-util": "^1.18.108",
50
+ "@arcblock/jwt": "^1.18.108",
51
+ "@arcblock/ux": "^2.9.6",
52
+ "@blocklet/logger": "1.16.21",
53
+ "@blocklet/sdk": "1.16.21",
54
+ "@blocklet/ui-react": "^2.9.6",
55
+ "@blocklet/uploader": "^0.0.62",
56
56
  "@mui/icons-material": "^5.14.19",
57
57
  "@mui/lab": "^5.0.0-alpha.155",
58
58
  "@mui/material": "^5.14.20",
59
59
  "@mui/styles": "^5.14.20",
60
60
  "@mui/system": "^5.14.20",
61
- "@ocap/asset": "^1.18.106",
62
- "@ocap/client": "^1.18.106",
63
- "@ocap/mcrypto": "^1.18.106",
64
- "@ocap/util": "^1.18.106",
65
- "@ocap/wallet": "^1.18.106",
61
+ "@ocap/asset": "^1.18.108",
62
+ "@ocap/client": "^1.18.108",
63
+ "@ocap/mcrypto": "^1.18.108",
64
+ "@ocap/util": "^1.18.108",
65
+ "@ocap/wallet": "^1.18.108",
66
66
  "@stripe/react-stripe-js": "^2.4.0",
67
67
  "@stripe/stripe-js": "^2.2.0",
68
68
  "ahooks": "^3.7.8",
@@ -107,10 +107,10 @@
107
107
  "validator": "^13.11.0"
108
108
  },
109
109
  "devDependencies": {
110
- "@abtnode/types": "1.16.21-beta-e828f413",
110
+ "@abtnode/types": "1.16.21",
111
111
  "@arcblock/eslint-config": "^0.2.4",
112
112
  "@arcblock/eslint-config-ts": "^0.2.4",
113
- "@did-pay/types": "1.13.88",
113
+ "@did-pay/types": "1.13.89",
114
114
  "@types/cookie-parser": "^1.4.6",
115
115
  "@types/cors": "^2.8.17",
116
116
  "@types/dotenv-flow": "^3.3.3",
@@ -134,7 +134,7 @@
134
134
  "type-fest": "^4.8.3",
135
135
  "typescript": "^4.9.5",
136
136
  "vite": "^4.5.1",
137
- "vite-plugin-blocklet": "^0.6.16",
137
+ "vite-plugin-blocklet": "^0.7.2",
138
138
  "vite-plugin-node-polyfills": "^0.7.0",
139
139
  "vite-plugin-svgr": "^2.4.0",
140
140
  "zx": "^7.2.3"
@@ -149,5 +149,5 @@
149
149
  "parser": "typescript"
150
150
  }
151
151
  },
152
- "gitHead": "1c1c92c77043c0c77f0cda969a299b31d06f70e5"
152
+ "gitHead": "309312b8ffce48cd121af0a5b75494a1ae5dada0"
153
153
  }