Constructor
new CosPboc2(cos7816)
构造CosPboc2操作对象
Name | Type | Description |
---|---|---|
cos7816 | Cos7816 | Cos7816操作对象 |
- Source
Members
(static, readonly) OrderType :number
PBOC订单类型
- number
Name | Type | Description |
---|---|---|
ED_ADD | number | 存折圈存加款 |
EP_ADD | number | 钱包圈存加款 |
ED_SUB | number | 存折圈提减款 |
ED_ATM | number | 存折取现减款 |
ED_POS | number | 存折消费减款 |
EP_POS | number | 钱包消费减款 |
ED_REN | number | 存折修改透支 |
EP_ETC | number | 钱包复合消费 |
ED_ETC | number | 存折复合消费 |
- Source
(static, readonly) PurseType :number
PBOC钱包类型
- number
Name | Type | Description |
---|---|---|
ED | number | 电子存折 占用文件标识0x0001 支持所有功能 需验证用户PIN口令 |
EP | number | 电子钱包 占用文件标识0x0002 无需验证PIN消费 不支持提现和透支 |
- Source
Methods
(async) etcWriteLog(sfid, id, mode, data, safe) → {Promise}
复合消费写记录文件数据
Name | Type | Default | Description |
---|---|---|---|
sfid | number | 文件短标识符(0x01~0x1F) 0x00=当前打开的文件 | |
id | number | 写入位置的记录编号或标识 如果为0x00则代表当前记录 | |
mode | LogIdMode | 记录ID模式 参考LogIdMode | |
data | string | 写入的十六进制字符串数据 注意不能超过创建时定长记录大小 | |
safe | RfSafe | null | 线路安全选项 参考RfSafe方法生成 默认忽略 |
- Source
err/msg + retval
- Type:
- Promise
(async) etcWriteTlv(sfid, id, mode, tlvData, safe) → {Promise}
复合消费写变长TLV记录文件数据 注意已添加的TLV记录不能改变长度
Name | Type | Default | Description |
---|---|---|---|
sfid | number | 文件短标识符(0x01~0x1F) 0x00=当前打开的文件 | |
id | number | 写入位置的记录编号或标识 如果为0x00则代表当前记录 | |
mode | LogIdMode | 记录ID模式 参考LogIdMode | |
tlvData | TlvData | 写入的变长记录TLV格式数据 参考TlvData方法生成 | |
safe | RfSafe | null | 线路安全选项 参考RfSafe方法生成 默认忽略 |
- Source
err/msg + retval
- Type:
- Promise
(async) getBalance(type) → {Promise}
读取余额
Name | Type | Description |
---|---|---|
type | PurseType | 钱包类型 参考Rokato.CosPboc2.PurseType |
- Source
err/msg + retval/money
- Type:
- Promise
(async) getOrderTac(type, seq) → {Promise}
获取订单认证数据
Name | Type | Description |
---|---|---|
type | OrderType | 订单类型 参考Rokato.CosPboc2.OrderType |
seq | number | 订单序号 |
- Source
err/msg + retval/tac/mac
- Type:
- Promise
(async) lockApp(key, die) → {Promise}
锁定当前应用目录
Name | Type | Description |
---|---|---|
key | KeyData | 主线路安全密钥对象 参考KeyData方法生成 |
die | boolean | 是否锁死,如果为true则为永久锁定无法解锁 |
- Source
err/msg + retval
- Type:
- Promise
(async) lockCard(key) → {Promise}
永久锁定卡片所有应用目录
Name | Type | Description |
---|---|---|
key | KeyData | 主线路安全密钥对象 参考KeyData方法生成 |
- Source
err/msg + retval
- Type:
- Promise
(async) orderCommit(orderData) → {Promise}
通用订单提交
Name | Type | Description |
---|---|---|
orderData | object | 由订单请求响应的订单数据对象 |
- Source
err/msg + retval/orderData(提交响应订单数据对象)
- Type:
- Promise
(async) orderReq(type, id, key, money, times, number, keyTac) → {Promise}
通用订单请求
Name | Type | Default | Description |
---|---|---|---|
type | OrderType | 订单类型 参考Rokato.CosPboc2.OrderType | |
id | number | 业务密钥标识ID | |
key | KeyData | 业务密钥数据对象 参考KeyData方法生成 | |
money | number | 订单金额 单位分 | |
times | number | 0 | 订单时间戳(秒级) 默认0自动获取 |
number | string | 000000000000 | 订单终端编号-必须为12个十六进制字符串 默认6字节全0x00 |
keyTac | KeyData | null | 订单验证TAC密钥对象 默认空忽略验证 |
- Source
err/msg + retval/orderData(请求响应订单数据对象)
- Type:
- Promise
(async) renPin(id, oldPin, newPin) → {Promise}
修改用户PIN字符口令
Name | Type | Description |
---|---|---|
id | number | 口令标识ID |
oldPin | string | 原字符口令 不能小于3和超过12 |
newPin | string | 新字符口令 不能小于3和超过12 |
- Source
err/msg + retval
- Type:
- Promise
(async) resetPin(id, key, pin) → {Promise}
重置用户PIN字符口令
Name | Type | Description |
---|---|---|
id | number | 口令标识ID对应的重置口令密钥标识ID |
key | KeyData | 重置口令密钥对象 参考KeyData方法生成 |
pin | string | 重置的新字符口令 不能小于3和超过12 |
- Source
err/msg + retval
- Type:
- Promise
(async) unlockApp(key) → {Promise}
解锁当前应用目录
Name | Type | Description |
---|---|---|
key | KeyData | 主线路安全密钥对象 参考KeyData方法生成 |
- Source
err/msg + retval
- Type:
- Promise
(async) unlockPin(id, key, pin) → {Promise}
解锁用户PIN字符口令
Name | Type | Description |
---|---|---|
id | number | 口令标识ID对应的解锁口令密钥标识ID |
key | KeyData | 解锁口令密钥对象 参考KeyData方法生成 |
pin | string | 正确的字符口令 不能小于3和超过12 |
- Source
err/msg + retval
- Type:
- Promise
(static) orderTypeStr(type)
获取订单类型名称
Name | Type | Description |
---|---|---|
type | OrderType | 订单类型 参考Rokato.CosPboc2.OrderType |
- Source
(static) parseOrderLog(logHex) → {object}
解析订单记录数据
Name | Type | Description |
---|---|---|
logHex | string | 23字节订单记录 |
- Source
数据异常解析失败返回null 否则返回解析后的对象
- Type:
- object