@qore-id/react-native-qoreid-sdk 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ import com.qoreid.sdk.core.QoreIDSdk.QORE_ID_RESULT_EXTRA_KEY
21
21
  import com.qoreid.sdk.core.models.AddressData
22
22
  import com.qoreid.sdk.core.models.ApplicantData
23
23
  import com.qoreid.sdk.core.models.ErrorResult
24
+ import com.qoreid.sdk.core.models.IdentityData
24
25
  import com.qoreid.sdk.core.models.QoreIDResult
25
26
  import com.qoreid.sdk.core.models.ResultData
26
27
  import com.qoreid.sdk.core.models.SuccessResult
@@ -111,6 +112,18 @@ class QoreidSdkModule(context: ReactApplicationContext) :
111
112
  )
112
113
  val flowId = config?.get("flowId") as? Double
113
114
 
115
+ val _identityData = data?.get("identityData") as? HashMap<*, *>
116
+
117
+ var identityData: IdentityData? = null
118
+
119
+ if(!_identityData.isNullOrEmpty()){
120
+ identityData = IdentityData(
121
+ _identityData?.get("idType") as String,
122
+ _identityData?.get("idNumber") as String
123
+ )
124
+ }
125
+
126
+
114
127
  val _extraData = data?.get("extraData") as? HashMap<*, *>?
115
128
  var extraData: VerificationExtraData? = null
116
129
 
@@ -123,13 +136,19 @@ class QoreidSdkModule(context: ReactApplicationContext) :
123
136
  )
124
137
  }
125
138
 
139
+ var acceptedDocuments: List<String>? = data?.get("acceptedDocuments") as? List<String>
140
+
141
+ if(acceptedDocuments.isNullOrEmpty()){
142
+ acceptedDocuments = emptyList()
143
+ }
144
+
126
145
  val qoreIDParams =
127
146
  if (flowId?.toLong() != 0L) {
128
147
  QoreIDParams()
129
148
  .clientId(config?.get("clientId") as String)
130
149
  .customerReference(config?.get("customerReference") as String)
131
- .inputData(applicantData, addressData, null, extraData)
132
- .ocrAcceptedDocuments(data?.get("acceptedDocuments") as List<String>)
150
+ .inputData(applicantData, addressData, identityData, extraData)
151
+ .ocrAcceptedDocuments(acceptedDocuments)
133
152
  .workflow(flowId!!.toLong())
134
153
  .workflowDefaultIdentity(
135
154
  config?.get("defaultIdType") as
@@ -139,8 +158,8 @@ class QoreidSdkModule(context: ReactApplicationContext) :
139
158
  QoreIDParams()
140
159
  .clientId(config?.get("clientId") as String)
141
160
  .customerReference(config?.get("customerReference") as String)
142
- .inputData(applicantData, addressData, null, extraData)
143
- .ocrAcceptedDocuments(data?.get("acceptedDocuments") as List<String>)
161
+ .inputData(applicantData, addressData, identityData, extraData)
162
+ .ocrAcceptedDocuments(acceptedDocuments)
144
163
  .collection(config?.get("productCode") as String)
145
164
  }
146
165
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qore-id/react-native-qoreid-sdk",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "QoreId React Native SDK",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",