payment-kit 1.13.48 → 1.13.49
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.
|
@@ -353,7 +353,7 @@ export async function ensureInvoiceForCheckout({
|
|
|
353
353
|
|
|
354
354
|
return InvoiceItem.create({
|
|
355
355
|
livemode: checkoutSession.livemode,
|
|
356
|
-
amount: setup.amount,
|
|
356
|
+
amount: quantity > 0 ? setup.amount : '0',
|
|
357
357
|
quantity,
|
|
358
358
|
description: setup.description,
|
|
359
359
|
period: setup.period,
|
|
@@ -65,6 +65,9 @@ router.get('/', authMine, async (req, res) => {
|
|
|
65
65
|
const customer = await Customer.findOne({ where: { did: query.customer_did } });
|
|
66
66
|
if (customer) {
|
|
67
67
|
where.customer_id = customer.id;
|
|
68
|
+
} else {
|
|
69
|
+
res.json({ count: 0, list: [] });
|
|
70
|
+
return;
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
if (query.subscription_id) {
|
|
@@ -63,6 +63,9 @@ router.get('/', authMine, async (req, res) => {
|
|
|
63
63
|
const customer = await Customer.findOne({ where: { did: query.customer_did } });
|
|
64
64
|
if (customer) {
|
|
65
65
|
where.customer_id = customer.id;
|
|
66
|
+
} else {
|
|
67
|
+
res.json({ count: 0, list: [] });
|
|
68
|
+
return;
|
|
66
69
|
}
|
|
67
70
|
}
|
|
68
71
|
if (query.invoice_id) {
|
|
@@ -73,7 +73,7 @@ const formatBeforeSave = (payload: any) => {
|
|
|
73
73
|
// @ts-ignore
|
|
74
74
|
raw.after_completion.hosted_confirmation = null;
|
|
75
75
|
}
|
|
76
|
-
if (!payload.include_free_trial) {
|
|
76
|
+
if (typeof payload.include_free_trial === 'boolean' && !payload.include_free_trial) {
|
|
77
77
|
// @ts-ignore
|
|
78
78
|
raw.subscription_data = null;
|
|
79
79
|
}
|
|
@@ -75,6 +75,9 @@ router.get('/', authMine, async (req, res) => {
|
|
|
75
75
|
const customer = await Customer.findOne({ where: { did: query.customer_did } });
|
|
76
76
|
if (customer) {
|
|
77
77
|
where.customer_id = customer.id;
|
|
78
|
+
} else {
|
|
79
|
+
res.json({ count: 0, list: [] });
|
|
80
|
+
return;
|
|
78
81
|
}
|
|
79
82
|
}
|
|
80
83
|
if (typeof livemode === 'boolean') {
|
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.49",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "blocklet dev",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@abtnode/types": "1.16.17",
|
|
104
104
|
"@arcblock/eslint-config": "^0.2.4",
|
|
105
105
|
"@arcblock/eslint-config-ts": "^0.2.4",
|
|
106
|
-
"@did-pay/types": "1.13.
|
|
106
|
+
"@did-pay/types": "1.13.49",
|
|
107
107
|
"@types/cookie-parser": "^1.4.5",
|
|
108
108
|
"@types/cors": "^2.8.15",
|
|
109
109
|
"@types/dotenv-flow": "^3.3.2",
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
"parser": "typescript"
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
|
-
"gitHead": "
|
|
143
|
+
"gitHead": "8fd11641c7ee8f092afc35eb9615c27d321d398c"
|
|
144
144
|
}
|