payment-kit 1.14.1 → 1.14.2
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/libs/refund.ts +4 -2
- package/api/src/libs/subscription.ts +8 -1
- package/blocklet.yml +1 -1
- package/package.json +4 -4
package/api/src/libs/refund.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BN } from '@ocap/util';
|
|
2
|
-
import type
|
|
2
|
+
import { Op, type WhereOptions } from 'sequelize';
|
|
3
3
|
import { PaymentIntent, Refund } from '../store/models';
|
|
4
4
|
|
|
5
5
|
export async function getRefundAmountSetup({
|
|
@@ -20,7 +20,9 @@ export async function getRefundAmountSetup({
|
|
|
20
20
|
throw new Error('PaymentIntent not found');
|
|
21
21
|
}
|
|
22
22
|
const where: WhereOptions<Refund> = {
|
|
23
|
-
status:
|
|
23
|
+
status: {
|
|
24
|
+
[Op.not]: 'canceled',
|
|
25
|
+
},
|
|
24
26
|
payment_intent_id: paymentIntentId,
|
|
25
27
|
};
|
|
26
28
|
if (currencyId) {
|
|
@@ -6,6 +6,7 @@ import pick from 'lodash/pick';
|
|
|
6
6
|
import type { LiteralUnion } from 'type-fest';
|
|
7
7
|
import { withQuery } from 'ufo';
|
|
8
8
|
|
|
9
|
+
import { Op } from 'sequelize';
|
|
9
10
|
import {
|
|
10
11
|
Customer,
|
|
11
12
|
Invoice,
|
|
@@ -642,7 +643,13 @@ export async function getRemainingStakes(subscriptionIds: string[], subscription
|
|
|
642
643
|
await Promise.all(
|
|
643
644
|
subscriptionIds.map(async (subscriptionId) => {
|
|
644
645
|
const refund = await Refund.findOne({
|
|
645
|
-
where: {
|
|
646
|
+
where: {
|
|
647
|
+
subscription_id: subscriptionId,
|
|
648
|
+
status: {
|
|
649
|
+
[Op.not]: 'canceled',
|
|
650
|
+
},
|
|
651
|
+
type: 'stake_return',
|
|
652
|
+
},
|
|
646
653
|
});
|
|
647
654
|
if (!refund) {
|
|
648
655
|
// this subscription not return stake
|
package/blocklet.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "payment-kit",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.2",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "blocklet dev --open",
|
|
6
6
|
"eject": "vite eject",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@arcblock/validator": "^1.18.124",
|
|
53
53
|
"@blocklet/js-sdk": "1.16.28",
|
|
54
54
|
"@blocklet/logger": "1.16.28",
|
|
55
|
-
"@blocklet/payment-react": "1.14.
|
|
55
|
+
"@blocklet/payment-react": "1.14.2",
|
|
56
56
|
"@blocklet/sdk": "1.16.28",
|
|
57
57
|
"@blocklet/ui-react": "^2.10.3",
|
|
58
58
|
"@blocklet/uploader": "^0.1.20",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@abtnode/types": "1.16.28",
|
|
120
120
|
"@arcblock/eslint-config-ts": "^0.3.2",
|
|
121
|
-
"@blocklet/payment-types": "1.14.
|
|
121
|
+
"@blocklet/payment-types": "1.14.2",
|
|
122
122
|
"@types/cookie-parser": "^1.4.7",
|
|
123
123
|
"@types/cors": "^2.8.17",
|
|
124
124
|
"@types/debug": "^4.1.12",
|
|
@@ -160,5 +160,5 @@
|
|
|
160
160
|
"parser": "typescript"
|
|
161
161
|
}
|
|
162
162
|
},
|
|
163
|
-
"gitHead": "
|
|
163
|
+
"gitHead": "a4a936dc1b6bb74eb02674cd619d453410b1aa86"
|
|
164
164
|
}
|