payment-kit 1.13.74 → 1.13.75
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/api/src/routes/subscriptions.ts +8 -3
- package/blocklet.yml +1 -1
- package/package.json +3 -3
|
@@ -675,13 +675,18 @@ router.put('/:id', auth, async (req, res) => {
|
|
|
675
675
|
|
|
676
676
|
// FIXME: this should be removed in future
|
|
677
677
|
// Clean up subscriptions that have invalid invoices and payments
|
|
678
|
-
router.delete('/cleanup', auth, async (
|
|
678
|
+
router.delete('/cleanup', auth, async (req, res) => {
|
|
679
|
+
const status = String(req.query.status || 'uncollectible');
|
|
680
|
+
if (['open', 'uncollectible'].includes(status)) {
|
|
681
|
+
res.json({ error: 'status must be either open or uncollectible' });
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
|
|
679
685
|
const subscriptions = await Subscription.findAll();
|
|
680
686
|
const canceled: string[] = [];
|
|
681
|
-
|
|
682
687
|
await Promise.all(
|
|
683
688
|
subscriptions.map(async (x) => {
|
|
684
|
-
const invoices = await Invoice.findAll({ where: { subscription_id: x.id, status
|
|
689
|
+
const invoices = await Invoice.findAll({ where: { subscription_id: x.id, status } });
|
|
685
690
|
if (invoices.length <= 1) {
|
|
686
691
|
return;
|
|
687
692
|
}
|
package/blocklet.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payment-kit",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.75",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"@abtnode/types": "^1.16.20",
|
|
110
110
|
"@arcblock/eslint-config": "^0.2.4",
|
|
111
111
|
"@arcblock/eslint-config-ts": "^0.2.4",
|
|
112
|
-
"@did-pay/types": "1.13.
|
|
112
|
+
"@did-pay/types": "1.13.75",
|
|
113
113
|
"@types/cookie-parser": "^1.4.6",
|
|
114
114
|
"@types/cors": "^2.8.17",
|
|
115
115
|
"@types/dotenv-flow": "^3.3.3",
|
|
@@ -148,5 +148,5 @@
|
|
|
148
148
|
"parser": "typescript"
|
|
149
149
|
}
|
|
150
150
|
},
|
|
151
|
-
"gitHead": "
|
|
151
|
+
"gitHead": "85068655ce5a0ce3dadb956be5a3254166097f20"
|
|
152
152
|
}
|