@be-link/ecommerce-trade-service-node-sdk 0.1.95 → 0.1.97
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/consts.d.ts +9 -0
- package/consts.js +10 -1
- package/enums.d.ts +12 -1
- package/enums.js +12 -0
- package/index.d.ts +1 -1
- package/index.js +2 -1
- package/modules/pos/orderCore/types.d.ts +2 -0
- package/modules/pos/orderQuery/types.d.ts +26 -6
- package/modules/ros/orderQuery/types.d.ts +39 -1
- package/package.json +1 -1
- package/types.d.ts +82 -12
- package/types.js +3 -0
package/consts.d.ts
CHANGED
|
@@ -26,6 +26,13 @@ export declare const PromotionToReverseResourceTypeMap: {
|
|
|
26
26
|
};
|
|
27
27
|
/** 逆向订单优惠券资源类型集合(包含单品券和订单券,兼容历史数据) */
|
|
28
28
|
export declare const ReverseResourceCouponTypeList: ENUM.ReverseResourceType[];
|
|
29
|
+
/** Redis Key 前缀常量 */
|
|
30
|
+
export declare const REDIS_KEY: {
|
|
31
|
+
/** 支付参数限流计数器: TRADE:PAYMENT_PARAM:RATE_LIMIT:{timestamp_second} */
|
|
32
|
+
readonly PAYMENT_PARAM_RATE_LIMIT: "TRADE:PAYMENT_PARAM:RATE_LIMIT";
|
|
33
|
+
/** 支付参数缓存: TRADE:PAYMENT_PARAM:CACHE:{orderId} */
|
|
34
|
+
readonly PAYMENT_PARAM_CACHE: "TRADE:PAYMENT_PARAM:CACHE";
|
|
35
|
+
};
|
|
29
36
|
/** Redis 锁 Key 前缀常量 */
|
|
30
37
|
export declare const REDIS_LOCK_KEY: {
|
|
31
38
|
/** 逆向订单操作锁(订单维度) - 用于所有退款相关操作 */
|
|
@@ -38,6 +45,8 @@ export declare const REDIS_LOCK_KEY: {
|
|
|
38
45
|
readonly ROS_BATCH_REFUND: "TRADE:ROS:BATCH_REFUND_LOCK";
|
|
39
46
|
/** 正向订单创建锁(用户维度) */
|
|
40
47
|
readonly POS_ORDER_CREATE: "TRADE:POS:ORDER_CREATE_LOCK";
|
|
48
|
+
/** 支付参数锁(订单维度): TRADE:PAYMENT_PARAM:LOCK:{orderId} */
|
|
49
|
+
readonly PAYMENT_PARAM: "TRADE:PAYMENT_PARAM:LOCK";
|
|
41
50
|
};
|
|
42
51
|
/** 交易 MQ */
|
|
43
52
|
export declare const TradeVHOST = "ecommerce";
|
package/consts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ForeverEnd = exports.ROSTopicName = exports.POSTopicName = exports.TradeVHOST = exports.REDIS_LOCK_KEY = exports.ReverseResourceCouponTypeList = exports.PromotionToReverseResourceTypeMap = exports.PromotionCouponTypeMap = exports.PromotionCouponTypeList = exports.PayWayMap = exports.PayPlatformMap = exports.PayChannelMap = exports.ReverseRefundWayMap = exports.ReverseRefundTypeMap = exports.ReverseArrivalStatusMap = exports.ReverseOrderStatusMap = exports.ReverseResourceTypeMap = exports.OrderVerificationStatusMap = exports.OrderRefundStatusMap = exports.OrderPayStatusMap = exports.OrderStatusMap = exports.OrderOsTypeMap = exports.OrderPlatformMap = exports.OrderSourceMap = void 0;
|
|
3
|
+
exports.ForeverEnd = exports.ROSTopicName = exports.POSTopicName = exports.TradeVHOST = exports.REDIS_LOCK_KEY = exports.REDIS_KEY = exports.ReverseResourceCouponTypeList = exports.PromotionToReverseResourceTypeMap = exports.PromotionCouponTypeMap = exports.PromotionCouponTypeList = exports.PayWayMap = exports.PayPlatformMap = exports.PayChannelMap = exports.ReverseRefundWayMap = exports.ReverseRefundTypeMap = exports.ReverseArrivalStatusMap = exports.ReverseOrderStatusMap = exports.ReverseResourceTypeMap = exports.OrderVerificationStatusMap = exports.OrderRefundStatusMap = exports.OrderPayStatusMap = exports.OrderStatusMap = exports.OrderOsTypeMap = exports.OrderPlatformMap = exports.OrderSourceMap = void 0;
|
|
4
4
|
const ecommerce_promotion_service_node_sdk_1 = require("@be-link/ecommerce-promotion-service-node-sdk");
|
|
5
5
|
const enums_1 = require("./enums");
|
|
6
6
|
exports.OrderSourceMap = {
|
|
@@ -121,6 +121,13 @@ exports.ReverseResourceCouponTypeList = [
|
|
|
121
121
|
enums_1.ENUM.ReverseResourceType.ORDER_DISCOUNT, // 订单券(新值)
|
|
122
122
|
enums_1.ENUM.ReverseResourceType.VOUCHER, // 核销券
|
|
123
123
|
];
|
|
124
|
+
/** Redis Key 前缀常量 */
|
|
125
|
+
exports.REDIS_KEY = {
|
|
126
|
+
/** 支付参数限流计数器: TRADE:PAYMENT_PARAM:RATE_LIMIT:{timestamp_second} */
|
|
127
|
+
PAYMENT_PARAM_RATE_LIMIT: 'TRADE:PAYMENT_PARAM:RATE_LIMIT',
|
|
128
|
+
/** 支付参数缓存: TRADE:PAYMENT_PARAM:CACHE:{orderId} */
|
|
129
|
+
PAYMENT_PARAM_CACHE: 'TRADE:PAYMENT_PARAM:CACHE',
|
|
130
|
+
};
|
|
124
131
|
/** Redis 锁 Key 前缀常量 */
|
|
125
132
|
exports.REDIS_LOCK_KEY = {
|
|
126
133
|
/** 逆向订单操作锁(订单维度) - 用于所有退款相关操作 */
|
|
@@ -133,6 +140,8 @@ exports.REDIS_LOCK_KEY = {
|
|
|
133
140
|
ROS_BATCH_REFUND: 'TRADE:ROS:BATCH_REFUND_LOCK',
|
|
134
141
|
/** 正向订单创建锁(用户维度) */
|
|
135
142
|
POS_ORDER_CREATE: 'TRADE:POS:ORDER_CREATE_LOCK',
|
|
143
|
+
/** 支付参数锁(订单维度): TRADE:PAYMENT_PARAM:LOCK:{orderId} */
|
|
144
|
+
PAYMENT_PARAM: 'TRADE:PAYMENT_PARAM:LOCK',
|
|
136
145
|
};
|
|
137
146
|
/** 交易 MQ */
|
|
138
147
|
exports.TradeVHOST = 'ecommerce';
|
package/enums.d.ts
CHANGED
|
@@ -231,6 +231,15 @@ export declare namespace ENUM {
|
|
|
231
231
|
/** 核销券 */
|
|
232
232
|
VOUCHER = "VOUCHER"
|
|
233
233
|
}
|
|
234
|
+
/** 支付参数状态 */
|
|
235
|
+
enum PaymentParamStatus {
|
|
236
|
+
/** 处理中 */
|
|
237
|
+
PROCESSING = "PROCESSING",
|
|
238
|
+
/** 成功 */
|
|
239
|
+
SUCCESS = "SUCCESS",
|
|
240
|
+
/** 失败 */
|
|
241
|
+
FAILED = "FAILED"
|
|
242
|
+
}
|
|
234
243
|
/** 申请退款状态 */
|
|
235
244
|
enum ApplyRefundStatus {
|
|
236
245
|
/** 极速退款 */
|
|
@@ -383,7 +392,9 @@ export declare namespace EXCHANGE_ENUM {
|
|
|
383
392
|
/** 取消交易 */
|
|
384
393
|
CANCELED = "trade.order.positive.canceled",
|
|
385
394
|
/** 已关闭 */
|
|
386
|
-
CLOSED = "trade.order.positive.closed"
|
|
395
|
+
CLOSED = "trade.order.positive.closed",
|
|
396
|
+
/** 获取支付参数 */
|
|
397
|
+
FETCH_PAYMENT_PARAM = "trade.order.positive.fetch_payment_param"
|
|
387
398
|
}
|
|
388
399
|
/** 逆向订单交换机路由 */
|
|
389
400
|
enum RosRoutingKeyEnum {
|
package/enums.js
CHANGED
|
@@ -257,6 +257,16 @@ var ENUM;
|
|
|
257
257
|
/** 核销券 */
|
|
258
258
|
PayWay["VOUCHER"] = "VOUCHER";
|
|
259
259
|
})(PayWay = ENUM.PayWay || (ENUM.PayWay = {}));
|
|
260
|
+
/** 支付参数状态 */
|
|
261
|
+
let PaymentParamStatus;
|
|
262
|
+
(function (PaymentParamStatus) {
|
|
263
|
+
/** 处理中 */
|
|
264
|
+
PaymentParamStatus["PROCESSING"] = "PROCESSING";
|
|
265
|
+
/** 成功 */
|
|
266
|
+
PaymentParamStatus["SUCCESS"] = "SUCCESS";
|
|
267
|
+
/** 失败 */
|
|
268
|
+
PaymentParamStatus["FAILED"] = "FAILED";
|
|
269
|
+
})(PaymentParamStatus = ENUM.PaymentParamStatus || (ENUM.PaymentParamStatus = {}));
|
|
260
270
|
/** 申请退款状态 */
|
|
261
271
|
let ApplyRefundStatus;
|
|
262
272
|
(function (ApplyRefundStatus) {
|
|
@@ -429,6 +439,8 @@ var EXCHANGE_ENUM;
|
|
|
429
439
|
PosRoutingKeyEnum["CANCELED"] = "trade.order.positive.canceled";
|
|
430
440
|
/** 已关闭 */
|
|
431
441
|
PosRoutingKeyEnum["CLOSED"] = "trade.order.positive.closed";
|
|
442
|
+
/** 获取支付参数 */
|
|
443
|
+
PosRoutingKeyEnum["FETCH_PAYMENT_PARAM"] = "trade.order.positive.fetch_payment_param";
|
|
432
444
|
})(PosRoutingKeyEnum = EXCHANGE_ENUM.PosRoutingKeyEnum || (EXCHANGE_ENUM.PosRoutingKeyEnum = {}));
|
|
433
445
|
/** 逆向订单交换机路由 */
|
|
434
446
|
let RosRoutingKeyEnum;
|
package/index.d.ts
CHANGED
|
@@ -4,6 +4,6 @@ export * as STATISTICS from './modules/statistics';
|
|
|
4
4
|
export { ENUM, ENUM_CN, EXCHANGE_ENUM } from './enums';
|
|
5
5
|
export * as CONSTS from './consts';
|
|
6
6
|
export * as DTO from './types';
|
|
7
|
-
export { PromotionCouponTypeList, PromotionCouponTypeMap, PromotionToReverseResourceTypeMap as OrderPromotionToReverseResourceTypeMap, ReverseResourceCouponTypeList, REDIS_LOCK_KEY, } from './consts';
|
|
7
|
+
export { PromotionCouponTypeList, PromotionCouponTypeMap, PromotionToReverseResourceTypeMap as OrderPromotionToReverseResourceTypeMap, ReverseResourceCouponTypeList, REDIS_KEY, REDIS_LOCK_KEY, } from './consts';
|
|
8
8
|
export { verificationService } from './modules/verification/service';
|
|
9
9
|
export type { VerificationService as VerificationServiceTypes } from './modules/verification/types';
|
package/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.verificationService = exports.REDIS_LOCK_KEY = exports.ReverseResourceCouponTypeList = exports.OrderPromotionToReverseResourceTypeMap = exports.PromotionCouponTypeMap = exports.PromotionCouponTypeList = exports.DTO = exports.CONSTS = exports.EXCHANGE_ENUM = exports.ENUM_CN = exports.ENUM = exports.STATISTICS = exports.ROS = exports.POS = void 0;
|
|
36
|
+
exports.verificationService = exports.REDIS_LOCK_KEY = exports.REDIS_KEY = exports.ReverseResourceCouponTypeList = exports.OrderPromotionToReverseResourceTypeMap = exports.PromotionCouponTypeMap = exports.PromotionCouponTypeList = exports.DTO = exports.CONSTS = exports.EXCHANGE_ENUM = exports.ENUM_CN = exports.ENUM = exports.STATISTICS = exports.ROS = exports.POS = void 0;
|
|
37
37
|
exports.POS = __importStar(require("./modules/pos"));
|
|
38
38
|
exports.ROS = __importStar(require("./modules/ros"));
|
|
39
39
|
exports.STATISTICS = __importStar(require("./modules/statistics"));
|
|
@@ -48,6 +48,7 @@ Object.defineProperty(exports, "PromotionCouponTypeList", { enumerable: true, ge
|
|
|
48
48
|
Object.defineProperty(exports, "PromotionCouponTypeMap", { enumerable: true, get: function () { return consts_1.PromotionCouponTypeMap; } });
|
|
49
49
|
Object.defineProperty(exports, "OrderPromotionToReverseResourceTypeMap", { enumerable: true, get: function () { return consts_1.PromotionToReverseResourceTypeMap; } });
|
|
50
50
|
Object.defineProperty(exports, "ReverseResourceCouponTypeList", { enumerable: true, get: function () { return consts_1.ReverseResourceCouponTypeList; } });
|
|
51
|
+
Object.defineProperty(exports, "REDIS_KEY", { enumerable: true, get: function () { return consts_1.REDIS_KEY; } });
|
|
51
52
|
Object.defineProperty(exports, "REDIS_LOCK_KEY", { enumerable: true, get: function () { return consts_1.REDIS_LOCK_KEY; } });
|
|
52
53
|
// 核销
|
|
53
54
|
var service_1 = require("./modules/verification/service");
|
|
@@ -777,6 +777,10 @@ export declare namespace PosOrderQueryService {
|
|
|
777
777
|
/** 订单ID */
|
|
778
778
|
orderId: string;
|
|
779
779
|
}
|
|
780
|
+
interface IGetPaymentParam {
|
|
781
|
+
/** 订单ID */
|
|
782
|
+
orderId: string;
|
|
783
|
+
}
|
|
780
784
|
interface IGetUserPositiveAmount {
|
|
781
785
|
/** 用户ID */
|
|
782
786
|
userId: string;
|
|
@@ -842,6 +846,10 @@ export declare namespace PosOrderQueryService {
|
|
|
842
846
|
source: ENUM.OrderSource;
|
|
843
847
|
/** 订单类型 */
|
|
844
848
|
orderType: ENUM.OrderType;
|
|
849
|
+
/** 单位积分数 */
|
|
850
|
+
unitPointNum: number;
|
|
851
|
+
/** 单位优惠券数量 */
|
|
852
|
+
unitCouponNum: number;
|
|
845
853
|
/** 积分数 */
|
|
846
854
|
pointNum: number;
|
|
847
855
|
/** 优惠券数量 */
|
|
@@ -915,6 +923,14 @@ export declare namespace PosOrderQueryService {
|
|
|
915
923
|
memberPrice: number;
|
|
916
924
|
/** 商品提货方式 */
|
|
917
925
|
productPick: PRODUCT_SERVICE_ENUM.PRODUCT_ENUM.PICK_TYPE;
|
|
926
|
+
/** 下单时的积分数量 */
|
|
927
|
+
pointNum: number;
|
|
928
|
+
/** 积分单价(积分数量/商品数量) */
|
|
929
|
+
unitPointPrice: number;
|
|
930
|
+
/** 下单时的券总金额 */
|
|
931
|
+
couponAmount: number;
|
|
932
|
+
/** 券单价(券总金额/商品数量) */
|
|
933
|
+
unitCouponPrice: number;
|
|
918
934
|
};
|
|
919
935
|
/** 门店信息 */
|
|
920
936
|
store: {
|
|
@@ -1020,12 +1036,16 @@ export declare namespace PosOrderQueryService {
|
|
|
1020
1036
|
receiverPhone: string;
|
|
1021
1037
|
}
|
|
1022
1038
|
interface IGetOrderPayParams {
|
|
1023
|
-
/**
|
|
1024
|
-
|
|
1025
|
-
/**
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1039
|
+
/** 支付参数状态 */
|
|
1040
|
+
status: ENUM.PaymentParamStatus;
|
|
1041
|
+
/** 微信支付请求参数(status=SUCCESS 时有值,其他状态为 null) */
|
|
1042
|
+
payment: DTO.IWePayParam | null;
|
|
1043
|
+
}
|
|
1044
|
+
interface IGetPaymentParam {
|
|
1045
|
+
/** 支付参数状态:null=未找到,PROCESSING=处理中,SUCCESS=成功,FAILED=失败 */
|
|
1046
|
+
status: 'PROCESSING' | 'SUCCESS' | 'FAILED' | null;
|
|
1047
|
+
/** 支付参数(仅 status=SUCCESS 时有值) */
|
|
1048
|
+
paymentParam: DTO.IPaymentParam | null;
|
|
1029
1049
|
}
|
|
1030
1050
|
interface IGetUserPositiveAmount {
|
|
1031
1051
|
/** 用户ID */
|
|
@@ -99,6 +99,11 @@ export declare namespace RosOrderQueryService {
|
|
|
99
99
|
pageIndex: number;
|
|
100
100
|
pageSize: number;
|
|
101
101
|
};
|
|
102
|
+
/** 深度分页游标(可选,用于优化深度分页性能) */
|
|
103
|
+
cursor?: {
|
|
104
|
+
lastCreatedAt: number;
|
|
105
|
+
lastId: string;
|
|
106
|
+
};
|
|
102
107
|
}
|
|
103
108
|
interface IExportOrderData extends IList {
|
|
104
109
|
}
|
|
@@ -110,6 +115,11 @@ export declare namespace RosOrderQueryService {
|
|
|
110
115
|
pageIndex: number;
|
|
111
116
|
pageSize: number;
|
|
112
117
|
};
|
|
118
|
+
/** 深度分页游标(可选,用于优化深度分页性能) */
|
|
119
|
+
cursor?: {
|
|
120
|
+
lastCreatedAt: number;
|
|
121
|
+
lastId: string;
|
|
122
|
+
};
|
|
113
123
|
}
|
|
114
124
|
interface IGetApplyRefundInfo {
|
|
115
125
|
/** 正向订单ID */
|
|
@@ -276,6 +286,11 @@ export declare namespace RosOrderQueryService {
|
|
|
276
286
|
list: IListItem[];
|
|
277
287
|
/** 总记录数 */
|
|
278
288
|
total: number;
|
|
289
|
+
/** 下一页游标(如果还有更多数据) */
|
|
290
|
+
nextCursor?: {
|
|
291
|
+
lastCreatedAt: number;
|
|
292
|
+
lastId: string;
|
|
293
|
+
};
|
|
279
294
|
}
|
|
280
295
|
interface IExportOrderData {
|
|
281
296
|
/** 表头 */
|
|
@@ -415,6 +430,18 @@ export declare namespace RosOrderQueryService {
|
|
|
415
430
|
source: ENUM.OrderSource;
|
|
416
431
|
/** 订单类型 */
|
|
417
432
|
orderType: ENUM.OrderType;
|
|
433
|
+
/** 退款金额 */
|
|
434
|
+
refundAmount: number;
|
|
435
|
+
/** 单位积分数 */
|
|
436
|
+
unitPointNum: number;
|
|
437
|
+
/** 单位优惠券数量 */
|
|
438
|
+
unitCouponNum: number;
|
|
439
|
+
/** 积分数 */
|
|
440
|
+
pointNum: number;
|
|
441
|
+
/** 优惠券数量 */
|
|
442
|
+
couponNum: number;
|
|
443
|
+
/** 商品数量 */
|
|
444
|
+
productQuantity: number;
|
|
418
445
|
}
|
|
419
446
|
interface IRefundOrderList {
|
|
420
447
|
/** 订单列表 */
|
|
@@ -448,7 +475,10 @@ export declare namespace RosOrderQueryService {
|
|
|
448
475
|
/** 退回优惠券数量 */
|
|
449
476
|
exchangeCouponNum: number;
|
|
450
477
|
/** 退回优惠券码 */
|
|
451
|
-
refundedCoupons:
|
|
478
|
+
refundedCoupons: {
|
|
479
|
+
code: string;
|
|
480
|
+
discount: number;
|
|
481
|
+
}[];
|
|
452
482
|
};
|
|
453
483
|
/** 积分商城订单信息 */
|
|
454
484
|
pointsOrderInfo?: {
|
|
@@ -469,6 +499,14 @@ export declare namespace RosOrderQueryService {
|
|
|
469
499
|
unitPrice: number;
|
|
470
500
|
/** 商品会员价 */
|
|
471
501
|
memberPrice: number;
|
|
502
|
+
/** 下单时的积分数量 */
|
|
503
|
+
pointNum: number;
|
|
504
|
+
/** 积分单价(积分数量/商品数量) */
|
|
505
|
+
unitPointPrice: number;
|
|
506
|
+
/** 下单时的券总金额 */
|
|
507
|
+
couponAmount: number;
|
|
508
|
+
/** 券单价(券总金额/商品数量) */
|
|
509
|
+
unitCouponPrice: number;
|
|
472
510
|
};
|
|
473
511
|
}
|
|
474
512
|
interface IGetRefundableResource {
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -321,7 +321,7 @@ export interface RosOrderPayload {
|
|
|
321
321
|
/** 事件发送时间 */
|
|
322
322
|
eventTime: number;
|
|
323
323
|
/** 资源退还时间 */
|
|
324
|
-
refundAt
|
|
324
|
+
refundAt?: number;
|
|
325
325
|
}
|
|
326
326
|
export interface RosOrderHeaders {
|
|
327
327
|
/** 是否全单退(0=否,1=是)退最后一份也算全单退 */
|
|
@@ -357,6 +357,10 @@ export interface ICouponInfo {
|
|
|
357
357
|
validStartTime?: number;
|
|
358
358
|
/** 有效期结束 */
|
|
359
359
|
validEndTime?: number;
|
|
360
|
+
/** 领取渠道一级 */
|
|
361
|
+
getChannel1?: string;
|
|
362
|
+
/** 领取渠道二级 */
|
|
363
|
+
getChannel2?: string;
|
|
360
364
|
}
|
|
361
365
|
/** 会员信息 */
|
|
362
366
|
export interface IMemberInfo {
|
|
@@ -366,21 +370,87 @@ export interface IMemberInfo {
|
|
|
366
370
|
quantity: number;
|
|
367
371
|
}
|
|
368
372
|
/** 订单支付额外信息 */
|
|
373
|
+
/**
|
|
374
|
+
* 现金支付信息
|
|
375
|
+
*/
|
|
376
|
+
export interface ICashPaymentInfo {
|
|
377
|
+
/** 子商户号 */
|
|
378
|
+
subMchId: string;
|
|
379
|
+
/** 预支付ID */
|
|
380
|
+
prepayId: string;
|
|
381
|
+
/** 支付参数 */
|
|
382
|
+
payment: IWePayParam;
|
|
383
|
+
/** 用户openId */
|
|
384
|
+
openId?: string;
|
|
385
|
+
/** 小程序appId */
|
|
386
|
+
appId?: string;
|
|
387
|
+
/** 商户号信息 */
|
|
388
|
+
merchantInfo: IMerchantInfo;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* 订单支付额外信息
|
|
392
|
+
*/
|
|
369
393
|
export interface ITradeOrderPaymentExtraInfo {
|
|
370
394
|
/** 现金支付信息 */
|
|
371
|
-
cash?:
|
|
372
|
-
subMchId: string;
|
|
373
|
-
prepayId: string;
|
|
374
|
-
payment: IWePayParam;
|
|
375
|
-
/** 用户openId */
|
|
376
|
-
openId?: string;
|
|
377
|
-
/** 小程序appId */
|
|
378
|
-
appId?: string;
|
|
379
|
-
/** 商户号信息 */
|
|
380
|
-
merchantInfo: IMerchantInfo;
|
|
381
|
-
};
|
|
395
|
+
cash?: ICashPaymentInfo;
|
|
382
396
|
/** 兑换券信息 */
|
|
383
397
|
exchangeCoupon?: ICouponInfo[];
|
|
384
398
|
/** 核销券信息 */
|
|
385
399
|
coupon?: ICouponInfo;
|
|
386
400
|
}
|
|
401
|
+
/**
|
|
402
|
+
* 调用支付接口的请求参数
|
|
403
|
+
*/
|
|
404
|
+
export interface IPayReqParam {
|
|
405
|
+
/** 订单ID */
|
|
406
|
+
orderId: string;
|
|
407
|
+
/** 用户openId */
|
|
408
|
+
openId: string;
|
|
409
|
+
/** 支付金额(单位:分) */
|
|
410
|
+
amount: number;
|
|
411
|
+
/** 商品描述 */
|
|
412
|
+
description: string;
|
|
413
|
+
/** 客户端IP地址 */
|
|
414
|
+
clientIp?: string;
|
|
415
|
+
/** 小程序appId */
|
|
416
|
+
appId?: string;
|
|
417
|
+
/** 微信支付方式 */
|
|
418
|
+
payWay?: ENUM.WePayWay;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* 支付参数MQ消息Payload
|
|
422
|
+
*/
|
|
423
|
+
export interface IPaymentParamPayload {
|
|
424
|
+
/** 订单ID */
|
|
425
|
+
orderId: string;
|
|
426
|
+
/** 用户ID */
|
|
427
|
+
userId: string;
|
|
428
|
+
/** 订单创建时间戳(毫秒),用于消费者超时检查 */
|
|
429
|
+
createTime: number;
|
|
430
|
+
/** 调用支付接口的请求参数 */
|
|
431
|
+
payReqParam: IPayReqParam;
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* 支付参数(返回给前端的支付参数)
|
|
435
|
+
*/
|
|
436
|
+
export interface IPaymentParam {
|
|
437
|
+
/** 微信支付参数 */
|
|
438
|
+
[ENUM.PayPlatform.WECHAT]?: IWePayParam;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* 支付参数缓存 Redis Hash 数据结构
|
|
442
|
+
* Key: TRADE:PAYMENT_PARAM:CACHE:{orderId}
|
|
443
|
+
* Expire: 30分钟
|
|
444
|
+
*/
|
|
445
|
+
export interface IPaymentParamCache {
|
|
446
|
+
/** 支付参数状态 */
|
|
447
|
+
status: ENUM.PaymentParamStatus;
|
|
448
|
+
/** 用户ID(用于验证订单归属) */
|
|
449
|
+
userId: string;
|
|
450
|
+
/** 支付参数(IPaymentParam 类型的 JSON 字符串,仅 SUCCESS 时有值) */
|
|
451
|
+
paymentParam?: string;
|
|
452
|
+
/** 订单创建时间戳(毫秒,用于超时检查) */
|
|
453
|
+
createTime: string;
|
|
454
|
+
/** 更新时间戳(毫秒) */
|
|
455
|
+
updatedAt: string;
|
|
456
|
+
}
|