com.BTPaySDK
Class BTPay_SDK.EMVLevel2

java.lang.Object
  extended by com.BTPaySDK.BTPay_SDK.EMVLevel2
Enclosing class:
BTPay_SDK

public class BTPay_SDK.EMVLevel2
extends java.lang.Object

Class EMVLevel2 includes all methods for EMV Level2 function.


Constructor Summary
BTPay_SDK.EMVLevel2()
           
 
Method Summary
 int completeOnlineEMVTransaction(boolean enableOnline, ResDataStruct dataBuf)
          Complete Online Authorization transaction;the API need to be used if API startEMVTransaction returns "Response code" = 0x0002.
 int GetEMVKernelVersion(java.lang.StringBuilder emvVersion)
          Get the EMV L2 Version.
 int removeApplicationData(java.lang.String strAID)
          Removes the Application Data by AID name passed as the parameter.
 int removeCAPK(java.lang.String ridIndex)
          Removes Certificate Authority Public Key by the RID/Index.
 int removeCRL(CRLDataStruct dataBuf)
          Removes all CRL as specified by the RID and Index passed as a parameter in the CRLDataStruct class.
 int 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 removeTerminalData()
          Removes the Terminal data.
 int retrieveAIDList(ResDataStruct dataBuf)
          Retrieves all the AID name/length.
 int retrieveApplicationData(java.lang.String strAID, ResDataStruct dataBuf)
          Retrieves Application Data by AID.
 int retrieveCAPK(java.lang.String ridIndex, CAKeyStruct dataBuf)
          Retrieves Certificate Authority Public Key by the RID/Index.
 int retrieveCAPKList(ResDataStruct dataBuf)
          Retrieves the Certificate Authority Public Key list.
 int 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 retrieveCRLList(ResDataStruct dataBuf)
          Retrieves all the RID in the CRL.
 int retrieveTerminalData(TerminalDataStruct dataBuf)
          Retrieves the Terminal data.
 int setApplicationData(java.lang.String strAID, ResDataStruct dataBuf)
          Set application data by AID.
 int setCAPK(CAKeyStruct dataBuf)
          Sets Certificate Authority Public Key .
 int setCRL(CRLDataStruct dataBuf)
          Sets the CRL data as specified by the CRLDataStruct class.
 int setTerminalData(TerminalDataStruct dataBuf)
          Sets the Terminal data.
 int startEMVTransaction(float amount, float amtOther, int timeOut1, int timeOut2, byte transType, ResDataStruct dataBuf)
          Start EMV transaction.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BTPay_SDK.EMVLevel2

public BTPay_SDK.EMVLevel2()
Method Detail

GetEMVKernelVersion

public int GetEMVKernelVersion(java.lang.StringBuilder emvVersion)
Get the EMV L2 Version.

Parameters:
emvVersion - for Version.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

startEMVTransaction

public int startEMVTransaction(float amount,
                               float amtOther,
                               int timeOut1,
                               int timeOut2,
                               byte transType,
                               ResDataStruct dataBuf)
Start EMV transaction.

Parameters:
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 class for input data of TLV format.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

completeOnlineEMVTransaction

public int completeOnlineEMVTransaction(boolean enableOnline,
                                        ResDataStruct dataBuf)
Complete Online Authorization transaction;the API need to be used if API startEMVTransaction returns "Response code" = 0x0002.

Parameters:
enableOnline - true:Online processing with the host(issuer) was completed. false:Online processing could not be completed due to connection error with the host(issuer).There is no other data if false.
dataBuf - the class for input data and output data.
In parameter: TLV data..
Out parameter: Response code(2 bytes) + Response data(TLV data returns back from ICC card)..
Response code(2 bytes):
[0x00,0x00]- Approved,accept the online transaction.
[0x00,0x01]- Declined,decline the online transaction.
[0x00,0x02]- Go Online,request to go online;continue calling completeOnlineEMVTransaction to finish online authorization
[0x00,0x03]- Failed,transaction is terminate.
[0x00,0x05]- System Error, Application was not selected by kernel or ICC format Error or ICC missing data error.
[0x00,0x07]- Not Accept,ICC didn¡¯t accepted transaction.
[0x00,0x0A]- Fallback,application may fallback to magstripe technology.
[0x00,0x0C]- Cancel,transaction was cancel.
[0x00,0x0F]- Other Error.
[0x00,0x0D]- Time Out.
[0x00,0x10]- Offline approved,accept the offline transaction.
[0x00,0x11]- Offline declined,decline the offline transaction.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

retrieveApplicationData

public int retrieveApplicationData(java.lang.String strAID,
                                   ResDataStruct dataBuf)
Retrieves Application Data by AID.

Parameters:
strAID - the application's ID in hex string,the length is 5~16 bytes,example "A0 00 00 00 04 F3 03".
dataBuf - the class for output data stores PROCESSING data according to giving ID.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

removeApplicationData

public int removeApplicationData(java.lang.String strAID)
Removes the Application Data by AID name passed as the parameter.

Parameters:
strAID - the application's ID in hex string,the length is 5~16 bytes,example "A0 00 00 00 04 F3 03".
Returns:
success or error code.
See Also:
BTPay_ErrorCode

setApplicationData

public int setApplicationData(java.lang.String strAID,
                              ResDataStruct dataBuf)
Set application data by AID.

Parameters:
strAID - the application's ID in hex string,the length is 5~16 bytes,example "A0 00 00 00 04 F3 03".
dataBuf - the class for application data.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

retrieveAIDList

public int retrieveAIDList(ResDataStruct dataBuf)
Retrieves all the AID name/length.

Parameters:
dataBuf - the class for all AID name/length. the format is {AID_num (n)} {AID_Len 1} {AID 1} ...{AID_Len n} {AID n}.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

retrieveTerminalData

public int retrieveTerminalData(TerminalDataStruct dataBuf)
Retrieves the Terminal data.

Parameters:
dataBuf - the class for Terminal data,please see TerminalDataStruct define for more information.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

removeTerminalData

public int removeTerminalData()
Removes the Terminal data.

Returns:
success or error code.
See Also:
BTPay_ErrorCode

setTerminalData

public int setTerminalData(TerminalDataStruct dataBuf)
Sets the Terminal data.

Parameters:
dataBuf - the class for Terminal data.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

retrieveCAPKList

public int retrieveCAPKList(ResDataStruct dataBuf)
Retrieves the Certificate Authority Public Key list.

Parameters:
dataBuf - the class for all the CAPK RID and index,every item is 6 bytes, bytes 1-5 RID,bytes 6 index.
the format is {CAKey number (n)} {RID 1} {Index 1} ... {RID n} {Index n}.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

retrieveCAPK

public int retrieveCAPK(java.lang.String ridIndex,
                        CAKeyStruct dataBuf)
Retrieves Certificate Authority Public Key by the RID/Index.

Parameters:
ridIndex - The RID and Index of the key to retrieve, the format is hex string,example "A0 00 00 00 03 57".
dataBuf - the class for the CAPK as specified by the RID/Index.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

removeCAPK

public int removeCAPK(java.lang.String ridIndex)
Removes Certificate Authority Public Key by the RID/Index.

Parameters:
ridIndex - The RID and Index of the key to remove, the format is hex string,example "A0 00 00 00 03 57".
Returns:
success or error code.
See Also:
BTPay_ErrorCode

setCAPK

public int setCAPK(CAKeyStruct dataBuf)
Sets Certificate Authority Public Key .

Parameters:
dataBuf - the class for the CAPK containing the RID, Index, Exponent and key data to set.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

retrieveCRLForRID

public int 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.

Parameters:
rid - the RID of the certificate to search for , the format is hex string,example "A0 00 00 00 03".
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.
the format:{CRL units in total(n)} {Index1} {Serial number 1}...{Index n} {Serial number n} .
Returns:
success or error code.
See Also:
BTPay_ErrorCode

removeCRLUnit

public int removeCRLUnit(CRLDataStruct dataBuf)
Removes a single CRL data as specified by the RID/Index/Serial Number passed as a parameter in the CRLDataStruct class.

Parameters:
dataBuf - The class for CRL containing the RID, Index and serial number.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

setCRL

public int setCRL(CRLDataStruct dataBuf)
Sets the CRL data as specified by the CRLDataStruct class.

Parameters:
dataBuf - The class for CRL containing the RID, Index and serial number.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

retrieveCRLList

public int retrieveCRLList(ResDataStruct dataBuf)
Retrieves all the RID in the CRL.

Parameters:
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}.
Returns:
success or error code.
See Also:
BTPay_ErrorCode

removeCRL

public int removeCRL(CRLDataStruct dataBuf)
Removes all CRL as specified by the RID and Index passed as a parameter in the CRLDataStruct class.

Parameters:
dataBuf - The class for CRL containing the RID, Index.
Returns:
success or error code.
See Also:
BTPay_ErrorCode