createTransaction

abstract fun createTransaction(directoryServerID: String, messageVersion: String?): Transaction

The createTransaction method creates an instance of Transaction through which the app gets the data that is required to perform the transaction. The app calls the createTransaction method for each transaction that is to be processed. When the createTransaction method is called:

  • The 3DS SDK uses the information adhering to the protocol version passed in the optional messageVersion parameter, if it supports the protocol version. If it does not support the protocol version, it generates an InvalidInputException. If the messageVersion parameter is empty or null, the highest protocol version that the 3DS SDK supports is used. If Challenge Flow is triggered for the transaction, the 3DS SDK uses the same protocol version during the challenge process.

  • The 3DS SDK uses a secure random function to generate a Transaction ID in UUID format. This ID is used to uniquely identify each transaction.

  • The 3DS SDK generates a fresh ephemeral key pair. This key pair is used to establish a secure session between the 3DS SDK and the ACS subsequently during the transaction.

Return

This method returns an instance of the Transaction interface.

Parameters

directoryServerID

Registered Application Provider Identifier (RID) that is unique to the Payment System.

RIDs are defined by the ISO 7816-5 standard.

RIDs are issued by the ISO/IEC 7816- 5 registration authority.

Contains a 5-byte value.

The 3DS SDK encrypts the device information by using the DS public key. This key is identified based on the directoryServerID that is passed to the createTransaction method.

Note: The 3DS SDK shall have the DS Public Keys of all the 3-D Secure participating Directory Servers.

messageVersion

(optional) Protocol version according to which the transaction shall be created.

Throws

This exception shall be thrown if an input parameter is invalid. This also includes an invalid Directory Server ID or a protocol version that the 3DS SDK does not support.

This exception shall be thrown if an internal error is encountered by the 3DS SDK.