@pisell/private-materials 6.8.76 → 6.8.78

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 (126) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/checkout/PaymentModal.js +32 -8
  12. package/es/components/checkout/components/PaymentOptionsModule/index.js +1 -1
  13. package/es/components/eftposPay/amount.d.ts +1 -1
  14. package/es/components/eftposPay/app.d.ts +1 -1
  15. package/es/components/eftposPay/app.js +0 -5
  16. package/es/components/eftposPay/component/fail/failCustom.js +12 -16
  17. package/es/components/eftposPay/component/fail/index.js +5 -12
  18. package/es/components/eftposPay/const.d.ts +1 -6
  19. package/es/components/eftposPay/const.js +0 -3
  20. package/es/components/eftposPay/device.d.ts +1 -1
  21. package/es/components/eftposPay/hooks.d.ts +2 -3
  22. package/es/components/eftposPay/hooks.js +0 -12
  23. package/es/components/eftposPay/index.js +1 -5
  24. package/es/components/eftposPay/locales.d.ts +0 -36
  25. package/es/components/eftposPay/locales.js +3 -42
  26. package/es/components/eftposPay/manufacturer.d.ts +0 -1
  27. package/es/components/eftposPay/manufacturer.js +0 -5
  28. package/es/components/eftposPay/pay.js +2 -6
  29. package/es/components/eftposPay/store/index.d.ts +5 -12
  30. package/es/components/kioskSkuDetail/index.d.ts +0 -3
  31. package/es/components/kioskSkuDetail/index.js +173 -266
  32. package/es/components/kioskSkuDetail/index.less +7 -49
  33. package/es/components/kioskSkuDetail/locales.d.ts +0 -6
  34. package/es/components/kioskSkuDetail/locales.js +3 -9
  35. package/es/components/pay/toB/components/EFTPOS/index.js +1 -8
  36. package/es/components/pay/toB/types/index.d.ts +0 -1
  37. package/es/components/pay/toC/PaymentList/serve.js +0 -14
  38. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -7
  39. package/es/plus/skuOptionsSelection/components/VariantCard/index.js +1 -1
  40. package/es/plus/skuOptionsSelection/locales.d.ts +0 -3
  41. package/es/plus/skuOptionsSelection/locales.js +0 -3
  42. package/es/pro/Login2.0/components/LoginCodeInput.js +3 -36
  43. package/es/pro/Login2.0/steps/CodeInput.js +7 -37
  44. package/lib/components/checkout/PaymentModal.js +41 -24
  45. package/lib/components/checkout/components/PaymentOptionsModule/index.js +1 -2
  46. package/lib/components/eftposPay/amount.d.ts +1 -1
  47. package/lib/components/eftposPay/app.d.ts +1 -1
  48. package/lib/components/eftposPay/app.js +0 -5
  49. package/lib/components/eftposPay/component/fail/failCustom.js +9 -15
  50. package/lib/components/eftposPay/component/fail/index.js +1 -4
  51. package/lib/components/eftposPay/const.d.ts +1 -6
  52. package/lib/components/eftposPay/const.js +0 -3
  53. package/lib/components/eftposPay/device.d.ts +1 -1
  54. package/lib/components/eftposPay/hooks.d.ts +2 -3
  55. package/lib/components/eftposPay/hooks.js +0 -16
  56. package/lib/components/eftposPay/index.js +1 -5
  57. package/lib/components/eftposPay/locales.d.ts +0 -36
  58. package/lib/components/eftposPay/locales.js +3 -42
  59. package/lib/components/eftposPay/manufacturer.d.ts +0 -1
  60. package/lib/components/eftposPay/manufacturer.js +0 -7
  61. package/lib/components/eftposPay/pay.js +2 -3
  62. package/lib/components/eftposPay/store/index.d.ts +5 -12
  63. package/lib/components/kioskSkuDetail/index.d.ts +0 -3
  64. package/lib/components/kioskSkuDetail/index.js +113 -180
  65. package/lib/components/kioskSkuDetail/index.less +7 -49
  66. package/lib/components/kioskSkuDetail/locales.d.ts +0 -6
  67. package/lib/components/kioskSkuDetail/locales.js +3 -9
  68. package/lib/components/pay/toB/components/EFTPOS/index.js +1 -8
  69. package/lib/components/pay/toB/types/index.d.ts +0 -1
  70. package/lib/components/pay/toC/PaymentList/serve.js +0 -15
  71. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -7
  72. package/lib/plus/skuOptionsSelection/components/VariantCard/index.js +0 -2
  73. package/lib/plus/skuOptionsSelection/locales.d.ts +0 -3
  74. package/lib/plus/skuOptionsSelection/locales.js +0 -3
  75. package/lib/pro/Login2.0/components/LoginCodeInput.js +4 -26
  76. package/lib/pro/Login2.0/steps/CodeInput.js +5 -27
  77. package/lowcode/kiosk-sku-detail/meta.ts +94 -229
  78. package/package.json +8 -2
  79. package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +0 -7
  80. package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.js +0 -120
  81. package/es/components/eftposPay/aggregatePayment/index.d.ts +0 -3
  82. package/es/components/eftposPay/aggregatePayment/index.js +0 -3
  83. package/es/components/eftposPay/aggregatePayment/service.d.ts +0 -24
  84. package/es/components/eftposPay/aggregatePayment/service.js +0 -69
  85. package/es/components/eftposPay/aggregatePayment/types.d.ts +0 -106
  86. package/es/components/eftposPay/aggregatePayment/types.js +0 -65
  87. package/es/components/eftposPay/aggregatePayment/utils/logs.d.ts +0 -110
  88. package/es/components/eftposPay/aggregatePayment/utils/logs.js +0 -371
  89. package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +0 -139
  90. package/es/components/eftposPay/aggregatePayment/utils/payment.js +0 -1138
  91. package/es/components/eftposPay/huifu/Action.d.ts +0 -8
  92. package/es/components/eftposPay/huifu/Action.js +0 -146
  93. package/es/components/eftposPay/huifu/const.d.ts +0 -5
  94. package/es/components/eftposPay/huifu/const.js +0 -70
  95. package/es/components/eftposPay/huifu/hooks.d.ts +0 -25
  96. package/es/components/eftposPay/huifu/hooks.js +0 -184
  97. package/es/components/eftposPay/huifu/index.d.ts +0 -5
  98. package/es/components/eftposPay/huifu/index.js +0 -196
  99. package/es/components/eftposPay/huifu/index.less +0 -180
  100. package/es/components/eftposPay/huifu/types.d.ts +0 -14
  101. package/es/components/eftposPay/huifu/types.js +0 -1
  102. package/es/pro/skuDetailModal/index.d.ts +0 -5
  103. package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +0 -7
  104. package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.js +0 -133
  105. package/lib/components/eftposPay/aggregatePayment/index.d.ts +0 -3
  106. package/lib/components/eftposPay/aggregatePayment/index.js +0 -42
  107. package/lib/components/eftposPay/aggregatePayment/service.d.ts +0 -24
  108. package/lib/components/eftposPay/aggregatePayment/service.js +0 -81
  109. package/lib/components/eftposPay/aggregatePayment/types.d.ts +0 -106
  110. package/lib/components/eftposPay/aggregatePayment/types.js +0 -74
  111. package/lib/components/eftposPay/aggregatePayment/utils/logs.d.ts +0 -110
  112. package/lib/components/eftposPay/aggregatePayment/utils/logs.js +0 -294
  113. package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +0 -139
  114. package/lib/components/eftposPay/aggregatePayment/utils/payment.js +0 -752
  115. package/lib/components/eftposPay/huifu/Action.d.ts +0 -8
  116. package/lib/components/eftposPay/huifu/Action.js +0 -174
  117. package/lib/components/eftposPay/huifu/const.d.ts +0 -5
  118. package/lib/components/eftposPay/huifu/const.js +0 -86
  119. package/lib/components/eftposPay/huifu/hooks.d.ts +0 -25
  120. package/lib/components/eftposPay/huifu/hooks.js +0 -186
  121. package/lib/components/eftposPay/huifu/index.d.ts +0 -5
  122. package/lib/components/eftposPay/huifu/index.js +0 -200
  123. package/lib/components/eftposPay/huifu/index.less +0 -180
  124. package/lib/components/eftposPay/huifu/types.d.ts +0 -14
  125. package/lib/components/eftposPay/huifu/types.js +0 -17
  126. package/lib/pro/skuDetailModal/index.d.ts +0 -5
@@ -1,110 +0,0 @@
1
- export interface LogEntry {
2
- /** 日志标题 */
3
- title: string;
4
- /** 日志内容 */
5
- content?: any;
6
- /** 支付时间(精确到毫秒) */
7
- time: string;
8
- }
9
- interface PaymentLogRecord {
10
- /** 交易记录号 */
11
- number: string;
12
- /** 订单ID */
13
- orderId?: string | number;
14
- /** 设备ID */
15
- deviceId?: string | number;
16
- /** 支付类型 */
17
- paymentCode?: string;
18
- /** 创建时间 */
19
- createdAt: string;
20
- /** 日志条目列表 */
21
- logs: LogEntry[];
22
- }
23
- declare class PaymentLogInstance {
24
- private static instance;
25
- /** 当前交易记录号 */
26
- private currentNumber;
27
- /** 当前日志记录 */
28
- private currentRecord;
29
- private constructor();
30
- /**
31
- * 获取单例实例
32
- */
33
- static getInstance(): PaymentLogInstance;
34
- /**
35
- * 初始化支付日志
36
- * @param number 交易记录号
37
- * @param options 初始化选项
38
- */
39
- init(number: string, options?: {
40
- orderId?: string | number;
41
- deviceId?: string | number;
42
- paymentCode?: string;
43
- [key: string]: any;
44
- }): void;
45
- /**
46
- * 添加日志条目
47
- * @param title 日志标题
48
- * @param content 日志内容
49
- */
50
- addLog(params: {
51
- title: string;
52
- content?: any;
53
- }): void;
54
- /**
55
- * 构建日志内容
56
- * @param record 日志记录
57
- * @returns 格式化的日志内容数组
58
- */
59
- private buildLogContent;
60
- /**
61
- * 发送单条日志记录到飞书
62
- * @param record 日志记录
63
- * @param isRestore 是否是恢复上传
64
- */
65
- private sendLogRecord;
66
- /**
67
- * 发送日志到飞书
68
- * @param title 日志标题(可选,仅在需要自定义标题时使用)
69
- */
70
- sendLogs(title?: string): void;
71
- /**
72
- * 清除当前日志
73
- * @param shouldSend 清除前是否发送到飞书,默认为 true
74
- */
75
- clearLogs(shouldSend?: boolean): void;
76
- /**
77
- * 检查并上传旧日志
78
- */
79
- private checkAndUploadOldLogs;
80
- /**
81
- * 获取所有支付日志对象
82
- */
83
- private getAllLogsObject;
84
- /**
85
- * 保存所有支付日志对象
86
- */
87
- private saveAllLogsObject;
88
- /**
89
- * 保存到 localStorage
90
- */
91
- private saveToLocalStorage;
92
- /**
93
- * 从 localStorage 中删除
94
- */
95
- private removeFromLocalStorage;
96
- /**
97
- * 获取所有旧日志
98
- */
99
- private getOldLogsFromLocalStorage;
100
- /**
101
- * 获取当前日志记录(用于调试)
102
- */
103
- getCurrentRecord(): PaymentLogRecord | null;
104
- /**
105
- * 获取当前交易号(用于调试)
106
- */
107
- getCurrentNumber(): string | null;
108
- }
109
- declare const paymentLog: PaymentLogInstance;
110
- export default paymentLog;
@@ -1,294 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/eftposPay/aggregatePayment/utils/logs.ts
30
- var logs_exports = {};
31
- __export(logs_exports, {
32
- default: () => logs_default
33
- });
34
- module.exports = __toCommonJS(logs_exports);
35
- var import_dayjs = __toESM(require("dayjs"));
36
- var import_utils = require("@pisell/utils");
37
- var PAYMENT_LOGS_KEY = "pisell2_eftpos_payment_logs";
38
- var PaymentLogInstance = class _PaymentLogInstance {
39
- static instance;
40
- /** 当前交易记录号 */
41
- currentNumber = null;
42
- /** 当前日志记录 */
43
- currentRecord = null;
44
- constructor() {
45
- }
46
- /**
47
- * 获取单例实例
48
- */
49
- static getInstance() {
50
- if (!_PaymentLogInstance.instance) {
51
- _PaymentLogInstance.instance = new _PaymentLogInstance();
52
- }
53
- return _PaymentLogInstance.instance;
54
- }
55
- /**
56
- * 初始化支付日志
57
- * @param number 交易记录号
58
- * @param options 初始化选项
59
- */
60
- init(number, options) {
61
- try {
62
- this.checkAndUploadOldLogs();
63
- this.currentNumber = number;
64
- this.currentRecord = {
65
- number,
66
- orderId: options == null ? void 0 : options.orderId,
67
- deviceId: options == null ? void 0 : options.deviceId,
68
- paymentCode: options == null ? void 0 : options.paymentCode,
69
- createdAt: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss.SSS"),
70
- logs: []
71
- };
72
- this.addLog({
73
- title: "EFTPOS日志初始化",
74
- content: { number, ...options || {} }
75
- });
76
- console.log(`📝 支付日志初始化成功,交易号: ${number}`);
77
- } catch (error) {
78
- console.error("❌ 支付日志初始化失败:", error);
79
- }
80
- }
81
- /**
82
- * 添加日志条目
83
- * @param title 日志标题
84
- * @param content 日志内容
85
- */
86
- addLog(params) {
87
- try {
88
- if (!this.currentRecord || !this.currentNumber) {
89
- console.warn("⚠️ 日志未初始化,无法添加日志");
90
- return;
91
- }
92
- const logEntry = {
93
- title: params.title,
94
- time: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss.SSS")
95
- };
96
- if (params == null ? void 0 : params.content) {
97
- logEntry.content = params.content;
98
- }
99
- this.currentRecord.logs.push(logEntry);
100
- this.saveToLocalStorage();
101
- console.log(`📝 添加支付日志: ${params.title}`, logEntry);
102
- } catch (error) {
103
- console.error("❌ 添加日志失败:", error);
104
- }
105
- }
106
- /**
107
- * 构建日志内容
108
- * @param record 日志记录
109
- * @returns 格式化的日志内容数组
110
- */
111
- buildLogContent(record) {
112
- return [
113
- {
114
- key: "交易记录号",
115
- value: record.number
116
- },
117
- {
118
- key: "订单ID",
119
- value: (record == null ? void 0 : record.orderId) || "未知"
120
- },
121
- {
122
- key: "设备ID",
123
- value: (record == null ? void 0 : record.deviceId) || "未知"
124
- },
125
- {
126
- key: "支付类型",
127
- value: (record == null ? void 0 : record.paymentCode) || "未知"
128
- },
129
- {
130
- key: "创建时间",
131
- value: record.createdAt
132
- },
133
- {
134
- key: "详细日志",
135
- value: JSON.stringify(record.logs || [])
136
- }
137
- ];
138
- }
139
- /**
140
- * 发送单条日志记录到飞书
141
- * @param record 日志记录
142
- * @param isRestore 是否是恢复上传
143
- */
144
- sendLogRecord(record, isRestore = false) {
145
- const prefix = isRestore ? "-[恢复上传]" : "";
146
- const title = `支付日志-${record.paymentCode || "Unknown"}-${record.orderId || "Unknown"}${prefix}`;
147
- const content = this.buildLogContent(record);
148
- (0, import_utils.sendWarningLog)({ title, content });
149
- console.log(`✅ 日志已发送到飞书: ${title}`);
150
- }
151
- /**
152
- * 发送日志到飞书
153
- * @param title 日志标题(可选,仅在需要自定义标题时使用)
154
- */
155
- sendLogs(title) {
156
- try {
157
- if (!this.currentRecord) {
158
- console.warn("⚠️ 没有日志记录需要发送");
159
- return;
160
- }
161
- if (title) {
162
- const content = this.buildLogContent(this.currentRecord);
163
- (0, import_utils.sendWarningLog)({ title, content });
164
- console.log(`✅ 日志已发送到飞书: ${title}`);
165
- } else {
166
- this.sendLogRecord(this.currentRecord, false);
167
- }
168
- } catch (error) {
169
- console.error("❌ 发送日志到飞书失败:", error);
170
- }
171
- }
172
- /**
173
- * 清除当前日志
174
- * @param shouldSend 清除前是否发送到飞书,默认为 true
175
- */
176
- clearLogs(shouldSend = true) {
177
- try {
178
- if (!this.currentNumber) {
179
- console.warn("⚠️ 没有活动的日志记录需要清除");
180
- return;
181
- }
182
- if (shouldSend && this.currentRecord) {
183
- this.sendLogs();
184
- }
185
- this.removeFromLocalStorage(this.currentNumber);
186
- this.currentNumber = null;
187
- this.currentRecord = null;
188
- console.log("🧹 日志已清除");
189
- } catch (error) {
190
- console.error("❌ 清除日志失败:", error);
191
- }
192
- }
193
- /**
194
- * 检查并上传旧日志
195
- */
196
- checkAndUploadOldLogs() {
197
- try {
198
- const oldLogs = this.getOldLogsFromLocalStorage();
199
- if (oldLogs.length === 0) {
200
- return;
201
- }
202
- console.log(`📤 发现 ${oldLogs.length} 条旧日志记录,准备上传...`);
203
- for (const log of oldLogs) {
204
- try {
205
- this.sendLogRecord(log, true);
206
- this.removeFromLocalStorage(log.number);
207
- console.log(`✅ 旧日志已上传并删除: ${log.number}`);
208
- } catch (error) {
209
- console.error(`❌ 上传旧日志失败 (${log.number}):`, error);
210
- }
211
- }
212
- } catch (error) {
213
- console.error("❌ 检查旧日志失败:", error);
214
- }
215
- }
216
- /**
217
- * 获取所有支付日志对象
218
- */
219
- getAllLogsObject() {
220
- try {
221
- const value = localStorage.getItem(PAYMENT_LOGS_KEY);
222
- if (!value) {
223
- return {};
224
- }
225
- return JSON.parse(value);
226
- } catch (error) {
227
- console.error("❌ 读取 localStorage 失败:", error);
228
- return {};
229
- }
230
- }
231
- /**
232
- * 保存所有支付日志对象
233
- */
234
- saveAllLogsObject(logsObject) {
235
- try {
236
- localStorage.setItem(PAYMENT_LOGS_KEY, JSON.stringify(logsObject));
237
- } catch (error) {
238
- console.error("❌ 保存到 localStorage 失败:", error);
239
- }
240
- }
241
- /**
242
- * 保存到 localStorage
243
- */
244
- saveToLocalStorage() {
245
- try {
246
- if (!this.currentRecord || !this.currentNumber) {
247
- return;
248
- }
249
- const allLogs = this.getAllLogsObject();
250
- allLogs[this.currentNumber] = this.currentRecord;
251
- this.saveAllLogsObject(allLogs);
252
- } catch (error) {
253
- console.error("❌ 保存到 localStorage 失败:", error);
254
- }
255
- }
256
- /**
257
- * 从 localStorage 中删除
258
- */
259
- removeFromLocalStorage(number) {
260
- try {
261
- const allLogs = this.getAllLogsObject();
262
- delete allLogs[number];
263
- this.saveAllLogsObject(allLogs);
264
- } catch (error) {
265
- console.error("❌ 从 localStorage 删除失败:", error);
266
- }
267
- }
268
- /**
269
- * 获取所有旧日志
270
- */
271
- getOldLogsFromLocalStorage() {
272
- try {
273
- const allLogs = this.getAllLogsObject();
274
- return Object.values(allLogs);
275
- } catch (error) {
276
- console.error("❌ 获取旧日志失败:", error);
277
- return [];
278
- }
279
- }
280
- /**
281
- * 获取当前日志记录(用于调试)
282
- */
283
- getCurrentRecord() {
284
- return this.currentRecord;
285
- }
286
- /**
287
- * 获取当前交易号(用于调试)
288
- */
289
- getCurrentNumber() {
290
- return this.currentNumber;
291
- }
292
- };
293
- var paymentLog = PaymentLogInstance.getInstance();
294
- var logs_default = paymentLog;
@@ -1,139 +0,0 @@
1
- /**
2
- * 聚合支付方法类
3
- * 核心点:
4
- * 1.发起支付/退款,在十秒钟后发起轮询操作,两个接口谁先返回成功用谁的结果,如果返回的失败是存在明确code信息的则全部失败
5
- * 2.轮询操作总查询时间2分钟,超时直接失败,单次轮询超时时间5秒,超时直接abort本次请求,间隔两秒后发起新的请求
6
- * 3.最终成功或者失败都需要把定时器给清理掉,并将未完成的接口abort掉
7
- */
8
- import { PaymentMethodOptions } from '../types';
9
- declare class PaymentMethod {
10
- /** 初始化参数 */
11
- private initOptions;
12
- private paymentNum;
13
- private orderId?;
14
- private deviceId?;
15
- private callback;
16
- private shouldContinue;
17
- private config;
18
- private controller;
19
- private queryController;
20
- private queryStartTimer;
21
- private globalTimeoutTimer;
22
- private requestTimeoutTimer;
23
- private queryIntervalTimer;
24
- private isFinished;
25
- private isQuerying;
26
- private currentActionType;
27
- private currentQueryId;
28
- private currentRunId;
29
- private currentQueryApi;
30
- constructor(options: PaymentMethodOptions);
31
- /**
32
- * 判断请求是否需要等待轮询结果
33
- * 1. 有明确错误code且不是超时和支付超时,则直接失败
34
- * @param code 错误码
35
- */
36
- private isRequestFailed;
37
- /**
38
- * 清理定时器和请求控制器
39
- */
40
- private cleanupTimersAndControllers;
41
- /**
42
- * 清理资源并重置状态
43
- * @param markAsFinished 是否标记为已完成(true: 操作完成; false: 准备新操作)
44
- */
45
- private clean;
46
- /**
47
- * 开始新的操作流程(统一的流程初始化)
48
- * @param actionType 操作类型
49
- * @returns 本次流程的唯一ID
50
- */
51
- private startNewOperation;
52
- /**
53
- * 处理操作过程
54
- */
55
- private handleOperationProcess;
56
- /**
57
- * 处理成功结果
58
- */
59
- private handleOperationSuccess;
60
- /**
61
- * 处理错误(最终失败)
62
- * @param error 错误信息
63
- */
64
- private handleOperationError;
65
- /**
66
- * 处理接口响应
67
- */
68
- private handleResponse;
69
- /**
70
- * 创建超时 Promise
71
- */
72
- private createTimeoutPromise;
73
- /**
74
- * 单次查询请求
75
- */
76
- private performQuery;
77
- /**
78
- * 安排下一次查询
79
- */
80
- private scheduleNextQuery;
81
- /**
82
- * 开始轮询
83
- */
84
- private startQuery;
85
- /**
86
- * 获取操作API和查询API
87
- */
88
- private getActionApi;
89
- /**
90
- * 执行纯查询操作(不需要先调用支付/退款接口)
91
- */
92
- private runQuery;
93
- /**
94
- * 执行操作的核心方法
95
- */
96
- private run;
97
- /**
98
- * 执行操作
99
- */
100
- private runAction;
101
- /**
102
- * 支付
103
- * @param params 支付参数
104
- */
105
- pay(params: Record<string, any>): void;
106
- /**
107
- * 支付取消
108
- * @param params 取消参数
109
- */
110
- payAction(params: Record<string, any>): void;
111
- /**
112
- * 退款
113
- * @param params 退款参数
114
- */
115
- refund(params: Record<string, any>): void;
116
- /**
117
- * 退款取消
118
- * @param params 取消参数
119
- */
120
- refundAction(params: Record<string, any>): void;
121
- /**
122
- * 支付查询(直接查询,带2分钟超时和轮询机制)
123
- */
124
- payQuery(): void;
125
- /**
126
- * 退款查询(直接查询,带2分钟超时和轮询机制)
127
- */
128
- refundQuery(): void;
129
- /**
130
- * 停止操作,后续依然可以重新发起操作
131
- */
132
- stop(): void;
133
- /**
134
- * 销毁实例(完全清理并上传日志)
135
- * 注意:销毁后实例不可再使用
136
- */
137
- destroy(): void;
138
- }
139
- export default PaymentMethod;