# 安卓K12刷脸插件调用示例
# K12刷脸插件下载地址
版本号 | 下载链接 |
---|---|
1.0 | 下载链接 (opens new window) |
# 简要说明说明
使用Android中的onActivityResult方法,其中requestCode自定义参数,resultCode固定值1003
# 请求参数说明
参数名 | 类型 | 说明 |
---|---|---|
storeId | String | 门店ID |
apiSecret | String | 请求来源系统的密钥 对应门店的openSecret |
deviceId | String | 终端设备编号 |
amt | String | 交易金额 单位:分 |
deviceIp | String | 设备IP |
mac | String | 设备mac |
countdown | String | 倒计时(单位秒) |
# 请求示例
以下参数为测试参数
Intent intent = new Intent();
intent.setAction("app.intent.action.VIEW");
intent.addCategory("android.intent.category.DEFAULT");
bundle.putString("storeId","1296258251744940032");
bundle.putString("apiSecret","fe5f3c86-e513-4dec-a741-b5ccc14312eb");
bundle.putString("deviceId",getSerialNumber());
bundle.putString("amt","1");
bundle.putString("deviceIp",DeviceIpAddressUtils.getIPAddress(this));
bundle.putString("mac",MacAddressUtils.getMac(this));
intent.putExtras(bundle);
startActivityForResult(intent,1002);
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# 返回参数说明
参数名 | 类型 | 说明 |
---|---|---|
code | String | 0调用错误1支付成功 |
msg | String | 提示 |
orderNumber | String | 订单编号(支付成功返回) |
# 返回示例
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
if (requestCode==1002&&resultCode==1003){
String code= data.getStringExtra("code");
String msg= data.getStringExtra("msg");
}
super.onActivityResult(requestCode, resultCode, data);
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8