@@ -29,6 +29,7 @@ import com.regula.documentreader.api.listener.NetworkInterceptorListener
2929import com.regula.documentreader.api.params.AuthenticityParams
3030import com.regula.documentreader.api.params.BackendProcessingConfig
3131import com.regula.documentreader.api.params.BleDeviceConfig
32+ import com.regula.documentreader.api.params.Bsi
3233import com.regula.documentreader.api.params.DocReaderConfig
3334import com.regula.documentreader.api.params.FaceApiParams
3435import com.regula.documentreader.api.params.Functionality
@@ -309,6 +310,7 @@ fun backendProcessingConfigFromJSON(input: JSONObject?) = input?.let {
309310 }
310311 result.rfidServerSideChipVerification = it.getBooleanOrNull(" rfidServerSideChipVerification" )
311312 result.timeoutConnection = it.getDoubleOrNull(" timeoutConnection" )
313+ if (it.has(" mdlVerification" )) result.mdlVerification = it.getBoolean(" mdlVerification" )
312314 result
313315}
314316
@@ -321,7 +323,20 @@ fun generateBackendProcessingConfig(input: BackendProcessingConfig?) = input?.le
321323 val httpHeaders = JSONObject ()
322324 for ((key, value) in it.httpHeaders!! ) httpHeaders.put(key, value)
323325 httpHeaders
324- }
326+ },
327+ " mdlVerification" to it.mdlVerification,
328+ ).toJson()
329+ }
330+
331+ fun bsiFromJSON (input : JSONObject ? ) = input?.let {
332+ val result = Bsi ()
333+ result.generateResult = it.getBooleanOrNull(" generateResult" )
334+ result
335+ }
336+
337+ fun generateBsi (input : Bsi ? ) = input?.let {
338+ mapOf (
339+ " generateResult" to it.generateResult,
325340 ).toJson()
326341}
327342
@@ -903,18 +918,18 @@ fun generateCameraSize(width: Int?, height: Int?): JSONObject? {
903918fun documentReaderDocumentTypeFromJSON (input : JSONObject ? ) = input?.let {
904919 val result = DocumentReaderDocumentType ()
905920
906- result.pageIndex = it.optInt (" pageIndex" )
907- result.documentID = it.optInt (" documentID" )
908- result.dType = it.optInt (" dType" )
909- result.dFormat = it.optInt (" dFormat" )
910- result.dMRZ = it.optBoolean (" dMRZ" )
911- result.isDeprecated = it.optBoolean (" isDeprecated" )
912- result.name = it.optString (" name" )
913- result.ICAOCode = it.optString (" ICAOCode" )
914- result.dDescription = it.optString (" dDescription" )
915- result.dCountryName = it.optString (" dCountryName" )
916- result.dYear = it.optString (" dYear" )
917- result.FDSID = it.optJSONArray (" FDSID" ).toIntArray()
921+ result.pageIndex = it.getInt (" pageIndex" )
922+ result.documentID = it.getInt (" documentID" )
923+ result.dType = it.getInt (" dType" )
924+ result.dFormat = it.getInt (" dFormat" )
925+ result.dMRZ = it.getBoolean (" dMRZ" )
926+ result.isDeprecated = it.getBoolean (" isDeprecated" )
927+ result.name = it.getStringOrNull (" name" )
928+ result.ICAOCode = it.getStringOrNull (" ICAOCode" )
929+ result.dDescription = it.getStringOrNull (" dDescription" )
930+ result.dCountryName = it.getStringOrNull (" dCountryName" )
931+ result.dYear = it.getStringOrNull (" dYear" )
932+ result.FDSID = it.getJSONArrayOrNull (" FDSID" ).toIntArray()
918933
919934 result
920935}
@@ -1438,7 +1453,7 @@ fun generateDocumentReaderAuthenticityElement(input: DocumentReaderAuthenticityE
14381453fun paResourcesIssuerFromJSON (input : JSONObject ? ) = input?.let {
14391454 val result = PAResourcesIssuer ()
14401455 result.data = it.optString(" data" ).toByteArray()
1441- result.friendlyName = it.optString (" friendlyName" )
1456+ result.friendlyName = it.getStringOrNull (" friendlyName" )
14421457 result.attributes = it.optJSONArray(" attributes" ).toArray(::paAttributeFromJSON)
14431458 result
14441459}
@@ -1718,9 +1733,9 @@ fun generateDocumentReaderRFIDOrigin(input: DocumentReaderRfidOrigin?) = input?.
17181733
17191734fun documentReaderTextSourceFromJSON (input : JSONObject ? ) = input?.let {
17201735 val result = DocumentReaderTextSource ()
1721- result.sourceType = it.optInt (" sourceType" )
1722- result.source = it.optString (" source" )
1723- result.validityStatus = it.optInt (" validityStatus" )
1736+ result.sourceType = it.getInt (" sourceType" )
1737+ result.source = it.getStringOrNull (" source" )
1738+ result.validityStatus = it.getInt (" validityStatus" )
17241739 result
17251740}
17261741
@@ -1862,7 +1877,7 @@ fun documentReaderResultsFromJSON(input: JSONObject?) = input?.let {
18621877 result.mrzPosition = it.optJSONArray(" mrzPosition" ).toList(::elementPositionFromJSON)!!
18631878 result.imageQuality = it.optJSONArray(" imageQuality" ).toList(::imageQualityGroupFromJSON)!!
18641879 result.rawResult = it.optString(" rawResult" )
1865- result.bsiTr03135Results = it.optString (" bsiTr03135Results" )
1880+ result.bsiTr03135Results = it.getStringOrNull (" bsiTr03135Results" )
18661881 result.rfidSessionData = rfidSessionDataFromJSON(it.optJSONObject(" rfidSessionData" ))
18671882 result.authenticityResult = documentReaderAuthenticityResultFromJSON(it.optJSONObject(" authenticityResult" ))
18681883 result.barcodeResult = documentReaderBarcodeResultFromJSON(it.optJSONObject(" barcodeResult" ))
@@ -2111,13 +2126,15 @@ fun finalizeConfigFromJSON(input: JSONObject?) = input?.let {
21112126 if (it.has(" rawImages" )) result.setRawImages(it.getBoolean(" rawImages" ))
21122127 if (it.has(" video" )) result.setVideo(it.getBoolean(" video" ))
21132128 if (it.has(" rfidSession" )) result.setRfidSession(it.getBoolean(" rfidSession" ))
2129+ if (it.has(" mdlSession" )) result.setMdlSession(it.getBoolean(" mdlSession" ))
21142130 result.build()
21152131}
21162132
21172133fun generateFinalizeConfig (input : FinalizeConfig ? ) = input?.let {
21182134 mapOf (
21192135 " rawImages" to it.getPrivateProperty(" rawImages" ),
21202136 " video" to it.getPrivateProperty(" video" ),
2121- " rfidSession" to it.getPrivateProperty(" rfidSession" )
2137+ " rfidSession" to it.getPrivateProperty(" rfidSession" ),
2138+ " mdlSession" to it.getPrivateProperty(" mdlSession" ),
21222139 ).toJson()
21232140}
0 commit comments