@be-link/ecommerce-trade-service-node-sdk 0.1.84 → 0.1.86

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/enums.d.ts CHANGED
@@ -103,6 +103,21 @@ export declare namespace ENUM {
103
103
  /** 核销券 */
104
104
  VOUCHER = "VOUCHER"
105
105
  }
106
+ /** 订单资源类型 */
107
+ enum OrderResourceType {
108
+ /** 资金 */
109
+ FUNDS = "FUNDS",
110
+ /** 商品库存 */
111
+ STOCK = "STOCK",
112
+ /** 积分 */
113
+ POINTS = "POINTS",
114
+ /** 兑换券 */
115
+ COUPON = "COUPON",
116
+ /** 满减券 */
117
+ FULL_REDUCTION = "FULL_REDUCTION",
118
+ /** 核销券 */
119
+ VOUCHER = "VOUCHER"
120
+ }
106
121
  /** 逆向订单状态 */
107
122
  enum ReverseOrderStatus {
108
123
  /** 待审核 */
package/enums.js CHANGED
@@ -115,6 +115,22 @@ var ENUM;
115
115
  /** 核销券 */
116
116
  ReverseResourceType["VOUCHER"] = "VOUCHER";
117
117
  })(ReverseResourceType = ENUM.ReverseResourceType || (ENUM.ReverseResourceType = {}));
118
+ /** 订单资源类型 */
119
+ let OrderResourceType;
120
+ (function (OrderResourceType) {
121
+ /** 资金 */
122
+ OrderResourceType["FUNDS"] = "FUNDS";
123
+ /** 商品库存 */
124
+ OrderResourceType["STOCK"] = "STOCK";
125
+ /** 积分 */
126
+ OrderResourceType["POINTS"] = "POINTS";
127
+ /** 兑换券 */
128
+ OrderResourceType["COUPON"] = "COUPON";
129
+ /** 满减券 */
130
+ OrderResourceType["FULL_REDUCTION"] = "FULL_REDUCTION";
131
+ /** 核销券 */
132
+ OrderResourceType["VOUCHER"] = "VOUCHER";
133
+ })(OrderResourceType = ENUM.OrderResourceType || (ENUM.OrderResourceType = {}));
118
134
  /** 逆向订单状态 */
119
135
  let ReverseOrderStatus;
120
136
  (function (ReverseOrderStatus) {
@@ -3,6 +3,7 @@ import BaseService from '../../BaseService';
3
3
  declare class OrderCoreByInternalService extends BaseService {
4
4
  protected prefixUrl: string;
5
5
  createOrderByVerifyCoupon(request: PosCoreService.ByInternal.Request.ICreateOrderByVerifyCoupon): Promise<PosCoreService.ByInternal.Response.ICreateOrderByVerifyCoupon>;
6
+ switchPaymentMerchantNo(request: PosCoreService.ByInternal.Request.ISwitchPaymentMerchantNo): Promise<void>;
6
7
  stressTestOrderPaid(request: PosCoreService.ByInternal.Request.IStressTestOrderPaid): Promise<void>;
7
8
  }
8
9
  export declare const orderCoreByInternalService: OrderCoreByInternalService;
@@ -24,6 +24,9 @@ let OrderCoreByInternalService = class OrderCoreByInternalService extends BaseSe
24
24
  createOrderByVerifyCoupon(request) {
25
25
  return (0, http_1.callApi)(this.getApiUrl(this.createOrderByVerifyCoupon), request);
26
26
  }
27
+ switchPaymentMerchantNo(request) {
28
+ return (0, http_1.callApi)(this.getApiUrl(this.switchPaymentMerchantNo), request);
29
+ }
27
30
  stressTestOrderPaid(request) {
28
31
  return (0, http_1.callApi)(this.getApiUrl(this.stressTestOrderPaid), request);
29
32
  }
@@ -33,6 +36,11 @@ __decorate([
33
36
  (0, tsoa_1.Post)('create-order-by-verify-coupon'),
34
37
  __param(0, (0, tsoa_1.Body)())
35
38
  ], OrderCoreByInternalService.prototype, "createOrderByVerifyCoupon", null);
39
+ __decorate([
40
+ (0, tsoa_1.OperationId)('切换支付商户号'),
41
+ (0, tsoa_1.Post)('switch-payment-merchant-no'),
42
+ __param(0, (0, tsoa_1.Body)())
43
+ ], OrderCoreByInternalService.prototype, "switchPaymentMerchantNo", null);
36
44
  __decorate([
37
45
  (0, tsoa_1.OperationId)('压测支付回调'),
38
46
  (0, tsoa_1.Post)('stress-test-order-paid'),
@@ -109,6 +109,10 @@ export declare namespace PosCoreService {
109
109
  couponInfos?: Dto.ICoupon[];
110
110
  /** 用户选择使用的积分数 */
111
111
  pointNum?: number;
112
+ /** 小程序 appId(可选) */
113
+ appId?: string;
114
+ /** 用户 openId(可选) */
115
+ openId?: string;
112
116
  }
113
117
  interface IUpdateAddress {
114
118
  userId: string;
@@ -154,6 +158,11 @@ export declare namespace PosCoreService {
154
158
  userId: string;
155
159
  skuId: string;
156
160
  }
161
+ /** 切换支付商户号请求参数 */
162
+ interface ISwitchPaymentMerchantNo {
163
+ /** 商户号序号(0、1、2、3) */
164
+ merIndex: number;
165
+ }
157
166
  /** 压测支付回调请求参数 */
158
167
  interface IStressTestOrderPaid {
159
168
  /** 订单ID */
@@ -199,6 +208,8 @@ export declare namespace PosCoreService {
199
208
  interface CoreByInternalController {
200
209
  /** 核销券创建订单 */
201
210
  createOrderByVerifyCoupon(request: ByInternal.Request.ICreateOrderByVerifyCoupon, req: any): Promise<ByInternal.Response.ICreateOrderByVerifyCoupon>;
211
+ /** 切换支付商户号 */
212
+ switchPaymentMerchantNo(request: ByInternal.Request.ISwitchPaymentMerchantNo, req: any): Promise<void>;
202
213
  /** 压测支付回调(内部使用,跳过宝付回调解析) */
203
214
  stressTestOrderPaid(request: ByInternal.Request.IStressTestOrderPaid, req: any): Promise<void>;
204
215
  }
@@ -614,6 +614,10 @@ export declare namespace PosOrderQueryService {
614
614
  /** 时间范围结束时间(时间戳) */
615
615
  endTime?: number;
616
616
  }
617
+ interface IGetTradeSnapshot {
618
+ /** 订单ID */
619
+ orderId: string;
620
+ }
617
621
  }
618
622
  /** 微信支付请求参数 */
619
623
  interface IWePayReq {
@@ -854,6 +858,45 @@ export declare namespace PosOrderQueryService {
854
858
  /** 时间范围结束时间 */
855
859
  endTime?: number;
856
860
  }
861
+ interface IGetTradeSnapshot {
862
+ /** 商品快照信息 */
863
+ productSnapshot: {
864
+ /** 商品ID */
865
+ productId: string;
866
+ /** 商品名称 */
867
+ productName: string;
868
+ /** 商品主图URL */
869
+ productImage: string;
870
+ /** 商品提货方式 */
871
+ productPick: string;
872
+ /** 商品发货方式 */
873
+ productDispatch: string;
874
+ };
875
+ /** SKU快照信息 */
876
+ skuSnapshot: {
877
+ /** SKU ID */
878
+ skuId: string;
879
+ /** SKU编码 */
880
+ skuCode: string;
881
+ /** 商品单价(分) */
882
+ price: number;
883
+ /** 商品规格属性列表 */
884
+ attrs: Array<{
885
+ attrName: string;
886
+ attrValue: string;
887
+ }>;
888
+ };
889
+ /** 商品数量 */
890
+ quantity: number;
891
+ /** 子商品SKU信息列表 */
892
+ subProductSkuInfos?: Array<{
893
+ productId: string;
894
+ skuId: string;
895
+ quantity: number;
896
+ productSnapshot: any;
897
+ skuSnapshot: any;
898
+ }>;
899
+ }
857
900
  }
858
901
  interface QueryController {
859
902
  /** 根据商品提货方式查询用户最近一条订单 */
@@ -870,6 +913,8 @@ export declare namespace PosOrderQueryService {
870
913
  getOrderPayParams(request: Request.IGetOrderPayParams, req: any): Promise<Response.IGetOrderPayParams>;
871
914
  /** 查询用户一段时间内的正向金额 */
872
915
  getUserPositiveAmount(request: Request.IGetUserPositiveAmount, req: any): Promise<Response.IGetUserPositiveAmount>;
916
+ /** 查询交易快照(商品快照) */
917
+ getTradeSnapshot(request: Request.IGetTradeSnapshot, req: any): Promise<Response.IGetTradeSnapshot>;
873
918
  }
874
919
  }
875
920
  }
@@ -10,6 +10,7 @@ declare class OrderQueryByUserService extends BaseService {
10
10
  orderDetail(request: PosOrderQueryService.ByUser.Request.IOrderDetail): Promise<PosOrderQueryService.ByUser.Response.IOrderDetail>;
11
11
  getOrderPayParams(request: PosOrderQueryService.ByUser.Request.IGetOrderPayParams): Promise<PosOrderQueryService.ByUser.Response.IGetOrderPayParams>;
12
12
  getUserPositiveAmount(request: PosOrderQueryService.ByUser.Request.IGetUserPositiveAmount): Promise<PosOrderQueryService.ByUser.Response.IGetUserPositiveAmount>;
13
+ getTradeSnapshot(request: PosOrderQueryService.ByUser.Request.IGetTradeSnapshot): Promise<PosOrderQueryService.ByUser.Response.IGetTradeSnapshot>;
13
14
  }
14
15
  export declare const queryByUserService: OrderQueryByUserService;
15
16
  export default queryByUserService;
@@ -45,6 +45,9 @@ let OrderQueryByUserService = class OrderQueryByUserService extends BaseService_
45
45
  getUserPositiveAmount(request) {
46
46
  return (0, http_1.callApi)(this.getApiUrl(this.getUserPositiveAmount), request);
47
47
  }
48
+ getTradeSnapshot(request) {
49
+ return (0, http_1.callApi)(this.getApiUrl(this.getTradeSnapshot), request);
50
+ }
48
51
  };
49
52
  __decorate([
50
53
  (0, tsoa_1.OperationId)('根据商品提货方式查询用户最近订单'),
@@ -86,6 +89,11 @@ __decorate([
86
89
  (0, tsoa_1.Post)('get-user-positive-amount'),
87
90
  __param(0, (0, tsoa_1.Body)())
88
91
  ], OrderQueryByUserService.prototype, "getUserPositiveAmount", null);
92
+ __decorate([
93
+ (0, tsoa_1.OperationId)('查询交易快照(商品快照)'),
94
+ (0, tsoa_1.Post)('get-trade-snapshot'),
95
+ __param(0, (0, tsoa_1.Body)())
96
+ ], OrderQueryByUserService.prototype, "getTradeSnapshot", null);
89
97
  OrderQueryByUserService = __decorate([
90
98
  (0, tsoa_1.Route)('pos/query/user'),
91
99
  (0, tsoa_1.Tags)('PosOrderQuery')
@@ -383,6 +383,17 @@ export declare namespace RosOrderQueryService {
383
383
  pointNum: number;
384
384
  /** 拒绝原因(状态为拒绝时返回) */
385
385
  rejectReason?: string;
386
+ /** 退回优惠券数量 */
387
+ exchangeCouponNum: number;
388
+ /** 退回优惠券详情 */
389
+ refundedCoupons: string[];
390
+ };
391
+ /** 积分商城订单信息 */
392
+ pointsOrderInfo?: {
393
+ /** 兑换积分数量 */
394
+ exchangePointsAmount: number;
395
+ /** 兑换优惠券数量 */
396
+ exchangeCouponsAmount: number;
386
397
  };
387
398
  /** 商品信息 */
388
399
  product: {
@@ -394,6 +405,8 @@ export declare namespace RosOrderQueryService {
394
405
  productSpec: string;
395
406
  /** 商品单价 */
396
407
  unitPrice: number;
408
+ /** 商品会员价 */
409
+ memberPrice: number;
397
410
  };
398
411
  }
399
412
  interface IGetRefundableResource {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@be-link/ecommerce-trade-service-node-sdk",
3
- "version": "0.1.84",
3
+ "version": "0.1.86",
4
4
  "description": "EcommerceTradeService Node.js SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.d.ts CHANGED
@@ -2,6 +2,17 @@
2
2
  /** 基础信息 */
3
3
  import { ENUM } from './enums';
4
4
  import { PRODUCT_SERVICE_ENUM } from '@be-link/ecommerce-product-service-node-sdk';
5
+ /**
6
+ * 商户号信息
7
+ */
8
+ export interface IMerchantInfo {
9
+ /** 交易终端号 */
10
+ terId: string;
11
+ /** 商户ID */
12
+ merId: string;
13
+ /** 子商户ID */
14
+ subMchId: string;
15
+ }
5
16
  export interface ITradeOrder {
6
17
  id: string;
7
18
  userId: string;
@@ -108,7 +119,7 @@ export interface ITradeOrderPayment {
108
119
  payAmount: number;
109
120
  payWay: ENUM.PayWay;
110
121
  bizId: string;
111
- extraInfo: any;
122
+ extraInfo: ITradeOrderPaymentExtraInfo;
112
123
  createdAt: number;
113
124
  updatedAt: number;
114
125
  }
@@ -119,12 +130,8 @@ export interface ITradeOrderPromotion {
119
130
  quantity: number;
120
131
  discount: number;
121
132
  snapshot: {
122
- coupon?: {
123
- id: string;
124
- code: string;
125
- name: string;
126
- discount: number;
127
- }[];
133
+ coupon?: ICouponInfo[];
134
+ member?: IMemberInfo[];
128
135
  };
129
136
  createdAt: number;
130
137
  updatedAt: number;
@@ -201,6 +208,8 @@ export interface IBizExtraInfo {
201
208
  name: string;
202
209
  code: string;
203
210
  }[];
211
+ /** 商户号信息(资金类型时,用于退款) */
212
+ merchantInfo?: IMerchantInfo;
204
213
  }
205
214
  export interface ITradeReverseOrderResource {
206
215
  id: string;
@@ -321,3 +330,46 @@ export interface IWePayParam {
321
330
  paySign: string;
322
331
  signType: string;
323
332
  }
333
+ /** 优惠券信息 */
334
+ export interface ICouponInfo {
335
+ /** 券模板ID */
336
+ id: string;
337
+ /** 券码 */
338
+ code: string;
339
+ /** 券模板名称 */
340
+ name: string;
341
+ /** 数量 */
342
+ quantity?: number;
343
+ /** 优惠金额 */
344
+ discount?: number;
345
+ /** 有效期开始 */
346
+ validStartTime?: number;
347
+ /** 有效期结束 */
348
+ validEndTime?: number;
349
+ }
350
+ /** 会员信息 */
351
+ export interface IMemberInfo {
352
+ /** 会员优惠金额 */
353
+ discount: number;
354
+ /** 份数 */
355
+ quantity: number;
356
+ }
357
+ /** 订单支付额外信息 */
358
+ export interface ITradeOrderPaymentExtraInfo {
359
+ /** 现金支付信息 */
360
+ cash?: {
361
+ subMchId: string;
362
+ prepayId: string;
363
+ payment: IWePayParam;
364
+ /** 用户openId */
365
+ openId?: string;
366
+ /** 小程序appId */
367
+ appId?: string;
368
+ /** 商户号信息 */
369
+ merchantInfo: IMerchantInfo;
370
+ };
371
+ /** 兑换券信息 */
372
+ exchangeCoupon?: ICouponInfo[];
373
+ /** 核销券信息 */
374
+ coupon?: ICouponInfo;
375
+ }