oak-pay-business 1.0.12 → 1.1.0
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/es/aspects/AspectDict.d.ts +4 -1
- package/es/aspects/account.d.ts +5 -0
- package/es/aspects/account.js +4 -0
- package/es/aspects/index.js +2 -2
- package/es/checkers/accountOper.js +10 -3
- package/es/checkers/pay.js +31 -0
- package/es/checkers/refund.d.ts +5 -0
- package/es/checkers/refund.js +18 -0
- package/es/components/account/deposit/index.js +1 -1
- package/es/components/account/detail/index.d.ts +1 -0
- package/es/components/account/detail/index.js +4 -0
- package/es/components/account/detail/index.xml +1 -0
- package/es/components/account/detail/web.d.ts +2 -1
- package/es/components/account/detail/web.js +2 -5
- package/es/components/account/detail/web.pc.d.ts +1 -0
- package/es/components/account/detail/web.pc.js +2 -5
- package/es/components/pay/list/web.pc.js +19 -17
- package/es/components/pay/list/web.pc.module.less +10 -10
- package/es/components/payConfig/system/web.pc.module.less +16 -16
- package/es/components/payConfig/upsert/offline/index.js +20 -20
- package/es/components/payConfig/upsert/wechatPay/index.js +24 -1
- package/es/components/payConfig/upsert/wechatPay/locales/zh-CN.json +8 -2
- package/es/components/withdraw/create/index.d.ts +8 -0
- package/es/components/withdraw/create/index.js +236 -0
- package/es/components/withdraw/create/index.json +9 -0
- package/es/components/withdraw/create/index.less +105 -0
- package/es/components/withdraw/create/index.xml +94 -0
- package/es/components/withdraw/create/locales/zh-CN.json +39 -0
- package/es/components/withdraw/create/web.d.ts +32 -0
- package/es/components/withdraw/create/web.js +89 -0
- package/es/components/withdraw/create/web.module.less +104 -0
- package/es/components/withdraw/create/web.pc.d.ts +32 -0
- package/es/components/withdraw/create/web.pc.js +71 -0
- package/es/components/withdraw/create/web.pc.module.less +79 -0
- package/es/components/withdraw/detail/index.d.ts +4 -0
- package/es/components/withdraw/detail/index.js +60 -0
- package/es/components/withdraw/detail/index.json +5 -0
- package/es/components/withdraw/detail/index.less +11 -0
- package/es/components/withdraw/detail/index.xml +14 -0
- package/es/components/withdraw/detail/locales/zh-CN.json +13 -0
- package/es/components/withdraw/detail/web.d.ts +19 -0
- package/es/components/withdraw/detail/web.js +13 -0
- package/es/components/withdraw/detail/web.module.less +8 -0
- package/es/components/withdraw/detail/web.pc.d.ts +19 -0
- package/es/components/withdraw/detail/web.pc.js +13 -0
- package/es/components/withdraw/detail/web.pc.module.less +8 -0
- package/es/components/withdraw/dry/Detail.d.ts +14 -0
- package/es/components/withdraw/dry/Detail.js +71 -0
- package/es/components/withdraw/dry/Detail.mobile.d.ts +21 -0
- package/es/components/withdraw/dry/Detail.mobile.js +75 -0
- package/es/components/withdraw/dry/Detail.module.less +84 -0
- package/es/components/withdraw/dry/Detail.pc.d.ts +21 -0
- package/es/components/withdraw/dry/Detail.pc.js +100 -0
- package/es/components/withdraw/dry/Detail.pc.module.less +81 -0
- package/es/components/withdraw/dry/index.d.ts +21 -0
- package/es/components/withdraw/dry/index.js +11 -0
- package/es/components/withdraw/dry/index.json +7 -0
- package/es/components/withdraw/dry/index.less +84 -0
- package/es/components/withdraw/dry/index.xml +74 -0
- package/es/components/withdraw/dry/locales/zh-CN.json +39 -0
- package/es/components/withdrawChannel/list/index.d.ts +6 -0
- package/es/components/withdrawChannel/list/index.js +32 -0
- package/es/components/withdrawChannel/list/index.json +1 -0
- package/es/components/withdrawChannel/list/locales/zh-CN.json +3 -0
- package/es/components/withdrawChannel/list/web.pc.d.ts +8 -0
- package/es/components/withdrawChannel/list/web.pc.js +25 -0
- package/es/components/withdrawChannel/upsert/index.d.ts +3 -0
- package/es/components/withdrawChannel/upsert/index.js +14 -0
- package/es/components/withdrawChannel/upsert/index.json +1 -0
- package/es/components/withdrawChannel/upsert/locales/zh-CN.json +6 -0
- package/es/components/withdrawChannel/upsert/web.pc.d.ts +6 -0
- package/es/components/withdrawChannel/upsert/web.pc.js +25 -0
- package/es/configuration/attrUpdateMatrix.js +34 -0
- package/es/context/BackendRuntimeContext.d.ts +1 -0
- package/es/context/BackendRuntimeContext.js +2 -0
- package/es/data/actionAuth.d.ts +3 -0
- package/es/data/actionAuth.js +43 -0
- package/es/data/i18n.js +143 -2
- package/es/data/index.d.ts +2 -0
- package/es/data/index.js +4 -0
- package/es/data/path.d.ts +3 -0
- package/es/data/path.js +73 -0
- package/es/entities/Account.d.ts +1 -0
- package/es/entities/Account.js +1 -0
- package/es/entities/AccountOper.d.ts +2 -1
- package/es/entities/AccountOper.js +5 -2
- package/es/entities/Pay.d.ts +4 -3
- package/es/entities/Pay.js +19 -0
- package/es/entities/Refund.d.ts +9 -5
- package/es/entities/Refund.js +10 -3
- package/es/entities/User.d.ts +2 -0
- package/es/entities/User.js +1 -0
- package/es/entities/Withdraw.d.ts +14 -5
- package/es/entities/Withdraw.js +17 -3
- package/es/entities/WithdrawAccount.d.ts +15 -0
- package/es/entities/WithdrawAccount.js +34 -0
- package/es/entities/WithdrawChannel.d.ts +5 -5
- package/es/entities/WithdrawChannel.js +3 -17
- package/es/oak-app-domain/Account/Schema.d.ts +6 -0
- package/es/oak-app-domain/Account/Storage.js +4 -0
- package/es/oak-app-domain/Account/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/AccountOper/Schema.d.ts +7 -1
- package/es/oak-app-domain/AccountOper/Storage.js +4 -1
- package/es/oak-app-domain/AccountOper/Style.js +2 -1
- package/es/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/EntityDict.d.ts +2 -0
- package/es/oak-app-domain/ModiEntity/Schema.d.ts +34 -5
- package/es/oak-app-domain/ModiEntity/Storage.js +1 -1
- package/es/oak-app-domain/OperEntity/Schema.d.ts +34 -5
- package/es/oak-app-domain/OperEntity/Storage.js +1 -1
- package/es/oak-app-domain/Pay/Action.d.ts +2 -2
- package/es/oak-app-domain/Pay/Action.js +2 -1
- package/es/oak-app-domain/Pay/Schema.d.ts +8 -2
- package/es/oak-app-domain/Pay/Storage.js +15 -0
- package/es/oak-app-domain/Pay/Style.js +2 -0
- package/es/oak-app-domain/Pay/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/Refund/Action.d.ts +2 -2
- package/es/oak-app-domain/Refund/Action.js +4 -3
- package/es/oak-app-domain/Refund/Schema.d.ts +95 -10
- package/es/oak-app-domain/Refund/Storage.js +17 -2
- package/es/oak-app-domain/Refund/Style.js +1 -0
- package/es/oak-app-domain/Refund/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/Storage.js +2 -0
- package/es/oak-app-domain/System/Schema.d.ts +12 -0
- package/es/oak-app-domain/User/Schema.d.ts +36 -0
- package/es/oak-app-domain/User/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/Withdraw/Action.d.ts +2 -2
- package/es/oak-app-domain/Withdraw/Action.js +4 -3
- package/es/oak-app-domain/Withdraw/Schema.d.ts +110 -31
- package/es/oak-app-domain/Withdraw/Storage.js +25 -3
- package/es/oak-app-domain/Withdraw/Style.js +3 -0
- package/es/oak-app-domain/Withdraw/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/WithdrawAccount/Schema.d.ts +230 -0
- package/es/oak-app-domain/WithdrawAccount/Schema.js +1 -0
- package/es/oak-app-domain/WithdrawAccount/Storage.d.ts +3 -0
- package/es/oak-app-domain/WithdrawAccount/Storage.js +71 -0
- package/es/oak-app-domain/WithdrawAccount/locales/zh_CN.json +1 -0
- package/es/oak-app-domain/WithdrawChannel/Schema.d.ts +60 -30
- package/es/oak-app-domain/WithdrawChannel/Storage.js +9 -27
- package/es/oak-app-domain/WithdrawChannel/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/_SubQuery.d.ts +24 -2
- package/es/triggers/account.js +72 -0
- package/es/triggers/accountOper.js +24 -22
- package/es/triggers/index.js +4 -0
- package/es/triggers/pay.js +52 -2
- package/es/triggers/refund.js +157 -6
- package/es/triggers/userSystem.js +1 -0
- package/es/triggers/withdraw.d.ts +5 -0
- package/es/triggers/withdraw.js +147 -0
- package/es/types/Exception.d.ts +3 -0
- package/es/types/Exception.js +9 -0
- package/es/types/PayConfig.d.ts +3 -0
- package/es/utils/application.d.ts +1 -0
- package/es/utils/application.js +8 -0
- package/es/utils/pay.d.ts +1 -0
- package/es/utils/pay.js +87 -0
- package/es/utils/payClazz/Account.d.ts +2 -1
- package/es/utils/payClazz/Account.js +27 -15
- package/es/utils/payClazz/WechatPay/WechatPay.d.ts +4 -0
- package/es/utils/payClazz/WechatPay/WechatPay.debug.js +12 -5
- package/es/utils/payClazz/WechatPay/WechatPay.js +28 -5
- package/es/watchers/index.js +2 -0
- package/es/watchers/pay.js +17 -0
- package/es/watchers/refund.d.ts +5 -0
- package/es/watchers/refund.js +74 -0
- package/lib/aspects/AspectDict.d.ts +4 -1
- package/lib/aspects/account.d.ts +5 -0
- package/lib/aspects/account.js +8 -0
- package/lib/aspects/index.js +2 -2
- package/lib/checkers/accountOper.js +10 -3
- package/lib/checkers/pay.js +32 -0
- package/lib/checkers/refund.d.ts +5 -0
- package/lib/checkers/refund.js +20 -0
- package/lib/configuration/attrUpdateMatrix.js +34 -0
- package/lib/context/BackendRuntimeContext.d.ts +1 -0
- package/lib/context/BackendRuntimeContext.js +2 -0
- package/lib/data/actionAuth.d.ts +3 -0
- package/lib/data/actionAuth.js +45 -0
- package/lib/data/i18n.js +143 -2
- package/lib/data/index.d.ts +2 -0
- package/lib/data/index.js +4 -0
- package/lib/data/path.d.ts +3 -0
- package/lib/data/path.js +75 -0
- package/lib/entities/Account.d.ts +1 -0
- package/lib/entities/Account.js +1 -0
- package/lib/entities/AccountOper.d.ts +2 -1
- package/lib/entities/AccountOper.js +5 -2
- package/lib/entities/Pay.d.ts +4 -3
- package/lib/entities/Pay.js +19 -0
- package/lib/entities/Refund.d.ts +9 -5
- package/lib/entities/Refund.js +10 -3
- package/lib/entities/User.d.ts +2 -0
- package/lib/entities/User.js +1 -0
- package/lib/entities/Withdraw.d.ts +14 -5
- package/lib/entities/Withdraw.js +17 -3
- package/lib/entities/WithdrawAccount.d.ts +15 -0
- package/lib/entities/WithdrawAccount.js +37 -0
- package/lib/entities/WithdrawChannel.d.ts +5 -5
- package/lib/entities/WithdrawChannel.js +3 -17
- package/lib/oak-app-domain/Account/Schema.d.ts +6 -0
- package/lib/oak-app-domain/Account/Storage.js +4 -0
- package/lib/oak-app-domain/Account/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/AccountOper/Schema.d.ts +7 -1
- package/lib/oak-app-domain/AccountOper/Storage.js +4 -1
- package/lib/oak-app-domain/AccountOper/Style.js +2 -1
- package/lib/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/EntityDict.d.ts +2 -0
- package/lib/oak-app-domain/ModiEntity/Schema.d.ts +34 -5
- package/lib/oak-app-domain/ModiEntity/Storage.js +1 -1
- package/lib/oak-app-domain/OperEntity/Schema.d.ts +34 -5
- package/lib/oak-app-domain/OperEntity/Storage.js +1 -1
- package/lib/oak-app-domain/Pay/Action.d.ts +2 -2
- package/lib/oak-app-domain/Pay/Action.js +2 -1
- package/lib/oak-app-domain/Pay/Schema.d.ts +8 -2
- package/lib/oak-app-domain/Pay/Storage.js +15 -0
- package/lib/oak-app-domain/Pay/Style.js +2 -0
- package/lib/oak-app-domain/Pay/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/Refund/Action.d.ts +2 -2
- package/lib/oak-app-domain/Refund/Action.js +4 -3
- package/lib/oak-app-domain/Refund/Schema.d.ts +95 -10
- package/lib/oak-app-domain/Refund/Storage.js +17 -2
- package/lib/oak-app-domain/Refund/Style.js +1 -0
- package/lib/oak-app-domain/Refund/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/Storage.js +4 -2
- package/lib/oak-app-domain/System/Schema.d.ts +12 -0
- package/lib/oak-app-domain/User/Schema.d.ts +36 -0
- package/lib/oak-app-domain/User/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/Withdraw/Action.d.ts +2 -2
- package/lib/oak-app-domain/Withdraw/Action.js +4 -3
- package/lib/oak-app-domain/Withdraw/Schema.d.ts +110 -31
- package/lib/oak-app-domain/Withdraw/Storage.js +25 -3
- package/lib/oak-app-domain/Withdraw/Style.js +3 -0
- package/lib/oak-app-domain/Withdraw/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/WithdrawAccount/Schema.d.ts +230 -0
- package/lib/oak-app-domain/WithdrawAccount/Schema.js +2 -0
- package/lib/oak-app-domain/WithdrawAccount/Storage.d.ts +3 -0
- package/lib/oak-app-domain/WithdrawAccount/Storage.js +74 -0
- package/lib/oak-app-domain/WithdrawAccount/locales/zh_CN.json +1 -0
- package/lib/oak-app-domain/WithdrawChannel/Schema.d.ts +60 -30
- package/lib/oak-app-domain/WithdrawChannel/Storage.js +9 -27
- package/lib/oak-app-domain/WithdrawChannel/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/_SubQuery.d.ts +24 -2
- package/lib/triggers/account.js +74 -0
- package/lib/triggers/accountOper.js +9 -5
- package/lib/triggers/index.js +4 -0
- package/lib/triggers/pay.js +101 -5
- package/lib/triggers/refund.js +156 -5
- package/lib/triggers/userSystem.js +1 -0
- package/lib/triggers/withdraw.d.ts +5 -0
- package/lib/triggers/withdraw.js +150 -0
- package/lib/types/Exception.d.ts +3 -0
- package/lib/types/Exception.js +11 -1
- package/lib/types/PayConfig.d.ts +3 -0
- package/lib/utils/application.d.ts +1 -0
- package/lib/utils/application.js +11 -0
- package/lib/utils/pay.d.ts +1 -0
- package/lib/utils/pay.js +89 -1
- package/lib/utils/payClazz/Account.d.ts +2 -1
- package/lib/utils/payClazz/Account.js +20 -6
- package/lib/utils/payClazz/WechatPay/WechatPay.d.ts +4 -0
- package/lib/utils/payClazz/WechatPay/WechatPay.debug.js +12 -5
- package/lib/utils/payClazz/WechatPay/WechatPay.js +28 -5
- package/lib/watchers/index.js +2 -0
- package/lib/watchers/pay.js +17 -0
- package/lib/watchers/refund.d.ts +5 -0
- package/lib/watchers/refund.js +77 -0
- package/package.json +4 -4
- package/src/entities/Account.ts +77 -75
- package/src/entities/AccountOper.ts +7 -3
- package/src/entities/Application.ts +53 -53
- package/src/entities/Pay.ts +22 -2
- package/src/entities/Refund.ts +18 -8
- package/src/entities/System.ts +28 -28
- package/src/entities/User.ts +170 -167
- package/src/entities/Withdraw.ts +94 -71
- package/src/entities/WithdrawAccount.ts +55 -0
- package/src/entities/WithdrawChannel.ts +8 -21
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { BRC } from '../types/RuntimeCxt';
|
|
2
|
+
import { EntityDict } from '../oak-app-domain';
|
|
2
3
|
export type AspectDict = {
|
|
3
|
-
|
|
4
|
+
getAccountPayRefunds: (params: {
|
|
5
|
+
accountId: string;
|
|
6
|
+
}, context: BRC) => Promise<EntityDict['refund']['CreateSingle']['data'][]>;
|
|
4
7
|
};
|
package/es/aspects/index.js
CHANGED
|
@@ -18,7 +18,7 @@ const checkers = [
|
|
|
18
18
|
type: 'data',
|
|
19
19
|
checker(data, context) {
|
|
20
20
|
assert(!(data instanceof Array));
|
|
21
|
-
const { type, totalPlus, availPlus } = data;
|
|
21
|
+
const { type, totalPlus, availPlus, refundablePlus } = data;
|
|
22
22
|
if (typeof totalPlus !== 'number') {
|
|
23
23
|
throw new OakInputIllegalException('accountOper', ['totalPlus'], 'accountOper中的totalPlus不是数字');
|
|
24
24
|
}
|
|
@@ -33,8 +33,9 @@ const checkers = [
|
|
|
33
33
|
break;
|
|
34
34
|
}
|
|
35
35
|
case 'deposit': {
|
|
36
|
-
if (totalPlus < 0 || availPlus < 0 || totalPlus !== availPlus
|
|
37
|
-
|
|
36
|
+
if (totalPlus < 0 || availPlus < 0 || totalPlus !== availPlus ||
|
|
37
|
+
typeof refundablePlus === 'number' && refundablePlus < 0) {
|
|
38
|
+
throw new OakInputIllegalException('accountOper', ['availPlus'], 'accountOper为deposit时,其totalPlus/availPlus必须为正数且相等, refundable必须为空或者正数');
|
|
38
39
|
}
|
|
39
40
|
break;
|
|
40
41
|
}
|
|
@@ -68,6 +69,12 @@ const checkers = [
|
|
|
68
69
|
}
|
|
69
70
|
break;
|
|
70
71
|
}
|
|
72
|
+
case 'cutoffRefundable': {
|
|
73
|
+
if (totalPlus !== 0 || availPlus !== 0 || typeof refundablePlus !== 'number' || refundablePlus >= 0) {
|
|
74
|
+
throw new OakInputIllegalException('accountOper', ['refundablePlus'], 'accountOper为cutoffRefundable时,其totalPlus/availPlus必须为0,且refundablePlus必须为负数');
|
|
75
|
+
}
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
71
78
|
default: {
|
|
72
79
|
assert(false);
|
|
73
80
|
break;
|
package/es/checkers/pay.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { OakInputIllegalException } from 'oak-domain/lib/types';
|
|
2
|
+
import { CHECKER_MAX_PRIORITY } from 'oak-domain/lib/types/Trigger';
|
|
3
|
+
import { pipeline } from 'oak-domain/lib/utils/executor';
|
|
4
|
+
import assert from 'assert';
|
|
2
5
|
import { PAY_CHANNEL_ACCOUNT_NAME, PAY_CHANNEL_OFFLINE_NAME } from '../types/PayConfig';
|
|
3
6
|
const checkers = [
|
|
4
7
|
{
|
|
@@ -50,6 +53,7 @@ const checkers = [
|
|
|
50
53
|
checker(operation, context) {
|
|
51
54
|
const { data } = operation;
|
|
52
55
|
const { orderId, price } = data;
|
|
56
|
+
data.refundable = false;
|
|
53
57
|
if (orderId) {
|
|
54
58
|
// 所有已经支付和正在支付的pay之和不能超过订单总和
|
|
55
59
|
const order = context.select('order', {
|
|
@@ -102,6 +106,33 @@ const checkers = [
|
|
|
102
106
|
channel: PAY_CHANNEL_OFFLINE_NAME,
|
|
103
107
|
};
|
|
104
108
|
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
// 如果在开始支付或者继续支付过程中,paid达到了price,pay的状态可以改为paid
|
|
112
|
+
entity: 'pay',
|
|
113
|
+
type: 'logical',
|
|
114
|
+
action: ['continuePaying', 'startPaying'],
|
|
115
|
+
priority: CHECKER_MAX_PRIORITY - 1, // 要超过action矩阵定义的赋state值
|
|
116
|
+
checker: (operation, context) => {
|
|
117
|
+
const { data, filter } = operation;
|
|
118
|
+
assert(filter && typeof filter.id === 'string');
|
|
119
|
+
const { paid } = data;
|
|
120
|
+
if (paid) {
|
|
121
|
+
return pipeline(() => context.select('pay', {
|
|
122
|
+
data: {
|
|
123
|
+
id: 1,
|
|
124
|
+
paid: 1,
|
|
125
|
+
price: 1,
|
|
126
|
+
},
|
|
127
|
+
}, {}), (pays) => {
|
|
128
|
+
const [pay] = pays;
|
|
129
|
+
const { paid: payPaid, price } = pay;
|
|
130
|
+
if (payPaid + paid === price) {
|
|
131
|
+
data.iState === 'paid';
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
105
136
|
}
|
|
106
137
|
];
|
|
107
138
|
export default checkers;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const checkers = [
|
|
2
|
+
{
|
|
3
|
+
// 退款所在的pay一定是可以退款状态,且其上不能有另一个正在退款的请求
|
|
4
|
+
entity: 'refund',
|
|
5
|
+
type: 'row',
|
|
6
|
+
filter: {
|
|
7
|
+
pay: {
|
|
8
|
+
refundable: true,
|
|
9
|
+
refund$pay: {
|
|
10
|
+
'#sqp': 'not in',
|
|
11
|
+
iState: 'refunding',
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
action: 'create',
|
|
16
|
+
}
|
|
17
|
+
];
|
|
18
|
+
export default checkers;
|
|
@@ -52,7 +52,7 @@ export default OakComponent({
|
|
|
52
52
|
}
|
|
53
53
|
else if (PAY_ORG_CHANNELS.includes(next.channel) && (!prev.channel || !PAY_ORG_CHANNELS.includes(prev.channel))) {
|
|
54
54
|
// 计算损耗
|
|
55
|
-
const ratio = this.features.pay.getDepositRatio(
|
|
55
|
+
const ratio = this.features.pay.getDepositRatio(next.channel);
|
|
56
56
|
if (ratio > 0) {
|
|
57
57
|
const ratioDelta = Math.floor(price * ratio / 100);
|
|
58
58
|
this.onPriceChange(ToYuan(price + ratioDelta), true, ratioDelta);
|
|
@@ -52,6 +52,7 @@ export default OakComponent({
|
|
|
52
52
|
depositMinCent: 0,
|
|
53
53
|
depositMaxCent: 1000000,
|
|
54
54
|
onDepositPayId: (payId) => undefined,
|
|
55
|
+
onWithdraw: () => undefined,
|
|
55
56
|
},
|
|
56
57
|
formData({ data }) {
|
|
57
58
|
const unfinishedPayId = data?.pay$account?.[0]?.id;
|
|
@@ -158,6 +159,9 @@ export default OakComponent({
|
|
|
158
159
|
const { onDepositPayId } = this.props;
|
|
159
160
|
const { unfinishedPayId } = this.state;
|
|
160
161
|
onDepositPayId && onDepositPayId(unfinishedPayId);
|
|
162
|
+
},
|
|
163
|
+
onWithdrawClick() {
|
|
164
|
+
this.props.onWithdraw();
|
|
161
165
|
}
|
|
162
166
|
},
|
|
163
167
|
data: {
|
|
@@ -7,6 +7,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
|
|
|
7
7
|
depositMinCent: number;
|
|
8
8
|
unfinishedPayId?: string;
|
|
9
9
|
onDepositPayId: (payId: string) => void;
|
|
10
|
+
onWithdraw: () => void;
|
|
10
11
|
depositOpen: boolean;
|
|
11
12
|
ufOpen: boolean;
|
|
12
13
|
depPrice: number | null;
|
|
@@ -14,7 +15,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
|
|
|
14
15
|
depositMeta: any;
|
|
15
16
|
depositing: boolean;
|
|
16
17
|
}, {
|
|
17
|
-
createDepositPay: () => Promise<
|
|
18
|
+
createDepositPay: () => Promise<void>;
|
|
18
19
|
setDepositOpen: (v: boolean) => void;
|
|
19
20
|
setUfOpen: (v: boolean) => void;
|
|
20
21
|
setDepPrice: (v: number | null) => void;
|
|
@@ -5,7 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
import { CentToString } from 'oak-domain/lib/utils/money';
|
|
6
6
|
import AccountDeposit from '../deposit';
|
|
7
7
|
export default function Render(props) {
|
|
8
|
-
const { account, depositMaxCent, unfinishedPayId, onDepositPayId, depositOpen, depositMinCent, ufOpen, depPrice, depositChannel, depositMeta, depositing } = props.data;
|
|
8
|
+
const { account, depositMaxCent, unfinishedPayId, onDepositPayId, depositOpen, depositMinCent, ufOpen, depPrice, depositChannel, depositMeta, depositing, onWithdraw, } = props.data;
|
|
9
9
|
const { t, createDepositPay, setMessage, setDepositOpen, setUfOpen, setDepPrice, setDepositChannel, setDepositMeta, setDepositing, onDepositClick, onDepositModalClose, onUfModalClose } = props.methods;
|
|
10
10
|
if (account) {
|
|
11
11
|
const { total, avail, '#oakLegalActions': legalActions, accountOper$account: opers } = account;
|
|
@@ -40,10 +40,7 @@ export default function Render(props) {
|
|
|
40
40
|
</Button>
|
|
41
41
|
</div>}
|
|
42
42
|
{legalActions?.includes('withdraw') && <div className={Styles.item}>
|
|
43
|
-
<Button block onClick={() =>
|
|
44
|
-
type: 'warning',
|
|
45
|
-
content: '尚未实现'
|
|
46
|
-
})}>
|
|
43
|
+
<Button block onClick={() => onWithdraw()}>
|
|
47
44
|
{t('account:action.withdraw')}
|
|
48
45
|
</Button>
|
|
49
46
|
</div>}
|
|
@@ -7,6 +7,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
|
|
|
7
7
|
depositMinCent: number;
|
|
8
8
|
unfinishedPayId?: string;
|
|
9
9
|
onDepositPayId: (payId: string) => void;
|
|
10
|
+
onWithdraw: () => void;
|
|
10
11
|
depositOpen: boolean;
|
|
11
12
|
ufOpen: boolean;
|
|
12
13
|
depPrice: number | null;
|
|
@@ -7,7 +7,7 @@ import AccountDeposit from '../deposit';
|
|
|
7
7
|
import AccountOperList from '../../accountOper/pure/List.pc';
|
|
8
8
|
import { AccountBookOutlined, ScheduleOutlined } from '@ant-design/icons';
|
|
9
9
|
export default function Render(props) {
|
|
10
|
-
const { account, depositMaxCent, unfinishedPayId, onDepositPayId, depositOpen, depositMinCent, ufOpen, depPrice, depositChannel, depositMeta, depositing } = props.data;
|
|
10
|
+
const { account, depositMaxCent, unfinishedPayId, onDepositPayId, depositOpen, depositMinCent, ufOpen, depPrice, depositChannel, depositMeta, depositing, onWithdraw, } = props.data;
|
|
11
11
|
const { t, createDepositPay, setMessage, setDepositOpen, setUfOpen, setDepPrice, setDepositChannel, setDepositMeta, setDepositing, onDepositClick, onDepositModalClose, } = props.methods;
|
|
12
12
|
if (account) {
|
|
13
13
|
const { total, avail, '#oakLegalActions': legalActions, accountOper$account: opers } = account;
|
|
@@ -16,10 +16,7 @@ export default function Render(props) {
|
|
|
16
16
|
{legalActions?.includes('deposit') && <Button type="primary" disabled={ufOpen || depositOpen} onClick={() => onDepositClick()}>
|
|
17
17
|
{t('account:action.deposit')}
|
|
18
18
|
</Button>}
|
|
19
|
-
{legalActions?.includes('withdraw') && <Button onClick={() =>
|
|
20
|
-
type: 'warning',
|
|
21
|
-
content: '尚未实现'
|
|
22
|
-
})}>
|
|
19
|
+
{legalActions?.includes('withdraw') && <Button onClick={() => onWithdraw()}>
|
|
23
20
|
{t('account:action.withdraw')}
|
|
24
21
|
</Button>}
|
|
25
22
|
</Flex>}>
|
|
@@ -11,7 +11,7 @@ export default function Render(props) {
|
|
|
11
11
|
const [spId, setSpId] = useState('');
|
|
12
12
|
if (pays) {
|
|
13
13
|
const spRow = (spId && pays.find(ele => ele.id === spId));
|
|
14
|
-
return (<>
|
|
14
|
+
return (<>
|
|
15
15
|
<ListPro data={pays} entity="pay" attributes={[
|
|
16
16
|
{
|
|
17
17
|
path: 'price',
|
|
@@ -30,8 +30,8 @@ export default function Render(props) {
|
|
|
30
30
|
span: 1,
|
|
31
31
|
render(row) {
|
|
32
32
|
const { orderId } = row;
|
|
33
|
-
return (<Tag bordered={false} color={orderId ? 'processing' : 'success'}>
|
|
34
|
-
{orderId ? t('source.order') : t('source.deposit')}
|
|
33
|
+
return (<Tag bordered={false} color={orderId ? 'processing' : 'success'}>
|
|
34
|
+
{orderId ? t('source.order') : t('source.deposit')}
|
|
35
35
|
</Tag>);
|
|
36
36
|
}
|
|
37
37
|
},
|
|
@@ -86,31 +86,33 @@ export default function Render(props) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
updateItem({
|
|
89
|
+
updateItem({
|
|
90
|
+
paid:row.price,
|
|
91
|
+
}, row.id, 'succeedPaying');
|
|
90
92
|
setSpId(row.id);
|
|
91
93
|
}
|
|
92
94
|
}
|
|
93
|
-
}}/>
|
|
95
|
+
}}/>
|
|
94
96
|
<Modal title={t('csp.title')} width={600} open={!!spId} footer={null} onCancel={() => {
|
|
95
97
|
clean();
|
|
96
98
|
setSpId('');
|
|
97
|
-
}}>
|
|
98
|
-
<div className={Styles.spCon}>
|
|
99
|
-
<Alert type="warning" message={t('csp.tips')}/>
|
|
100
|
-
<Divider style={{ width: '80%', alignSelf: 'flex-end' }}/>
|
|
99
|
+
}}>
|
|
100
|
+
<div className={Styles.spCon}>
|
|
101
|
+
<Alert type="warning" message={t('csp.tips')}/>
|
|
102
|
+
<Divider style={{ width: '80%', alignSelf: 'flex-end' }}/>
|
|
101
103
|
<RenderOffline pay={spRow} t={t} offline={offlineConfig} metaUpdatable={true} updateMeta={(meta) => {
|
|
102
104
|
updateItem({ meta }, spRow.id, 'succeedPaying');
|
|
103
|
-
}}/>
|
|
104
|
-
<div className={Styles.btn}>
|
|
105
|
+
}}/>
|
|
106
|
+
<div className={Styles.btn}>
|
|
105
107
|
<Button type="primary" onClick={async () => {
|
|
106
108
|
await execute();
|
|
107
109
|
setSpId('');
|
|
108
|
-
}}>
|
|
109
|
-
{t('common::confirm')}
|
|
110
|
-
</Button>
|
|
111
|
-
</div>
|
|
112
|
-
</div>
|
|
113
|
-
</Modal>
|
|
110
|
+
}}>
|
|
111
|
+
{t('common::confirm')}
|
|
112
|
+
</Button>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</Modal>
|
|
114
116
|
</>);
|
|
115
117
|
}
|
|
116
118
|
return null;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.spCon {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: center;
|
|
5
|
-
padding: 18px;
|
|
6
|
-
|
|
7
|
-
.btn {
|
|
8
|
-
margin-top: 13px;
|
|
9
|
-
align-self: flex-end;
|
|
10
|
-
}
|
|
1
|
+
.spCon {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding: 18px;
|
|
6
|
+
|
|
7
|
+
.btn {
|
|
8
|
+
margin-top: 13px;
|
|
9
|
+
align-self: flex-end;
|
|
10
|
+
}
|
|
11
11
|
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
background: var(--oak-bg-color-container);
|
|
3
|
-
padding: 8px;
|
|
4
|
-
height: 100%;
|
|
5
|
-
|
|
6
|
-
// .tabLabel {
|
|
7
|
-
// writing-mode: vertical-rl;
|
|
8
|
-
// letter-spacing: .2rem;
|
|
9
|
-
// }
|
|
10
|
-
.systemLabel {
|
|
11
|
-
font-weight: bolder;
|
|
12
|
-
}
|
|
13
|
-
.padding {
|
|
14
|
-
height: 10px;
|
|
15
|
-
font-size: small;
|
|
16
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
background: var(--oak-bg-color-container);
|
|
3
|
+
padding: 8px;
|
|
4
|
+
height: 100%;
|
|
5
|
+
|
|
6
|
+
// .tabLabel {
|
|
7
|
+
// writing-mode: vertical-rl;
|
|
8
|
+
// letter-spacing: .2rem;
|
|
9
|
+
// }
|
|
10
|
+
.systemLabel {
|
|
11
|
+
font-weight: bolder;
|
|
12
|
+
}
|
|
13
|
+
.padding {
|
|
14
|
+
height: 10px;
|
|
15
|
+
font-size: small;
|
|
16
|
+
}
|
|
17
17
|
}
|
|
@@ -36,41 +36,41 @@ export default function Offline(props) {
|
|
|
36
36
|
setOption('');
|
|
37
37
|
setInputVisible(false);
|
|
38
38
|
};
|
|
39
|
-
return (<div className={Styles.container}>
|
|
40
|
-
<Alert type='info' message={t('tips')}/>
|
|
41
|
-
<Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} layout="horizontal" style={{ minWidth: 600, marginTop: 22 }}>
|
|
42
|
-
<Form.Item label={t('tips2')}>
|
|
39
|
+
return (<div className={Styles.container}>
|
|
40
|
+
<Alert type='info' message={t('tips')}/>
|
|
41
|
+
<Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} layout="horizontal" style={{ minWidth: 600, marginTop: 22 }}>
|
|
42
|
+
<Form.Item label={t('tips2')}>
|
|
43
43
|
<Input.TextArea rows={4} value={tips} placeholder={t('tipsHolder')} onChange={({ currentTarget }) => {
|
|
44
44
|
update({
|
|
45
45
|
...config,
|
|
46
46
|
tips: currentTarget.value,
|
|
47
47
|
});
|
|
48
|
-
}}/>
|
|
49
|
-
</Form.Item>
|
|
50
|
-
<Form.Item label={t('options')}>
|
|
51
|
-
<Flex gap="4px 0" wrap="wrap">
|
|
48
|
+
}}/>
|
|
49
|
+
</Form.Item>
|
|
50
|
+
<Form.Item label={t('options')}>
|
|
51
|
+
<Flex gap="4px 0" wrap="wrap">
|
|
52
52
|
{options.map((option, idx) => <Tag bordered={false} closable key={idx} onClose={() => {
|
|
53
53
|
options.splice(idx, 1);
|
|
54
54
|
update({
|
|
55
55
|
...config,
|
|
56
56
|
options,
|
|
57
57
|
});
|
|
58
|
-
}}>
|
|
59
|
-
{option}
|
|
60
|
-
</Tag>)}
|
|
61
|
-
{inputVisible ? (<Input ref={inputRef} type="text" size="small" style={tagInputStyle} value={option} onChange={({ currentTarget }) => setOption(currentTarget.value)} onBlur={handleOptionCreated} onPressEnter={handleOptionCreated}/>) : (<Tag style={tagPlusStyle} icon={<PlusOutlined />} onClick={() => setInputVisible(true)}>
|
|
62
|
-
{t('newOption')}
|
|
63
|
-
</Tag>)}
|
|
64
|
-
</Flex>
|
|
65
|
-
</Form.Item>
|
|
66
|
-
<Form.Item label={t('allowUser')}>
|
|
58
|
+
}}>
|
|
59
|
+
{option}
|
|
60
|
+
</Tag>)}
|
|
61
|
+
{inputVisible ? (<Input ref={inputRef} type="text" size="small" style={tagInputStyle} value={option} onChange={({ currentTarget }) => setOption(currentTarget.value)} onBlur={handleOptionCreated} onPressEnter={handleOptionCreated}/>) : (<Tag style={tagPlusStyle} icon={<PlusOutlined />} onClick={() => setInputVisible(true)}>
|
|
62
|
+
{t('newOption')}
|
|
63
|
+
</Tag>)}
|
|
64
|
+
</Flex>
|
|
65
|
+
</Form.Item>
|
|
66
|
+
<Form.Item label={t('allowUser')}>
|
|
67
67
|
<Switch value={allowUser} onChange={(v) => {
|
|
68
68
|
update({
|
|
69
69
|
...config,
|
|
70
70
|
allowUser: v,
|
|
71
71
|
});
|
|
72
|
-
}}/>
|
|
73
|
-
</Form.Item>
|
|
74
|
-
</Form>
|
|
72
|
+
}}/>
|
|
73
|
+
</Form.Item>
|
|
74
|
+
</Form>
|
|
75
75
|
</div>);
|
|
76
76
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Form, Input, InputNumber } from 'antd';
|
|
2
|
+
import { Form, Input, InputNumber, Radio } from 'antd';
|
|
3
3
|
export default function WechatPay(props) {
|
|
4
4
|
const { config, update, t, extra: { serverUrl } } = props;
|
|
5
5
|
return (<Form labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} layout="horizontal" style={{ minWidth: 600 }}>
|
|
@@ -45,5 +45,28 @@ export default function WechatPay(props) {
|
|
|
45
45
|
update(config);
|
|
46
46
|
}}/>
|
|
47
47
|
</Form.Item>
|
|
48
|
+
<Form.Item label={t('label.refundGapDays')} help={t('placeholder.refundGapDays')}>
|
|
49
|
+
<InputNumber value={config.refundGapDays} max={365} min={7} addonAfter={"天"} step={1} onChange={(value) => {
|
|
50
|
+
config.refundGapDays = value;
|
|
51
|
+
update(config);
|
|
52
|
+
}}/>
|
|
53
|
+
</Form.Item>
|
|
54
|
+
<Form.Item label={t('label.refundLossRatio')} help={t('placeholder.refundLossRatio')}>
|
|
55
|
+
<InputNumber value={config.refundLossRatio} max={5} min={0.01} addonAfter={"%"} step={0.01} precision={2} onChange={(value) => {
|
|
56
|
+
config.refundLossRatio = value;
|
|
57
|
+
update(config);
|
|
58
|
+
}}/>
|
|
59
|
+
</Form.Item>
|
|
60
|
+
<Form.Item label={t('label.refundLossFloor')} help={t('placeholder.refundLossFloor')}>
|
|
61
|
+
<Radio.Group onChange={({ target }) => {
|
|
62
|
+
const { value } = target;
|
|
63
|
+
config.refundLossFloor = value;
|
|
64
|
+
update(config);
|
|
65
|
+
}} value={config.refundLossFloor}>
|
|
66
|
+
<Radio value={1}>分</Radio>
|
|
67
|
+
<Radio value={2}>角</Radio>
|
|
68
|
+
<Radio value={3}>元</Radio>
|
|
69
|
+
</Radio.Group>
|
|
70
|
+
</Form.Item>
|
|
48
71
|
</Form>);
|
|
49
72
|
}
|
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
"payNotifyUrl": "支付回调URL",
|
|
6
6
|
"refundNotifyUrl": "退款回调URL",
|
|
7
7
|
"lossRatio": "手续费比例",
|
|
8
|
-
"apiV3Key": "apiV3Key"
|
|
8
|
+
"apiV3Key": "apiV3Key",
|
|
9
|
+
"refundGapDays": "退款限制天数",
|
|
10
|
+
"refundLossRatio": "退款损耗百分比",
|
|
11
|
+
"refundLossFloor": "退款取整位数"
|
|
9
12
|
},
|
|
10
13
|
"placeholder": {
|
|
11
14
|
"privateKeyFilePath": "服务器上存放apiclient_key.pem的路径,注意访问权限",
|
|
@@ -13,6 +16,9 @@
|
|
|
13
16
|
"lossRatio": "填百分比(0.6就代表千分之六)",
|
|
14
17
|
"payNotifyUrl": "endpoint",
|
|
15
18
|
"refundNotifyUrl": "endpoint",
|
|
16
|
-
"apiV3Key": "需要登录商户后台获取"
|
|
19
|
+
"apiV3Key": "需要登录商户后台获取",
|
|
20
|
+
"refundGapDays": "超过这个天数后无法退款",
|
|
21
|
+
"refundLossRatio": "退款时将按这个百分比扣除损耗(0.6就代表千分之六)",
|
|
22
|
+
"refundLossFloor": "退款时按位向下取整(如按元取整,则忽略角位和分位)"
|
|
17
23
|
}
|
|
18
24
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EntityDict } from "../../../oak-app-domain";
|
|
2
|
+
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, boolean, {
|
|
3
|
+
accountId: string;
|
|
4
|
+
withdrawAccountFilter: import("../../../oak-app-domain/WithdrawAccount/Schema").Filter | undefined;
|
|
5
|
+
onNewWithdrawAccount: () => void;
|
|
6
|
+
onCreateWithdraw: (id: string) => void;
|
|
7
|
+
}>) => React.ReactElement;
|
|
8
|
+
export default _default;
|