react-native-hyperkyc-sdk 0.1.6-alpha2 → 0.1.8-alpha1
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
|
@@ -11,11 +11,11 @@ npm install react-native-hyperkyc-sdk
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import {
|
|
14
|
+
import { Hyperkyc } from "react-native-hyperkyc-sdk";
|
|
15
15
|
|
|
16
16
|
// ...
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
Hyperkyc.launch(config)
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Contributing
|
package/android/build.gradle
CHANGED
|
@@ -57,7 +57,7 @@ dependencies {
|
|
|
57
57
|
//noinspection GradleDynamicVersion
|
|
58
58
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
59
59
|
|
|
60
|
-
implementation('co.hyperverge:hyperkyc:0.0.
|
|
60
|
+
implementation('co.hyperverge:hyperkyc:0.0.2-alpha02@aar', {
|
|
61
61
|
transitive = true
|
|
62
62
|
})
|
|
63
63
|
}
|
|
@@ -3,7 +3,7 @@ package com.reactnativehyperkycsdk;
|
|
|
3
3
|
|
|
4
4
|
import android.app.Activity;
|
|
5
5
|
import android.content.Intent;
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
import com.facebook.react.ReactActivity;
|
|
@@ -19,11 +19,13 @@ import com.facebook.react.bridge.WritableMap;
|
|
|
19
19
|
import com.facebook.react.bridge.WritableNativeMap;
|
|
20
20
|
import com.google.gson.Gson;
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
|
|
24
24
|
import java.util.ArrayList;
|
|
25
25
|
import java.util.List;
|
|
26
|
-
|
|
26
|
+
import org.json.JSONArray;
|
|
27
|
+
import org.json.JSONException;
|
|
28
|
+
import org.json.JSONObject;
|
|
27
29
|
|
|
28
30
|
import co.hyperverge.hyperkyc.HyperKyc;
|
|
29
31
|
import co.hyperverge.hyperkyc.data.models.DocFlowConfig;
|
|
@@ -31,7 +33,7 @@ import co.hyperverge.hyperkyc.data.models.HyperKycConfig;
|
|
|
31
33
|
import co.hyperverge.hyperkyc.data.models.HyperKycData;
|
|
32
34
|
import co.hyperverge.hyperkyc.data.models.HyperKycFlow;
|
|
33
35
|
import co.hyperverge.hyperkyc.data.models.HyperKycResult;
|
|
34
|
-
|
|
36
|
+
import androidx.annotation.NonNull;
|
|
35
37
|
|
|
36
38
|
|
|
37
39
|
public class HyperkycSdkModule extends ReactContextBaseJavaModule implements ActivityEventListener {
|
|
@@ -41,7 +43,7 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule implements Act
|
|
|
41
43
|
|
|
42
44
|
private final int HYPERKYC_REQUEST_CODE = 56455;
|
|
43
45
|
Callback callback;
|
|
44
|
-
|
|
46
|
+
HyperKyc.Contract contract;
|
|
45
47
|
Gson gson;
|
|
46
48
|
WritableMap result;
|
|
47
49
|
|
|
@@ -111,7 +113,7 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule implements Act
|
|
|
111
113
|
String resultJSON = gson.toJson(hyperKycData);
|
|
112
114
|
JSONObject result = new JSONObject(resultJSON);
|
|
113
115
|
result.remove("config");
|
|
114
|
-
WritableMap hyperKycDataMap =
|
|
116
|
+
WritableMap hyperKycDataMap = HyperkycSdkUtils.convertJsonToMap(result);
|
|
115
117
|
resultMap.putMap("hyperKycData", hyperKycDataMap);
|
|
116
118
|
}
|
|
117
119
|
|
|
@@ -141,9 +143,9 @@ public class HyperkycSdkModule extends ReactContextBaseJavaModule implements Act
|
|
|
141
143
|
String flowStr = kycFlow.getString("type");
|
|
142
144
|
switch (flowStr) {
|
|
143
145
|
case "document":
|
|
144
|
-
String countryId = kycFlow.has(
|
|
145
|
-
String documentId = kycFlow.has(
|
|
146
|
-
boolean useForFaceMatch = kycFlow.has(
|
|
146
|
+
String countryId = kycFlow.has(HyperkycConstants.COUNTRY_ID) ? kycFlow.getString(HyperkycConstants.COUNTRY_ID): null;
|
|
147
|
+
String documentId = kycFlow.has(HyperkycConstants.DOCUMENT_ID) ? kycFlow.getString(HyperkycConstants.DOCUMENT_ID): null;
|
|
148
|
+
boolean useForFaceMatch = kycFlow.has(HyperkycConstants.USE_FOR_FACE_MATCH)? kycFlow.getBoolean(HyperkycConstants.USE_FOR_FACE_MATCH): false;
|
|
147
149
|
|
|
148
150
|
workflows.add(new HyperKycFlow.Document(new DocFlowConfig(useForFaceMatch, countryId, documentId )));
|
|
149
151
|
case "face":
|