@qzsy/ums-pos 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +87 -2
- package/dist/cjs/client.js +95 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/constants.js +108 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/index.js +29 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +3 -0
- package/dist/cjs/types.js +3 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/client.d.ts +51 -0
- package/dist/esm/client.d.ts.map +1 -0
- package/dist/esm/client.js +91 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/constants.d.ts +35 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +105 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/types.d.ts +292 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/package.json +48 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 qunxing-payment contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,88 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @qzsy/ums-pos
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
银联商务 BC 分账 · POS 通分账模块(v20220520)。
|
|
4
|
+
|
|
5
|
+
覆盖商品信息上送、分账支付、分账退货、分账查询、聚合营销(查询/退货查询/退货)、异步分账确认。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @qzsy/ums-core @qzsy/ums-pos
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 使用
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { UmsClient } from '@qzsy/ums-core';
|
|
17
|
+
import { PosApi } from '@qzsy/ums-pos';
|
|
18
|
+
|
|
19
|
+
const client = new UmsClient({
|
|
20
|
+
appId: process.env.UMS_APP_ID!,
|
|
21
|
+
appKey: process.env.UMS_APP_KEY!,
|
|
22
|
+
env: 'test',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const pos = new PosApi(client, {
|
|
26
|
+
merchantCode: '898460115200115',
|
|
27
|
+
terminalCode: '12345678',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// 1. 上送商品与分账信息
|
|
31
|
+
const goods = await pos.uploadGoods({
|
|
32
|
+
systemTraceNum: '123456', // 6 位数字
|
|
33
|
+
transactionAmount: 2,
|
|
34
|
+
merchantOrderId: 'ORDER-1',
|
|
35
|
+
subAccountInfo: [
|
|
36
|
+
{ merchantCode: '898310048145530', amount: 1 },
|
|
37
|
+
{ merchantCode: '898310048145550', amount: 1 },
|
|
38
|
+
],
|
|
39
|
+
goodsInfo: JSON.stringify([{ name: '商品', price: 2 }]),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// 2. 分账支付
|
|
43
|
+
const pay = await pos.pay({
|
|
44
|
+
systemTraceNum: '123457',
|
|
45
|
+
transactionAmount: 2,
|
|
46
|
+
transactionCurrencyCode: '156',
|
|
47
|
+
merchantOrderId: 'ORDER-1',
|
|
48
|
+
retrievalRefNumOfAddGoodsInfo: goods.retrievalRefNum!,
|
|
49
|
+
payMode: 'CODE_SCAN',
|
|
50
|
+
payCode: '134567890123456789',
|
|
51
|
+
deviceType: '01',
|
|
52
|
+
subAccountInfo: [
|
|
53
|
+
{ merchantCode: '898310048145530', amount: 1 },
|
|
54
|
+
{ merchantCode: '898310048145550', amount: 1 },
|
|
55
|
+
],
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// 3. 查询
|
|
59
|
+
const query = await pos.query({ systemTraceNum: '123458', merchantOrderId: 'ORDER-1' });
|
|
60
|
+
if (query.queryResCode === '00') {
|
|
61
|
+
// 支付成功
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 方法
|
|
66
|
+
|
|
67
|
+
| 方法 | 路径 |
|
|
68
|
+
| --- | --- |
|
|
69
|
+
| `uploadGoods` | `/v1/poslink/transaction/sub-account/add-goods-info` |
|
|
70
|
+
| `pay` | `/v1/poslink/transaction/sub-account/pay` |
|
|
71
|
+
| `refund` | `/v1/poslink/transaction/sub-account/refund` |
|
|
72
|
+
| `query` | `/v1/poslink/transaction/sub-account/query` |
|
|
73
|
+
| `marketingQuery` | `.../convergence-marketing-query` |
|
|
74
|
+
| `marketingRefundQuery` | `.../convergence-marketing-refund-query` |
|
|
75
|
+
| `marketingRefund` | `.../convergence-marketing-refund` |
|
|
76
|
+
| `confirmAsyncSubAccount` | `.../asy-sub-account-confirm` |
|
|
77
|
+
|
|
78
|
+
`merchantCode` / `terminalCode` 可在构造时传入,也可单次覆盖;`systemTraceNum`、`termSsn`
|
|
79
|
+
会被校验为 6 位数字。
|
|
80
|
+
|
|
81
|
+
## 码值
|
|
82
|
+
|
|
83
|
+
`POS_SYSTEM_CODES`、`POS_TRANSACTION_CODES`、`POS_PAY_WAYS`、`POS_DEVICE_TYPES`、
|
|
84
|
+
`POS_PAY_MODES`、`POS_INST_MIDS` 均从包内导出,便于判码。
|
|
85
|
+
|
|
86
|
+
## License
|
|
87
|
+
|
|
88
|
+
MIT
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PosApi = exports.POS_PATHS = void 0;
|
|
4
|
+
const ums_core_1 = require("@qzsy/ums-core");
|
|
5
|
+
/** POS 通分账接口路径。 */
|
|
6
|
+
exports.POS_PATHS = {
|
|
7
|
+
addGoodsInfo: '/v1/poslink/transaction/sub-account/add-goods-info',
|
|
8
|
+
pay: '/v1/poslink/transaction/sub-account/pay',
|
|
9
|
+
refund: '/v1/poslink/transaction/sub-account/refund',
|
|
10
|
+
query: '/v1/poslink/transaction/sub-account/query',
|
|
11
|
+
marketingQuery: '/v1/poslink/transaction/sub-account/convergence-marketing-query',
|
|
12
|
+
marketingRefundQuery: '/v1/poslink/transaction/sub-account/convergence-marketing-refund-query',
|
|
13
|
+
marketingRefund: '/v1/poslink/transaction/sub-account/convergence-marketing-refund',
|
|
14
|
+
confirmAsyncSubAccount: '/v1/poslink/transaction/sub-account/asy-sub-account-confirm',
|
|
15
|
+
};
|
|
16
|
+
function assertSixDigits(value, field) {
|
|
17
|
+
if (!value || !/^\d{6}$/.test(value)) {
|
|
18
|
+
throw new ums_core_1.UmsValidationError(`${field} 必须是 6 位数字,收到 "${value ?? ''}"`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* POS 通分账 API。
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* const pos = new PosApi(client, { merchantCode, terminalCode });
|
|
26
|
+
* const goods = await pos.uploadGoods({ ... });
|
|
27
|
+
* const pay = await pos.pay({ retrievalRefNumOfAddGoodsInfo: goods.retrievalRefNum!, ... });
|
|
28
|
+
*/
|
|
29
|
+
class PosApi {
|
|
30
|
+
client;
|
|
31
|
+
options;
|
|
32
|
+
constructor(client, options = {}) {
|
|
33
|
+
this.client = client;
|
|
34
|
+
this.options = options;
|
|
35
|
+
}
|
|
36
|
+
fill(input) {
|
|
37
|
+
const out = { ...input };
|
|
38
|
+
out.merchantCode ??= this.options.merchantCode;
|
|
39
|
+
out.terminalCode ??= this.options.terminalCode;
|
|
40
|
+
if (!out.merchantCode)
|
|
41
|
+
throw new ums_core_1.UmsValidationError('merchantCode(商户号)不能为空');
|
|
42
|
+
if (!out.terminalCode)
|
|
43
|
+
throw new ums_core_1.UmsValidationError('terminalCode(终端号)不能为空');
|
|
44
|
+
return out;
|
|
45
|
+
}
|
|
46
|
+
/** 1.1 商品信息上送(分账支付前必须先上送)。 */
|
|
47
|
+
async uploadGoods(input, options) {
|
|
48
|
+
assertSixDigits(input.systemTraceNum, 'systemTraceNum');
|
|
49
|
+
return this.client.request(exports.POS_PATHS.addGoodsInfo, this.fill(input), options);
|
|
50
|
+
}
|
|
51
|
+
/** 1.2 分账支付。 */
|
|
52
|
+
async pay(input, options) {
|
|
53
|
+
assertSixDigits(input.systemTraceNum, 'systemTraceNum');
|
|
54
|
+
return this.client.request(exports.POS_PATHS.pay, this.fill(input), options);
|
|
55
|
+
}
|
|
56
|
+
/** 1.3 分账退货。 */
|
|
57
|
+
async refund(input, options) {
|
|
58
|
+
assertSixDigits(input.systemTraceNum, 'systemTraceNum');
|
|
59
|
+
assertSixDigits(input.originalSystemTraceNum, 'originalSystemTraceNum');
|
|
60
|
+
return this.client.request(exports.POS_PATHS.refund, this.fill(input), options);
|
|
61
|
+
}
|
|
62
|
+
/** 1.4 分账查询(幂等)。 */
|
|
63
|
+
async query(input, options) {
|
|
64
|
+
assertSixDigits(input.systemTraceNum, 'systemTraceNum');
|
|
65
|
+
if (!input.originalSystemTraceNum && !input.merchantOrderId) {
|
|
66
|
+
throw new ums_core_1.UmsValidationError('originalSystemTraceNum 与 merchantOrderId 至少需要传一个');
|
|
67
|
+
}
|
|
68
|
+
return this.client.request(exports.POS_PATHS.query, this.fill(input), {
|
|
69
|
+
idempotent: true,
|
|
70
|
+
...options,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/** 1.5 聚合营销查询(营销支付前调用)。 */
|
|
74
|
+
async marketingQuery(input, options) {
|
|
75
|
+
assertSixDigits(input.termSsn, 'termSsn');
|
|
76
|
+
return this.client.request(exports.POS_PATHS.marketingQuery, this.fill(input), options);
|
|
77
|
+
}
|
|
78
|
+
/** 1.6 聚合营销退货查询(幂等)。 */
|
|
79
|
+
async marketingRefundQuery(input, options) {
|
|
80
|
+
assertSixDigits(input.termSsn, 'termSsn');
|
|
81
|
+
return this.client.request(exports.POS_PATHS.marketingRefundQuery, this.fill(input), { idempotent: true, ...options });
|
|
82
|
+
}
|
|
83
|
+
/** 1.7 聚合营销退货。 */
|
|
84
|
+
async marketingRefund(input, options) {
|
|
85
|
+
assertSixDigits(input.termSsn, 'termSsn');
|
|
86
|
+
return this.client.request(exports.POS_PATHS.marketingRefund, this.fill(input), options);
|
|
87
|
+
}
|
|
88
|
+
/** 1.8 异步分账消费确认。 */
|
|
89
|
+
async confirmAsyncSubAccount(input, options) {
|
|
90
|
+
assertSixDigits(input.termSsn, 'termSsn');
|
|
91
|
+
return this.client.request(exports.POS_PATHS.confirmAsyncSubAccount, this.fill(input), options);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.PosApi = PosApi;
|
|
95
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":";;;AAAA,6CAIwB;AAoBxB,mBAAmB;AACN,QAAA,SAAS,GAAG;IACvB,YAAY,EAAE,oDAAoD;IAClE,GAAG,EAAE,yCAAyC;IAC9C,MAAM,EAAE,4CAA4C;IACpD,KAAK,EAAE,2CAA2C;IAClD,cAAc,EAAE,iEAAiE;IACjF,oBAAoB,EAClB,wEAAwE;IAC1E,eAAe,EAAE,kEAAkE;IACnF,sBAAsB,EAAE,6DAA6D;CAC7E,CAAC;AAUX,SAAS,eAAe,CAAC,KAAyB,EAAE,KAAa;IAC/D,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,6BAAkB,CAAC,GAAG,KAAK,kBAAkB,KAAK,IAAI,EAAE,GAAG,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAa,MAAM;IAEN;IACQ;IAFnB,YACW,MAAiB,EACT,UAAyB,EAAE;QADnC,WAAM,GAAN,MAAM,CAAW;QACT,YAAO,GAAP,OAAO,CAAoB;IAC3C,CAAC;IAEI,IAAI,CAA6D,KAAQ;QAC/E,MAAM,GAAG,GAAG,EAAE,GAAG,KAAK,EAAiC,CAAC;QACxD,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QAC/C,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC;QAC/C,IAAI,CAAC,GAAG,CAAC,YAAY;YAAE,MAAM,IAAI,6BAAkB,CAAC,uBAAuB,CAAC,CAAC;QAC7E,IAAI,CAAC,GAAG,CAAC,YAAY;YAAE,MAA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OAAO,CACxB,iBAAS,CAAC,sBAAsB,EAChC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAChB,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AA1GD,wBA0GC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* POS 通分账常量(《03-POS通分账交易接口》第 2 章)。
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.POS_INST_MIDS = exports.POS_PAY_MODES = exports.POS_DEVICE_TYPES = exports.POS_PAY_WAYS = exports.POS_TRANSACTION_CODES = exports.POS_SYSTEM_CODES = void 0;
|
|
7
|
+
/** 系统返回码。 */
|
|
8
|
+
exports.POS_SYSTEM_CODES = {
|
|
9
|
+
'0000': '正常',
|
|
10
|
+
'1000': '认证失败',
|
|
11
|
+
'1001': '授权失败',
|
|
12
|
+
'9001': '参数校验失败',
|
|
13
|
+
'9999': '系统错误',
|
|
14
|
+
};
|
|
15
|
+
/** 常见交易返回码(ISO8583)。 */
|
|
16
|
+
exports.POS_TRANSACTION_CODES = {
|
|
17
|
+
'00': '交易成功',
|
|
18
|
+
'03': '无效商户',
|
|
19
|
+
'13': '无效金额',
|
|
20
|
+
'22': '原交易不存在',
|
|
21
|
+
'25': '找不到原始交易',
|
|
22
|
+
'30': '报文格式错误',
|
|
23
|
+
'57': '不允许此交易',
|
|
24
|
+
'61': '超出金额限制',
|
|
25
|
+
'64': '原始金额错误',
|
|
26
|
+
'92': '发卡方线路异常',
|
|
27
|
+
'94': '重复交易',
|
|
28
|
+
'96': '交换中心异常',
|
|
29
|
+
'97': '终端号未登记',
|
|
30
|
+
CF: '重复交易',
|
|
31
|
+
A7: '安全处理失败',
|
|
32
|
+
ER: '参见具体返回信息',
|
|
33
|
+
};
|
|
34
|
+
/** 支付方式代码 → 名称。 */
|
|
35
|
+
exports.POS_PAY_WAYS = {
|
|
36
|
+
'1': '现金',
|
|
37
|
+
'2': '银行卡支付',
|
|
38
|
+
'3': '积分',
|
|
39
|
+
'5': '积分+刷卡',
|
|
40
|
+
'6': '积分+现金',
|
|
41
|
+
'7': '预付费卡',
|
|
42
|
+
'8': '虚拟账户支付',
|
|
43
|
+
'9': '圈存账户支付',
|
|
44
|
+
'10': '翼支付',
|
|
45
|
+
'11': '山西移动和包',
|
|
46
|
+
'12': '全民付',
|
|
47
|
+
'13': '支付宝',
|
|
48
|
+
'14': '微信',
|
|
49
|
+
'15': '银联钱包',
|
|
50
|
+
'16': '壹钱包',
|
|
51
|
+
'17': '快钱钱包',
|
|
52
|
+
'18': '翼支付钱包',
|
|
53
|
+
'19': 'ApplePay',
|
|
54
|
+
'20': 'SamsungPay',
|
|
55
|
+
'21': 'HuaweiPay',
|
|
56
|
+
'22': 'MiPay',
|
|
57
|
+
'23': '保险额度',
|
|
58
|
+
'24': '在线支付',
|
|
59
|
+
'25': '刷卡(一盒宝)',
|
|
60
|
+
'26': '银联云闪付',
|
|
61
|
+
'27': '中国工商银行APP',
|
|
62
|
+
'28': '建行龙支付',
|
|
63
|
+
'29': '中国银行APP',
|
|
64
|
+
'30': '农行掌上银行',
|
|
65
|
+
'31': '交通银行APP',
|
|
66
|
+
'32': '招商银行APP',
|
|
67
|
+
'33': '老银联钱包',
|
|
68
|
+
'34': '百度钱包',
|
|
69
|
+
'35': '京东钱包',
|
|
70
|
+
'36': '顺丰顺手付',
|
|
71
|
+
'37': '银联全渠道立码付',
|
|
72
|
+
'38': 'POS通',
|
|
73
|
+
'99': '其他',
|
|
74
|
+
};
|
|
75
|
+
/** 设备类型 → 名称。 */
|
|
76
|
+
exports.POS_DEVICE_TYPES = {
|
|
77
|
+
'01': '自动柜员机(含 ATM 和 CDM)和多媒体自助终端',
|
|
78
|
+
'02': '传统POS',
|
|
79
|
+
'03': 'MPOS',
|
|
80
|
+
'04': '智能POS',
|
|
81
|
+
'05': 'II型固话POS',
|
|
82
|
+
'06': '云闪付终端',
|
|
83
|
+
'07': '保留使用',
|
|
84
|
+
'08': '手机POS',
|
|
85
|
+
'09': '人脸识别终端',
|
|
86
|
+
'10': '条码支付受理终端',
|
|
87
|
+
'11': '条码支付辅助受理终端',
|
|
88
|
+
'12': '行业终端',
|
|
89
|
+
'13': 'MIS 终端',
|
|
90
|
+
};
|
|
91
|
+
/** 支付方式(支付请求 payMode)名称。 */
|
|
92
|
+
exports.POS_PAY_MODES = {
|
|
93
|
+
E_CASH: '电子现金',
|
|
94
|
+
SOUNDWAVE: '声波',
|
|
95
|
+
NFC: 'NFC',
|
|
96
|
+
CODE_SCAN: '扫码',
|
|
97
|
+
MANUAL: '手输',
|
|
98
|
+
};
|
|
99
|
+
/** 业务类型(instMid)。 */
|
|
100
|
+
exports.POS_INST_MIDS = {
|
|
101
|
+
/** POS 通 */
|
|
102
|
+
POS: 'POSDEFAULT',
|
|
103
|
+
/** 悦单 */
|
|
104
|
+
YUEDAN: 'YUEDANDEFAULT',
|
|
105
|
+
/** 二维码 */
|
|
106
|
+
QRPAY: 'QRPAYDEFAULT',
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,aAAa;AACA,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,MAAM;CACN,CAAC;AAEX,wBAAwB;AACX,QAAA,qBAAqB,GAAqC;IACrE,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAA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,EAAE,MAAM;IACZ,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,QAAQ;CACf,CAAC;AAEF,4BAA4B;AACf,QAAA,aAAa,GAAG;IAC3B,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,IAAI;IACf,GAAG,EAAE,KAAK;IACV,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;CACJ,CAAC;AAEX,qBAAqB;AACR,QAAA,aAAa,GAAG;IAC3B,YAAY;IACZ,GAAG,EAAE,YAAY;IACjB,SAAS;IACT,MAAM,EAAE,eAAe;IACvB,UAAU;IACV,KAAK,EAAE,cAAc;CACb,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @qzsy/ums-pos —— 银联商务 POS 通分账。
|
|
4
|
+
*
|
|
5
|
+
* 覆盖《03-POS通分账交易接口》全部接口:商品信息上送、分账支付、分账退货、
|
|
6
|
+
* 分账查询、聚合营销查询/退货查询/退货、异步分账消费确认。
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.VERSION = void 0;
|
|
24
|
+
__exportStar(require("./types.js"), exports);
|
|
25
|
+
__exportStar(require("./constants.js"), exports);
|
|
26
|
+
__exportStar(require("./client.js"), exports);
|
|
27
|
+
/** 本包版本号。 */
|
|
28
|
+
exports.VERSION = '0.1.0';
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;AAEH,6CAA2B;AAC3B,iDAA+B;AAC/B,8CAA4B;AAE5B,aAAa;AACA,QAAA,OAAO,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type UmsClient, type UmsRequestOptions } from '@qzsy/ums-core';
|
|
2
|
+
import type { PosAsyncConfirmRequest, PosAsyncConfirmResponse, PosGoodsUploadRequest, PosGoodsUploadResponse, PosMarketingQueryRequest, PosMarketingQueryResponse, PosMarketingRefundQueryRequest, PosMarketingRefundQueryResponse, PosMarketingRefundRequest, PosMarketingRefundResponse, PosPaymentRequest, PosPaymentResponse, PosQueryRequest, PosQueryResponse, PosRefundRequest, PosRefundResponse } from './types.js';
|
|
3
|
+
/** POS 通分账接口路径。 */
|
|
4
|
+
export declare const POS_PATHS: {
|
|
5
|
+
readonly addGoodsInfo: "/v1/poslink/transaction/sub-account/add-goods-info";
|
|
6
|
+
readonly pay: "/v1/poslink/transaction/sub-account/pay";
|
|
7
|
+
readonly refund: "/v1/poslink/transaction/sub-account/refund";
|
|
8
|
+
readonly query: "/v1/poslink/transaction/sub-account/query";
|
|
9
|
+
readonly marketingQuery: "/v1/poslink/transaction/sub-account/convergence-marketing-query";
|
|
10
|
+
readonly marketingRefundQuery: "/v1/poslink/transaction/sub-account/convergence-marketing-refund-query";
|
|
11
|
+
readonly marketingRefund: "/v1/poslink/transaction/sub-account/convergence-marketing-refund";
|
|
12
|
+
readonly confirmAsyncSubAccount: "/v1/poslink/transaction/sub-account/asy-sub-account-confirm";
|
|
13
|
+
};
|
|
14
|
+
/** POS 模块默认值。 */
|
|
15
|
+
export interface PosApiOptions {
|
|
16
|
+
/** 默认商户号 */
|
|
17
|
+
merchantCode?: string;
|
|
18
|
+
/** 默认终端号 */
|
|
19
|
+
terminalCode?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* POS 通分账 API。
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* const pos = new PosApi(client, { merchantCode, terminalCode });
|
|
26
|
+
* const goods = await pos.uploadGoods({ ... });
|
|
27
|
+
* const pay = await pos.pay({ retrievalRefNumOfAddGoodsInfo: goods.retrievalRefNum!, ... });
|
|
28
|
+
*/
|
|
29
|
+
export declare class PosApi {
|
|
30
|
+
readonly client: UmsClient;
|
|
31
|
+
private readonly options;
|
|
32
|
+
constructor(client: UmsClient, options?: PosApiOptions);
|
|
33
|
+
private fill;
|
|
34
|
+
/** 1.1 商品信息上送(分账支付前必须先上送)。 */
|
|
35
|
+
uploadGoods(input: PosGoodsUploadRequest, options?: UmsRequestOptions): Promise<PosGoodsUploadResponse>;
|
|
36
|
+
/** 1.2 分账支付。 */
|
|
37
|
+
pay(input: PosPaymentRequest, options?: UmsRequestOptions): Promise<PosPaymentResponse>;
|
|
38
|
+
/** 1.3 分账退货。 */
|
|
39
|
+
refund(input: PosRefundRequest, options?: UmsRequestOptions): Promise<PosRefundResponse>;
|
|
40
|
+
/** 1.4 分账查询(幂等)。 */
|
|
41
|
+
query(input: PosQueryRequest, options?: UmsRequestOptions): Promise<PosQueryResponse>;
|
|
42
|
+
/** 1.5 聚合营销查询(营销支付前调用)。 */
|
|
43
|
+
marketingQuery(input: PosMarketingQueryRequest, options?: UmsRequestOptions): Promise<PosMarketingQueryResponse>;
|
|
44
|
+
/** 1.6 聚合营销退货查询(幂等)。 */
|
|
45
|
+
marketingRefundQuery(input: PosMarketingRefundQueryRequest, options?: UmsRequestOptions): Promise<PosMarketingRefundQueryResponse>;
|
|
46
|
+
/** 1.7 聚合营销退货。 */
|
|
47
|
+
marketingRefund(input: PosMarketingRefundRequest, options?: UmsRequestOptions): Promise<PosMarketingRefundResponse>;
|
|
48
|
+
/** 1.8 异步分账消费确认。 */
|
|
49
|
+
confirmAsyncSubAccount(input: PosAsyncConfirmRequest, options?: UmsRequestOptions): Promise<PosAsyncConfirmResponse>;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,iBAAiB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,+BAA+B,EAC/B,yBAAyB,EACzB,0BAA0B,EAC1B,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,mBAAmB;AACnB,eAAO,MAAM,SAAS;;;;;;;;;CAUZ,CAAC;AAEX,iBAAiB;AACjB,MAAM,WAAW,aAAa;IAC5B,YAAY;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY;IACZ,YAAY,CAAC,EAAE,MAAM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
|
|
2
|
+
/** POS 通分账接口路径。 */
|
|
3
|
+
export const POS_PATHS = {
|
|
4
|
+
addGoodsInfo: '/v1/poslink/transaction/sub-account/add-goods-info',
|
|
5
|
+
pay: '/v1/poslink/transaction/sub-account/pay',
|
|
6
|
+
refund: '/v1/poslink/transaction/sub-account/refund',
|
|
7
|
+
query: '/v1/poslink/transaction/sub-account/query',
|
|
8
|
+
marketingQuery: '/v1/poslink/transaction/sub-account/convergence-marketing-query',
|
|
9
|
+
marketingRefundQuery: '/v1/poslink/transaction/sub-account/convergence-marketing-refund-query',
|
|
10
|
+
marketingRefund: '/v1/poslink/transaction/sub-account/convergence-marketing-refund',
|
|
11
|
+
confirmAsyncSubAccount: '/v1/poslink/transaction/sub-account/asy-sub-account-confirm',
|
|
12
|
+
};
|
|
13
|
+
function assertSixDigits(value, field) {
|
|
14
|
+
if (!value || !/^\d{6}$/.test(value)) {
|
|
15
|
+
throw new UmsValidationError(`${field} 必须是 6 位数字,收到 "${value ?? ''}"`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* POS 通分账 API。
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* const pos = new PosApi(client, { merchantCode, terminalCode });
|
|
23
|
+
* const goods = await pos.uploadGoods({ ... });
|
|
24
|
+
* const pay = await pos.pay({ retrievalRefNumOfAddGoodsInfo: goods.retrievalRefNum!, ... });
|
|
25
|
+
*/
|
|
26
|
+
export class PosApi {
|
|
27
|
+
client;
|
|
28
|
+
options;
|
|
29
|
+
constructor(client, options = {}) {
|
|
30
|
+
this.client = client;
|
|
31
|
+
this.options = options;
|
|
32
|
+
}
|
|
33
|
+
fill(input) {
|
|
34
|
+
const out = { ...input };
|
|
35
|
+
out.merchantCode ??= this.options.merchantCode;
|
|
36
|
+
out.terminalCode ??= this.options.terminalCode;
|
|
37
|
+
if (!out.merchantCode)
|
|
38
|
+
throw new UmsValidationError('merchantCode(商户号)不能为空');
|
|
39
|
+
if (!out.terminalCode)
|
|
40
|
+
throw new UmsValidationError('terminalCode(终端号)不能为空');
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
/** 1.1 商品信息上送(分账支付前必须先上送)。 */
|
|
44
|
+
async uploadGoods(input, options) {
|
|
45
|
+
assertSixDigits(input.systemTraceNum, 'systemTraceNum');
|
|
46
|
+
return this.client.request(POS_PATHS.addGoodsInfo, this.fill(input), options);
|
|
47
|
+
}
|
|
48
|
+
/** 1.2 分账支付。 */
|
|
49
|
+
async pay(input, options) {
|
|
50
|
+
assertSixDigits(input.systemTraceNum, 'systemTraceNum');
|
|
51
|
+
return this.client.request(POS_PATHS.pay, this.fill(input), options);
|
|
52
|
+
}
|
|
53
|
+
/** 1.3 分账退货。 */
|
|
54
|
+
async refund(input, options) {
|
|
55
|
+
assertSixDigits(input.systemTraceNum, 'systemTraceNum');
|
|
56
|
+
assertSixDigits(input.originalSystemTraceNum, 'originalSystemTraceNum');
|
|
57
|
+
return this.client.request(POS_PATHS.refund, this.fill(input), options);
|
|
58
|
+
}
|
|
59
|
+
/** 1.4 分账查询(幂等)。 */
|
|
60
|
+
async query(input, options) {
|
|
61
|
+
assertSixDigits(input.systemTraceNum, 'systemTraceNum');
|
|
62
|
+
if (!input.originalSystemTraceNum && !input.merchantOrderId) {
|
|
63
|
+
throw new UmsValidationError('originalSystemTraceNum 与 merchantOrderId 至少需要传一个');
|
|
64
|
+
}
|
|
65
|
+
return this.client.request(POS_PATHS.query, this.fill(input), {
|
|
66
|
+
idempotent: true,
|
|
67
|
+
...options,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** 1.5 聚合营销查询(营销支付前调用)。 */
|
|
71
|
+
async marketingQuery(input, options) {
|
|
72
|
+
assertSixDigits(input.termSsn, 'termSsn');
|
|
73
|
+
return this.client.request(POS_PATHS.marketingQuery, this.fill(input), options);
|
|
74
|
+
}
|
|
75
|
+
/** 1.6 聚合营销退货查询(幂等)。 */
|
|
76
|
+
async marketingRefundQuery(input, options) {
|
|
77
|
+
assertSixDigits(input.termSsn, 'termSsn');
|
|
78
|
+
return this.client.request(POS_PATHS.marketingRefundQuery, this.fill(input), { idempotent: true, ...options });
|
|
79
|
+
}
|
|
80
|
+
/** 1.7 聚合营销退货。 */
|
|
81
|
+
async marketingRefund(input, options) {
|
|
82
|
+
assertSixDigits(input.termSsn, 'termSsn');
|
|
83
|
+
return this.client.request(POS_PATHS.marketingRefund, this.fill(input), options);
|
|
84
|
+
}
|
|
85
|
+
/** 1.8 异步分账消费确认。 */
|
|
86
|
+
async confirmAsyncSubAccount(input, options) {
|
|
87
|
+
assertSixDigits(input.termSsn, 'termSsn');
|
|
88
|
+
return this.client.request(POS_PATHS.confirmAsyncSubAccount, this.fill(input), options);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAGnB,MAAM,gBAAgB,CAAC;AAoBxB,mBAAmB;AACnB,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,YAAY,EAAE,oDAAoD;IAClE,GAAG,EAAE,yCAAyC;IAC9C,MAAM,EAAE,4CAA4C;IACpD,KAAK,EAAE,2CAA2C;IAClD,cAAc,EAAE,iEAAiE;IACjF,oBAAoB,EAClB,wEAAwE;IAC1E,eAAe,EAAE,kEAAkE;IACnF,sBAAsB,EAAE,6DAA6D;CAC7E,CAAC;AAUX,SAAS,eAAe,CAAC,KAAyB,EAAE,KAAa;IAC/D,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,kBAAkB,CAAC,GAAG,KAAK,kBAAkB,KAAK,IAAI,EAAE,GAAG,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAA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AE,GAAG,OAAO,EAAE,CACjC,CAAC;IACJ,CAAC;IAED,kBAAkB;IAClB,KAAK,CAAC,eAAe,CACnB,KAAgC,EAChC,OAA2B;QAE3B,eAAe,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,SAAS,CAAC,eAAe,EACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAChB,OAAO,CACR,CAAC;IACJ,CAAC;IAED,oBAAoB;IACpB,KAAK,CAAC,sBAAsB,CAC1B,KAA6B,EAC7B,OAA2B;QAE3B,eAAe,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,SAAS,CAAC,sBAAsB,EAChC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAChB,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POS 通分账常量(《03-POS通分账交易接口》第 2 章)。
|
|
3
|
+
*/
|
|
4
|
+
/** 系统返回码。 */
|
|
5
|
+
export declare const POS_SYSTEM_CODES: {
|
|
6
|
+
readonly '0000': "正常";
|
|
7
|
+
readonly '1000': "认证失败";
|
|
8
|
+
readonly '1001': "授权失败";
|
|
9
|
+
readonly '9001': "参数校验失败";
|
|
10
|
+
readonly '9999': "系统错误";
|
|
11
|
+
};
|
|
12
|
+
/** 常见交易返回码(ISO8583)。 */
|
|
13
|
+
export declare const POS_TRANSACTION_CODES: Readonly<Record<string, string>>;
|
|
14
|
+
/** 支付方式代码 → 名称。 */
|
|
15
|
+
export declare const POS_PAY_WAYS: Readonly<Record<string, string>>;
|
|
16
|
+
/** 设备类型 → 名称。 */
|
|
17
|
+
export declare const POS_DEVICE_TYPES: Readonly<Record<string, string>>;
|
|
18
|
+
/** 支付方式(支付请求 payMode)名称。 */
|
|
19
|
+
export declare const POS_PAY_MODES: {
|
|
20
|
+
readonly E_CASH: "电子现金";
|
|
21
|
+
readonly SOUNDWAVE: "声波";
|
|
22
|
+
readonly NFC: "NFC";
|
|
23
|
+
readonly CODE_SCAN: "扫码";
|
|
24
|
+
readonly MANUAL: "手输";
|
|
25
|
+
};
|
|
26
|
+
/** 业务类型(instMid)。 */
|
|
27
|
+
export declare const POS_INST_MIDS: {
|
|
28
|
+
/** POS 通 */
|
|
29
|
+
readonly POS: "POSDEFAULT";
|
|
30
|
+
/** 悦单 */
|
|
31
|
+
readonly YUEDAN: "YUEDANDEFAULT";
|
|
32
|
+
/** 二维码 */
|
|
33
|
+
readonly QRPAY: "QRPAYDEFAULT";
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,aAAa;AACb,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAC;AAEX,wBAAwB;AACxB,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBlE,CAAC;AAEF,mBAAmB;AACnB,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuCzD,CAAC;AAEF,iBAAiB;AACjB,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAc7D,CAAC;AAEF,4BAA4B;AAC5B,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,qBAAqB;AACrB,eAAO,MAAM,aAAa;IACxB,YAAY;;IAEZ,SAAS;;IAET,UAAU;;CAEF,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* POS 通分账常量(《03-POS通分账交易接口》第 2 章)。
|
|
3
|
+
*/
|
|
4
|
+
/** 系统返回码。 */
|
|
5
|
+
export const POS_SYSTEM_CODES = {
|
|
6
|
+
'0000': '正常',
|
|
7
|
+
'1000': '认证失败',
|
|
8
|
+
'1001': '授权失败',
|
|
9
|
+
'9001': '参数校验失败',
|
|
10
|
+
'9999': '系统错误',
|
|
11
|
+
};
|
|
12
|
+
/** 常见交易返回码(ISO8583)。 */
|
|
13
|
+
export const POS_TRANSACTION_CODES = {
|
|
14
|
+
'00': '交易成功',
|
|
15
|
+
'03': '无效商户',
|
|
16
|
+
'13': '无效金额',
|
|
17
|
+
'22': '原交易不存在',
|
|
18
|
+
'25': '找不到原始交易',
|
|
19
|
+
'30': '报文格式错误',
|
|
20
|
+
'57': '不允许此交易',
|
|
21
|
+
'61': '超出金额限制',
|
|
22
|
+
'64': '原始金额错误',
|
|
23
|
+
'92': '发卡方线路异常',
|
|
24
|
+
'94': '重复交易',
|
|
25
|
+
'96': '交换中心异常',
|
|
26
|
+
'97': '终端号未登记',
|
|
27
|
+
CF: '重复交易',
|
|
28
|
+
A7: '安全处理失败',
|
|
29
|
+
ER: '参见具体返回信息',
|
|
30
|
+
};
|
|
31
|
+
/** 支付方式代码 → 名称。 */
|
|
32
|
+
export const POS_PAY_WAYS = {
|
|
33
|
+
'1': '现金',
|
|
34
|
+
'2': '银行卡支付',
|
|
35
|
+
'3': '积分',
|
|
36
|
+
'5': '积分+刷卡',
|
|
37
|
+
'6': '积分+现金',
|
|
38
|
+
'7': '预付费卡',
|
|
39
|
+
'8': '虚拟账户支付',
|
|
40
|
+
'9': '圈存账户支付',
|
|
41
|
+
'10': '翼支付',
|
|
42
|
+
'11': '山西移动和包',
|
|
43
|
+
'12': '全民付',
|
|
44
|
+
'13': '支付宝',
|
|
45
|
+
'14': '微信',
|
|
46
|
+
'15': '银联钱包',
|
|
47
|
+
'16': '壹钱包',
|
|
48
|
+
'17': '快钱钱包',
|
|
49
|
+
'18': '翼支付钱包',
|
|
50
|
+
'19': 'ApplePay',
|
|
51
|
+
'20': 'SamsungPay',
|
|
52
|
+
'21': 'HuaweiPay',
|
|
53
|
+
'22': 'MiPay',
|
|
54
|
+
'23': '保险额度',
|
|
55
|
+
'24': '在线支付',
|
|
56
|
+
'25': '刷卡(一盒宝)',
|
|
57
|
+
'26': '银联云闪付',
|
|
58
|
+
'27': '中国工商银行APP',
|
|
59
|
+
'28': '建行龙支付',
|
|
60
|
+
'29': '中国银行APP',
|
|
61
|
+
'30': '农行掌上银行',
|
|
62
|
+
'31': '交通银行APP',
|
|
63
|
+
'32': '招商银行APP',
|
|
64
|
+
'33': '老银联钱包',
|
|
65
|
+
'34': '百度钱包',
|
|
66
|
+
'35': '京东钱包',
|
|
67
|
+
'36': '顺丰顺手付',
|
|
68
|
+
'37': '银联全渠道立码付',
|
|
69
|
+
'38': 'POS通',
|
|
70
|
+
'99': '其他',
|
|
71
|
+
};
|
|
72
|
+
/** 设备类型 → 名称。 */
|
|
73
|
+
export const POS_DEVICE_TYPES = {
|
|
74
|
+
'01': '自动柜员机(含 ATM 和 CDM)和多媒体自助终端',
|
|
75
|
+
'02': '传统POS',
|
|
76
|
+
'03': 'MPOS',
|
|
77
|
+
'04': '智能POS',
|
|
78
|
+
'05': 'II型固话POS',
|
|
79
|
+
'06': '云闪付终端',
|
|
80
|
+
'07': '保留使用',
|
|
81
|
+
'08': '手机POS',
|
|
82
|
+
'09': '人脸识别终端',
|
|
83
|
+
'10': '条码支付受理终端',
|
|
84
|
+
'11': '条码支付辅助受理终端',
|
|
85
|
+
'12': '行业终端',
|
|
86
|
+
'13': 'MIS 终端',
|
|
87
|
+
};
|
|
88
|
+
/** 支付方式(支付请求 payMode)名称。 */
|
|
89
|
+
export const POS_PAY_MODES = {
|
|
90
|
+
E_CASH: '电子现金',
|
|
91
|
+
SOUNDWAVE: '声波',
|
|
92
|
+
NFC: 'NFC',
|
|
93
|
+
CODE_SCAN: '扫码',
|
|
94
|
+
MANUAL: '手输',
|
|
95
|
+
};
|
|
96
|
+
/** 业务类型(instMid)。 */
|
|
97
|
+
export const POS_INST_MIDS = {
|
|
98
|
+
/** POS 通 */
|
|
99
|
+
POS: 'POSDEFAULT',
|
|
100
|
+
/** 悦单 */
|
|
101
|
+
YUEDAN: 'YUEDANDEFAULT',
|
|
102
|
+
/** 二维码 */
|
|
103
|
+
QRPAY: 'QRPAYDEFAULT',
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,aAAa;AACb,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,MAAM;CACN,CAAC;AAEX,wBAAwB;AACxB,MAAM,CAAC,MAAM,qBAAqB,GAAqC;IACrE,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,QAAQ;IACZ,EAAE,EAAE,UAAU;CACf,CAAC;AAEF,mBAAmB;AACnB,MAAM,CAAC,MAAM,YAAY,GAAqC;IAC5D,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,OAAO;IACZ,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,QAA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E,KAAK;IACV,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;CACJ,CAAC;AAEX,qBAAqB;AACrB,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY;IACZ,GAAG,EAAE,YAAY;IACjB,SAAS;IACT,MAAM,EAAE,eAAe;IACvB,UAAU;IACV,KAAK,EAAE,cAAc;CACb,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @qzsy/ums-pos —— 银联商务 POS 通分账。
|
|
3
|
+
*
|
|
4
|
+
* 覆盖《03-POS通分账交易接口》全部接口:商品信息上送、分账支付、分账退货、
|
|
5
|
+
* 分账查询、聚合营销查询/退货查询/退货、异步分账消费确认。
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export * from './constants.js';
|
|
9
|
+
export * from './client.js';
|
|
10
|
+
/** 本包版本号。 */
|
|
11
|
+
export declare const VERSION = "0.1.0";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAE5B,aAAa;AACb,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @qzsy/ums-pos —— 银联商务 POS 通分账。
|
|
3
|
+
*
|
|
4
|
+
* 覆盖《03-POS通分账交易接口》全部接口:商品信息上送、分账支付、分账退货、
|
|
5
|
+
* 分账查询、聚合营销查询/退货查询/退货、异步分账消费确认。
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export * from './constants.js';
|
|
9
|
+
export * from './client.js';
|
|
10
|
+
/** 本包版本号。 */
|
|
11
|
+
export const VERSION = '0.1.0';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAE5B,aAAa;AACb,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import type { Fen, UmsEnvelope } from '@qzsy/ums-core';
|
|
2
|
+
/**
|
|
3
|
+
* POS 通分账请求/响应类型。
|
|
4
|
+
*
|
|
5
|
+
* 文档:《03-POS通分账交易接口(开放平台)v20220520》
|
|
6
|
+
* 金额单位均为分;`systemTraceNum` 为 6 位数字终端流水。
|
|
7
|
+
*/
|
|
8
|
+
/** 支付方式。 */
|
|
9
|
+
export type PosPayMode = 'E_CASH' | 'SOUNDWAVE' | 'NFC' | 'CODE_SCAN' | 'MANUAL' | (string & {});
|
|
10
|
+
/** 设备类型。 */
|
|
11
|
+
export type PosDeviceType = '01' | '02' | '03' | '04' | '05' | '06' | '07' | '08' | '09' | '10' | '11' | '12' | '13' | (string & {});
|
|
12
|
+
/** 分账信息元素(商品上送 / 分账支付)。 */
|
|
13
|
+
export interface PosSubAccount {
|
|
14
|
+
/** 分账接收方商户号 */
|
|
15
|
+
merchantCode: string;
|
|
16
|
+
/** 金额,单位分 */
|
|
17
|
+
amount: Fen;
|
|
18
|
+
/** 聚合营销查询应答优惠方案 */
|
|
19
|
+
promotionDetail?: string;
|
|
20
|
+
/** 折扣金额 */
|
|
21
|
+
discountAmt?: string;
|
|
22
|
+
/** 折后应收金额 */
|
|
23
|
+
recvAmt?: string;
|
|
24
|
+
/** 营销查询返回的 ulink 流水号 */
|
|
25
|
+
transSsn?: string;
|
|
26
|
+
[key: string]: unknown;
|
|
27
|
+
}
|
|
28
|
+
/** 基站信息(实体类终端无经纬度时必送)。 */
|
|
29
|
+
export interface PosCellInfo {
|
|
30
|
+
locationCode1?: string;
|
|
31
|
+
lbsNum1?: string;
|
|
32
|
+
lbsSignal1?: string;
|
|
33
|
+
locationCode2?: string;
|
|
34
|
+
lbsNum2?: string;
|
|
35
|
+
lbsSignal2?: string;
|
|
36
|
+
locationCode3?: string;
|
|
37
|
+
lbsNum3?: string;
|
|
38
|
+
lbsSignal3?: string;
|
|
39
|
+
telecomSysId?: string;
|
|
40
|
+
telecomNetId?: string;
|
|
41
|
+
telecomLbs?: string;
|
|
42
|
+
telecomLbsSignal?: string;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
/** POS 公共响应字段。 */
|
|
46
|
+
export interface PosBaseResponse extends UmsEnvelope {
|
|
47
|
+
/** 交易时间 hhmmss */
|
|
48
|
+
transactionTime?: string;
|
|
49
|
+
/** 交易日期 MMdd */
|
|
50
|
+
transactionDate?: string;
|
|
51
|
+
/** 结算日期 MMdd */
|
|
52
|
+
settlementDate?: string;
|
|
53
|
+
/** 检索参考号,12 位 */
|
|
54
|
+
retrievalRefNum?: string;
|
|
55
|
+
/** 商户订单号,原样返回 */
|
|
56
|
+
merchantOrderId?: string;
|
|
57
|
+
[key: string]: unknown;
|
|
58
|
+
}
|
|
59
|
+
/** 1.1 商品信息上送请求。 */
|
|
60
|
+
export interface PosGoodsUploadRequest {
|
|
61
|
+
merchantCode: string;
|
|
62
|
+
terminalCode: string;
|
|
63
|
+
/** 6 位数字 */
|
|
64
|
+
systemTraceNum: string;
|
|
65
|
+
transactionAmount: Fen;
|
|
66
|
+
/** 商户订单号,全局唯一,≤50 位 */
|
|
67
|
+
merchantOrderId: string;
|
|
68
|
+
subAccountInfo: PosSubAccount[];
|
|
69
|
+
/** 商品信息,平台只记录不校验 */
|
|
70
|
+
goodsInfo: string;
|
|
71
|
+
[key: string]: unknown;
|
|
72
|
+
}
|
|
73
|
+
/** 1.1 商品信息上送响应。 */
|
|
74
|
+
export type PosGoodsUploadResponse = PosBaseResponse;
|
|
75
|
+
/** 1.2 分账支付请求。 */
|
|
76
|
+
export interface PosPaymentRequest {
|
|
77
|
+
merchantCode: string;
|
|
78
|
+
terminalCode: string;
|
|
79
|
+
systemTraceNum: string;
|
|
80
|
+
transactionAmount: Fen;
|
|
81
|
+
/** 00 正常消费;01 营销查询后使用(消费成功自动销券) */
|
|
82
|
+
posCondCode?: '00' | '01' | (string & {});
|
|
83
|
+
/** 固定 156 */
|
|
84
|
+
transactionCurrencyCode: '156' | (string & {});
|
|
85
|
+
/** 需与商品上送交易一致 */
|
|
86
|
+
merchantOrderId: string;
|
|
87
|
+
/** 原商品上送交易应答检索参考号 */
|
|
88
|
+
retrievalRefNumOfAddGoodsInfo: string;
|
|
89
|
+
subAccountInfo?: PosSubAccount[];
|
|
90
|
+
/** 固定分账标识,Y 时可不上送分账信息与商品上送交易 */
|
|
91
|
+
subAcctFlag?: 'Y';
|
|
92
|
+
/** 异步分账标识 */
|
|
93
|
+
asynSubAcctFlag?: 'Y';
|
|
94
|
+
payMode: PosPayMode;
|
|
95
|
+
payCode: string;
|
|
96
|
+
/** 内部保留域:商户标识+操作人+省份+地市+区县+营业厅名称+营业厅编号 */
|
|
97
|
+
reserve?: string;
|
|
98
|
+
deviceType: PosDeviceType;
|
|
99
|
+
/** 终端硬件序列号:6 位厂商编号 + 2 位终端类型 + 42 位自定义 */
|
|
100
|
+
serialNum?: string;
|
|
101
|
+
encryptRandNum?: string;
|
|
102
|
+
secretText?: string;
|
|
103
|
+
appVersion?: string;
|
|
104
|
+
longitude?: string;
|
|
105
|
+
latitude?: string;
|
|
106
|
+
mobileCountryCode?: string;
|
|
107
|
+
mobileNetNum?: string;
|
|
108
|
+
/** 坐标系 BD09/GCJ02/WGS84 */
|
|
109
|
+
location?: string;
|
|
110
|
+
cust2?: PosCellInfo;
|
|
111
|
+
iccId?: string;
|
|
112
|
+
/** 非实体类终端(01/11/12/13)无经纬度时必送 */
|
|
113
|
+
ip?: string;
|
|
114
|
+
[key: string]: unknown;
|
|
115
|
+
}
|
|
116
|
+
/** 1.2 分账支付响应。 */
|
|
117
|
+
export interface PosPaymentResponse extends PosBaseResponse {
|
|
118
|
+
/** 与请求交易金额一致 */
|
|
119
|
+
transactionAmount?: Fen;
|
|
120
|
+
/** 消费 ulink 流水号 */
|
|
121
|
+
transSsn?: string;
|
|
122
|
+
/** 营销联盟销券流水号 */
|
|
123
|
+
yxlmSsn?: string;
|
|
124
|
+
/** 用户实际支付金额 */
|
|
125
|
+
amount?: Fen;
|
|
126
|
+
/** 订单号,≤50 位 */
|
|
127
|
+
orderId?: string;
|
|
128
|
+
thirdPartyDiscountInstruction?: string;
|
|
129
|
+
thirdPartyName?: string;
|
|
130
|
+
thirdPartyBuyerId?: string;
|
|
131
|
+
thirdPartyBuyerUserName?: string;
|
|
132
|
+
thirdPartyOrderId?: string;
|
|
133
|
+
/** 格式:方式:金额|方式:金额 */
|
|
134
|
+
thirdPartyPayInformation?: string;
|
|
135
|
+
}
|
|
136
|
+
/** 1.3 分账退货请求。 */
|
|
137
|
+
export interface PosRefundRequest {
|
|
138
|
+
merchantCode: string;
|
|
139
|
+
terminalCode: string;
|
|
140
|
+
systemTraceNum: string;
|
|
141
|
+
merchantOrderId: string;
|
|
142
|
+
/** 退货金额 */
|
|
143
|
+
transactionAmount: Fen;
|
|
144
|
+
/** 必须与原支付交易一致 */
|
|
145
|
+
originalSystemTraceNum: string;
|
|
146
|
+
transactionCurrencyCode: '156' | (string & {});
|
|
147
|
+
/** 原交易支付应答检索参考号 */
|
|
148
|
+
originalRetrievalRefNum: string;
|
|
149
|
+
/** 原支付交易日期 MMdd */
|
|
150
|
+
originalTransactionDate: string;
|
|
151
|
+
subAccountInfo: PosSubAccount[];
|
|
152
|
+
promotionDetail?: string;
|
|
153
|
+
discountAmt?: string;
|
|
154
|
+
recvAmt?: string;
|
|
155
|
+
reserve?: string;
|
|
156
|
+
/** 原消费交易的商户订单号(目前仅河北电信使用) */
|
|
157
|
+
oriTransOrderId?: string;
|
|
158
|
+
[key: string]: unknown;
|
|
159
|
+
}
|
|
160
|
+
/** 1.3 分账退货响应。 */
|
|
161
|
+
export interface PosRefundResponse extends PosBaseResponse {
|
|
162
|
+
/** 仅退款成功时存在 */
|
|
163
|
+
thirdPartyName?: string;
|
|
164
|
+
}
|
|
165
|
+
/** 1.4 分账查询请求。 */
|
|
166
|
+
export interface PosQueryRequest {
|
|
167
|
+
merchantCode: string;
|
|
168
|
+
terminalCode: string;
|
|
169
|
+
systemTraceNum: string;
|
|
170
|
+
/** 与 merchantOrderId 至少传一个;都存在时以本字段为准 */
|
|
171
|
+
originalSystemTraceNum?: string;
|
|
172
|
+
merchantOrderId?: string;
|
|
173
|
+
[key: string]: unknown;
|
|
174
|
+
}
|
|
175
|
+
/** 1.4 分账查询响应。 */
|
|
176
|
+
export interface PosQueryResponse extends PosBaseResponse {
|
|
177
|
+
/** 00 成功;01 支付中;其余失败 */
|
|
178
|
+
queryResCode?: '00' | '01' | (string & {});
|
|
179
|
+
queryResInfo?: string;
|
|
180
|
+
/** 所查询交易日期 */
|
|
181
|
+
dealDate?: string;
|
|
182
|
+
/** 所查询交易时间 */
|
|
183
|
+
dealTime?: string;
|
|
184
|
+
/** 原终端上送金额 */
|
|
185
|
+
originalAmount?: Fen;
|
|
186
|
+
/** 所查询交易流水 */
|
|
187
|
+
dealSystemTraceNum?: string;
|
|
188
|
+
/** 所查询交易系统参考号 */
|
|
189
|
+
dealRetrievalRefNum?: string;
|
|
190
|
+
/** 买家公众号 ID */
|
|
191
|
+
buyerId?: string;
|
|
192
|
+
}
|
|
193
|
+
/** 1.5 聚合营销查询请求。 */
|
|
194
|
+
export interface PosMarketingQueryRequest {
|
|
195
|
+
merchantCode: string;
|
|
196
|
+
terminalCode: string;
|
|
197
|
+
/** 终端交易流水,6 位数字 */
|
|
198
|
+
termSsn: string;
|
|
199
|
+
/** 商户订单号,全局唯一,≤50 位 */
|
|
200
|
+
mchntOrderId: string;
|
|
201
|
+
transAmt: Fen;
|
|
202
|
+
payCode: string;
|
|
203
|
+
/** 支付方式代码,见 POS_PAY_WAYS */
|
|
204
|
+
payWay: string;
|
|
205
|
+
/** 默认 156 */
|
|
206
|
+
ccy?: string;
|
|
207
|
+
buyerUsername?: string;
|
|
208
|
+
subAcctInfo: PosMarketingSubAccount[];
|
|
209
|
+
[key: string]: unknown;
|
|
210
|
+
}
|
|
211
|
+
/** 聚合营销分账信息。 */
|
|
212
|
+
export interface PosMarketingSubAccount {
|
|
213
|
+
merchantCode: string;
|
|
214
|
+
amt: Fen;
|
|
215
|
+
[key: string]: unknown;
|
|
216
|
+
}
|
|
217
|
+
/** 1.5 聚合营销查询响应。 */
|
|
218
|
+
export interface PosMarketingQueryResponse extends UmsEnvelope {
|
|
219
|
+
transAmt?: string;
|
|
220
|
+
termSsn?: string;
|
|
221
|
+
transTime?: string;
|
|
222
|
+
transDate?: string;
|
|
223
|
+
terminalCode?: string;
|
|
224
|
+
merchantCode?: string;
|
|
225
|
+
respCode?: string;
|
|
226
|
+
respDesc?: string;
|
|
227
|
+
transSsn?: string;
|
|
228
|
+
yxlmSsn?: string;
|
|
229
|
+
discountAmt?: string;
|
|
230
|
+
recvAmt?: string;
|
|
231
|
+
thirdPartySubsAmt?: string;
|
|
232
|
+
mchntSubsAmt?: string;
|
|
233
|
+
promotionDetail?: string;
|
|
234
|
+
ccy?: string;
|
|
235
|
+
[key: string]: unknown;
|
|
236
|
+
}
|
|
237
|
+
/** 1.6 聚合营销退货查询请求。 */
|
|
238
|
+
export interface PosMarketingRefundQueryRequest {
|
|
239
|
+
transAmt: Fen;
|
|
240
|
+
termSsn: string;
|
|
241
|
+
terminalCode: string;
|
|
242
|
+
merchantCode: string;
|
|
243
|
+
mchntOrderId: string;
|
|
244
|
+
/** 原交易日期 YYYYMMDD */
|
|
245
|
+
oriTransDate: string;
|
|
246
|
+
/** 原营销联盟销券流水号 */
|
|
247
|
+
oriYxlmSsn: string;
|
|
248
|
+
ccy?: string;
|
|
249
|
+
[key: string]: unknown;
|
|
250
|
+
}
|
|
251
|
+
/** 1.6 聚合营销退货查询响应。 */
|
|
252
|
+
export interface PosMarketingRefundQueryResponse extends PosMarketingQueryResponse {
|
|
253
|
+
/** 退货查询方案 ID */
|
|
254
|
+
queryId?: string;
|
|
255
|
+
}
|
|
256
|
+
/** 1.7 聚合营销退货请求。 */
|
|
257
|
+
export interface PosMarketingRefundRequest extends PosMarketingRefundQueryRequest {
|
|
258
|
+
queryId: string;
|
|
259
|
+
}
|
|
260
|
+
/** 1.7 聚合营销退货响应。 */
|
|
261
|
+
export type PosMarketingRefundResponse = PosMarketingQueryResponse;
|
|
262
|
+
/** 1.8 异步分账消费确认请求。 */
|
|
263
|
+
export interface PosAsyncConfirmRequest {
|
|
264
|
+
/** 同原交易 */
|
|
265
|
+
transAmt: Fen;
|
|
266
|
+
/** POS 终端交易流水,6 位数字 */
|
|
267
|
+
termSsn: string;
|
|
268
|
+
terminalCode: string;
|
|
269
|
+
merchantCode: string;
|
|
270
|
+
subAcctInfo: PosMarketingSubAccount[];
|
|
271
|
+
/** 原消费响应 ulink 流水号 */
|
|
272
|
+
transSsn: string;
|
|
273
|
+
/** 原交易日期 YYYYMMDD */
|
|
274
|
+
oriTransDate: string;
|
|
275
|
+
/** 156 */
|
|
276
|
+
ccy: string;
|
|
277
|
+
[key: string]: unknown;
|
|
278
|
+
}
|
|
279
|
+
/** 1.8 异步分账消费确认响应。 */
|
|
280
|
+
export interface PosAsyncConfirmResponse extends UmsEnvelope {
|
|
281
|
+
transAmt?: string;
|
|
282
|
+
termSsn?: string;
|
|
283
|
+
transTime?: string;
|
|
284
|
+
transDate?: string;
|
|
285
|
+
stlDate?: string;
|
|
286
|
+
acqCode?: string;
|
|
287
|
+
terminalCode?: string;
|
|
288
|
+
merchantCode?: string;
|
|
289
|
+
addiRespData?: string;
|
|
290
|
+
[key: string]: unknown;
|
|
291
|
+
}
|
|
292
|
+
//# sourceMappingURL=types.d.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AyB;IAChF,gBAAgB;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,oBAAoB;AACpB,MAAM,WAAW,yBAA0B,SAAQ,8BAA8B;IAC/E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,oBAAoB;AACpB,MAAM,MAAM,0BAA0B,GAAG,yBAAyB,CAAC;AAEnE,sBAAsB;AACtB,MAAM,WAAW,sBAAsB;IACrC,WAAW;IACX,QAAQ,EAAE,GAAG,CAAC;IACd,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACtC,sBAAsB;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,qBAAqB;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU;IACV,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,sBAAsB;AACtB,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,48 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@qzsy/ums-pos",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@qzsy/ums-pos",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "银联商务 POS 通分账:商品上送、分账支付/退货/查询、聚合营销、异步分账确认",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"chinaums",
|
|
7
|
+
"银联商务",
|
|
8
|
+
"ums",
|
|
9
|
+
"sdk",
|
|
10
|
+
"pos",
|
|
11
|
+
"分账",
|
|
12
|
+
"poslink"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/cjs/index.js",
|
|
17
|
+
"module": "./dist/esm/index.js",
|
|
18
|
+
"types": "./dist/esm/index.d.ts",
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/esm/index.d.ts",
|
|
22
|
+
"import": "./dist/esm/index.js",
|
|
23
|
+
"require": "./dist/cjs/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"README.md",
|
|
30
|
+
"LICENSE"
|
|
31
|
+
],
|
|
32
|
+
"sideEffects": false,
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=18"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@qzsy/ums-core": "^0.1.0"
|
|
38
|
+
},
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc -p tsconfig.build.json && tsc -p tsconfig.cjs.json && node ../../scripts/postbuild.mjs .",
|
|
41
|
+
"test": "bun test",
|
|
42
|
+
"typecheck": "tsc -p tsconfig.json"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"registry": "https://registry.npmjs.org",
|
|
46
|
+
"access": "public"
|
|
47
|
+
}
|
|
48
|
+
}
|