react-native-hyperkyc-sdk 0.3.1-alpha05 → 0.3.1
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.
|
@@ -10,11 +10,8 @@ import org.json.JSONException;
|
|
|
10
10
|
import org.json.JSONObject;
|
|
11
11
|
|
|
12
12
|
import java.util.Iterator;
|
|
13
|
-
import java.util.Arrays;
|
|
14
13
|
|
|
15
14
|
public class HyperkycSdkUtils {
|
|
16
|
-
static String[] skipVariables = new String[]{"variables"};
|
|
17
|
-
|
|
18
15
|
public static WritableArray convertJsonToArray(JSONArray jsonArray) throws JSONException {
|
|
19
16
|
WritableArray array = new WritableNativeArray();
|
|
20
17
|
|
|
@@ -46,7 +43,6 @@ public class HyperkycSdkUtils {
|
|
|
46
43
|
while (iterator.hasNext()) {
|
|
47
44
|
String key = iterator.next();
|
|
48
45
|
Object value = jsonObject.get(key);
|
|
49
|
-
if(!Arrays.asList(skipVariables).contains(key)){
|
|
50
46
|
if (value instanceof JSONObject) {
|
|
51
47
|
map.putMap(key, convertJsonToMap((JSONObject) value));
|
|
52
48
|
} else if (value instanceof JSONArray) {
|
|
@@ -62,7 +58,6 @@ public class HyperkycSdkUtils {
|
|
|
62
58
|
} else {
|
|
63
59
|
map.putString(key, value.toString());
|
|
64
60
|
}
|
|
65
|
-
}
|
|
66
61
|
}
|
|
67
62
|
return map;
|
|
68
63
|
}
|
package/ios/HyperkycSdk.swift
CHANGED
|
@@ -58,7 +58,7 @@ class Hyperkyc: NSObject {
|
|
|
58
58
|
"id": countryResult.id,
|
|
59
59
|
"name": countryResult.name,
|
|
60
60
|
"region": countryResult.region,
|
|
61
|
-
"
|
|
61
|
+
"moduleId": countryResult.moduleId,
|
|
62
62
|
"baseUrl": countryResult.baseUrl
|
|
63
63
|
|
|
64
64
|
] as [String: Any]
|
|
@@ -75,7 +75,7 @@ class Hyperkyc: NSObject {
|
|
|
75
75
|
}
|
|
76
76
|
var docResultDictionary = [
|
|
77
77
|
"documentId": docResult.documentId,
|
|
78
|
-
"
|
|
78
|
+
"moduleId":docResult.moduleId,
|
|
79
79
|
"docDataList": docDataList
|
|
80
80
|
] as [String : Any]
|
|
81
81
|
|
|
@@ -87,7 +87,7 @@ class Hyperkyc: NSObject {
|
|
|
87
87
|
//
|
|
88
88
|
// Process face data
|
|
89
89
|
if let faceResult = hyperKycData.faceResult {
|
|
90
|
-
var faceResultDictionary = ["
|
|
90
|
+
var faceResultDictionary = ["moduleId": faceResult.moduleId] as [String:Any]
|
|
91
91
|
faceResultDictionary["faceData"] = processDictionary(inputDictionary: faceResult.faceData.asDictionary)
|
|
92
92
|
kycData["faceResult"] = faceResultDictionary
|
|
93
93
|
}
|
|
@@ -98,7 +98,7 @@ class Hyperkyc: NSObject {
|
|
|
98
98
|
var apiResultList : [[String: Any]] = []
|
|
99
99
|
for apiResult in hyperKycData.apiResultList{
|
|
100
100
|
var apiResultDictionary = [
|
|
101
|
-
"
|
|
101
|
+
"moduleId" : apiResult.moduleId
|
|
102
102
|
] as [String : Any]
|
|
103
103
|
apiResultDictionary["apiData"] = processDictionary(inputDictionary: apiResult.apiData.asDictionary)
|
|
104
104
|
apiResultList.append(apiResultDictionary)
|
|
@@ -114,18 +114,18 @@ class Hyperkyc: NSObject {
|
|
|
114
114
|
|
|
115
115
|
for formViewResult in hyperKycData.formResultList{
|
|
116
116
|
var formViewResultDictionary = [
|
|
117
|
-
"
|
|
117
|
+
"moduleId" : formViewResult.moduleId
|
|
118
118
|
] as [String : Any]
|
|
119
119
|
formViewResultList.append(formViewResultDictionary)
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
kycData["
|
|
122
|
+
kycData["formViewResultList"] = formViewResultList
|
|
123
123
|
|
|
124
124
|
//Process webview data
|
|
125
125
|
var webViewResultList : [[String: Any]] = []
|
|
126
126
|
for webViewResult in hyperKycData.webviewResultList{
|
|
127
127
|
var webViewResultDictionary = [
|
|
128
|
-
"
|
|
128
|
+
"moduleId" : webViewResult.moduleId
|
|
129
129
|
] as [String : Any]
|
|
130
130
|
|
|
131
131
|
webViewResultDictionary["webViewData"] = processDictionary(inputDictionary: webViewResult.webviewData.asDictionary)
|
|
@@ -164,7 +164,7 @@ class Hyperkyc: NSObject {
|
|
|
164
164
|
if(!skipKeysArray.contains(key) ){
|
|
165
165
|
var keyName = key
|
|
166
166
|
if(key == "responseResultRaw"){
|
|
167
|
-
keyName = "
|
|
167
|
+
keyName = "responseResult"
|
|
168
168
|
}
|
|
169
169
|
resultDictionary[keyName] = value
|
|
170
170
|
}
|
|
Binary file
|