Skip to content

onlyxhb/cordova-plugin-smartpos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova SmartPos Plugin

这是一个简单的安卓版pos机s1000 SDK调用的插件.

它包含了基本的调用功能,包括测试,打印走纸,安全键盘等等功能。

使用

创建一个新项目(已有cordova项目不用创建)

$ cordova create demo com.example.demo demo

安装插件

$ cd demo
$ cordova plugin add https://github.com/Xonlystar/cordova-plugin-smartpos.git

调用插件

  • isbind方法----判断是否绑定服务
    smartpos.isbind("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • bind方法----绑定服务
    smartpos.bind("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • unbind方法----解绑服务
    smartpos.unbind("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • searchCard方法----寻卡
    smartpos.searchCard("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • print方法----打印
    smartpos.print("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • pinpad方法----密码键盘
    smartpos.pinpad("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • systemInterface方法----系统接口
    smartpos.systemInterface("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • emv方法----EMV
    smartpos.emv("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • pin方法----PIN
    smartpos.pin("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • scan方法----扫码接口
    smartpos.scan("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • stopScan方法----停止扫码
    smartpos.stopScan("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • ICApdu方法----IC卡APDU
    smartpos.ICApdu("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • RFApdu方法----RF卡APDU
    smartpos.RFApdu("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });
  • PsamApdu方法----PSAM卡APDU
    smartpos.PsamApdu("", function(message) {
        alert(message);
    }, function() {
        alert("插件调用出错");
    });

安装安卓平台

cordova platform add android

打包apk

cordova build android

更多信息

有关设置Cordova的更多信息,请参阅 文档

有关插件的更多信息,请参阅 cordova插件开发指南

About

这是一个简单的安卓版pos机s1000 SDK调用的插件.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published