payment-kit 1.13.268 → 1.13.270
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/checkout-sessions.ts +16 -0
- package/api/src/routes/pricing-table.ts +15 -10
- package/blocklet.yml +1 -1
- package/package.json +16 -16
|
@@ -346,6 +346,22 @@ export async function startCheckoutSessionFromPaymentLink(id: string, req: Reque
|
|
|
346
346
|
raw.cancel_url = req.query.redirect as string;
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
+
try {
|
|
350
|
+
if (req.query.nft_mint_factory && isValid(req.query.nft_mint_factory as string)) {
|
|
351
|
+
raw.nft_mint_settings = {
|
|
352
|
+
enabled: true,
|
|
353
|
+
behavior: 'per_checkout_session',
|
|
354
|
+
factory: req.query.nft_mint_factory as string,
|
|
355
|
+
};
|
|
356
|
+
raw.nft_mint_status = 'pending';
|
|
357
|
+
logger.info('use nft_mint_settings from query when checkout from payment link', { v: raw.nft_mint_settings });
|
|
358
|
+
} else {
|
|
359
|
+
raw.nft_mint_status = 'disabled';
|
|
360
|
+
}
|
|
361
|
+
} catch {
|
|
362
|
+
// Do nothing
|
|
363
|
+
}
|
|
364
|
+
|
|
349
365
|
let doc;
|
|
350
366
|
if (req.query.preview === '1') {
|
|
351
367
|
doc = await CheckoutSession.findOne({ where: { payment_link_id: link.id, metadata: { preview: '1' } } });
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isValid } from '@arcblock/did';
|
|
1
2
|
import { getUrl } from '@blocklet/sdk/lib/component';
|
|
2
3
|
import { Router } from 'express';
|
|
3
4
|
import Joi from 'joi';
|
|
@@ -249,16 +250,20 @@ router.post('/:id/checkout/:priceId', async (req, res) => {
|
|
|
249
250
|
raw.cross_sell_behavior = req.query.cross_sell_behavior as string;
|
|
250
251
|
logger.info('use cross_sell_behavior from query when checkout from pricing table', { v: raw.cross_sell_behavior });
|
|
251
252
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
253
|
+
try {
|
|
254
|
+
if (req.query.nft_mint_factory && isValid(req.query.nft_mint_factory as string)) {
|
|
255
|
+
raw.nft_mint_settings = {
|
|
256
|
+
enabled: true,
|
|
257
|
+
behavior: 'per_checkout_session',
|
|
258
|
+
factory: req.query.nft_mint_factory as string,
|
|
259
|
+
};
|
|
260
|
+
raw.nft_mint_status = 'pending';
|
|
261
|
+
logger.info('use nft_mint_settings from query when checkout from pricing table', { v: raw.nft_mint_settings });
|
|
262
|
+
} else {
|
|
263
|
+
raw.nft_mint_status = 'disabled';
|
|
264
|
+
}
|
|
265
|
+
} catch {
|
|
266
|
+
// Do nothing
|
|
262
267
|
}
|
|
263
268
|
|
|
264
269
|
const session = await CheckoutSession.create(raw as any);
|
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.270",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "blocklet dev --open",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -43,28 +43,28 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@abtnode/cron": "1.16.26",
|
|
46
|
-
"@arcblock/did": "^1.18.
|
|
46
|
+
"@arcblock/did": "^1.18.121",
|
|
47
47
|
"@arcblock/did-auth-storage-nedb": "^1.7.1",
|
|
48
|
-
"@arcblock/did-connect": "^2.9.
|
|
49
|
-
"@arcblock/did-util": "^1.18.
|
|
50
|
-
"@arcblock/jwt": "^1.18.
|
|
51
|
-
"@arcblock/ux": "^2.9.
|
|
52
|
-
"@arcblock/validator": "^1.18.
|
|
48
|
+
"@arcblock/did-connect": "^2.9.89",
|
|
49
|
+
"@arcblock/did-util": "^1.18.121",
|
|
50
|
+
"@arcblock/jwt": "^1.18.121",
|
|
51
|
+
"@arcblock/ux": "^2.9.89",
|
|
52
|
+
"@arcblock/validator": "^1.18.121",
|
|
53
53
|
"@blocklet/logger": "1.16.26",
|
|
54
|
-
"@blocklet/payment-react": "1.13.
|
|
54
|
+
"@blocklet/payment-react": "1.13.270",
|
|
55
55
|
"@blocklet/sdk": "1.16.26",
|
|
56
|
-
"@blocklet/ui-react": "^2.9.
|
|
56
|
+
"@blocklet/ui-react": "^2.9.89",
|
|
57
57
|
"@blocklet/uploader": "^0.1.6",
|
|
58
58
|
"@mui/icons-material": "^5.15.18",
|
|
59
59
|
"@mui/lab": "^5.0.0-alpha.170",
|
|
60
60
|
"@mui/material": "^5.15.18",
|
|
61
61
|
"@mui/styles": "^5.15.18",
|
|
62
62
|
"@mui/system": "^5.15.15",
|
|
63
|
-
"@ocap/asset": "^1.18.
|
|
64
|
-
"@ocap/client": "^1.18.
|
|
65
|
-
"@ocap/mcrypto": "^1.18.
|
|
66
|
-
"@ocap/util": "^1.18.
|
|
67
|
-
"@ocap/wallet": "^1.18.
|
|
63
|
+
"@ocap/asset": "^1.18.121",
|
|
64
|
+
"@ocap/client": "^1.18.121",
|
|
65
|
+
"@ocap/mcrypto": "^1.18.121",
|
|
66
|
+
"@ocap/util": "^1.18.121",
|
|
67
|
+
"@ocap/wallet": "^1.18.121",
|
|
68
68
|
"@react-pdf/renderer": "^3.4.4",
|
|
69
69
|
"@stripe/react-stripe-js": "^2.7.1",
|
|
70
70
|
"@stripe/stripe-js": "^2.4.0",
|
|
@@ -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.270",
|
|
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": "99484b4bdf4b1bba8c9dc0e20764ad0e4217d82f"
|
|
159
159
|
}
|