@networkinternational/ni-card-management-sdk 1.0.2 → 1.0.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.
- package/README.md +13 -3
- package/android/build.gradle +3 -1
- package/android/src/main/java/com/nicardmanagement/JsonDeserialization.kt +13 -2
- package/ios/NiCardManagement.swift +12 -1
- package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts +1 -0
- package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-ni-card-management.podspec +1 -1
- package/src/interfaces/NiCardManagementInterfaces.ts +1 -0
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Network International React Native Card Management SDK
|
|
2
2
|
|
|
3
3
|
The Network International React Native Card Management SDK allows you to integrate with Network International standard APIs for card management. (https://developer.network.ae)
|
|
4
|
+
A NICardManagement wrapper is used to integrate the Network International SDK into react-native projects, whose methods access the native NiCardManagement SDK.
|
|
5
|
+
|
|
4
6
|
The current supported features are:
|
|
5
7
|
1. Get Secured Card Details : Display a card component providing the ability to show card number, expiry date, CVV and cardholder name. This supports full end to end encryption to securely transport this sensitive information.
|
|
6
8
|
2. Set PIN : Displays a PIN pad to allow cardholder to set a PIN on their new card. The PIN is end to end encrypted to securely transport this sensitive information
|
|
@@ -20,7 +22,7 @@ The SDK requires the following dependencies: react-native-paper, @react-native-c
|
|
|
20
22
|
- Please install the react-native-paper @react-native-community/clipboard react-native-linear-gradient packages only if you did not already.
|
|
21
23
|
|
|
22
24
|
```node
|
|
23
|
-
|
|
25
|
+
npm install react-native-paper @react-native-community/clipboard react-native-linear-gradient
|
|
24
26
|
npm install @networkinternational/ni-card-management-sdk
|
|
25
27
|
```
|
|
26
28
|
|
|
@@ -502,7 +504,6 @@ javascript:
|
|
|
502
504
|
|
|
503
505
|
```
|
|
504
506
|
|
|
505
|
-
|
|
506
507
|
##### Set PIN
|
|
507
508
|
The programmatic interface for the Set PIN functionality will return a success or failure response.
|
|
508
509
|
|
|
@@ -648,4 +649,13 @@ javascript:
|
|
|
648
649
|
isLoading,
|
|
649
650
|
onViewPin,
|
|
650
651
|
} = useViewPin();
|
|
651
|
-
```
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
|
|
655
|
+
### NICardManagement wrapper
|
|
656
|
+
|
|
657
|
+
A NICardManagement wrapper is used to integrate the Network International SDK into react-native projects, whose methods access the native NiCardManagement SDK.
|
|
658
|
+
|
|
659
|
+
- the iOS NICardManagement wrapper can be find inside the __./ios__ folder.
|
|
660
|
+
|
|
661
|
+
- the android NICardManagement wrapper can be find inside the __./android/src/main/java/com/nicardmanagement__ folder.
|
package/android/build.gradle
CHANGED
|
@@ -90,6 +90,8 @@ dependencies {
|
|
|
90
90
|
//noinspection GradleDynamicVersion
|
|
91
91
|
implementation "com.facebook.react:react-native:+"
|
|
92
92
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
93
|
-
|
|
93
|
+
// use alpha.2 for exposing logs
|
|
94
|
+
//implementation 'com.github.network-international:card-management-sdk-android:1.0.49-alpha.2'
|
|
95
|
+
implementation 'com.github.network-international:card-management-sdk-android:1.0.49-alpha.1'
|
|
94
96
|
}
|
|
95
97
|
|
|
@@ -12,9 +12,20 @@ fun deserializePerson(jsonString: String): NIInput? {
|
|
|
12
12
|
val cardIdentifierType = jsonObject.getString("cardIdentifierType")
|
|
13
13
|
val connectionPropertiesJsonObject = jsonObject.getJSONObject("connectionProperties")
|
|
14
14
|
|
|
15
|
+
val rootUrl = connectionPropertiesJsonObject.getString("rootUrl")
|
|
16
|
+
val token = connectionPropertiesJsonObject.getString("token")
|
|
17
|
+
val extraNetworkHeadersString = connectionPropertiesJsonObject.getString("extraHeaders")
|
|
18
|
+
val headersJsonObject = JSONObject(extraNetworkHeadersString)
|
|
19
|
+
val extraNetworkHeaders = mutableMapOf<String, String>()
|
|
20
|
+
|
|
21
|
+
//extraNetworkHeaders["apiuat_za_network_global"] = "qWyQt3D44Upner1T"
|
|
22
|
+
headersJsonObject.keys().forEach {
|
|
23
|
+
extraNetworkHeaders[it] = headersJsonObject.getString(it)
|
|
24
|
+
}
|
|
15
25
|
val connectionProperties = NIConnectionProperties(
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
rootUrl,
|
|
27
|
+
token,
|
|
28
|
+
extraNetworkHeaders
|
|
18
29
|
)
|
|
19
30
|
return NIInput(bankCode, cardIdentifierId, cardIdentifierType, connectionProperties)
|
|
20
31
|
} catch (e: Exception) {
|
|
@@ -11,6 +11,16 @@ func createNICardManagementAPIInstance(from input: NSDictionary) -> NICardManage
|
|
|
11
11
|
let rootUrl = connectionProperties?["rootUrl"] as? String ?? ""
|
|
12
12
|
let token = connectionProperties?["token"] as? String ?? ""
|
|
13
13
|
|
|
14
|
+
let extraHeadersDict = connectionProperties?["extraNetworkHeaders"] as? NSDictionary
|
|
15
|
+
var extraHeaders = [String: String]()
|
|
16
|
+
if let extraHeadersDict = extraHeadersDict {
|
|
17
|
+
for item in extraHeadersDict {
|
|
18
|
+
guard let key = item.key as? String, let val = item.value as? String else { continue }
|
|
19
|
+
extraHeaders[key] = val
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
|
|
14
24
|
let tokenFetchable = TokenFetcherFactory.makeSimpleWrapper(tokenValue: token)
|
|
15
25
|
|
|
16
26
|
let sdk = NICardManagementAPI(
|
|
@@ -18,7 +28,8 @@ func createNICardManagementAPIInstance(from input: NSDictionary) -> NICardManage
|
|
|
18
28
|
cardIdentifierId: cardIdentifierId,
|
|
19
29
|
cardIdentifierType: cardIdentifierType,
|
|
20
30
|
bankCode: bankCode,
|
|
21
|
-
tokenFetchable: tokenFetchable
|
|
31
|
+
tokenFetchable: tokenFetchable,
|
|
32
|
+
extraHeaders: extraHeaders
|
|
22
33
|
)
|
|
23
34
|
return sdk
|
|
24
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NiCardManagementInterfaces.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/NiCardManagementInterfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"NiCardManagementInterfaces.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/NiCardManagementInterfaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,sBAAsB,CAAC;CAC9C;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,UAAU,qBAAqB;IAC7B,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,EAAE,GAAG,EAAE,wBAAwB,GAAG,IAAI,GAAG,IAAI,CAAC;CAC7E;AAED,UAAU,iBAAiB;IACzB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpD;AAED,MAAM,WAAW,yBAAyB;IACxC,cAAc,CACZ,KAAK,EAAE,gBAAgB,GAAG,MAAM,EAChC,QAAQ,EAAE,qBAAqB,GAC9B,IAAI,CAAC;IAER,MAAM,CACJ,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,gBAAgB,GAAG,MAAM,EAChC,QAAQ,EAAE,iBAAiB,GAC1B,IAAI,CAAC;IAER,SAAS,CACP,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,gBAAgB,GAAG,MAAM,EAChC,QAAQ,EAAE,iBAAiB,GAC1B,IAAI,CAAC;IAER,SAAS,CACP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,gBAAgB,GAAG,MAAM,EAChC,QAAQ,EAAE,iBAAiB,GAC1B,IAAI,CAAC;IAER,MAAM,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,EAAE,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAC7E"}
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
|
|
|
16
16
|
s.source_files = "ios/**/*.{h,m,mm,swift}"
|
|
17
17
|
|
|
18
18
|
s.dependency "React-Core"
|
|
19
|
-
s.dependency "NICardManagementSDK", '1.1.0'
|
|
19
|
+
s.dependency "NICardManagementSDK", '1.1.0-alpha.1'
|
|
20
20
|
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
|
|
21
21
|
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
|
|
22
22
|
if respond_to?(:install_modules_dependencies, true)
|