oak-pay-business 3.0.4 → 3.1.1
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/checkers/wpProduct.js +2 -2
- package/es/components/AbstractComponents.d.ts +11 -62
- package/es/components/accountOper/pure/List.pc.d.ts +0 -1
- package/es/components/aliPay/upsert/index.d.ts +5 -0
- package/es/components/aliPay/upsert/index.js +44 -0
- package/es/components/aliPay/upsert/index.json +1 -0
- package/es/components/aliPay/upsert/locales/zh-CN.json +7 -0
- package/es/components/aliPay/upsert/web.pc.d.ts +7 -0
- package/es/components/aliPay/upsert/web.pc.js +29 -0
- package/es/components/aliPay/upsert/web.pc.module.less +3 -0
- package/es/components/apAccount/config/index.d.ts +4 -0
- package/es/components/apAccount/config/index.js +60 -0
- package/es/components/apAccount/config/index.json +1 -0
- package/es/components/apAccount/config/locales/zh-CN.json +7 -0
- package/es/components/apAccount/config/web.pc.d.ts +17 -0
- package/es/components/apAccount/config/web.pc.js +118 -0
- package/es/components/apAccount/config/web.pc.module.less +55 -0
- package/es/components/apAccount/upsert/index.d.ts +4 -0
- package/es/components/apAccount/upsert/index.js +93 -0
- package/es/components/apAccount/upsert/index.json +1 -0
- package/es/components/apAccount/upsert/locales/zh-CN.json +25 -0
- package/es/components/apAccount/upsert/web.pc.d.ts +8 -0
- package/es/components/apAccount/upsert/web.pc.js +139 -0
- package/es/components/apAccount/upsert/web.pc.module.less +4 -0
- package/es/components/apProduct/config/index.d.ts +5 -0
- package/es/components/apProduct/config/index.js +60 -0
- package/es/components/apProduct/config/index.json +1 -0
- package/es/components/apProduct/config/locales/zh-CN.json +7 -0
- package/es/components/apProduct/config/web.pc.d.ts +11 -0
- package/es/components/apProduct/config/web.pc.js +98 -0
- package/es/components/apProduct/config/web.pc.module.less +62 -0
- package/es/components/apProduct/upsert/index.d.ts +5 -0
- package/es/components/apProduct/upsert/index.js +67 -0
- package/es/components/apProduct/upsert/index.json +1 -0
- package/es/components/apProduct/upsert/locales/zh-CN.json +34 -0
- package/es/components/apProduct/upsert/web.pc.d.ts +8 -0
- package/es/components/apProduct/upsert/web.pc.js +107 -0
- package/es/components/offlineAccount/upsert/index.d.ts +0 -1
- package/es/components/order/list/index.d.ts +0 -1
- package/es/components/order/pay/index.d.ts +1 -1
- package/es/components/order/pay/info.d.ts +0 -1
- package/es/components/pay/channelPicker2/web.d.ts +0 -1
- package/es/components/pay/channelPicker2/web.pc.d.ts +0 -1
- package/es/components/pay/list/index.d.ts +0 -1
- package/es/components/payConfig/system/index.d.ts +0 -1
- package/es/components/refund/list/index.d.ts +0 -1
- package/es/components/ship/system/index.d.ts +0 -1
- package/es/components/ship/wechatMpShip/upsert/index.d.ts +0 -1
- package/es/components/sysAccount/transferList/index.d.ts +0 -1
- package/es/components/withdraw/detail/index.d.ts +0 -1
- package/es/components/withdraw/display/web.d.ts +0 -1
- package/es/components/withdraw/display/web.pc.d.ts +0 -1
- package/es/components/withdrawTransfer/list/index.d.ts +0 -1
- package/es/components/wpAccount/config/index.js +11 -1
- package/es/components/wpAccount/upsert/index.js +1 -0
- package/es/components/wpProduct/config/index.js +4 -0
- package/es/data/i18n.js +115 -0
- package/es/entities/AliPay.d.ts +10 -0
- package/es/entities/AliPay.js +13 -0
- package/es/entities/ApAccount.d.ts +35 -0
- package/es/entities/ApAccount.js +89 -0
- package/es/entities/ApProduct.d.ts +19 -0
- package/es/entities/ApProduct.js +44 -0
- package/es/oak-app-domain/ActionDefDict.d.ts +1 -0
- package/es/oak-app-domain/ActionDefDict.js +2 -0
- package/es/oak-app-domain/AliPay/Schema.d.ts +19 -0
- package/es/oak-app-domain/AliPay/Schema.js +1 -0
- package/es/oak-app-domain/AliPay/Storage.d.ts +3 -0
- package/es/oak-app-domain/AliPay/Storage.js +25 -0
- package/es/oak-app-domain/AliPay/_baseSchema.d.ts +45 -0
- package/es/oak-app-domain/AliPay/_baseSchema.js +1 -0
- package/es/oak-app-domain/AliPay/locales/zh_CN.json +8 -0
- package/es/oak-app-domain/ApAccount/Action.d.ts +5 -0
- package/es/oak-app-domain/ApAccount/Action.js +2 -0
- package/es/oak-app-domain/ApAccount/Schema.d.ts +19 -0
- package/es/oak-app-domain/ApAccount/Schema.js +1 -0
- package/es/oak-app-domain/ApAccount/Storage.d.ts +3 -0
- package/es/oak-app-domain/ApAccount/Storage.js +132 -0
- package/es/oak-app-domain/ApAccount/Style.d.ts +3 -0
- package/es/oak-app-domain/ApAccount/Style.js +26 -0
- package/es/oak-app-domain/ApAccount/_baseSchema.d.ts +141 -0
- package/es/oak-app-domain/ApAccount/_baseSchema.js +1 -0
- package/es/oak-app-domain/ApAccount/locales/zh_CN.json +58 -0
- package/es/oak-app-domain/ApProduct/Schema.d.ts +19 -0
- package/es/oak-app-domain/ApProduct/Schema.js +1 -0
- package/es/oak-app-domain/ApProduct/Storage.d.ts +3 -0
- package/es/oak-app-domain/ApProduct/Storage.js +53 -0
- package/es/oak-app-domain/ApProduct/Style.d.ts +3 -0
- package/es/oak-app-domain/ApProduct/Style.js +13 -0
- package/es/oak-app-domain/ApProduct/_baseSchema.d.ts +75 -0
- package/es/oak-app-domain/ApProduct/_baseSchema.js +1 -0
- package/es/oak-app-domain/ApProduct/locales/zh_CN.json +26 -0
- package/es/oak-app-domain/Application/_baseSchema.d.ts +4 -2
- package/es/oak-app-domain/EntityDict.d.ts +235 -0
- package/es/oak-app-domain/Pay/Storage.js +1 -1
- package/es/oak-app-domain/Pay/_baseSchema.d.ts +2 -2
- package/es/oak-app-domain/Storage.js +6 -0
- package/es/oak-app-domain/StyleDict.js +4 -0
- package/es/oak-app-domain/SysAccountOper/Storage.js +1 -1
- package/es/oak-app-domain/SysAccountOper/_baseSchema.d.ts +2 -2
- package/es/oak-app-domain/WithdrawChannel/Storage.js +1 -1
- package/es/oak-app-domain/WithdrawChannel/_baseSchema.d.ts +2 -2
- package/es/timers/index.d.ts +1 -1
- package/es/triggers/order.js +2 -2
- package/es/triggers/withdraw.d.ts +1 -1
- package/es/utils/apProduct.d.ts +2 -0
- package/es/utils/apProduct.js +25 -0
- package/es/utils/pay.d.ts +0 -1
- package/es/utils/pay.js +5 -0
- package/es/utils/payClazz/AliPay/AliPay.d.ts +50 -0
- package/es/utils/payClazz/AliPay/AliPay.debug.d.ts +39 -0
- package/es/utils/payClazz/AliPay/AliPay.debug.js +157 -0
- package/es/utils/payClazz/AliPay/AliPay.js +366 -0
- package/es/utils/payClazz/AliPay/index.d.ts +3 -0
- package/es/utils/payClazz/AliPay/index.js +3 -0
- package/es/utils/payClazz/WechatPay/WechatPay.js +2 -2
- package/es/utils/payClazz/index.js +3 -3
- package/lib/aspects/ship.js +2 -3
- package/lib/aspects/withdraw.js +1 -2
- package/lib/checkers/abstractChecker.js +2 -2
- package/lib/checkers/wpProduct.js +2 -2
- package/lib/data/i18n.js +115 -0
- package/lib/entities/AliPay.d.ts +10 -0
- package/lib/entities/AliPay.js +16 -0
- package/lib/entities/ApAccount.d.ts +35 -0
- package/lib/entities/ApAccount.js +92 -0
- package/lib/entities/ApProduct.d.ts +19 -0
- package/lib/entities/ApProduct.js +47 -0
- package/lib/features/index.js +2 -3
- package/lib/hooks/useFeatures.js +1 -1
- package/lib/oak-app-domain/ActionDefDict.d.ts +1 -0
- package/lib/oak-app-domain/ActionDefDict.js +28 -26
- package/lib/oak-app-domain/AliPay/Schema.d.ts +19 -0
- package/lib/oak-app-domain/AliPay/Schema.js +4 -0
- package/lib/oak-app-domain/AliPay/Storage.d.ts +3 -0
- package/lib/oak-app-domain/AliPay/Storage.js +28 -0
- package/lib/oak-app-domain/AliPay/_baseSchema.d.ts +45 -0
- package/lib/oak-app-domain/AliPay/_baseSchema.js +2 -0
- package/lib/oak-app-domain/AliPay/locales/zh_CN.json +8 -0
- package/lib/oak-app-domain/ApAccount/Action.d.ts +5 -0
- package/lib/oak-app-domain/ApAccount/Action.js +5 -0
- package/lib/oak-app-domain/ApAccount/Schema.d.ts +19 -0
- package/lib/oak-app-domain/ApAccount/Schema.js +4 -0
- package/lib/oak-app-domain/ApAccount/Storage.d.ts +3 -0
- package/lib/oak-app-domain/ApAccount/Storage.js +135 -0
- package/lib/oak-app-domain/ApAccount/Style.d.ts +3 -0
- package/lib/oak-app-domain/ApAccount/Style.js +29 -0
- package/lib/oak-app-domain/ApAccount/_baseSchema.d.ts +141 -0
- package/lib/oak-app-domain/ApAccount/_baseSchema.js +2 -0
- package/lib/oak-app-domain/ApAccount/locales/zh_CN.json +58 -0
- package/lib/oak-app-domain/ApProduct/Schema.d.ts +19 -0
- package/lib/oak-app-domain/ApProduct/Schema.js +4 -0
- package/lib/oak-app-domain/ApProduct/Storage.d.ts +3 -0
- package/lib/oak-app-domain/ApProduct/Storage.js +56 -0
- package/lib/oak-app-domain/ApProduct/Style.d.ts +3 -0
- package/lib/oak-app-domain/ApProduct/Style.js +16 -0
- package/lib/oak-app-domain/ApProduct/_baseSchema.d.ts +75 -0
- package/lib/oak-app-domain/ApProduct/_baseSchema.js +2 -0
- package/lib/oak-app-domain/ApProduct/locales/zh_CN.json +26 -0
- package/lib/oak-app-domain/Application/_baseSchema.d.ts +4 -2
- package/lib/oak-app-domain/EntityDict.d.ts +235 -0
- package/lib/oak-app-domain/Pay/Storage.js +1 -1
- package/lib/oak-app-domain/Pay/_baseSchema.d.ts +2 -2
- package/lib/oak-app-domain/Storage.js +48 -42
- package/lib/oak-app-domain/StyleDict.js +34 -30
- package/lib/oak-app-domain/SysAccountOper/Storage.js +1 -1
- package/lib/oak-app-domain/SysAccountOper/_baseSchema.d.ts +2 -2
- package/lib/oak-app-domain/WithdrawChannel/Storage.js +1 -1
- package/lib/oak-app-domain/WithdrawChannel/_baseSchema.d.ts +2 -2
- package/lib/timers/index.d.ts +1 -1
- package/lib/triggers/order.js +2 -2
- package/lib/triggers/withdraw.d.ts +1 -1
- package/lib/triggers/withdraw.js +1 -2
- package/lib/types/DependentExceptions.js +1 -1
- package/lib/utils/apProduct.d.ts +2 -0
- package/lib/utils/apProduct.js +28 -0
- package/lib/utils/application.js +2 -2
- package/lib/utils/pay.d.ts +0 -1
- package/lib/utils/pay.js +9 -4
- package/lib/utils/payClazz/AliPay/AliPay.d.ts +50 -0
- package/lib/utils/payClazz/AliPay/AliPay.debug.d.ts +39 -0
- package/lib/utils/payClazz/AliPay/AliPay.debug.js +162 -0
- package/lib/utils/payClazz/AliPay/AliPay.js +370 -0
- package/lib/utils/payClazz/AliPay/index.d.ts +3 -0
- package/lib/utils/payClazz/AliPay/index.js +6 -0
- package/lib/utils/payClazz/WechatPay/WechatPay.js +2 -2
- package/lib/utils/payClazz/index.js +6 -7
- package/lib/utils/ship.js +7 -7
- package/lib/utils/shipClazz/index.js +3 -4
- package/lib/utils/wpProduct.js +1 -2
- package/lib/utils/wpProductFrontend.js +2 -3
- package/package.json +6 -5
- package/src/entities/AliPay.ts +31 -0
- package/src/entities/ApAccount.ts +134 -0
- package/src/entities/ApProduct.ts +75 -0
package/es/checkers/wpProduct.js
CHANGED
|
@@ -83,8 +83,8 @@ const checkers = [
|
|
|
83
83
|
}
|
|
84
84
|
switch (type) {
|
|
85
85
|
case 'web': {
|
|
86
|
-
const {
|
|
87
|
-
if (!
|
|
86
|
+
const { wechatPay } = config;
|
|
87
|
+
if (!wechatPay?.appId) {
|
|
88
88
|
throw new OakInputIllegalException('wpProduct', ['applicationId'], 'error::wpProduct.NoWechatInfoOnApp', 'oak-pay-business');
|
|
89
89
|
}
|
|
90
90
|
break;
|
|
@@ -4,66 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { EntityDict } from '../oak-app-domain';
|
|
7
|
-
import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
data: RowWithActions<EntityDict, T>[];
|
|
19
|
-
loading: boolean;
|
|
20
|
-
tablePagination?: React.ReactNode;
|
|
21
|
-
rowSelection?: any;
|
|
22
|
-
hideHeader?: boolean | undefined;
|
|
23
|
-
disableSerialNumber?: boolean | undefined;
|
|
24
|
-
size?: "small" | "middle" | "large" | undefined;
|
|
25
|
-
scroll?: any;
|
|
26
|
-
empty?: React.ReactNode;
|
|
27
|
-
opWidth?: number | undefined;
|
|
28
|
-
ellipsis?: boolean | undefined;
|
|
29
|
-
}>) => React.ReactElement;
|
|
30
|
-
declare const ListPro: <T extends keyof EntityDict>(props: {
|
|
31
|
-
title?: any;
|
|
32
|
-
extraContent?: any;
|
|
33
|
-
hideDefaultButtons?: boolean | undefined;
|
|
34
|
-
buttonGroup?: ListButtonProps[] | undefined;
|
|
35
|
-
onReload?: (() => void) | undefined;
|
|
36
|
-
entity: T;
|
|
37
|
-
extraActions?: OakExtraActionProps[] | ((row: RowWithActions<EntityDict, T>) => OakExtraActionProps[]) | undefined;
|
|
38
|
-
onAction?: onActionFnDef | undefined;
|
|
39
|
-
disabledOp?: boolean | undefined;
|
|
40
|
-
attributes: OakAbsAttrDef[];
|
|
41
|
-
data: RowWithActions<EntityDict, T>[];
|
|
42
|
-
loading?: boolean | undefined;
|
|
43
|
-
tablePagination?: any;
|
|
44
|
-
rowSelection?: any;
|
|
45
|
-
disableSerialNumber?: boolean | undefined;
|
|
46
|
-
size?: "small" | "middle" | "large" | undefined;
|
|
47
|
-
scroll?: any;
|
|
48
|
-
empty?: any;
|
|
49
|
-
opWidth?: number | undefined;
|
|
50
|
-
oakPath?: string | undefined;
|
|
51
|
-
}) => React.ReactElement;
|
|
52
|
-
declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
53
|
-
column?: number | Record<Breakpoint, number> | undefined;
|
|
54
|
-
entity: T;
|
|
55
|
-
attributes: OakAbsAttrDef[];
|
|
56
|
-
data: Partial<EntityDict[T]["Schema"]>;
|
|
57
|
-
title?: string | undefined;
|
|
58
|
-
bordered?: boolean | undefined;
|
|
59
|
-
layout?: "horizontal" | "vertical" | undefined;
|
|
60
|
-
}>) => React.ReactElement;
|
|
61
|
-
declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
62
|
-
helps: Record<string, string>;
|
|
63
|
-
entity: T;
|
|
64
|
-
attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[];
|
|
65
|
-
data: EntityDict[T]["Schema"];
|
|
66
|
-
layout: "horizontal" | "vertical";
|
|
67
|
-
mode: "default" | "card";
|
|
68
|
-
}>) => React.ReactElement;
|
|
7
|
+
import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef } from 'oak-frontend-base';
|
|
8
|
+
import AbsFilterPanel from 'oak-frontend-base/es/components/filterPanel';
|
|
9
|
+
import AbsList from 'oak-frontend-base/es/components/list';
|
|
10
|
+
import AbsListPro from 'oak-frontend-base/es/components/listPro';
|
|
11
|
+
import AbsDetail from 'oak-frontend-base/es/components/detail';
|
|
12
|
+
import AbsUpsert from 'oak-frontend-base/es/components/upsert';
|
|
13
|
+
declare const FilterPanel: <T extends keyof EntityDict>(...props: Parameters<typeof AbsFilterPanel<EntityDict, T>>) => React.ReactElement;
|
|
14
|
+
declare const List: <T extends keyof EntityDict>(...props: Parameters<typeof AbsList<EntityDict, T>>) => React.ReactElement;
|
|
15
|
+
declare const ListPro: <T extends keyof EntityDict>(...props: Parameters<typeof AbsListPro<EntityDict, T>>) => React.ReactElement;
|
|
16
|
+
declare const Detail: <T extends keyof EntityDict>(...props: Parameters<typeof AbsDetail<EntityDict, T>>) => React.ReactElement;
|
|
17
|
+
declare const Upsert: <T extends keyof EntityDict>(...props: Parameters<typeof AbsUpsert<EntityDict, T>>) => React.ReactElement;
|
|
69
18
|
export { FilterPanel, List, ListPro, Detail, Upsert, ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { composeServerUrl } from "oak-general-business/es/utils/domain";
|
|
2
|
+
export default OakComponent({
|
|
3
|
+
entity: 'aliPay',
|
|
4
|
+
projection: {
|
|
5
|
+
id: 1,
|
|
6
|
+
refundNotifyUrl: 1,
|
|
7
|
+
payNotifyUrl: 1,
|
|
8
|
+
system: {
|
|
9
|
+
id: 1,
|
|
10
|
+
domain$system: {
|
|
11
|
+
$entity: 'domain',
|
|
12
|
+
data: {
|
|
13
|
+
id: 1,
|
|
14
|
+
protocol: 1,
|
|
15
|
+
url: 1,
|
|
16
|
+
apiPath: 1,
|
|
17
|
+
port: 1,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
isList: false,
|
|
23
|
+
formData({ data }) {
|
|
24
|
+
const domain = data && data.system?.domain$system?.[0];
|
|
25
|
+
const serverUrl = domain && composeServerUrl(domain);
|
|
26
|
+
return {
|
|
27
|
+
aliPay: data,
|
|
28
|
+
serverUrl,
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
properties: {
|
|
32
|
+
systemId: '',
|
|
33
|
+
},
|
|
34
|
+
lifetimes: {
|
|
35
|
+
ready() {
|
|
36
|
+
const { systemId } = this.props;
|
|
37
|
+
if (this.isCreation()) {
|
|
38
|
+
this.update({
|
|
39
|
+
systemId,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EntityDict } from "../../../oak-app-domain";
|
|
3
|
+
import { RowWithActions, WebComponentProps } from "oak-frontend-base";
|
|
4
|
+
export default function render(props: WebComponentProps<EntityDict, 'aliPay', false, {
|
|
5
|
+
aliPay?: (RowWithActions<EntityDict, 'aliPay'>);
|
|
6
|
+
serverUrl: string;
|
|
7
|
+
}>): React.JSX.Element | null;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Form, Input } from 'antd';
|
|
3
|
+
export default function render(props) {
|
|
4
|
+
const { aliPay, serverUrl } = props.data;
|
|
5
|
+
const { t, update } = props.methods;
|
|
6
|
+
if (aliPay) {
|
|
7
|
+
return (<>
|
|
8
|
+
<Form.Item label={t('aliPay:attr.payNotifyUrl')}>
|
|
9
|
+
<Input prefix={`${serverUrl}/endpoint`} suffix='/${payId}' value={aliPay.payNotifyUrl} placeholder={t('placeholder.payNotifyUrl')} onChange={({ currentTarget }) => {
|
|
10
|
+
const payNotifyUrl = currentTarget.value;
|
|
11
|
+
update({ payNotifyUrl });
|
|
12
|
+
}}/>
|
|
13
|
+
</Form.Item>
|
|
14
|
+
{/* <Form.Item label={t('aliPay:attr.refundNotifyUrl')}>
|
|
15
|
+
<Input
|
|
16
|
+
prefix={`${serverUrl}/endpoint`}
|
|
17
|
+
suffix='/${refundId}'
|
|
18
|
+
value={aliPay.refundNotifyUrl}
|
|
19
|
+
placeholder={t('placeholder.refundNotifyUrl')}
|
|
20
|
+
onChange={({ currentTarget }) => {
|
|
21
|
+
const refundNotifyUrl = currentTarget.value;
|
|
22
|
+
update({ refundNotifyUrl });
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
</Form.Item> */}
|
|
26
|
+
</>);
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export default OakComponent({
|
|
2
|
+
entity: 'apAccount',
|
|
3
|
+
isList: true,
|
|
4
|
+
projection: {
|
|
5
|
+
id: 1,
|
|
6
|
+
price: 1,
|
|
7
|
+
mchId: 1,
|
|
8
|
+
appId: 1,
|
|
9
|
+
enabled: 1,
|
|
10
|
+
aliPayId: 1,
|
|
11
|
+
aliPay: {
|
|
12
|
+
id: 1,
|
|
13
|
+
payNotifyUrl: 1,
|
|
14
|
+
refundNotifyUrl: 1,
|
|
15
|
+
},
|
|
16
|
+
refundGapDays: 1,
|
|
17
|
+
taxLossRatio: 1,
|
|
18
|
+
publicKeyPath: 1,
|
|
19
|
+
privateKeyPath: 1,
|
|
20
|
+
refundCompensateRatio: 1,
|
|
21
|
+
allowWithdrawTransfer: 1,
|
|
22
|
+
withdrawTransferLossRatio: 1,
|
|
23
|
+
needReceiving: 1,
|
|
24
|
+
encryptKey: 1,
|
|
25
|
+
alipayRootCertPath: 1,
|
|
26
|
+
alipayPublicCertPath: 1,
|
|
27
|
+
appCertPath: 1,
|
|
28
|
+
mode: 1,
|
|
29
|
+
gateway: 1,
|
|
30
|
+
endpoint: 1,
|
|
31
|
+
callbackUrl: 1,
|
|
32
|
+
wsServiceUrl: 1,
|
|
33
|
+
setting: 1,
|
|
34
|
+
keyType: 1,
|
|
35
|
+
timeout: 1,
|
|
36
|
+
needEncrypt: 1,
|
|
37
|
+
systemId: 1,
|
|
38
|
+
},
|
|
39
|
+
properties: {
|
|
40
|
+
systemId: '',
|
|
41
|
+
},
|
|
42
|
+
filters: [
|
|
43
|
+
{
|
|
44
|
+
filter() {
|
|
45
|
+
const { systemId } = this.props;
|
|
46
|
+
return {
|
|
47
|
+
systemId,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
formData({ data, legalActions }) {
|
|
53
|
+
return {
|
|
54
|
+
accounts: data,
|
|
55
|
+
canCreate: legalActions?.includes('create') && !data?.find(ele => ele.enabled),
|
|
56
|
+
oakExecutable: this.tryExecute(),
|
|
57
|
+
};
|
|
58
|
+
},
|
|
59
|
+
actions: ['create', 'update', 'remove'],
|
|
60
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EntityDict } from "../../../oak-app-domain";
|
|
3
|
+
import { RowWithActions, WebComponentProps } from "oak-frontend-base";
|
|
4
|
+
import { OakException } from 'oak-domain/lib/types';
|
|
5
|
+
export declare function ApAccount(props: {
|
|
6
|
+
data: RowWithActions<EntityDict, 'apAccount'>;
|
|
7
|
+
systemId: string;
|
|
8
|
+
t: (k: string, param?: any) => string;
|
|
9
|
+
onUpdate?: () => void;
|
|
10
|
+
onRemove?: () => void;
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
export default function render(props: WebComponentProps<EntityDict, 'apAccount', true, {
|
|
13
|
+
accounts?: (RowWithActions<EntityDict, 'apAccount'> & {})[];
|
|
14
|
+
systemId: string;
|
|
15
|
+
canCreate?: boolean;
|
|
16
|
+
oakExecutable: boolean | OakException<EntityDict>;
|
|
17
|
+
}>): React.JSX.Element;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Button, Modal, Alert, Descriptions, Tabs } from 'antd';
|
|
3
|
+
import { PlusCircleOutlined } from '@ant-design/icons';
|
|
4
|
+
import Styles from './web.pc.module.less';
|
|
5
|
+
import Upsert from '../upsert';
|
|
6
|
+
import ApProductConfig from '../../apProduct/config';
|
|
7
|
+
import { OakAttrNotNullException, OakException } from 'oak-domain/lib/types';
|
|
8
|
+
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
|
9
|
+
import { ToYuan } from 'oak-domain/lib/utils/money';
|
|
10
|
+
export function ApAccount(props) {
|
|
11
|
+
const { data: account, t, onUpdate, onRemove, systemId } = props;
|
|
12
|
+
const { refundGapDays, mchId, enabled, price, taxLossRatio, refundCompensateRatio, allowWithdrawTransfer, withdrawTransferLossRatio, needReceiving, appId } = account;
|
|
13
|
+
const [activeKey, setActiveKey] = useState("1");
|
|
14
|
+
const D = (<Descriptions column={1} bordered title={t('apAccount:name')} size="small">
|
|
15
|
+
<Descriptions.Item label={t('apAccount:attr.appId')}>{appId}</Descriptions.Item>
|
|
16
|
+
<Descriptions.Item label={t('apAccount:attr.mchId')}>{mchId}</Descriptions.Item>
|
|
17
|
+
<Descriptions.Item label={t('apAccount:attr.price')}>{ToYuan(price)}{t('common::pay.scale')}</Descriptions.Item>
|
|
18
|
+
<Descriptions.Item label={t('apAccount:attr.taxLossRatio')}>{taxLossRatio}%</Descriptions.Item>
|
|
19
|
+
<Descriptions.Item label={t('apAccount:attr.refundCompensateRatio')}>{refundCompensateRatio}%</Descriptions.Item>
|
|
20
|
+
<Descriptions.Item label={t('apAccount:attr.refundGapDays')}>{refundGapDays}</Descriptions.Item>
|
|
21
|
+
<Descriptions.Item label={t('apAccount:attr.allowWithdrawTransfer')}>{t(`common::${!!allowWithdrawTransfer}`)}</Descriptions.Item>
|
|
22
|
+
<Descriptions.Item label={t('apAccount:attr.withdrawTransferLossRatio')}>{withdrawTransferLossRatio}%</Descriptions.Item>
|
|
23
|
+
<Descriptions.Item label={t('apAccount:attr.enabled')}>{t(`common::${enabled}`)}</Descriptions.Item>
|
|
24
|
+
</Descriptions>);
|
|
25
|
+
if (onUpdate) {
|
|
26
|
+
return (<Tabs activeKey={activeKey} onTabClick={(activeKey) => {
|
|
27
|
+
setActiveKey(activeKey);
|
|
28
|
+
}} tabBarExtraContent={activeKey === "1" && <>
|
|
29
|
+
{onUpdate && <Button style={{ marginRight: 4 }} size="small" onClick={() => onUpdate()}>
|
|
30
|
+
{t('common::action.update')}
|
|
31
|
+
</Button>}
|
|
32
|
+
{onRemove && <Button danger size="small" onClick={() => onRemove()}>
|
|
33
|
+
{t('common::action.remove')}
|
|
34
|
+
</Button>}
|
|
35
|
+
</>} style={{ width: 380, height: 520 }} items={[
|
|
36
|
+
{
|
|
37
|
+
key: '1',
|
|
38
|
+
label: t('common::action.detail'),
|
|
39
|
+
children: D,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: '2',
|
|
43
|
+
label: t('apProduct:name'),
|
|
44
|
+
children: (<ApProductConfig oakPath={`$$apProduct-${account.id}`} systemId={systemId} apAccountId={account.id}/>)
|
|
45
|
+
}
|
|
46
|
+
]}/>);
|
|
47
|
+
}
|
|
48
|
+
return D;
|
|
49
|
+
}
|
|
50
|
+
export default function render(props) {
|
|
51
|
+
const { accounts, oakFullpath, oakExecutable, canCreate, systemId } = props.data;
|
|
52
|
+
const { t, addItem, execute, clean } = props.methods;
|
|
53
|
+
const getNotNullMessage = (entity, attr) => {
|
|
54
|
+
return t('notnull', { value: t(`${entity}:attr.${attr}`) });
|
|
55
|
+
};
|
|
56
|
+
const errMsg = oakExecutable instanceof OakException && (oakExecutable instanceof OakAttrNotNullException ? getNotNullMessage(oakExecutable.getEntity(), oakExecutable.getAttributes()[0]) : t(oakExecutable.message));
|
|
57
|
+
const [upsertId, setUpsertId] = useState('');
|
|
58
|
+
const U = (<Modal width={920} destroyOnClose title={`${t('apAccount:name')}${t('common::action.add')}`} open={!!upsertId} onCancel={() => {
|
|
59
|
+
clean();
|
|
60
|
+
setUpsertId('');
|
|
61
|
+
}} closeIcon={null} onOk={async () => {
|
|
62
|
+
await execute();
|
|
63
|
+
setUpsertId('');
|
|
64
|
+
}} okButtonProps={{
|
|
65
|
+
disabled: oakExecutable !== true,
|
|
66
|
+
}} okText={t('common::confirm')} cancelText={(t('common::action.cancel'))}>
|
|
67
|
+
<div style={{ padding: 10 }}>
|
|
68
|
+
{errMsg && <Alert type="error" message={errMsg} style={{ marginBottom: 20 }}/>}
|
|
69
|
+
<Upsert oakPath={`${oakFullpath}.${upsertId}`} systemId={systemId}/>
|
|
70
|
+
</div>
|
|
71
|
+
</Modal>);
|
|
72
|
+
if (accounts && accounts?.length) {
|
|
73
|
+
return (<div className={Styles.container}>
|
|
74
|
+
{U}
|
|
75
|
+
<div className={Styles.list}>
|
|
76
|
+
{accounts.filter(ele => ele.$$createAt$$ > 1).map((ele, idx) => <div className={Styles.item} key={idx}>
|
|
77
|
+
<ApAccount systemId={systemId} data={ele} t={t} onRemove={ele['#oakLegalActions']?.includes('remove') ? () => {
|
|
78
|
+
Modal.confirm({
|
|
79
|
+
title: t('confirmDelete'),
|
|
80
|
+
content: t('areYouSure'),
|
|
81
|
+
onOk: async () => execute(undefined, undefined, undefined, [
|
|
82
|
+
{
|
|
83
|
+
entity: 'apAccount',
|
|
84
|
+
operation: {
|
|
85
|
+
id: await generateNewIdAsync(),
|
|
86
|
+
action: 'remove',
|
|
87
|
+
data: {},
|
|
88
|
+
filter: {
|
|
89
|
+
id: ele.id,
|
|
90
|
+
},
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
]),
|
|
94
|
+
});
|
|
95
|
+
} : undefined} onUpdate={ele['#oakLegalActions']?.includes('update') ? () => setUpsertId(ele.id) : undefined}/>
|
|
96
|
+
</div>)}
|
|
97
|
+
</div>
|
|
98
|
+
<div className={Styles.btnBar}>
|
|
99
|
+
{canCreate && <Button type="primary" onClick={() => {
|
|
100
|
+
const id = addItem({ systemId });
|
|
101
|
+
setUpsertId(id);
|
|
102
|
+
}}>
|
|
103
|
+
{t('common::action.add')}
|
|
104
|
+
</Button>}
|
|
105
|
+
</div>
|
|
106
|
+
</div>);
|
|
107
|
+
}
|
|
108
|
+
return (<div className={Styles.container2}>
|
|
109
|
+
<Alert type='info' message={t('tips')}/>
|
|
110
|
+
{U}
|
|
111
|
+
<div className={Styles.body}>
|
|
112
|
+
{canCreate ? <PlusCircleOutlined className={Styles.add} shape="circle" style={{ fontSize: 50 }} onClick={() => {
|
|
113
|
+
const id = addItem({ systemId });
|
|
114
|
+
setUpsertId(id);
|
|
115
|
+
}}/> : t('noData')}
|
|
116
|
+
</div>
|
|
117
|
+
</div>);
|
|
118
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
min-height: 80vh;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: stretch;
|
|
8
|
+
flex-wrap: wrap;
|
|
9
|
+
|
|
10
|
+
.list {
|
|
11
|
+
flex: 1;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
flex-wrap: wrap;
|
|
15
|
+
align-items: flex-start;
|
|
16
|
+
|
|
17
|
+
.item {
|
|
18
|
+
border: 0.1px solid silver;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
margin: 18px;
|
|
21
|
+
padding: 18px;
|
|
22
|
+
|
|
23
|
+
.qrCode:hover {
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.btnBar {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: flex-end;
|
|
32
|
+
padding: 12px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.container2 {
|
|
37
|
+
min-height: 80vh;
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 100%;
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-direction: column;
|
|
42
|
+
align-items: stretch;
|
|
43
|
+
|
|
44
|
+
.body {
|
|
45
|
+
flex: 1;
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
|
|
51
|
+
.add:hover {
|
|
52
|
+
color: var(--oak-color-primary);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export default OakComponent({
|
|
2
|
+
entity: 'apAccount',
|
|
3
|
+
isList: false,
|
|
4
|
+
projection: {
|
|
5
|
+
id: 1,
|
|
6
|
+
price: 1,
|
|
7
|
+
mchId: 1,
|
|
8
|
+
appId: 1,
|
|
9
|
+
enabled: 1,
|
|
10
|
+
aliPayId: 1,
|
|
11
|
+
aliPay: {
|
|
12
|
+
id: 1,
|
|
13
|
+
payNotifyUrl: 1,
|
|
14
|
+
refundNotifyUrl: 1,
|
|
15
|
+
},
|
|
16
|
+
refundGapDays: 1,
|
|
17
|
+
taxLossRatio: 1,
|
|
18
|
+
publicKeyPath: 1,
|
|
19
|
+
privateKeyPath: 1,
|
|
20
|
+
refundCompensateRatio: 1,
|
|
21
|
+
allowWithdrawTransfer: 1,
|
|
22
|
+
withdrawTransferLossRatio: 1,
|
|
23
|
+
needReceiving: 1,
|
|
24
|
+
encryptKey: 1,
|
|
25
|
+
alipayRootCertPath: 1,
|
|
26
|
+
alipayPublicCertPath: 1,
|
|
27
|
+
appCertPath: 1,
|
|
28
|
+
mode: 1,
|
|
29
|
+
gateway: 1,
|
|
30
|
+
endpoint: 1,
|
|
31
|
+
callbackUrl: 1,
|
|
32
|
+
wsServiceUrl: 1,
|
|
33
|
+
setting: 1,
|
|
34
|
+
keyType: 1,
|
|
35
|
+
timeout: 1,
|
|
36
|
+
needEncrypt: 1,
|
|
37
|
+
systemId: 1,
|
|
38
|
+
},
|
|
39
|
+
formData({ data, features }) {
|
|
40
|
+
const { systemId } = this.props;
|
|
41
|
+
const [aliPay] = features.cache.get('aliPay', {
|
|
42
|
+
data: {
|
|
43
|
+
id: 1,
|
|
44
|
+
refundNotifyUrl: 1,
|
|
45
|
+
payNotifyUrl: 1,
|
|
46
|
+
},
|
|
47
|
+
filter: {
|
|
48
|
+
systemId,
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return {
|
|
52
|
+
apAccount: data,
|
|
53
|
+
aliPay,
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
properties: {
|
|
57
|
+
systemId: '',
|
|
58
|
+
},
|
|
59
|
+
lifetimes: {
|
|
60
|
+
async ready() {
|
|
61
|
+
if (this.isCreation()) {
|
|
62
|
+
this.update({
|
|
63
|
+
price: 0,
|
|
64
|
+
enabled: true,
|
|
65
|
+
taxLossRatio: 0.6,
|
|
66
|
+
refundCompensateRatio: 100,
|
|
67
|
+
allowWithdrawTransfer: false,
|
|
68
|
+
needReceiving: false,
|
|
69
|
+
mode: 'publicKey',
|
|
70
|
+
setting: 'openId',
|
|
71
|
+
keyType: 'PKCS1',
|
|
72
|
+
needEncrypt: false
|
|
73
|
+
});
|
|
74
|
+
const { systemId } = this.props;
|
|
75
|
+
const { data: [aliPay] } = await this.features.cache.refresh('aliPay', {
|
|
76
|
+
data: {
|
|
77
|
+
id: 1,
|
|
78
|
+
refundNotifyUrl: 1,
|
|
79
|
+
payNotifyUrl: 1,
|
|
80
|
+
},
|
|
81
|
+
filter: {
|
|
82
|
+
systemId,
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
if (aliPay) {
|
|
86
|
+
this.update({
|
|
87
|
+
aliPayId: aliPay.id,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"placeholder": {
|
|
3
|
+
"privateKeyPath": "应用私钥路径,注意访问权限",
|
|
4
|
+
"publicKeyPath": "支付宝公钥路径,注意访问权限",
|
|
5
|
+
"alipayRootCertPath": "支付宝根证书文件路径,注意访问权限",
|
|
6
|
+
"alipayPublicCertPath": "支付宝公钥证书文件路径,注意访问权限",
|
|
7
|
+
"appCertPath": "应用公钥证书文件路径,注意访问权限",
|
|
8
|
+
"taxLossRatio": "支付宝支付收取的手续费百分比,一般为0.6(代表千分之六)",
|
|
9
|
+
"refundCompensateRatio": "渠道退款时,返回的手续费比例(50代表渠道将返回当时收取的手续费的一半)",
|
|
10
|
+
"depositLossRatio": "充值收取的手续费百分比,一般为0.6(代表千分之六)",
|
|
11
|
+
"payNotifyUrl": "endpoint",
|
|
12
|
+
"refundNotifyUrl": "endpoint",
|
|
13
|
+
"encryptKey": "需要登录商户后台获取",
|
|
14
|
+
"refundGapDays": "超过这个天数后无法退款",
|
|
15
|
+
"withdrawTransferLossRatio": "渠道转账(提现)时收取的手续费百分比,0.6代表千分之六",
|
|
16
|
+
"gateway": "支付宝网关地址"
|
|
17
|
+
},
|
|
18
|
+
"aliPayIsShared": "以上配置是全局的,请谨慎修改",
|
|
19
|
+
"modeTip": "调用OpenAPI接口需要用到公钥/证书,用于保障应用和开放平台交互的安全性。必填,若不设置,则无法调用OpenAPI接口。",
|
|
20
|
+
"gateway": "支付宝沙箱网关地址,开发者在沙箱环境调用 OpenAPI 发送 http(s) 请求的目标地址,需配置在AlipayClient中。",
|
|
21
|
+
"settingTip": "用于配置调用支付宝开放平台接口使用的用户标识(openid/uid),开发者需使用配置的用户标识进行调用,才能正常获取数据。更多信息,请查看支付宝文档。",
|
|
22
|
+
"keyTypeTip": "指定 privateKey 类型, 默认值是PKCS1",
|
|
23
|
+
"needEncryptTip": "支付宝SDK需要,用于内容加密",
|
|
24
|
+
"encryptKeyTip": "加密后,接口的请求内容和响应内容将会由明文内容变为密文内容,可以大大提升接口内容传输的安全性。选填"
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EntityDict } from "../../../oak-app-domain";
|
|
3
|
+
import { RowWithActions, WebComponentProps } from "oak-frontend-base";
|
|
4
|
+
export default function render(props: WebComponentProps<EntityDict, 'apAccount', false, {
|
|
5
|
+
apAccount?: (RowWithActions<EntityDict, 'apAccount'> & {});
|
|
6
|
+
aliPay?: EntityDict['aliPay']['OpSchema'];
|
|
7
|
+
systemId: string;
|
|
8
|
+
}>): React.JSX.Element | null;
|