react-native-hyperkyc-sdk 0.3.0 → 0.3.1-alpha03

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.
package/README.md CHANGED
@@ -19,24 +19,10 @@ const { Hyperkyc } = NativeModules
19
19
  var configDictionary = {};
20
20
  configDictionary["appId"] = appID
21
21
  configDictionary["appKey"] = appKey
22
- configDictionary["defaultCountryId"] = "ind"
23
-
22
+
23
+
24
24
  configDictionary["transactionId"] = transactionId
25
- configDictionary["workflow"] = JSON.stringify([ {
26
- type: "document",
27
- countryId:"ind",
28
- documentId:"pan",
29
- useForFaceMatch: true
30
- },
31
- {
32
- type: "document",
33
- useForFaceMatch: true
34
- },
35
- {
36
- type: "face"
37
- }
38
-
39
- ]);
25
+ configDictionary["workflowId"] = "<workflow-id>"
40
26
  Hyperkyc.launch(configDictionary, function(response){
41
27
  console.log(response)
42
28
  })
@@ -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
  }
@@ -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 = "responseResult"
167
+ keyName = "responseBody"
168
168
  }
169
169
  resultDictionary[keyName] = value
170
170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-hyperkyc-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.1-alpha03",
4
4
  "description": "React Native wrapper for HyperKYC SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",