|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.BTPaySDK.BTPay_SDK
public class BTPay_SDK
It is the constructor of the main class BTPay_SDK.
Nested Class Summary | |
---|---|
static class |
BTPay_SDK.CAPTURE_ENCODE_TYPE
Define Card type. |
static class |
BTPay_SDK.CAPTURE_ENCRYPT_TYPE
Define encrypted type. |
static class |
BTPay_SDK.EVENT_MSR_Types
Define MSR type. |
Constructor Summary | |
---|---|
BTPay_SDK(OnReceiverListener mL,
Context c)
Create SDK object and implement interface OnMSRListener. |
Method Summary | |
---|---|
void |
close()
Close and release the Bluetooth resource. |
int |
config_getDateTime(java.lang.StringBuilder dateTime)
Get the date and time of device. |
int |
config_getInterfaceDeviceSN(java.lang.StringBuilder serialNumber)
Get interface device's serial number. |
int |
config_getLanguageType(byte[] lanType)
Get Language Type. |
int |
config_getModelNumber(java.lang.StringBuilder modNumber)
Get the model number of device. |
int |
config_getSDKVersion(java.lang.StringBuilder sdkVersion)
Get the version of SDK. |
int |
config_getSerialNumber(java.lang.StringBuilder serialNumber)
Get the serial number of device. |
int |
config_getTerminalIdentification(java.lang.StringBuilder termIden)
Get Get terminal identification. |
int |
config_setBluetoothAddress(java.lang.String strAddress)
Set Bluetooth address. |
int |
config_setDateTime(java.lang.String dateTime)
Set the date and time to device. |
int |
config_setInterfaceDeviceSN(java.lang.String serNumber)
Set Interface device's serial number. |
int |
config_setLanguageType(byte lanType)
Set Language Type. |
int |
config_setSerialNumber(java.lang.String serNumber)
Set the serial number to device. |
int |
config_setTerminalIdentification(java.lang.String termIden)
Set terminal identification. |
void |
connect()
Connect device with the Bluetooth interface. |
void |
connect(java.lang.String address)
Connect device with the Bluetooth interface. |
int |
device_getFirmwareVersion(java.lang.StringBuilder version)
Get the firmware version of device. |
java.lang.String |
device_getResponseCodeString(int errorCode)
Get Response Code String. |
int |
device_rebootDevice()
Reboot device.The device will restart and need to reconnect device if success. |
int |
device_sendBeep(int frequency,
int duration)
Control the device's beeper. |
int |
device_uploadJPEG(int pID,
int pType,
byte[] pData)
Store picture in the device. |
int |
emv_completeOnlineEMVTransaction(byte onlineAuth,
byte[] dataBuf)
Complete Online Authorization transaction;the API need to be used if API emv_startEMVTransaction returns EMV_RESULT_CODE_GO_ONLINE. |
int |
emv_getEMVKernelVersion(java.lang.StringBuilder emvVersion)
Get the EMV L2 Version. |
int |
emv_removeApplicationData(java.lang.String strAID)
Removes the Application Data by AID name passed as the parameter. |
int |
emv_removeCAPK(java.lang.String rid,
java.lang.String index)
Removes Certificate Authority Public Key by the RID/Index. |
int |
emv_removeCRL(CRLDataStruct dataBuf)
Removes all CRL as specified by the RID and Index passed as a parameter in the CRLDataStruct class. |
int |
emv_removeCRLUnit(CRLDataStruct dataBuf)
Removes a single CRL data as specified by the RID/Index/Serial Number passed as a parameter in the CRLDataStruct class. |
int |
emv_removeTerminalData()
Removes the Terminal data. |
int |
emv_retrieveAIDList(ResDataStruct dataBuf)
Retrieves all the AID name/length. |
int |
emv_retrieveApplicationData(java.lang.String AID,
ApplicationIDStruct ResponseAID)
Retrieves Application Data by AID.Retrieves the Application Data as specified by the AID name passed as a parameter. |
int |
emv_retrieveCAPK(java.lang.String rid,
java.lang.String index,
CAKeyStruct dataBuf)
Retrieves Certificate Authority Public Key by the RID/Index. |
int |
emv_retrieveCAPKList(ResDataStruct dataBuf)
Retrieves the Certificate Authority Public Key list. |
int |
emv_retrieveCRLForRID(java.lang.String rid,
ResDataStruct dataBuf)
Retrieve the Certificate Revocation List specific to RID,returns all the serial numbers for a specific RID on the CRL. |
int |
emv_retrieveCRLList(ResDataStruct dataBuf)
Retrieves all the RID in the CRL. |
int |
emv_retrieveTerminalData(TerminalDataStruct dataBuf)
Retrieves the Terminal data. |
int |
emv_setApplicationData(ApplicationIDStruct data)
Set application data by AID. |
int |
emv_setCAPK(CAKeyStruct dataBuf)
Sets Certificate Authority Public Key . |
int |
emv_setCRL(CRLDataStruct dataBuf)
Sets the CRL data as specified by the CRLDataStruct class. |
int |
emv_setTerminalData(TerminalDataStruct dataBuf)
Sets the Terminal data. |
int |
emv_startEMVTransaction(float amount,
float amtOther,
int timeOut1,
int timeOut2,
byte transType,
byte[] dataBuf)
Start EMV transaction request,Authorizes the EMV transaction for an ICC card. The result code,tags and error code will be returned by emvTransactionData in interface OnReceiverListener. |
int |
icc_exchangeAPDU(byte[] dataAPDU,
APDUResponseStruct response)
Exchange APDU between the currently selected microprocessor card in the ICC reader. |
int |
icc_exchangeEncryptedAPDU(byte[] dataAPDU,
byte[] ksn,
APDUResponseStruct response)
Exchange APDU between the currently selected microprocessor card in the ICC reader. |
int |
icc_getCurrentKSN(ResDataStruct resKSN)
Get the current KSN for Smart card. |
int |
icc_getICCReaderStatus(ICCReaderStatusStruct ICCStatus)
Get ICC Reader microprocessor card status. |
int |
icc_powerOffICC()
Power down the currently selected microprocessor card in the ICC reader. |
int |
icc_powerOnICC(PowerOnStructure options,
ResDataStruct atrPPS)
Power up the currently selected microprocessor card in the ICC reader. |
int |
lcd_displayMessage(java.lang.String line1,
java.lang.String line2,
java.lang.String line3,
java.lang.String line4)
Display message. |
int |
lcd_setIdleTimeForSleep(int idleTime)
Set the time before the device into sleep mode. |
int |
lcd_setSleepMode(boolean sleepMode)
Change device the state of sleep mode. |
int |
lcd_showJPEG(int pID,
int X0,
int Y0,
int X1,
int Y1)
Show stored picture on the LCD. |
int |
msr_cancelMSRSwipe()
Disable MSR swipe card. |
int |
msr_defaultAllSetting()
Default all setting of Mask and Encryption. |
int |
msr_getSingleSetting(byte funcID,
byte[] response)
Get single setting of Mask and Encryption by Function ID. |
int |
msr_reviewAllSetting(MSRSettingStruct msrSetting)
Review all setting of Mask and Encryption. |
int |
msr_setSingleSetting(byte funcID,
byte setData)
Set single setting of Mask and Encryption by Function ID. |
int |
msr_startMSRSwipeWithDisplay(java.lang.String line1,
java.lang.String line2,
java.lang.String line3,
java.lang.String line4)
Enable MSR swipe card. |
void |
OnConnectBluetooth()
|
int |
pin_cancelPin()
Cancel enter from keypad,includes PIN,Numeric,Account,Encrypted data,Function Key and Amount. |
int |
pin_getAmount(byte iMax,
byte iMin,
int kID,
java.lang.String lang)
Get amount key code from keypad, Returns value of entered amount in pinpadData of interface OnReceiverListener. |
int |
pin_getCardAccount(int iMax,
int iMin,
java.lang.String line1,
java.lang.String line2)
Get Card account number from keyboad,Returns value of entered account numbers in pinpadData of interface OnReceiverListener. |
int |
pin_getEncryptedData(boolean eFlag,
int iMax,
int iMin,
int kID,
java.lang.String lang)
Get encrypted data,Returns value of entered data in pinpadData of interface OnReceiverListener. |
int |
pin_getEncryptedPIN(byte kType,
java.lang.String account,
java.lang.String line1,
java.lang.String line2,
java.lang.String line3)
Get Encrypted PIN from keyboard,Returns pinblock/ksn of entered PIN value in pinpadData of interface OnReceiverListener. |
int |
pin_getFunctionKey()
Get Function Key from keyboard, Returns value of pressed key in pinpadData of interface OnReceiverListener. |
int |
pin_getNumeric(boolean m_eFlag,
byte m_iMax,
byte m_iMin,
int kID,
java.lang.String lang)
Get numeric key code from keypad,Returns value of entered numeric key in pinpadData of interface OnReceiverListener. . |
int |
pin_getPinLength(byte[] lenBuf)
Get Encrypted PIN length. |
int |
pin_getPINpadStatus(byte[] response)
Get PINPad status. |
int |
pin_setPinLength(int m_iMin,
int m_iMax)
Set Encrypted PIN length. |
int |
StringToHex(java.lang.String str,
byte[] buff)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BTPay_SDK(OnReceiverListener mL, Context c)
mL
- for object of interface OnMSRListener.Method Detail |
---|
public void connect(java.lang.String address)
address
- the Bluetooth MAC address.public void connect()
public void close()
public java.lang.String device_getResponseCodeString(int errorCode)
errorCode
- Error code returns by other APIs.
public int device_getFirmwareVersion(java.lang.StringBuilder version)
version
- for version string.
BTPay_ErrorCode
public int config_getSDKVersion(java.lang.StringBuilder sdkVersion)
sdkVersion
- for version string.
BTPay_ErrorCode
public int config_getModelNumber(java.lang.StringBuilder modNumber)
modNumber
- for Model Number.
BTPay_ErrorCode
public int config_getSerialNumber(java.lang.StringBuilder serialNumber)
serialNumber
- for Serial Number.
BTPay_ErrorCode
public int config_setSerialNumber(java.lang.String serNumber)
serNumber
- for Serial Number string;9 or 10 bytes ASCII, from 0x20 to 0x7F.
BTPay_ErrorCode
public int config_getDateTime(java.lang.StringBuilder dateTime)
dateTime
- the device's date and time, 20121123122459.
BTPay_ErrorCode
public int config_setDateTime(java.lang.String dateTime)
dateTime
- the date and time in hex string,12 characters.If date is: 2012/11/23 12:24:59, dateTime should be 121123122459.
BTPay_ErrorCode
public int config_getLanguageType(byte[] lanType)
lanType
- lanType[0]is the Language type. 0x01:English;0x02:Portuguese;0x03:Spanish.
BTPay_ErrorCode
public int config_setLanguageType(byte lanType)
lanType
- lanType is the Language type.0x01:English;0x02:Portuguese;0x03:Spanish.
BTPay_ErrorCode
public int device_sendBeep(int frequency, int duration)
frequency
- the Frequency of beeper;the range from 2000 to 4000.duration
- the duration of beeper; the range from 0 to 65536.
BTPay_ErrorCode
public int lcd_setSleepMode(boolean sleepMode)
sleepMode
- true:set the device to sleep mode;
false:exit sleep mode.
BTPay_ErrorCode
public int lcd_setIdleTimeForSleep(int idleTime)
idleTime
- the time(Second).BTPay_ErrorCode
public int device_rebootDevice()
BTPay_ErrorCode
public int config_setBluetoothAddress(java.lang.String strAddress)
strAddress
- Bluetooth address 12 characters.example "00:27:15:08:27:F7".
BTPay_ErrorCode
public int device_uploadJPEG(int pID, int pType, byte[] pData)
pID
- for the identifier for the picture.pType
- for the picture's type.pData
- for the data of JPEG format.
BTPay_ErrorCode
public int lcd_showJPEG(int pID, int X0, int Y0, int X1, int Y1)
pID
- for the identifier for the picture;X0
- for X-coordinate of top left point;Y0
- for Y-coordinate of top left point;X1
- for X-coordinate of bottom right point;Y1
- for Y-coordinate of bottom right point.
{X0}{Y0}{X1}{Y1} is scope of LCD, 0<="X0" < "X1"< 128, 0<="Y0" < "Y1" < 64.
BTPay_ErrorCode
public int lcd_displayMessage(java.lang.String line1, java.lang.String line2, java.lang.String line3, java.lang.String line4)
line1
- Display line 1, up to 12 characters.line2
- Display line 2, up to 16 characters.line3
- Display line 3, up to 16 characters.line4
- Display line 4, up to 16 characters.BTPay_ErrorCode
public int config_getInterfaceDeviceSN(java.lang.StringBuilder serialNumber)
serialNumber
- for interface device's serial number string.
BTPay_ErrorCode
public int config_setInterfaceDeviceSN(java.lang.String serNumber)
serNumber
- for Serial Number string;8 bytes ASCII, from 0x20 to 0x7F.
BTPay_ErrorCode
public int config_getTerminalIdentification(java.lang.StringBuilder termIden)
termIden
- for device terminal identification string.
BTPay_ErrorCode
public int config_setTerminalIdentification(java.lang.String termIden)
termIden
- for terminal identification string;8 bytes ASCII, from 0x20 to 0x7F.
BTPay_ErrorCode
public int icc_getICCReaderStatus(ICCReaderStatusStruct ICCStatus)
ICCStatus
- the class for the microprocessor card status.please see ICCReaderStatusStruct class for more information.ICCReaderStatusStruct
,
BTPay_ErrorCode
public int icc_powerOnICC(PowerOnStructure options, ResDataStruct atrPPS)
options
- the options is optional.atrPPS
- the class for ATR string.
PowerOnStructure
,
BTPay_ErrorCode
public int icc_powerOffICC()
BTPay_ErrorCode
public int icc_exchangeAPDU(byte[] dataAPDU, APDUResponseStruct response)
dataAPDU
- Plaintext APDU data buffer.response
- the class for response APDU,please see class APDUResponseStruct for more information.APDUResponseStruct
,
BTPay_ErrorCode
public int icc_exchangeEncryptedAPDU(byte[] dataAPDU, byte[] ksn, APDUResponseStruct response)
dataAPDU
- Encrypted APDU data buffer.ksn
- 10 bytes Key Serial Number.response
- the class for response APDU,please see class APDUResponseStruct for more information.APDUResponseStruct
,
BTPay_ErrorCode
public int icc_getCurrentKSN(ResDataStruct resKSN)
resKSN
- the class for current KSN.
BTPay_ErrorCode
public int emv_getEMVKernelVersion(java.lang.StringBuilder emvVersion)
emvVersion
- for Version.
BTPay_ErrorCode
public int emv_startEMVTransaction(float amount, float amtOther, int timeOut1, int timeOut2, byte transType, byte[] dataBuf)
amount
- Transaction amount value.Example 15.00.amtOther
- Other transaction amount value.timeOut1
- The timeout is define send "Transaction" command until command detect IC card.0 means disable timeout.timeOut2
- The timeout is define Online required Time out.0 means disable timeout.transType
- Transaction type, 1 byte.dataBuf
- the buffer for input data of TLV format.OnReceiverListener
,
BTPay_ErrorCode
public int emv_completeOnlineEMVTransaction(byte onlineAuth, byte[] dataBuf)
onlineAuth
- for Online Authorization Result.dataBuf
- the buffer for input TLV data.BTPay_ErrorCode
public int emv_retrieveApplicationData(java.lang.String AID, ApplicationIDStruct ResponseAID)
AID
- the application's ID in hex string,the length is 5~16 bytes,example "A000000004F303".ResponseAID
- the responseAID PROCESSING data data according to giving AID,please see class ApplicationIDStruct for more information.
ApplicationIDStruct
,
BTPay_ErrorCode
public int emv_removeApplicationData(java.lang.String strAID)
strAID
- the application's ID in hex string,the length is 5~16 bytes,example "A000000004F303".
BTPay_ErrorCode
public int emv_setApplicationData(ApplicationIDStruct data)
data
- the class for application data,please see class ApplicationIDStruct for more information.
ApplicationIDStruct
,
BTPay_ErrorCode
public int emv_retrieveAIDList(ResDataStruct dataBuf)
dataBuf
- the class for all AID name/length.
the format is {AID_num (n)} {AID_Len 1} {AID 1} ...{AID_Len n} {AID n}.
BTPay_ErrorCode
public int emv_retrieveTerminalData(TerminalDataStruct dataBuf)
dataBuf
- the class for Terminal data,please see TerminalDataStruct define for more information.
BTPay_ErrorCode
public int emv_removeTerminalData()
BTPay_ErrorCode
public int emv_setTerminalData(TerminalDataStruct dataBuf)
dataBuf
- the class for Terminal data.
BTPay_ErrorCode
public int emv_retrieveCAPKList(ResDataStruct dataBuf)
dataBuf
- the class for all the CAPK RID and index,every item is 6 bytes, bytes 1-5 RID,bytes 6 index.BTPay_ErrorCode
public int emv_retrieveCAPK(java.lang.String rid, java.lang.String index, CAKeyStruct dataBuf)
rid
- The RID of the key to retrieve, the format is hex string,example "A000000003".index
- the index of the key to retrieve, the format is hex string,example "57".dataBuf
- the class for the CAPK as specified by the RID/Index.please see class CAKeyStruct for more inforamtion.
CAKeyStruct
,
BTPay_ErrorCode
public int emv_removeCAPK(java.lang.String rid, java.lang.String index)
rid
- The RID of the key to remove, the format is hex string,example "A000000003".index
- The index of the key to remove, the format is hex string,example "57".
BTPay_ErrorCode
public int emv_setCAPK(CAKeyStruct dataBuf)
dataBuf
- the class for the CAPK containing the RID, Index, Exponent and key data to set.
BTPay_ErrorCode
public int emv_retrieveCRLForRID(java.lang.String rid, ResDataStruct dataBuf)
rid
- the RID of the certificate to search for , the format is hex string,example "A000000003".dataBuf
- the class for all the serial numbers for a specific RID on the CRL, for each object: 5 bytes: AID 1 byte: Index 3 bytes: Serial Number.BTPay_ErrorCode
public int emv_removeCRLUnit(CRLDataStruct dataBuf)
dataBuf
- The class for CRL containing the RID, Index and serial number.Please see class CRLDataStruct for more information.
BTPay_ErrorCode
public int emv_setCRL(CRLDataStruct dataBuf)
dataBuf
- The class for CRL containing the RID, Index and serial number.Please see class CRLDataStruct for more information.
BTPay_ErrorCode
public int emv_retrieveCRLList(ResDataStruct dataBuf)
dataBuf
- The class for all the RID in the CRL,5-byte objects for each RID,the format:{RID number (n)} {RID 1}...{RID n}.
BTPay_ErrorCode
public int emv_removeCRL(CRLDataStruct dataBuf)
dataBuf
- The class for CRL containing the RID, Index.please see class CRLDataStruct for more information.
BTPay_ErrorCode
public int pin_getPINpadStatus(byte[] response)
response
- Pad status,one byte; response[0].BTPay_ErrorCode
public int pin_cancelPin()
BTPay_ErrorCode
public int pin_getFunctionKey()
OnReceiverListener
,
BTPay_ErrorCode
public int pin_getEncryptedPIN(byte kType, java.lang.String account, java.lang.String line1, java.lang.String line2, java.lang.String line3)
kType
- for the key type.account
- for external account,ASCII code(0x30~0x39),the account will not exist if the m_kType is 0x10~0x11.
the length must be 13~20.line1
- Display line 1, up to 12 characters.line2
- Display line 2, up to 16 characters.line3
- Display line 3, up to 16 characters.OnReceiverListener
,
BTPay_ErrorCode
public int pin_getNumeric(boolean m_eFlag, byte m_iMax, byte m_iMin, int kID, java.lang.String lang)
m_eFlag
- Control whether the numeric key need to display in plain text,one byte.m_iMax
- The max length for numeric,max length can not beyond 16.m_iMin
- The minimum length for numeric, minimum length can not less than 1.kID
- the RSA encrypted message ID.every ID for a encrypted data of characters and language.lang
- Language to use for message and encrypted file.Example,lang is "English",the name of encrypted file is "English_RSAData.xml".OnReceiverListener
,
BTPay_ErrorCode
public int pin_getCardAccount(int iMax, int iMin, java.lang.String line1, java.lang.String line2)
iMax
- for max length of card account to be got from keypad, no more than 20.iMin
- for min length of card account to be got from keypad, no less than 12.line1
- Display line 1, up to 12 characters.line2
- Display line 2, up to 16 characters.OnReceiverListener
,
BTPay_ErrorCode
public int pin_getEncryptedData(boolean eFlag, int iMax, int iMin, int kID, java.lang.String lang)
eFlag
- 1. false:not the last package;
2. true:the last package.iMax
- The max length for numeric,max length can not beyond 16.iMin
- The minimum length for numeric, minimum length can not less than 1.kID
- the RSA encrypted message ID.every ID for a encrypted data of characters and language.lang
- Language to use for message and encrypted file.Example,lang is "English",the name of encrypted file is "English_RSAData.xml".OnReceiverListener
,
BTPay_ErrorCode
public int pin_getAmount(byte iMax, byte iMin, int kID, java.lang.String lang)
iMax
- The max length for amount,max length can not beyond 15.iMin
- The minimum length for amount, minimum length can not less than 0.kID
- the RSA encrypted message ID.every ID for a encrypted data of characters and language.lang
- Language to use for message and encrypted file.Example,lang is "English",the name of encrypted file is "English_RSAData.xml".OnReceiverListener
,
BTPay_ErrorCode
public int pin_getPinLength(byte[] lenBuf)
lenBuf
- lenBuf[0]is the minimum length for encrypted PIN and lenBuf[1] is the max length for encrypted PIN.
BTPay_ErrorCode
public int pin_setPinLength(int m_iMin, int m_iMax)
m_iMax
- The max length for encrypted PIN, max length can not beyond 12.
BTPay_ErrorCode
public int msr_reviewAllSetting(MSRSettingStruct msrSetting)
msrSetting
- for MSR setting. please see class MSRSettingStruct for more information.MSRSettingStruct
,
BTPay_ErrorCode
public int msr_defaultAllSetting()
BTPay_ErrorCode
public int msr_getSingleSetting(byte funcID, byte[] response)
funcID
- function ID.response
- response[0] for setting data.
BTPay_ErrorCode
public int msr_setSingleSetting(byte funcID, byte setData)
funcID
- function ID.setData
- for setting data.
BTPay_ErrorCode
public int msr_startMSRSwipeWithDisplay(java.lang.String line1, java.lang.String line2, java.lang.String line3, java.lang.String line4)
line1
- Display line 1, up to 12 characters.line2
- Display line 2, up to 16 characters.line3
- Display line 3, up to 16 characters.line4
- Display line 4, up to 16 characters.OnReceiverListener
,
BTPay_ErrorCode
public int msr_cancelMSRSwipe()
BTPay_ErrorCode
public int StringToHex(java.lang.String str, byte[] buff)
public void OnConnectBluetooth()
OnConnectBluetooth
in interface com.BTPaySDK.OnReceiverBluetooth
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |