authorizeRegister login logout addAuthNetListener initAnetEMVManager initAnetEMVTransactionRequest setConnectionMode resetEMVManager getMerchantDetails emvTransaction readQuickChipCard discardQuickChipCard startQuickChip startQuickChipWithTipOptions createCustomerProfile initAcceptClient getTokenWithRequest
封装了authorize的EMV交易
注册接口
authorizeRegister({params})
username:
password:
mobileDeviceId:
var authorize = api.require('authorize');
authorize.authorizeRegister({
username: '',
password: '',
mobileDeviceId: ''
});
iOS系统
可提供的 1.0.0 及更高版本
登录接口(仅iOS支持)
login({params})
username:
password:
mobileDeviceId:
var authorize = api.require('authorize');
authorize.login({
username: '',
password: '',
mobileDeviceId:''
});
iOS系统
可提供的 1.0.0 及更高版本
退出登录(仅iOS支持)
logout({params})
sessionToken:
mobileDeviceId:
var authorize = api.require('authorize');
authorize.logout({
sessionToken: '',
mobileDeviceId: ''
});
iOS系统
添加authNet监听(仅iOS支持)
addAuthNetListener(callback(ret))
ret:
{
state: 'emvPaymentSucceeded' //字符串类型;返回事件,取值范围如下:
//emvPaymentSucceeded
//paymentSucceeded
//requestFailed
//connectionFailed
//getBatchStatisticsSucceeded
//getSettledBatchListSucceeded
//getTransactionDetailsSucceeded
//getTransactionListSucceeded
//getUnsettledTransactionListSucceeded
//sendCustomerTransactionReceiptSucceeded
//getMerchantDetailsResponseSucceeded
//mobileDeviceLoginSucceeded
//captchaImageSucceeded
//createCustomerProfileTransactionSucceeded
//updateCustomerProfileSucceeded
//createCustomerPaymentProfileSucceeded
//updateCustomerPaymentProfileSucceeded
//getCustomerProfileSucceeded
//getCustomerPaymentProfileSucceeded
//testAccountRegistrationSucceeded
//mobileDeviceRegistrationSucceeded
//logoutSucceeded
sessionToken:'', //字符串类型:sessionToken,mobileDeviceLoginSucceeded事件返回
}
var authorize = api.require('authorize');
authorize.addAuthNetListener(function(ret) {
api.alert({
msg: JSON.stringify(ret)
})
});
iOS系统
可提供的1.0.0及更高版本
初始化EMV交易(仅iOS支持)
initAnetEMVManager({params})
currecyCode:
terminalID:
skipSignature:
showReceipt:
var authorize = api.require('authorize');
authorize.initAnetEMVManager({
currecyCode: '',
terminalID: ''
});
iOS系统
初始化EMV交易请求(仅iOS支持)
initAnetEMVTransactionRequest({params})
emvTransactionType:
lineItems:
{
[{
itemName:'',
itemTaxable:'',
itemQuantity:'',
itemID:'',
itemDescription:'',
itemPrice:''
}]
}
sessionToken:
mobileDeviceId:
amount:
invoiceNumber:
orderDescription:
marketType:
deviceType:
employeeId:
var authorize = api.require('authorize');
authorize.initAnetEMVTransactionRequest({
lineItems: [{}],
sessionToken: '',
mobileDeviceId: '',
amount: '',
invoiceNumber: '',
orderDescription: '',
marketType: '',
deviceType: '',
employeeId: ''
});
iOS系统
设置连接模式(仅iOS支持)
setConnectionMode({params})
connectionMode:
var authorize = api.require('authorize');
authorize.setConnectionMode({
connectionMode: 0
});
iOS系统
重置EMVManager(仅iOS支持)
resetEMVManager()
var authorize = api.require('authorize');
authorize.resetEMVManager();
iOS系统
获取商家详细信息(仅iOS支持)
getMerchantDetails({params})
sessionToken:
mobileDeviceId:
var authorize = api.require('authorize');
authorize.getMerchantDetails({
sessionToken: '',
mobileDeviceId: ''
});
iOS系统
EMV 交易(在initAnetEMVTransactionRequest之后调用该接口)(仅iOS支持)
emvTransaction(callback(ret))
ret:
{
status: true, //字符串类型;交易状态,取值范围:
//succeed:成功
//fail:失败
//cancel:取消
sessionToken: //字符串类型;令牌,status == succeed时返回
}
var authorize = api.require('authorize');
authorize.emvTransaction(function(ret) {
api.alert({ msg:JSON.stringify(ret)});
});
iOS系统
可提供的 1.0.0 及更高版本
启动快速卡片交易(仅iOS支持)
readQuickChipCard({params},callback(ret))
emvTransactionType:
ret:
{
status: true, //布尔类型;是否成功,true|false
progress: 0 //数字类型;交易进度,取值范围:
//0:waitingForCard
//1:retryInsertOrSwipe
//2:swipeOrTryAnotherCard
//3:swipe
//4:processingCard
//5:doneWithCard
}
var authorize = api.require('authorize');
authorize.readQuickChipCard({
emvTransactionType:0
},function(ret,err){
api.alert({ msg:JSON.stringify(ret)});
});
iOS系统
可提供的 1.0.0 及更高版本
丢弃以前处理过的卡片数据(仅iOS支持)
discardQuickChipCard(callback(ret))
ret:
{
status: true, //布尔类型;是否成功,true|false
}
var authorize = api.require('authorize');
authorize.discardQuickChipCard(function(ret,err){
api.alert({ msg:JSON.stringify(ret)});
});
iOS系统
开始快速芯片交易(在initAnetEMVTransactionRequest之后调用该接口)(仅iOS支持)
startQuickChip({params},callback(ret))
paperReceipt:
ret:
{
status: true, //字符串类型;交易状态,取值范围:
//succeed:成功
//fail:失败
//cancel:取消
sessionToken: //字符串类型;令牌,status == succeed时返回
}
var authorize = api.require('authorize');
authorize.startQuickChip({
paperReceipt:true
},function(ret) {
api.alert({ msg:JSON.stringify(ret)});
});
iOS系统
可提供的 1.0.0 及更高版本
带小费金额的快速筹码交易(在initAnetEMVTransactionRequest之后调用该接口)(仅iOS支持)
startQuickChipWithTipAmount({params},callback(ret))
tipAmount:
ret:
{
status: true, //字符串类型;交易状态,取值范围:
//succeed:成功
//fail:失败
//cancel:取消
sessionToken: //字符串类型;令牌,status == succeed时返回
}
var authorize = api.require('authorize');
authorize.startQuickChipWithTipAmount({
tipAmount:''
},function(ret) {
api.alert({ msg:JSON.stringify(ret)});
});
iOS系统
可提供的 1.0.0 及更高版本
带有提示选项的快速筹码交易(在initAnetEMVTransactionRequest之后调用该接口)(仅iOS支持)
startQuickChipWithTipOptions({params},callback(ret))
tipOptions:
ret:
{
status: true, //字符串类型;交易状态,取值范围:
//succeed:成功
//fail:失败
//cancel:取消
sessionToken: //字符串类型;令牌,status == succeed时返回
}
var authorize = api.require('authorize');
authorize.startQuickChipWithTipOptions({
tipOptions:['']
},function(ret) {
api.alert({ msg:JSON.stringify(ret)});
});
iOS系统
可提供的 1.0.0 及更高版本
创建客户资料并通过EMV请求启动快速筹码交易(在initAnetEMVTransactionRequest之后调用该接口)(仅iOS支持)
createCustomerProfile({params},callback(ret))
paperReceipt:
isConsentBefore:
ret:
{
status: true, //字符串类型;交易状态,取值范围:
//succeed:成功
//fail:失败
//cancel:取消
sessionToken: //字符串类型;令牌,status == succeed时返回
}
var authorize = api.require('authorize');
authorize.createCustomerProfile({
paperReceipt:true,
isConsentBefore:true
},function(ret) {
api.alert({ msg:JSON.stringify(ret)});
});
iOS系统
可提供的 1.0.0 及更高版本
创建附加付款资料并通过EMV请求启动快速筹码交易(在initAnetEMVTransactionRequest之后调用该接口)(仅iOS支持)
createAdditionalPaymentProfile({params},callback(ret))
paperReceipt:
isConsentBefore:
profileID:
ret:
{
status: true, //字符串类型;交易状态,取值范围:
//succeed:成功
//fail:失败
//cancel:取消
sessionToken: //字符串类型;令牌,status == succeed时返回
}
var authorize = api.require('authorize');
authorize.createAdditionalPaymentProfile({
paperReceipt:true,
isConsentBefore:true
},function(ret) {
api.alert({ msg:JSON.stringify(ret)});
});
iOS系统,Android系统
可提供的 1.0.0 及更高版本
初始化AcceptSDK(仅android支持)
initAcceptClient({params},callback(ret, err))
environment:
timeOut:
ret:
{
status: true //布尔类型;是否成功,true|false
}
err:
{
msg: '' //字符串类型;错误信息
}
var authorize = api.require('authorize');
authorize.initAcceptClient({
},function(ret, err) {
if (ret.status) {
api.alert({ msg:'成功'});
} else {
api.alert({ msg:JSON.stringify(err)});
}
});
android系统
可提供的 1.0.0 及更高版本
获取令牌(仅android支持)
getTokenWithRequest({params},callback(ret, err))
loginId:
clientKey:
cardNumber:
expirationMonth:
expirationYear:
cvv:
ret:
{
status: true //布尔类型;是否成功,true|false
describeContents:, //数字类型;
dataDescriptor:'', //字符串类型;描述
dataValue:'', //字符串类型;数据
}
err:
{
describeContents:, //数字类型;
firstErrorMessage: '' //字符串类型;错误信息
}
var authorize = api.require('authorize');
authorize.getTokenWithRequest({
},function(ret, err) {
if (ret.status) {
api.alert({ msg:'成功'});
} else {
api.alert({ msg:JSON.stringify(err)});
}
});
android系统
可提供的 1.0.0 及更高版本