oak-pay-business 2.2.5 → 2.2.6

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.
Files changed (50) hide show
  1. package/es/components/AbstractComponents.d.ts +1 -0
  2. package/es/components/AbstractComponents.js +0 -1
  3. package/es/components/account/detail/web.pc.module.less +68 -68
  4. package/es/components/order/pay/info.js +6 -6
  5. package/es/components/order/pay/info.module.less +24 -24
  6. package/es/components/order/pay/web.mobile.module.less +35 -35
  7. package/es/components/order/pay/web.pc.module.less +35 -35
  8. package/es/components/payConfig/upsert/offline/web.pc.module.less +4 -4
  9. package/es/components/payConfig/upsert/web.pc.module.less +10 -10
  10. package/es/entities/Refund.d.ts +2 -1
  11. package/es/entities/Refund.js +2 -1
  12. package/es/oak-app-domain/Refund/Schema.d.ts +7 -1
  13. package/es/oak-app-domain/Refund/Storage.js +3 -0
  14. package/es/oak-app-domain/Refund/locales/zh_CN.json +1 -1
  15. package/es/triggers/refund.js +1 -1
  16. package/es/triggers/withdraw.d.ts +1 -1
  17. package/es/types/Exception.d.ts +1 -1
  18. package/es/types/Exception.js +3 -3
  19. package/es/types/PayClazz.d.ts +8 -2
  20. package/es/utils/payClazz/Account.d.ts +6 -1
  21. package/es/utils/payClazz/Account.js +3 -3
  22. package/es/utils/payClazz/Offline.d.ts +6 -1
  23. package/es/utils/payClazz/Offline.js +3 -4
  24. package/es/utils/payClazz/WechatPay/WechatPay.d.ts +10 -5
  25. package/es/utils/payClazz/WechatPay/WechatPay.debug.d.ts +7 -2
  26. package/es/utils/payClazz/WechatPay/WechatPay.debug.js +4 -4
  27. package/es/utils/payClazz/WechatPay/WechatPay.js +98 -14
  28. package/es/utils/payClazz/WechatPay/index.d.ts +1 -1
  29. package/lib/aspects/withdraw.d.ts +8 -8
  30. package/lib/context/BackendRuntimeContext.d.ts +1 -1
  31. package/lib/entities/Refund.d.ts +2 -1
  32. package/lib/entities/Refund.js +2 -1
  33. package/lib/oak-app-domain/Refund/Schema.d.ts +7 -1
  34. package/lib/oak-app-domain/Refund/Storage.js +3 -0
  35. package/lib/oak-app-domain/Refund/locales/zh_CN.json +1 -1
  36. package/lib/triggers/refund.js +1 -1
  37. package/lib/types/Exception.d.ts +1 -1
  38. package/lib/types/Exception.js +5 -5
  39. package/lib/types/PayClazz.d.ts +8 -2
  40. package/lib/utils/application.d.ts +1 -1
  41. package/lib/utils/payClazz/Account.d.ts +6 -1
  42. package/lib/utils/payClazz/Account.js +3 -3
  43. package/lib/utils/payClazz/Offline.d.ts +6 -1
  44. package/lib/utils/payClazz/Offline.js +3 -4
  45. package/lib/utils/payClazz/WechatPay/WechatPay.d.ts +10 -5
  46. package/lib/utils/payClazz/WechatPay/WechatPay.debug.d.ts +7 -2
  47. package/lib/utils/payClazz/WechatPay/WechatPay.debug.js +4 -4
  48. package/lib/utils/payClazz/WechatPay/WechatPay.js +97 -13
  49. package/package.json +4 -4
  50. package/src/entities/Refund.ts +3 -1
@@ -2,6 +2,7 @@
2
2
  * 抽象组件在业务层根据EntityDict的重新声明
3
3
  * by Xc 20230807
4
4
  */
5
+ import React from 'react';
5
6
  import { EntityDict } from '../oak-app-domain';
6
7
  import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, ListButtonProps, OakAbsAttrUpsertDef } from 'oak-frontend-base';
7
8
  declare const FilterPanel: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
@@ -2,7 +2,6 @@
2
2
  * 抽象组件在业务层根据EntityDict的重新声明
3
3
  * by Xc 20230807
4
4
  */
5
- // @ts-nocheck
6
5
  import AbsFilterPanel from 'oak-frontend-base/es/components/filterPanel';
7
6
  import AbsList from 'oak-frontend-base/es/components/list';
8
7
  import AbsListPro from 'oak-frontend-base/es/components/listPro';
@@ -1,69 +1,69 @@
1
- .card {
2
- width: 100%;
3
-
4
- .content {
5
- display: flex;
6
- flex-direction: column;
7
- align-items: stretch;
8
-
9
-
10
- .oper {
11
- align-self: center;
12
- width: 70%;
13
- margin-bottom: 28px;
14
- display: flex;
15
- flex-direction: column;
16
- align-items: stretch;
17
-
18
- .title {
19
- margin-bottom: 28px;
20
- align-self: flex-start;
21
- color: var(--oak-color-primary3);
22
- font-size: var(--oak-font-size-title-medium);
23
- }
24
- }
25
- }
26
- }
27
-
28
- .grid {
29
- min-width: 133px;
30
- border-radius: 6px;
31
- padding: 16px;
32
- display: flex;
33
- flex-direction: column;
34
- margin: 13px;
35
-
36
- .label {
37
- font-size: 16px;
38
- font-weight: 400;
39
- color: var(--oak-color-primary);
40
- margin-bottom: 12px;
41
- }
42
-
43
- .value {
44
- font-size: 24px;
45
- font-weight: 600;
46
- color: var(--oak-color-primary);
47
- line-height: 33.6px;
48
- }
49
- }
50
-
51
- .fortify {
52
- background-color: var(--oak-color-primary-light);
53
-
54
- .label {
55
- font-weight: 900;
56
- }
57
-
58
- .value {
59
- font-weight: bolder;
60
- }
61
- }
62
-
63
- .uf {
64
- margin: 12px;
65
- display: flex;
66
- flex-direction: column;
67
- align-items: center;
68
- padding: 12px;
1
+ .card {
2
+ width: 100%;
3
+
4
+ .content {
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: stretch;
8
+
9
+
10
+ .oper {
11
+ align-self: center;
12
+ width: 70%;
13
+ margin-bottom: 28px;
14
+ display: flex;
15
+ flex-direction: column;
16
+ align-items: stretch;
17
+
18
+ .title {
19
+ margin-bottom: 28px;
20
+ align-self: flex-start;
21
+ color: var(--oak-color-primary3);
22
+ font-size: var(--oak-font-size-title-medium);
23
+ }
24
+ }
25
+ }
26
+ }
27
+
28
+ .grid {
29
+ min-width: 133px;
30
+ border-radius: 6px;
31
+ padding: 16px;
32
+ display: flex;
33
+ flex-direction: column;
34
+ margin: 13px;
35
+
36
+ .label {
37
+ font-size: 16px;
38
+ font-weight: 400;
39
+ color: var(--oak-color-primary);
40
+ margin-bottom: 12px;
41
+ }
42
+
43
+ .value {
44
+ font-size: 24px;
45
+ font-weight: 600;
46
+ color: var(--oak-color-primary);
47
+ line-height: 33.6px;
48
+ }
49
+ }
50
+
51
+ .fortify {
52
+ background-color: var(--oak-color-primary-light);
53
+
54
+ .label {
55
+ font-weight: 900;
56
+ }
57
+
58
+ .value {
59
+ font-weight: bolder;
60
+ }
61
+ }
62
+
63
+ .uf {
64
+ margin: 12px;
65
+ display: flex;
66
+ flex-direction: column;
67
+ align-items: center;
68
+ padding: 12px;
69
69
  }
@@ -1,11 +1,11 @@
1
1
  import Styles from './info.module.less';
2
2
  export default function Info(props) {
3
3
  const { price, t } = props;
4
- return (<div className={Styles.info}>
5
- <div className={Styles.should}>{t('price')}</div>
6
- <div className={Styles.price}>
7
- <div>{t('common::pay.symbol')}</div>
8
- <div>{price}</div>
9
- </div>
4
+ return (<div className={Styles.info}>
5
+ <div className={Styles.should}>{t('price')}</div>
6
+ <div className={Styles.price}>
7
+ <div>{t('common::pay.symbol')}</div>
8
+ <div>{price}</div>
9
+ </div>
10
10
  </div>);
11
11
  }
@@ -1,25 +1,25 @@
1
-
2
- .info {
3
- margin: 8px;
4
- height: 140px;
5
- display: flex;
6
- flex-direction: column;
7
- align-items: center;
8
- justify-content: center;
9
- background-color: var(--oak-color-info);
10
-
11
- .should {
12
- font-size: large;
13
- font-weight: bold;
14
- }
15
-
16
- .price {
17
- display: flex;
18
- flex-direction: row;
19
- padding: 3px;
20
- font-size: xx-large;
21
- font-weight: bolder;
22
- color: var(--oak-color-primary);
23
- align-items: baseline;
24
- }
1
+
2
+ .info {
3
+ margin: 8px;
4
+ height: 140px;
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ justify-content: center;
9
+ background-color: var(--oak-color-info);
10
+
11
+ .should {
12
+ font-size: large;
13
+ font-weight: bold;
14
+ }
15
+
16
+ .price {
17
+ display: flex;
18
+ flex-direction: row;
19
+ padding: 3px;
20
+ font-size: xx-large;
21
+ font-weight: bolder;
22
+ color: var(--oak-color-primary);
23
+ align-items: baseline;
24
+ }
25
25
  }
@@ -1,36 +1,36 @@
1
- .container {
2
- width: 100%;
3
- height: 100%;
4
- display: flex;
5
- flex-direction: column;
6
- align-items: stretch;
7
- background-color: var(--oak-bg-color-page);
8
- // min-height: 500px;
9
-
10
- .ctrl {
11
- margin: 8px;
12
- margin-top: 10px;
13
- flex: 1;
14
-
15
- .pc1 {
16
- width: 100%;
17
- height: 100%;
18
- display: flex;
19
- flex-direction: column;
20
- margin-top: 4px;
21
-
22
- .content {
23
- background-color: var(--oak-bg-color-container);
24
- padding: 4px;
25
- border-radius: 2px;
26
- padding: 16px;
27
-
28
- .tips {
29
- color: var(--oak-color-warning);
30
- font-size: small;
31
- margin-top: 3px;
32
- }
33
- }
34
- }
35
- }
1
+ .container {
2
+ width: 100%;
3
+ height: 100%;
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: stretch;
7
+ background-color: var(--oak-bg-color-page);
8
+ // min-height: 500px;
9
+
10
+ .ctrl {
11
+ margin: 8px;
12
+ margin-top: 10px;
13
+ flex: 1;
14
+
15
+ .pc1 {
16
+ width: 100%;
17
+ height: 100%;
18
+ display: flex;
19
+ flex-direction: column;
20
+ margin-top: 4px;
21
+
22
+ .content {
23
+ background-color: var(--oak-bg-color-container);
24
+ padding: 4px;
25
+ border-radius: 2px;
26
+ padding: 16px;
27
+
28
+ .tips {
29
+ color: var(--oak-color-warning);
30
+ font-size: small;
31
+ margin-top: 3px;
32
+ }
33
+ }
34
+ }
35
+ }
36
36
  }
@@ -1,36 +1,36 @@
1
- .container {
2
- width: 100%;
3
- height: 100%;
4
- display: flex;
5
- flex-direction: column;
6
- align-items: stretch;
7
- background-color: var(--oak-bg-color-page);
8
- // min-height: 500px;
9
-
10
- .ctrl {
11
- margin: 8px;
12
- margin-top: 10px;
13
- flex: 1;
14
-
15
- .pc1 {
16
- width: 100%;
17
- height: 100%;
18
- display: flex;
19
- flex-direction: column;
20
- margin-top: 4px;
21
-
22
- .content {
23
- background-color: var(--oak-bg-color-container);
24
- padding: 4px;
25
- border-radius: 2px;
26
- padding: 16px;
27
-
28
- .tips {
29
- color: var(--oak-color-warning);
30
- font-size: small;
31
- margin-left: 10px;
32
- }
33
- }
34
- }
35
- }
1
+ .container {
2
+ width: 100%;
3
+ height: 100%;
4
+ display: flex;
5
+ flex-direction: column;
6
+ align-items: stretch;
7
+ background-color: var(--oak-bg-color-page);
8
+ // min-height: 500px;
9
+
10
+ .ctrl {
11
+ margin: 8px;
12
+ margin-top: 10px;
13
+ flex: 1;
14
+
15
+ .pc1 {
16
+ width: 100%;
17
+ height: 100%;
18
+ display: flex;
19
+ flex-direction: column;
20
+ margin-top: 4px;
21
+
22
+ .content {
23
+ background-color: var(--oak-bg-color-container);
24
+ padding: 4px;
25
+ border-radius: 2px;
26
+ padding: 16px;
27
+
28
+ .tips {
29
+ color: var(--oak-color-warning);
30
+ font-size: small;
31
+ margin-left: 10px;
32
+ }
33
+ }
34
+ }
35
+ }
36
36
  }
@@ -1,5 +1,5 @@
1
- .container {
2
- display: flex;
3
- flex-direction: column;
4
- width: 100%;
1
+ .container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
5
  }
@@ -1,11 +1,11 @@
1
- .empty {
2
- min-height: 600px;
3
- }
4
-
5
- .container {
6
- width: 100%;
7
- display: flex;
8
- flex-direction: column;
9
- align-items: center;
10
- justify-content: center;
1
+ .empty {
2
+ min-height: 600px;
3
+ }
4
+
5
+ .container {
6
+ width: 100%;
7
+ display: flex;
8
+ flex-direction: column;
9
+ align-items: center;
10
+ justify-content: center;
11
11
  }
@@ -1,4 +1,4 @@
1
- import { String, Text, Price } from 'oak-domain/lib/types/DataType';
1
+ import { String, Text, Price, Datetime } from 'oak-domain/lib/types/DataType';
2
2
  import { EntityShape } from 'oak-domain/lib/types/Entity';
3
3
  import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
4
4
  import { Schema as User } from './User';
@@ -14,6 +14,7 @@ export interface Schema extends EntityShape {
14
14
  price: Price;
15
15
  creator: User;
16
16
  reason?: Text;
17
+ successAt?: Datetime;
17
18
  opers: AccountOper[];
18
19
  }
19
20
  export type IAction = 'succeed' | 'fail';
@@ -20,7 +20,8 @@ export const entityDesc = {
20
20
  iState: '状态',
21
21
  creator: '创建者',
22
22
  reason: '原因',
23
- opers: '相关账户操作'
23
+ opers: '相关账户操作',
24
+ successAt: '退款成功时间'
24
25
  },
25
26
  action: {
26
27
  succeed: '退款成功',
@@ -3,7 +3,7 @@ import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFil
3
3
  import { OneOf } from "oak-domain/lib/types/Polyfill";
4
4
  import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult, EntityShape } from "oak-domain/lib/types/Entity";
5
5
  import { Action, ParticularAction, IState } from "./Action";
6
- import { Price, String, Text } from "oak-domain/lib/types/DataType";
6
+ import { Price, String, Text, Datetime } from "oak-domain/lib/types/DataType";
7
7
  import * as Withdraw from "../Withdraw/Schema";
8
8
  import * as Pay from "../Pay/Schema";
9
9
  import * as User from "../User/Schema";
@@ -18,6 +18,7 @@ export type OpSchema = EntityShape & {
18
18
  price: Price;
19
19
  creatorId: ForeignKey<"user">;
20
20
  reason?: Text | null;
21
+ successAt?: Datetime | null;
21
22
  iState?: IState | null;
22
23
  };
23
24
  export type OpAttr = keyof OpSchema;
@@ -30,6 +31,7 @@ export type Schema = EntityShape & {
30
31
  price: Price;
31
32
  creatorId: ForeignKey<"user">;
32
33
  reason?: Text | null;
34
+ successAt?: Datetime | null;
33
35
  iState?: IState | null;
34
36
  withdraw?: Withdraw.Schema | null;
35
37
  pay: Pay.Schema;
@@ -57,6 +59,7 @@ type AttrFilter = {
57
59
  creatorId: Q_StringValue;
58
60
  creator: User.Filter;
59
61
  reason: Q_StringValue;
62
+ successAt: Q_DateValue;
60
63
  iState: Q_EnumValue<IState>;
61
64
  sysAccountOper$refund: SysAccountOper.Filter & SubQueryPredicateMetadata;
62
65
  accountOper$entity: AccountOper.Filter & SubQueryPredicateMetadata;
@@ -80,6 +83,7 @@ export type Projection = {
80
83
  creatorId?: number;
81
84
  creator?: User.Projection;
82
85
  reason?: number;
86
+ successAt?: number;
83
87
  iState?: number;
84
88
  sysAccountOper$refund?: SysAccountOper.Selection & {
85
89
  $entity: "sysAccountOper";
@@ -134,6 +138,8 @@ export type SortAttr = {
134
138
  creator: User.SortAttr;
135
139
  } | {
136
140
  reason: number;
141
+ } | {
142
+ successAt: number;
137
143
  } | {
138
144
  iState: number;
139
145
  } | {
@@ -35,6 +35,9 @@ export const desc = {
35
35
  reason: {
36
36
  type: "text"
37
37
  },
38
+ successAt: {
39
+ type: "datetime"
40
+ },
38
41
  iState: {
39
42
  type: "enum",
40
43
  enumeration: ["refunding", "successful", "failed"]
@@ -1 +1 @@
1
- { "name": "帐户", "attr": { "pay": "关联支付", "price": "价格", "loss": "损耗", "withdraw": "关联提现", "meta": "metadata", "externalId": "外部退款流水号", "iState": "状态", "creator": "创建者", "reason": "原因", "opers": "相关账户操作" }, "action": { "succeed": "退款成功", "fail": "退款失败" }, "v": { "iState": { "refunding": "退款中", "successful": "退款成功", "failed": "退款失败" } } }
1
+ { "name": "帐户", "attr": { "pay": "关联支付", "price": "价格", "loss": "损耗", "withdraw": "关联提现", "meta": "metadata", "externalId": "外部退款流水号", "iState": "状态", "creator": "创建者", "reason": "原因", "opers": "相关账户操作", "successAt": "退款成功时间" }, "action": { "succeed": "退款成功", "fail": "退款失败" }, "v": { "iState": { "refunding": "退款中", "successful": "退款成功", "failed": "退款失败" } } }
@@ -322,7 +322,7 @@ const triggers = [
322
322
  return;
323
323
  }
324
324
  }
325
- const data = await payClazz.refund(refund);
325
+ const data = await payClazz.refund(refund, context);
326
326
  if (data) {
327
327
  assert(data.externalId);
328
328
  const closeFn = context.openRootMode();
@@ -6,6 +6,6 @@ import { BRC } from '../types/RuntimeCxt';
6
6
  * @param context
7
7
  * @param refunds
8
8
  */
9
- export declare function updateWithdrawState(context: BRC, id: string): Promise<0 | 1>;
9
+ export declare function updateWithdrawState(context: BRC, id: string): Promise<1 | 0>;
10
10
  declare const triggers: Trigger<EntityDict, 'withdraw', BRC>[];
11
11
  export default triggers;
@@ -1,6 +1,6 @@
1
1
  import { OakException, OpRecord } from 'oak-domain/lib/types';
2
2
  import { EntityDict } from '../oak-app-domain/index';
3
- export declare class ExternalPrePayException<ED extends EntityDict> extends OakException<ED> {
3
+ export declare class ExternalPayUtilException<ED extends EntityDict> extends OakException<ED> {
4
4
  reason: any;
5
5
  constructor(reason: any, message?: string);
6
6
  getSerialData(): {
@@ -1,9 +1,9 @@
1
1
  import { OakException } from 'oak-domain/lib/types';
2
2
  import makeDepedentException from './DependentExceptions';
3
- export class ExternalPrePayException extends OakException {
3
+ export class ExternalPayUtilException extends OakException {
4
4
  reason;
5
5
  constructor(reason, message) {
6
- super(message || '调用外部支付预下单接口失败');
6
+ super(message || '调用外部支付渠道接口失败');
7
7
  this.reason = reason;
8
8
  }
9
9
  getSerialData() {
@@ -28,7 +28,7 @@ export function makeException(msg) {
28
28
  const { name, message } = data;
29
29
  switch (name) {
30
30
  case 'ExternalPrePayException': {
31
- exception = new ExternalPrePayException(data.reason, message);
31
+ exception = new ExternalPayUtilException(data.reason, message);
32
32
  break;
33
33
  }
34
34
  case 'RefundExceedMax': {
@@ -1,6 +1,7 @@
1
1
  import { EntityDict } from '../oak-app-domain';
2
2
  import { BRC } from '../types/RuntimeCxt';
3
3
  type IState = EntityDict['pay']['OpSchema']['iState'];
4
+ type RefundIState = EntityDict['refund']['OpSchema']['iState'];
4
5
  export default interface PayClazz {
5
6
  getAccountEntity(): [string, string];
6
7
  getAccountAmount(context: BRC): Promise<number>;
@@ -16,8 +17,13 @@ export default interface PayClazz {
16
17
  extra?: EntityDict['pay']['Update']['data'];
17
18
  price?: number;
18
19
  }>;
19
- refund(refund: EntityDict['refund']['OpSchema']): Promise<EntityDict['refund']['Update']['data'] | undefined>;
20
- closeRefund(refund: EntityDict['refund']['OpSchema']): Promise<void>;
20
+ decodeRefundNotification(params: Record<string, any>, body: any): Promise<{
21
+ refundId: string;
22
+ iState: RefundIState;
23
+ extra?: EntityDict['refund']['Update']['data'];
24
+ price?: number;
25
+ }>;
26
+ refund(refund: EntityDict['refund']['Schema'], context: BRC): Promise<EntityDict['refund']['Update']['data'] | undefined>;
21
27
  getRefundableAt(successAt: number): number;
22
28
  getRefundState(refund: EntityDict['refund']['OpSchema']): Promise<[EntityDict['refund']['OpSchema']['iState'], EntityDict['refund']['Update']['data'] | undefined]>;
23
29
  }
@@ -9,13 +9,18 @@ export default class Account implements PayClazz {
9
9
  calcPayTax(): [number, string, string];
10
10
  getRefundableAt(successAt: number): number;
11
11
  refund(refund: EntityDict['refund']['Schema']): Promise<undefined>;
12
- closeRefund(refund: EntityDict['refund']['Schema']): Promise<void>;
13
12
  getRefundState(refund: EntityDict['refund']['Schema']): Promise<[EntityDict['refund']['Schema']['iState'], undefined]>;
14
13
  decodePayNotification(params: Record<string, any>, body: any): Promise<{
15
14
  payId: string;
16
15
  iState: string | null | undefined;
17
16
  extra?: EntityDict['pay']['Update']['data'] | undefined;
18
17
  }>;
18
+ decodeRefundNotification(params: Record<string, any>, body: any): Promise<{
19
+ refundId: string;
20
+ iState: string | null | undefined;
21
+ extra?: EntityDict['refund']['Update']['data'] | undefined;
22
+ price?: number | undefined;
23
+ }>;
19
24
  prepay(pay: EntityDict['pay']['Schema'], data: EntityDict['pay']['Update']['data'], context: BRC): Promise<void>;
20
25
  getState(pay: EntityDict['pay']['Schema']): Promise<[string, EntityDict['pay']['Update']['data']]>;
21
26
  close(pay: EntityDict['pay']['Schema']): Promise<void>;
@@ -23,15 +23,15 @@ export default class Account {
23
23
  async refund(refund) {
24
24
  return;
25
25
  }
26
- async closeRefund(refund) {
27
- return;
28
- }
29
26
  async getRefundState(refund) {
30
27
  return ['refuding', undefined];
31
28
  }
32
29
  decodePayNotification(params, body) {
33
30
  throw new Error("account类型的pay不需调用此接口");
34
31
  }
32
+ decodeRefundNotification(params, body) {
33
+ throw new Error("account类型的pay不需调用此接口");
34
+ }
35
35
  async prepay(pay, data, context) {
36
36
  const { entity, entityId, price } = pay;
37
37
  assert(entity === 'account' && entityId);
@@ -13,13 +13,18 @@ export default class Offline implements PayClazz {
13
13
  calcPayTax(price: number): [number, string, string];
14
14
  getRefundableAt(successTime: number): number;
15
15
  refund(refund: RefundOpSchema): Promise<UpdateOperationData | undefined>;
16
- closeRefund(refund: RefundOpSchema): Promise<void>;
17
16
  getRefundState(refund: RefundOpSchema): Promise<[PayOpSchema['iState'], PayUpdateData | undefined]>;
18
17
  decodePayNotification(params: Record<string, any>, body: any): Promise<{
19
18
  payId: string;
20
19
  iState: string | null | undefined;
21
20
  extra?: PayUpdateData | undefined;
22
21
  }>;
22
+ decodeRefundNotification(params: Record<string, any>, body: any): Promise<{
23
+ refundId: string;
24
+ iState: string | null | undefined;
25
+ extra?: EntityDict['refund']['Update']['data'] | undefined;
26
+ price?: number | undefined;
27
+ }>;
23
28
  prepay(pay: PayOpSchema, data: PayUpdateData, context: BRC): Promise<void>;
24
29
  getState(pay: PayOpSchema): Promise<[string, PayUpdateData]>;
25
30
  close(pay: PayOpSchema): Promise<void>;
@@ -49,10 +49,6 @@ export default class Offline {
49
49
  // 啥也不做
50
50
  return;
51
51
  }
52
- async closeRefund(refund) {
53
- // 啥也不做
54
- return;
55
- }
56
52
  async getRefundState(refund) {
57
53
  const { iState } = refund;
58
54
  assert(iState === 'refunding');
@@ -61,6 +57,9 @@ export default class Offline {
61
57
  decodePayNotification(params, body) {
62
58
  throw new Error("offline类型的pay不需调用此接口");
63
59
  }
60
+ decodeRefundNotification(params, body) {
61
+ throw new Error("offline类型的pay不需调用此接口");
62
+ }
64
63
  async prepay(pay, data, context) {
65
64
  data.phantom3 = Math.ceil(Math.random() * 1000000);
66
65
  return;