react-native-hyperkyc-sdk 0.3.1 → 0.3.3

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.
@@ -108,6 +108,7 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule implements Act
108
108
  WritableMap resultMap = new WritableNativeMap();
109
109
  resultMap.putString("status", hyperKycResult.getStatus().toString());
110
110
  resultMap.putString("reason", hyperKycResult.getReason());
111
+ resultMap.putString("applicationStatus", hyperKycResult.getApplicationStatus());
111
112
  try {
112
113
  if (hyperKycData != null) {
113
114
 
@@ -10,8 +10,11 @@ import org.json.JSONException;
10
10
  import org.json.JSONObject;
11
11
 
12
12
  import java.util.Iterator;
13
+ import java.util.Arrays;
13
14
 
14
15
  public class HyperkycSdkUtils {
16
+ static String[] skipVariables = new String[]{"variables"};
17
+
15
18
  public static WritableArray convertJsonToArray(JSONArray jsonArray) throws JSONException {
16
19
  WritableArray array = new WritableNativeArray();
17
20
 
@@ -43,6 +46,7 @@ public class HyperkycSdkUtils {
43
46
  while (iterator.hasNext()) {
44
47
  String key = iterator.next();
45
48
  Object value = jsonObject.get(key);
49
+ if(!Arrays.asList(skipVariables).contains(key)){
46
50
  if (value instanceof JSONObject) {
47
51
  map.putMap(key, convertJsonToMap((JSONObject) value));
48
52
  } else if (value instanceof JSONArray) {
@@ -58,6 +62,7 @@ public class HyperkycSdkUtils {
58
62
  } else {
59
63
  map.putString(key, value.toString());
60
64
  }
65
+ }
61
66
  }
62
67
  return map;
63
68
  }
@@ -47,6 +47,7 @@ class Hyperkyc: NSObject {
47
47
  var resultEnumString = ""
48
48
  var kycData = [:] as [String: Any]
49
49
  var errorMessage = ""
50
+ var applicationStatus = ""
50
51
 
51
52
  resultEnumString = String(describing: resultEnum)
52
53
 
@@ -58,7 +59,7 @@ class Hyperkyc: NSObject {
58
59
  "id": countryResult.id,
59
60
  "name": countryResult.name,
60
61
  "region": countryResult.region,
61
- "moduleId": countryResult.moduleId,
62
+ "tag": countryResult.moduleId,
62
63
  "baseUrl": countryResult.baseUrl
63
64
 
64
65
  ] as [String: Any]
@@ -75,7 +76,7 @@ class Hyperkyc: NSObject {
75
76
  }
76
77
  var docResultDictionary = [
77
78
  "documentId": docResult.documentId,
78
- "moduleId":docResult.moduleId,
79
+ "tag":docResult.moduleId,
79
80
  "docDataList": docDataList
80
81
  ] as [String : Any]
81
82
 
@@ -87,7 +88,7 @@ class Hyperkyc: NSObject {
87
88
  //
88
89
  // Process face data
89
90
  if let faceResult = hyperKycData.faceResult {
90
- var faceResultDictionary = ["moduleId": faceResult.moduleId] as [String:Any]
91
+ var faceResultDictionary = ["tag": faceResult.moduleId] as [String:Any]
91
92
  faceResultDictionary["faceData"] = processDictionary(inputDictionary: faceResult.faceData.asDictionary)
92
93
  kycData["faceResult"] = faceResultDictionary
93
94
  }
@@ -98,7 +99,7 @@ class Hyperkyc: NSObject {
98
99
  var apiResultList : [[String: Any]] = []
99
100
  for apiResult in hyperKycData.apiResultList{
100
101
  var apiResultDictionary = [
101
- "moduleId" : apiResult.moduleId
102
+ "tag" : apiResult.moduleId
102
103
  ] as [String : Any]
103
104
  apiResultDictionary["apiData"] = processDictionary(inputDictionary: apiResult.apiData.asDictionary)
104
105
  apiResultList.append(apiResultDictionary)
@@ -114,18 +115,18 @@ class Hyperkyc: NSObject {
114
115
 
115
116
  for formViewResult in hyperKycData.formResultList{
116
117
  var formViewResultDictionary = [
117
- "moduleId" : formViewResult.moduleId
118
+ "tag" : formViewResult.moduleId
118
119
  ] as [String : Any]
119
120
  formViewResultList.append(formViewResultDictionary)
120
121
  }
121
122
 
122
- kycData["formViewResultList"] = formViewResultList
123
+ kycData["formResultList"] = formViewResultList
123
124
 
124
125
  //Process webview data
125
126
  var webViewResultList : [[String: Any]] = []
126
127
  for webViewResult in hyperKycData.webviewResultList{
127
128
  var webViewResultDictionary = [
128
- "moduleId" : webViewResult.moduleId
129
+ "tag" : webViewResult.moduleId
129
130
  ] as [String : Any]
130
131
 
131
132
  webViewResultDictionary["webViewData"] = processDictionary(inputDictionary: webViewResult.webviewData.asDictionary)
@@ -140,10 +141,15 @@ class Hyperkyc: NSObject {
140
141
  if let errorMsg = hyperKycResult.reason {
141
142
  errorMessage = errorMsg
142
143
  }
144
+ if let applStatus = hyperKycResult.applicationStatus {
145
+ applicationStatus = applStatus
146
+ }
147
+
143
148
 
144
149
  let resultMap = [
145
150
  "status" : resultEnumString,
146
151
  "reason" : errorMessage,
152
+ "applicationStatus":applicationStatus,
147
153
  "hyperKycData" : kycData
148
154
 
149
155
  ] as [String : Any]
@@ -164,7 +170,7 @@ class Hyperkyc: NSObject {
164
170
  if(!skipKeysArray.contains(key) ){
165
171
  var keyName = key
166
172
  if(key == "responseResultRaw"){
167
- keyName = "responseResult"
173
+ keyName = "responseBody"
168
174
  }
169
175
  resultDictionary[keyName] = value
170
176
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-hyperkyc-sdk",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "React Native wrapper for HyperKYC SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",