npm i --save nativescript-idtech-vp-sdk
- 版本:1.1.2
- GitHub:
- NPM: https://npmjs.net.cn/package/nativescript-idtech-vp-sdk
- 下载量
- 昨天: 0
- 上周: 0
- 上个月: 0
Nativescript IDTech VP3300 SDK
*** 重要 *** 仅适用于 iOS。使用自定义 iOS (umbrella) 框架实现 IDTech Universal SDK
ID Tech Universal SDK 方法子集,以支持 VP3300 EMV 读取器。
包含以下内容:
- BLE 设备搜索
- 连接到 VP3300 的 API 方法
- 启动非接触式/滑动/芯片交易的 API 方法
返回 解密 数据字符串 解密过程遵循以下指南
- https://idtechproducts.com/how-to-decrypt-credit-card-data-part-i/
- https://idtechproducts.com/how-to-decrypt-credit-card-data-part-ii/
注意 这只是可用的 SDK 方法的一小部分。这只是我能够获取和解析信用卡数据所必需的。
安装
tns plugin add nativescript-idtech-vp-sdk
用法
const idtechVp3300 = new IdtechVp3300();
//Handlers:
idtechVp3300.onReaderConnected = () => {
alert('connected');
};
idtechVp3300.onReaderDisconnected = () => {
alert('disconnected');
};
idtechVp3300.onReaderData = (data: string) => {
alert(data);
};
idtechVp3300.onReaderDataParseError = (error: string) => {
alert(error);
};
// BLE
idtechVp3300.onBluetoothAvailableDevicesListUpdate = (devices: Set<BluetoothDevice>) => {
const devicesList = Array.from(devices) || [];
const emvReaders = devicesList
.filter((i: BluetoothDevice) => i.isSupportedEmv);
if (available && available.length) {
// Connect to the first one
idtechVp3300
.connectWithIdentifier(available[0].identifier)
}
}
// Read
idtechVp3300.readCardData(0); // $0
// Connect
idtechVp3300.connectWithIdentifier("ABC")
idtechVp3300.connectWithFriendlyName("ID Tech")
许可
Apache 许可协议第 2 版,2004 年 1 月