payment-kit 1.13.243 → 1.13.244
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 +11 -4
- package/blocklet.yml +1 -1
- package/package.json +4 -4
|
@@ -212,7 +212,14 @@ router.put('/:id/cancel', authPortal, async (req, res) => {
|
|
|
212
212
|
return res.status(400).json({ error: 'Subscription already canceled' });
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
const {
|
|
215
|
+
const {
|
|
216
|
+
at = 'current_period_end',
|
|
217
|
+
refund = 'none',
|
|
218
|
+
time,
|
|
219
|
+
feedback = 'other',
|
|
220
|
+
comment = '',
|
|
221
|
+
reason = 'payment_disputed',
|
|
222
|
+
} = req.body;
|
|
216
223
|
if (at === 'custom' && dayjs(time).unix() < dayjs().unix()) {
|
|
217
224
|
return res.status(400).json({ error: 'cancel at must be a future timestamp' });
|
|
218
225
|
}
|
|
@@ -220,9 +227,9 @@ router.put('/:id/cancel', authPortal, async (req, res) => {
|
|
|
220
227
|
// update cancel at
|
|
221
228
|
const updates: Partial<Subscription> = {
|
|
222
229
|
cancelation_details: {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
230
|
+
comment: comment || `Requested by ${req.user?.role}:${req.user?.did}`,
|
|
231
|
+
reason: reason || 'payment_disputed',
|
|
232
|
+
feedback: feedback || 'other',
|
|
226
233
|
},
|
|
227
234
|
};
|
|
228
235
|
const now = dayjs().unix() + 3;
|
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.244",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "cross-env COMPONENT_STORE_URL=https://test.store.blocklet.dev blocklet dev --open",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@arcblock/ux": "^2.9.77",
|
|
52
52
|
"@arcblock/validator": "^1.18.116",
|
|
53
53
|
"@blocklet/logger": "1.16.26",
|
|
54
|
-
"@blocklet/payment-react": "1.13.
|
|
54
|
+
"@blocklet/payment-react": "1.13.244",
|
|
55
55
|
"@blocklet/sdk": "1.16.26",
|
|
56
56
|
"@blocklet/ui-react": "^2.9.77",
|
|
57
57
|
"@blocklet/uploader": "^0.1.6",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"devDependencies": {
|
|
117
117
|
"@abtnode/types": "1.16.26",
|
|
118
118
|
"@arcblock/eslint-config-ts": "^0.3.0",
|
|
119
|
-
"@blocklet/payment-types": "1.13.
|
|
119
|
+
"@blocklet/payment-types": "1.13.244",
|
|
120
120
|
"@types/cookie-parser": "^1.4.7",
|
|
121
121
|
"@types/cors": "^2.8.17",
|
|
122
122
|
"@types/dotenv-flow": "^3.3.3",
|
|
@@ -155,5 +155,5 @@
|
|
|
155
155
|
"parser": "typescript"
|
|
156
156
|
}
|
|
157
157
|
},
|
|
158
|
-
"gitHead": "
|
|
158
|
+
"gitHead": "b658527856e8ff8d33c15af1b2aa568320984751"
|
|
159
159
|
}
|