@networkinternational/ni-card-management-sdk 1.0.8 → 2.0.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.
- package/README.md +140 -38
- package/android/build.gradle +14 -3
- package/android/gradle.properties +1 -0
- package/ios/NiCardManagement.swift +60 -51
- package/lib/commonjs/NICardManagementComponents/CardDetailsComponent.js +15 -3
- package/lib/commonjs/NICardManagementComponents/CardDetailsComponent.js.map +1 -1
- package/lib/commonjs/NICardManagementComponents/NiInputInterfaces.js.map +1 -1
- package/lib/commonjs/NICardManagementComponents/ViewPinComponent.js +14 -7
- package/lib/commonjs/NICardManagementComponents/ViewPinComponent.js.map +1 -1
- package/lib/commonjs/components/CardDetails/CardHolderNameGroups.js +4 -5
- package/lib/commonjs/components/CardDetails/CardHolderNameGroups.js.map +1 -1
- package/lib/commonjs/components/CardDetails/CardNumberGroup.js +4 -5
- package/lib/commonjs/components/CardDetails/CardNumberGroup.js.map +1 -1
- package/lib/commonjs/components/CardDetails/DateCVVGroupOneRow.js.map +1 -1
- package/lib/commonjs/components/FeedbackPopup/FeedbackPopup.js +106 -0
- package/lib/commonjs/components/FeedbackPopup/FeedbackPopup.js.map +1 -0
- package/lib/commonjs/components/NIButton/NIButton.js +28 -6
- package/lib/commonjs/components/NIButton/NIButton.js.map +1 -1
- package/lib/commonjs/config/localization.js +10 -0
- package/lib/commonjs/config/localization.js.map +1 -1
- package/lib/commonjs/hooks/useChangePin.js +6 -4
- package/lib/commonjs/hooks/useChangePin.js.map +1 -1
- package/lib/commonjs/hooks/useGetCardDetails.js +6 -4
- package/lib/commonjs/hooks/useGetCardDetails.js.map +1 -1
- package/lib/commonjs/hooks/useSetPin.js +6 -4
- package/lib/commonjs/hooks/useSetPin.js.map +1 -1
- package/lib/commonjs/hooks/useVerifyPin.js +6 -4
- package/lib/commonjs/hooks/useVerifyPin.js.map +1 -1
- package/lib/commonjs/hooks/useViewPin.js +6 -4
- package/lib/commonjs/hooks/useViewPin.js.map +1 -1
- package/lib/commonjs/types/jsx-compat.d.js +6 -0
- package/lib/commonjs/types/jsx-compat.d.js.map +1 -0
- package/lib/commonjs/utils/normalizeNativeError.js +33 -0
- package/lib/commonjs/utils/normalizeNativeError.js.map +1 -0
- package/lib/module/NICardManagementComponents/CardDetailsComponent.js +15 -3
- package/lib/module/NICardManagementComponents/CardDetailsComponent.js.map +1 -1
- package/lib/module/NICardManagementComponents/NiInputInterfaces.js.map +1 -1
- package/lib/module/NICardManagementComponents/ViewPinComponent.js +14 -7
- package/lib/module/NICardManagementComponents/ViewPinComponent.js.map +1 -1
- package/lib/module/components/CardDetails/CardHolderNameGroups.js +4 -5
- package/lib/module/components/CardDetails/CardHolderNameGroups.js.map +1 -1
- package/lib/module/components/CardDetails/CardNumberGroup.js +4 -5
- package/lib/module/components/CardDetails/CardNumberGroup.js.map +1 -1
- package/lib/module/components/CardDetails/DateCVVGroupOneRow.js.map +1 -1
- package/lib/module/components/FeedbackPopup/FeedbackPopup.js +97 -0
- package/lib/module/components/FeedbackPopup/FeedbackPopup.js.map +1 -0
- package/lib/module/components/NIButton/NIButton.js +28 -6
- package/lib/module/components/NIButton/NIButton.js.map +1 -1
- package/lib/module/config/localization.js +10 -0
- package/lib/module/config/localization.js.map +1 -1
- package/lib/module/hooks/useChangePin.js +7 -5
- package/lib/module/hooks/useChangePin.js.map +1 -1
- package/lib/module/hooks/useGetCardDetails.js +7 -5
- package/lib/module/hooks/useGetCardDetails.js.map +1 -1
- package/lib/module/hooks/useSetPin.js +7 -5
- package/lib/module/hooks/useSetPin.js.map +1 -1
- package/lib/module/hooks/useVerifyPin.js +7 -5
- package/lib/module/hooks/useVerifyPin.js.map +1 -1
- package/lib/module/hooks/useViewPin.js +7 -5
- package/lib/module/hooks/useViewPin.js.map +1 -1
- package/lib/module/types/jsx-compat.d.js +2 -0
- package/lib/module/types/jsx-compat.d.js.map +1 -0
- package/lib/module/utils/normalizeNativeError.js +27 -0
- package/lib/module/utils/normalizeNativeError.js.map +1 -0
- package/lib/typescript/src/NICardManagementComponents/CardDetailsComponent.d.ts +0 -1
- package/lib/typescript/src/NICardManagementComponents/CardDetailsComponent.d.ts.map +1 -1
- package/lib/typescript/src/NICardManagementComponents/ChangePinView.d.ts +0 -1
- package/lib/typescript/src/NICardManagementComponents/ChangePinView.d.ts.map +1 -1
- package/lib/typescript/src/NICardManagementComponents/NiInputInterfaces.d.ts +1 -0
- package/lib/typescript/src/NICardManagementComponents/NiInputInterfaces.d.ts.map +1 -1
- package/lib/typescript/src/NICardManagementComponents/SetPinView.d.ts +0 -1
- package/lib/typescript/src/NICardManagementComponents/SetPinView.d.ts.map +1 -1
- package/lib/typescript/src/NICardManagementComponents/VerifyPinView.d.ts +0 -1
- package/lib/typescript/src/NICardManagementComponents/VerifyPinView.d.ts.map +1 -1
- package/lib/typescript/src/NICardManagementComponents/ViewPinComponent.d.ts +0 -1
- package/lib/typescript/src/NICardManagementComponents/ViewPinComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/CardDetails/CardDetails.d.ts +0 -1
- package/lib/typescript/src/components/CardDetails/CardDetails.d.ts.map +1 -1
- package/lib/typescript/src/components/CardDetails/CardDetailsBackgroundImage.d.ts +0 -1
- package/lib/typescript/src/components/CardDetails/CardDetailsBackgroundImage.d.ts.map +1 -1
- package/lib/typescript/src/components/CardDetails/CardDetailsGroups.d.ts +0 -1
- package/lib/typescript/src/components/CardDetails/CardDetailsGroups.d.ts.map +1 -1
- package/lib/typescript/src/components/CardDetails/CardHolderNameGroups.d.ts +0 -1
- package/lib/typescript/src/components/CardDetails/CardHolderNameGroups.d.ts.map +1 -1
- package/lib/typescript/src/components/CardDetails/CardNumberGroup.d.ts +0 -1
- package/lib/typescript/src/components/CardDetails/CardNumberGroup.d.ts.map +1 -1
- package/lib/typescript/src/components/CardDetails/DateCVVGroupOneRow.d.ts +0 -1
- package/lib/typescript/src/components/CardDetails/DateCVVGroupOneRow.d.ts.map +1 -1
- package/lib/typescript/src/components/ChangePin/CaptureCurrentPin.d.ts +0 -1
- package/lib/typescript/src/components/ChangePin/CaptureCurrentPin.d.ts.map +1 -1
- package/lib/typescript/src/components/ChangePin/CaptureNewPin.d.ts +0 -1
- package/lib/typescript/src/components/ChangePin/CaptureNewPin.d.ts.map +1 -1
- package/lib/typescript/src/components/ChangePin/ChangePin.d.ts +0 -1
- package/lib/typescript/src/components/ChangePin/ChangePin.d.ts.map +1 -1
- package/lib/typescript/src/components/ChangePin/ConfirmPin.d.ts +0 -1
- package/lib/typescript/src/components/ChangePin/ConfirmPin.d.ts.map +1 -1
- package/lib/typescript/src/components/ChangePin/ReenterNewPin.d.ts +0 -1
- package/lib/typescript/src/components/ChangePin/ReenterNewPin.d.ts.map +1 -1
- package/lib/typescript/src/components/FeedbackPopup/FeedbackPopup.d.ts +13 -0
- package/lib/typescript/src/components/FeedbackPopup/FeedbackPopup.d.ts.map +1 -0
- package/lib/typescript/src/components/NIButton/NIButton.d.ts +0 -1
- package/lib/typescript/src/components/NIButton/NIButton.d.ts.map +1 -1
- package/lib/typescript/src/components/Pin/CapturePin.d.ts +0 -1
- package/lib/typescript/src/components/Pin/CapturePin.d.ts.map +1 -1
- package/lib/typescript/src/components/Pin/NextButton.d.ts +0 -1
- package/lib/typescript/src/components/Pin/NextButton.d.ts.map +1 -1
- package/lib/typescript/src/components/Pin/ShowHideButton.d.ts +0 -1
- package/lib/typescript/src/components/Pin/ShowHideButton.d.ts.map +1 -1
- package/lib/typescript/src/components/PinState/LoadingState.d.ts +0 -1
- package/lib/typescript/src/components/PinState/LoadingState.d.ts.map +1 -1
- package/lib/typescript/src/components/PinState/PinState.d.ts +0 -1
- package/lib/typescript/src/components/PinState/PinState.d.ts.map +1 -1
- package/lib/typescript/src/components/SetPin/ConfirmPin.d.ts +0 -1
- package/lib/typescript/src/components/SetPin/ConfirmPin.d.ts.map +1 -1
- package/lib/typescript/src/components/SetPin/ReenterCardPin.d.ts +0 -1
- package/lib/typescript/src/components/SetPin/ReenterCardPin.d.ts.map +1 -1
- package/lib/typescript/src/components/SetPin/SetPin.d.ts +0 -1
- package/lib/typescript/src/components/SetPin/SetPin.d.ts.map +1 -1
- package/lib/typescript/src/components/SetPin/SetUpNewCardPin.d.ts +0 -1
- package/lib/typescript/src/components/SetPin/SetUpNewCardPin.d.ts.map +1 -1
- package/lib/typescript/src/components/VerifyPin/CaptureVerifyPin.d.ts +0 -1
- package/lib/typescript/src/components/VerifyPin/CaptureVerifyPin.d.ts.map +1 -1
- package/lib/typescript/src/components/VerifyPin/ConfirmPin.d.ts +0 -1
- package/lib/typescript/src/components/VerifyPin/ConfirmPin.d.ts.map +1 -1
- package/lib/typescript/src/components/VerifyPin/VerifyPin.d.ts +0 -1
- package/lib/typescript/src/components/VerifyPin/VerifyPin.d.ts.map +1 -1
- package/lib/typescript/src/components/ViewPin/ViewPin.d.ts +0 -1
- package/lib/typescript/src/components/ViewPin/ViewPin.d.ts.map +1 -1
- package/lib/typescript/src/components/icons/PredeterminedIcon.d.ts +2 -2
- package/lib/typescript/src/components/icons/PredeterminedIcon.d.ts.map +1 -1
- package/lib/typescript/src/config/localization.d.ts +10 -0
- package/lib/typescript/src/config/localization.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useChangePin.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useGetCardDetails.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useSetPin.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useVerifyPin.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useViewPin.d.ts +1 -1
- package/lib/typescript/src/hooks/useViewPin.d.ts.map +1 -1
- package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts +1 -1
- package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts.map +1 -1
- package/lib/typescript/src/interfaces/NiInputInterfaces.d.ts +4 -2
- package/lib/typescript/src/interfaces/NiInputInterfaces.d.ts.map +1 -1
- package/lib/typescript/src/nativeComponents/NICardManagementSDKModule.d.ts.map +1 -1
- package/lib/typescript/src/utils/formatInput.d.ts.map +1 -1
- package/lib/typescript/src/utils/localization.d.ts +5 -0
- package/lib/typescript/src/utils/localization.d.ts.map +1 -1
- package/lib/typescript/src/utils/normalizeNativeError.d.ts +4 -0
- package/lib/typescript/src/utils/normalizeNativeError.d.ts.map +1 -0
- package/package.json +26 -26
- package/react-native-ni-card-management.podspec +24 -17
- package/src/NICardManagementComponents/CardDetailsComponent.tsx +15 -2
- package/src/NICardManagementComponents/NiInputInterfaces.ts +2 -0
- package/src/NICardManagementComponents/ViewPinComponent.tsx +15 -9
- package/src/components/CardDetails/CardHolderNameGroups.tsx +4 -6
- package/src/components/CardDetails/CardNumberGroup.tsx +4 -6
- package/src/components/CardDetails/DateCVVGroupOneRow.tsx +1 -1
- package/src/components/FeedbackPopup/FeedbackPopup.tsx +117 -0
- package/src/components/NIButton/NIButton.tsx +31 -7
- package/src/config/localization.ts +12 -1
- package/src/hooks/useChangePin.ts +29 -24
- package/src/hooks/useGetCardDetails.ts +25 -20
- package/src/hooks/useSetPin.ts +27 -22
- package/src/hooks/useVerifyPin.ts +27 -22
- package/src/hooks/useViewPin.ts +25 -20
- package/src/interfaces/NiCardManagementInterfaces.ts +1 -1
- package/src/interfaces/NiInputInterfaces.ts +6 -2
- package/src/types/jsx-compat.d.ts +20 -0
- package/src/utils/normalizeNativeError.ts +54 -0
package/README.md
CHANGED
|
@@ -11,27 +11,42 @@ The current supported features are:
|
|
|
11
11
|
5. View PIN: Displays a component providing the ability to show PIN card. The PIN is end to end encrypted to securely transport this sensitive information
|
|
12
12
|
|
|
13
13
|
## Requirements
|
|
14
|
-
The
|
|
14
|
+
The SDK supports React Native 0.86.0 and later and iOS 15.1 and later. The repository and example app pin React Native 0.86.2, which is the currently tested and recommended version. Newer stable React Native versions are allowed by the peer dependency and become officially tested when the repository's automated dependency update passes Android and iOS CI.
|
|
15
|
+
|
|
16
|
+
Development requires the following toolchain:
|
|
17
|
+
|
|
18
|
+
| Tool | Version |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Node.js | 22.13.0 or newer in the Node 22 LTS line |
|
|
21
|
+
| Yarn | 3.6.1, provided by the repository |
|
|
22
|
+
| JDK | 17 |
|
|
23
|
+
| Android SDK Platform | 36 |
|
|
24
|
+
| Android Build Tools | 36.0.0 |
|
|
25
|
+
| Android NDK | 28.2.13676358 (r28c) |
|
|
26
|
+
| CMake | 3.22.1 |
|
|
27
|
+
| Xcode | A version that supports the installed iOS SDK and iOS 15.1 deployment target |
|
|
28
|
+
|
|
29
|
+
Gradle 9.3.1 is downloaded by the wrapper. React Native, the React Native CLI, the Android Gradle Plugin, and Kotlin are installed through Yarn and Gradle and do not need separate global installations.
|
|
15
30
|
|
|
16
31
|
## Installation
|
|
17
32
|
The SDK can be added via [npm](https://docs.npmjs.com) or [yarn](https://classic.yarnpkg.com/). Refer to the CONTRIBUTING.md file for the example app installation steps.
|
|
18
|
-
The SDK requires the following dependencies:
|
|
33
|
+
The SDK requires the following dependencies: @react-native-clipboard/clipboard, react-native-linear-gradient. If you did not already, please install them before installing the SDK.
|
|
19
34
|
|
|
20
35
|
##### npm
|
|
21
36
|
|
|
22
|
-
- Please install the
|
|
37
|
+
- Please install the @react-native-clipboard/clipboard react-native-linear-gradient packages only if you did not already.
|
|
23
38
|
|
|
24
39
|
```node
|
|
25
|
-
npm install
|
|
40
|
+
npm install @react-native-clipboard/clipboard react-native-linear-gradient
|
|
26
41
|
npm install @networkinternational/ni-card-management-sdk
|
|
27
42
|
```
|
|
28
43
|
|
|
29
44
|
#### yarn
|
|
30
45
|
|
|
31
|
-
- Please install the
|
|
46
|
+
- Please install the @react-native-clipboard/clipboard react-native-linear-gradient packages only if you did not already.
|
|
32
47
|
|
|
33
48
|
```node
|
|
34
|
-
yarn add
|
|
49
|
+
yarn add @react-native-clipboard/clipboard react-native-linear-gradient
|
|
35
50
|
yarn add @networkinternational/ni-card-management-sdk
|
|
36
51
|
```
|
|
37
52
|
|
|
@@ -67,7 +82,7 @@ In case of issues when running the iOS or the Android application after installi
|
|
|
67
82
|
## Integration
|
|
68
83
|
|
|
69
84
|
#### Basics
|
|
70
|
-
After you have installed the SDK, by following one of the above set of steps, you can import the SDK into your react native app and
|
|
85
|
+
After you have installed the SDK, by following one of the above set of steps, you can import the SDK into your react native app and use it.
|
|
71
86
|
|
|
72
87
|
|
|
73
88
|
#### Usage
|
|
@@ -87,16 +102,42 @@ In case of issues when running the iOS or the Android application after installi
|
|
|
87
102
|
bankCode: [yourBankCode],
|
|
88
103
|
cardIdentifierId: [cardIdentifierId],
|
|
89
104
|
cardIdentifierType: [cardIdentifierType],
|
|
90
|
-
connectionProperties:
|
|
91
|
-
rootUrl: [rootUrl],
|
|
105
|
+
connectionProperties: {
|
|
106
|
+
rootUrl: [rootUrl],
|
|
107
|
+
token: [token],
|
|
108
|
+
extraHeaders: JSON.stringify({
|
|
109
|
+
'custom-header': 'custom-value',
|
|
110
|
+
}),
|
|
92
111
|
},
|
|
93
|
-
displayAttributes:
|
|
112
|
+
displayAttributes: {
|
|
94
113
|
theme: NIThemeEnum.light as themeType,
|
|
95
114
|
language: NILanguageEnum.english as languageType,
|
|
96
115
|
},
|
|
97
116
|
};
|
|
98
117
|
```
|
|
99
118
|
|
|
119
|
+
`connectionProperties.extraHeaders` should be a JSON string representation of key/value headers.
|
|
120
|
+
For backward compatibility, iOS also accepts `extraNetworkHeaders` as a dictionary when provided by older integrations.
|
|
121
|
+
|
|
122
|
+
##### Native callback contract
|
|
123
|
+
|
|
124
|
+
All SDK callbacks return `(error, result)`:
|
|
125
|
+
|
|
126
|
+
- On success: `error` is `null` and `result` is populated.
|
|
127
|
+
- On failure: `result` is `null` and `error` is normalized to:
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
type NIErrorResponse = {
|
|
131
|
+
domain: string;
|
|
132
|
+
code: string | number;
|
|
133
|
+
message: string;
|
|
134
|
+
};
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
On `CardDetailsComponent` success, the callback result message is
|
|
138
|
+
`"Card details retrieved with success!"`; card details data is exposed through the
|
|
139
|
+
component/hook state (`getCardDetailsResult`).
|
|
140
|
+
|
|
100
141
|
###### Display attributes
|
|
101
142
|
Display attributes parameter is optional. You can set one or more attributes, or even none of them.
|
|
102
143
|
|
|
@@ -208,7 +249,7 @@ A PIN-pad will be displayed into a separate View on a separate screen.
|
|
|
208
249
|
NIPinTypeEnum,
|
|
209
250
|
} from '@networkinternational/ni-card-management-sdk';
|
|
210
251
|
|
|
211
|
-
import { input } from
|
|
252
|
+
import { input } from 'path/to/your/object/config';
|
|
212
253
|
```
|
|
213
254
|
|
|
214
255
|
by specifying the type (pin length)
|
|
@@ -261,7 +302,7 @@ A PIN-pad will be displayed in a VIEW into a separate screen.
|
|
|
261
302
|
NIThemeEnum,
|
|
262
303
|
} from '@networkinternational/ni-card-management-sdk';
|
|
263
304
|
|
|
264
|
-
import { input } from
|
|
305
|
+
import { input } from 'path/to/your/object/config';
|
|
265
306
|
```
|
|
266
307
|
|
|
267
308
|
by specifying the type (pin length)
|
|
@@ -303,7 +344,6 @@ or without specifying the type (pin length)
|
|
|
303
344
|
##### Verify PIN Form
|
|
304
345
|
A PIN-pad will be displayed in a View into a separate screen.
|
|
305
346
|
|
|
306
|
-
javascript:
|
|
307
347
|
```javascript
|
|
308
348
|
import {
|
|
309
349
|
VerifyPinView,
|
|
@@ -311,7 +351,7 @@ javascript:
|
|
|
311
351
|
NIPinTypeEnum,
|
|
312
352
|
} from '@networkinternational/ni-card-management-sdk';
|
|
313
353
|
|
|
314
|
-
import { input } from
|
|
354
|
+
import { input } from 'path/to/your/object/config';
|
|
315
355
|
```
|
|
316
356
|
|
|
317
357
|
by specifying the type (pin length)
|
|
@@ -359,7 +399,7 @@ A view of NICardView type can be added into a View, then set the input and start
|
|
|
359
399
|
NIPinTypeEnum,
|
|
360
400
|
} from '@networkinternational/ni-card-management-sdk';
|
|
361
401
|
|
|
362
|
-
import { input } from
|
|
402
|
+
import { input } from 'path/to/your/object/config';
|
|
363
403
|
```
|
|
364
404
|
|
|
365
405
|
by specifying the type (pin length)
|
|
@@ -407,10 +447,14 @@ This is a required parameter.
|
|
|
407
447
|
bankCode: [yourBankCode],
|
|
408
448
|
cardIdentifierId: [cardIdentifierId],
|
|
409
449
|
cardIdentifierType: [cardIdentifierType],
|
|
410
|
-
connectionProperties:
|
|
411
|
-
rootUrl: [rootUrl],
|
|
450
|
+
connectionProperties: {
|
|
451
|
+
rootUrl: [rootUrl],
|
|
452
|
+
token: [token],
|
|
453
|
+
extraHeaders: JSON.stringify({
|
|
454
|
+
'custom-header': 'custom-value',
|
|
455
|
+
}),
|
|
412
456
|
},
|
|
413
|
-
displayAttributes:
|
|
457
|
+
displayAttributes: {
|
|
414
458
|
theme: NIThemeEnum.light as themeType,
|
|
415
459
|
language: NILanguageEnum.english as languageType,
|
|
416
460
|
},
|
|
@@ -419,17 +463,17 @@ This is a required parameter.
|
|
|
419
463
|
```
|
|
420
464
|
|
|
421
465
|
|
|
422
|
-
##### Display View Pin
|
|
466
|
+
##### Display View Pin Component
|
|
423
467
|
|
|
424
|
-
A
|
|
468
|
+
A ViewPinComponent can be added into your screen, then set the input and start the flow as below:
|
|
425
469
|
```javascript
|
|
426
470
|
import {
|
|
427
|
-
|
|
471
|
+
ViewPinComponent,
|
|
428
472
|
type NIErrorResponse,
|
|
429
473
|
NIPinTypeEnum,
|
|
430
474
|
} from '@networkinternational/ni-card-management-sdk';
|
|
431
475
|
|
|
432
|
-
|
|
476
|
+
import { input } from 'path/to/your/object/config';
|
|
433
477
|
```
|
|
434
478
|
|
|
435
479
|
by specifying the type (pin length)
|
|
@@ -439,7 +483,7 @@ by specifying the type (pin length)
|
|
|
439
483
|
```
|
|
440
484
|
|
|
441
485
|
```javascript
|
|
442
|
-
<
|
|
486
|
+
<ViewPinComponent
|
|
443
487
|
input={TEST_INPUT_VIEW_PIN}
|
|
444
488
|
type={type}
|
|
445
489
|
callback={(
|
|
@@ -448,13 +492,13 @@ by specifying the type (pin length)
|
|
|
448
492
|
) => {
|
|
449
493
|
callback(); // implement your callback
|
|
450
494
|
}}
|
|
451
|
-
/>
|
|
495
|
+
/>
|
|
452
496
|
```
|
|
453
497
|
|
|
454
498
|
or without specifying the type (pin length)
|
|
455
499
|
|
|
456
500
|
```javascript
|
|
457
|
-
<
|
|
501
|
+
<ViewPinComponent
|
|
458
502
|
input={TEST_INPUT_VIEW_PIN}
|
|
459
503
|
callback={(
|
|
460
504
|
error: NIErrorResponse | null,
|
|
@@ -462,25 +506,24 @@ or without specifying the type (pin length)
|
|
|
462
506
|
) => {
|
|
463
507
|
callback(); // implement your callback
|
|
464
508
|
}}
|
|
465
|
-
/>
|
|
509
|
+
/>
|
|
466
510
|
```
|
|
467
511
|
|
|
468
512
|
|
|
469
|
-
####
|
|
513
|
+
#### Programmatic Interface
|
|
470
514
|
The customer application will be responsible to handle the UI part.
|
|
471
515
|
|
|
472
516
|
##### Retrieve Card Details
|
|
473
517
|
The programmatic interface of the card details will return the card details in the getCardDetailsResult: NIGetCardSuccessResponse object.
|
|
474
518
|
The card info returned are: Card Number, Expiry Date, CVV and Cardholder Name.
|
|
475
519
|
|
|
476
|
-
javascript:
|
|
477
520
|
```javascript
|
|
478
521
|
import {
|
|
479
522
|
useGetCardDetails,
|
|
480
523
|
type NIErrorResponse,
|
|
481
524
|
} from '@networkinternational/ni-card-management-sdk';
|
|
482
525
|
|
|
483
|
-
import { input } from
|
|
526
|
+
import { input } from 'path/to/your/object/config';
|
|
484
527
|
```
|
|
485
528
|
|
|
486
529
|
```javascript
|
|
@@ -507,15 +550,13 @@ javascript:
|
|
|
507
550
|
##### Set PIN
|
|
508
551
|
The programmatic interface for the Set PIN functionality will return a success or failure response.
|
|
509
552
|
|
|
510
|
-
javascript:
|
|
511
553
|
```javascript
|
|
512
554
|
import {
|
|
513
555
|
useSetPin,
|
|
514
556
|
type NIErrorResponse,
|
|
515
|
-
NIThemeEnum,
|
|
516
557
|
} from '@networkinternational/ni-card-management-sdk';
|
|
517
558
|
|
|
518
|
-
import { input } from
|
|
559
|
+
import { input } from 'path/to/your/object/config';
|
|
519
560
|
```
|
|
520
561
|
|
|
521
562
|
```javascript
|
|
@@ -545,14 +586,13 @@ javascript:
|
|
|
545
586
|
##### Change PIN
|
|
546
587
|
The programmatic interface for the Change PIN functionality will return a success or failure response.
|
|
547
588
|
|
|
548
|
-
javascript:
|
|
549
589
|
```javascript
|
|
550
590
|
import {
|
|
551
591
|
useChangePin,
|
|
552
592
|
type NIErrorResponse,
|
|
553
593
|
} from '@networkinternational/ni-card-management-sdk';
|
|
554
594
|
|
|
555
|
-
import { input } from
|
|
595
|
+
import { input } from 'path/to/your/object/config';
|
|
556
596
|
```
|
|
557
597
|
|
|
558
598
|
```javascript
|
|
@@ -584,14 +624,13 @@ javascript:
|
|
|
584
624
|
##### Verify PIN
|
|
585
625
|
The programmatic interface for the Verify PIN functionality will return a success or failure response.
|
|
586
626
|
|
|
587
|
-
javascript:
|
|
588
627
|
```javascript
|
|
589
628
|
import {
|
|
590
629
|
useVerifyPin,
|
|
591
630
|
type NIErrorResponse,
|
|
592
631
|
} from '@networkinternational/ni-card-management-sdk';
|
|
593
632
|
|
|
594
|
-
import { input } from
|
|
633
|
+
import { input } from 'path/to/your/object/config';
|
|
595
634
|
```
|
|
596
635
|
|
|
597
636
|
```javascript
|
|
@@ -621,14 +660,13 @@ javascript:
|
|
|
621
660
|
##### View PIN
|
|
622
661
|
The programmatic interface for the View PIN functionality will return in __viewPinResult__ as a String value representing the PIN or failure response.
|
|
623
662
|
|
|
624
|
-
javascript:
|
|
625
663
|
```javascript
|
|
626
664
|
import {
|
|
627
665
|
useViewPin,
|
|
628
666
|
type NIErrorResponse,
|
|
629
667
|
} from '@networkinternational/ni-card-management-sdk';
|
|
630
668
|
|
|
631
|
-
|
|
669
|
+
import { input } from 'path/to/your/object/config';
|
|
632
670
|
```
|
|
633
671
|
|
|
634
672
|
```javascript
|
|
@@ -659,3 +697,67 @@ A NICardManagement wrapper is used to integrate the Network International SDK in
|
|
|
659
697
|
- the iOS NICardManagement wrapper can be find inside the __./ios__ folder.
|
|
660
698
|
|
|
661
699
|
- the android NICardManagement wrapper can be find inside the __./android/src/main/java/com/nicardmanagement__ folder.
|
|
700
|
+
|
|
701
|
+
### Inspecting network traffic
|
|
702
|
+
|
|
703
|
+
Card-management operations cross the React Native bridge and execute inside the native `NICardManagementSDK`. They are not JavaScript `fetch` or `XMLHttpRequest` calls, so use the native platform inspector when investigating Card Details, Set PIN, Verify PIN, Change PIN, or View PIN traffic.
|
|
704
|
+
|
|
705
|
+
#### Android native SDK traffic
|
|
706
|
+
|
|
707
|
+
The Android SDK uses Retrofit and OkHttp, which are supported by Android Studio Network Inspector:
|
|
708
|
+
|
|
709
|
+
1. Run a debug build of the example application on an emulator or connected device.
|
|
710
|
+
2. Open `example/android` in Android Studio.
|
|
711
|
+
3. Select **View > Tool Windows > App Inspection**.
|
|
712
|
+
4. Select the device and the `com.nicardmanagementexample` process.
|
|
713
|
+
5. Open the **Network Inspector** tab before triggering an SDK operation.
|
|
714
|
+
6. Trigger the operation in the example app, select its request in **Connection View**, and inspect its URL, method, status, timings, headers, body, and call stack where available.
|
|
715
|
+
|
|
716
|
+
If the process is not listed, launch the debug app from Android Studio or attach the debugger to `com.nicardmanagementexample`. If traffic is still absent, restart the debug app while App Inspection is open and confirm that input validation or authentication did not fail before the native SDK attempted the request.
|
|
717
|
+
|
|
718
|
+
#### iOS native SDK traffic
|
|
719
|
+
|
|
720
|
+
The iOS SDK uses `URLSession`, so inspect its requests with the HTTP Traffic instrument included with Xcode:
|
|
721
|
+
|
|
722
|
+
1. Open `example/ios/NiCardManagementExample.xcworkspace` in Xcode.
|
|
723
|
+
2. Select the `NiCardManagementExample` scheme and an iOS Simulator or connected device.
|
|
724
|
+
3. Select **Product > Profile** to launch Instruments.
|
|
725
|
+
4. Select the **Network** template and click **Choose**.
|
|
726
|
+
5. Confirm that Instruments targets the `NiCardManagementExample` process, then click **Record**.
|
|
727
|
+
6. Read the capture warning and select **Record Anyway** only when using test or UAT data.
|
|
728
|
+
7. Trigger an SDK operation in the example app and stop the recording when the request completes.
|
|
729
|
+
8. Expand **HTTP Traffic > NiCardManagementExample > URLSession > domain**, then select a task or transaction to inspect timing, request and response headers, bodies, and the initiating backtrace where available.
|
|
730
|
+
|
|
731
|
+
The current native SDK uses both shared and ephemeral `URLSession` instances; both are visible to the HTTP Traffic instrument. If no transaction appears, begin recording before triggering the operation and confirm that the request was not rejected by local validation or authentication setup.
|
|
732
|
+
|
|
733
|
+
Instruments records decrypted HTTP and HTTPS headers and bodies in the trace document and system logs without encryption. Treat `.trace` files as sensitive artifacts: do not commit them, attach them to public issues, or retain captures containing production credentials or cardholder data.
|
|
734
|
+
|
|
735
|
+
#### React Native JavaScript traffic
|
|
736
|
+
|
|
737
|
+
React Native 0.86 DevTools includes a Network panel for requests made through React Native networking. Press `j` in the Metro terminal, or choose **Open DevTools** from the application developer menu, then select **Network** and trigger the request. This panel is useful for JavaScript networking but may not display requests initiated by `NICardManagementSDK`; Android Studio or Xcode tooling is authoritative for native SDK traffic.
|
|
738
|
+
|
|
739
|
+
#### Proxy tools and sensitive data
|
|
740
|
+
|
|
741
|
+
Proxyman or Charles can be used as a fallback when a platform inspector cannot observe a request, but HTTPS certificate pinning may prevent proxy decryption. Do not disable transport security or certificate pinning in production code to support inspection.
|
|
742
|
+
|
|
743
|
+
Inspect only test or UAT traffic. Requests can contain authentication tokens, card identifiers, PIN-related values, and card details. Do not enable BODY-level HTTP logging, commit captures, or share unredacted request headers and payloads.
|
|
744
|
+
|
|
745
|
+
### Maintainer notes
|
|
746
|
+
|
|
747
|
+
- CocoaPods source tags use `v{version}` format and are resolved from `repository` metadata (fallback to `homepage`).
|
|
748
|
+
- Android native SDK version is centralized in `android/gradle.properties` via `NiCardManagement_nativeSdkVersion`.
|
|
749
|
+
- iOS native SDK version is pinned in `react-native-ni-card-management.podspec` via `s.dependency "NICardManagementSDK", '...'`; keep this aligned with `NiCardManagement_nativeSdkVersion`.
|
|
750
|
+
- Current validated native pins are Android `2.2.2` (`NiCardManagement_nativeSdkVersion`) and iOS `2.1.7` (`NICardManagementSDK` pod dependency).
|
|
751
|
+
- Android library-side New Architecture is opt-in via `NiCardManagement_newArchEnabled`; keep it disabled by default so app-level `newArchEnabled=true` does not make the SDK module run React codegen for third-party dependency specs (which can cause duplicate generated classes such as `RNCSafeAreaProviderManagerDelegate`).
|
|
752
|
+
- Flipper was a desktop debugging platform for inspecting network traffic, logs, React components, layouts, and databases. React Native no longer includes the generated Flipper integration in current templates, so the obsolete, release-only `ReactNativeFlipper.java` no-op scaffold was removed. It did not initialize Flipper or import Flipper libraries, and no Flipper dependency remains in the JavaScript, Android, or iOS dependency graphs. Use React Native DevTools for the supported debugging workflow; removing the scaffold does not affect application runtime behavior.
|
|
753
|
+
- Jetifier rewrites dependencies from the legacy Android Support Library (`android.support.*`) to AndroidX (`androidx.*`). It is disabled because the current dependency graph is AndroidX-native, avoiding unnecessary transformation during builds. Restore `android.enableJetifier=true` only if a future dependency still contains legacy support-library references and fails to build without rewriting.
|
|
754
|
+
- If Metro start fails with `EADDRINUSE` on `:8081`, either stop the existing process using that port or run the example app on an alternate port with `yarn workspace react-native-ni-card-management-example start:8082`.
|
|
755
|
+
- Example app start scripts are guarded by `check:node` and require Node `>=22.13.0`; older runtimes can fail with Metro errors such as `configs.toReversed is not a function`.
|
|
756
|
+
- iOS bridge now accepts `connectionProperties.extraHeaders` as a JSON string (same contract as Android). `connectionProperties.extraNetworkHeaders` dictionary remains supported as a backward-compatible fallback.
|
|
757
|
+
- Android 2.2.2 integration may require manifest merge override for `android:allowBackup`; the example app resolves this in `example/android/app/src/main/AndroidManifest.xml` using `tools:replace="android:allowBackup"`.
|
|
758
|
+
- JitPack timeouts/resolution flakiness for Android metadata were mitigated in `android/build.gradle` by setting repository metadata sources to `mavenPom()` and `artifact()` for `https://jitpack.io`.
|
|
759
|
+
- RN and Flutter integration models differ by design:
|
|
760
|
+
- Flutter initializes once with `initialize(...)` and passes `extraNetworkHeaders` as a map.
|
|
761
|
+
- RN passes `NiInputInterface` per call/component and uses `connectionProperties.extraHeaders` JSON string as the cross-platform transport shape.
|
|
762
|
+
- iOS RN 0.86.x + RCT-Folly may fail with `folly/coro/Coroutine.h file not found` in some pod resolutions. The example app Podfile includes a temporary post-install workaround in `example/ios/Podfile` that disables coroutine-only include blocks in `RCT-Folly/folly/Expected.h` and `RCT-Folly/folly/Optional.h` only when `folly/coro/Coroutine.h` is absent.
|
|
763
|
+
- Remove that workaround once the installed `RCT-Folly` package consistently includes `folly/coro/Coroutine.h` (or when upgrading RN/Folly versions where this mismatch is fixed).
|
package/android/build.gradle
CHANGED
|
@@ -15,7 +15,11 @@ buildscript {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
def isNewArchitectureEnabled() {
|
|
18
|
-
|
|
18
|
+
if (project.hasProperty("NiCardManagement_newArchEnabled")) {
|
|
19
|
+
return project.getProperty("NiCardManagement_newArchEnabled") == "true"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return false
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
apply plugin: "com.android.library"
|
|
@@ -80,10 +84,17 @@ android {
|
|
|
80
84
|
repositories {
|
|
81
85
|
mavenCentral()
|
|
82
86
|
google()
|
|
83
|
-
maven {
|
|
87
|
+
maven {
|
|
88
|
+
url "https://jitpack.io"
|
|
89
|
+
metadataSources {
|
|
90
|
+
mavenPom()
|
|
91
|
+
artifact()
|
|
92
|
+
}
|
|
93
|
+
}
|
|
84
94
|
}
|
|
85
95
|
|
|
86
96
|
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
97
|
+
def native_sdk_version = getExtOrDefault("nativeSdkVersion")
|
|
87
98
|
|
|
88
99
|
dependencies {
|
|
89
100
|
// For < 0.71, this will be from the local maven repo
|
|
@@ -91,6 +102,6 @@ dependencies {
|
|
|
91
102
|
//noinspection GradleDynamicVersion
|
|
92
103
|
implementation "com.facebook.react:react-native:+"
|
|
93
104
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
94
|
-
implementation
|
|
105
|
+
implementation "com.github.network-international:card-management-sdk-android:$native_sdk_version"
|
|
95
106
|
}
|
|
96
107
|
|
|
@@ -2,6 +2,57 @@ import Foundation
|
|
|
2
2
|
import NICardManagementSDK
|
|
3
3
|
import React
|
|
4
4
|
|
|
5
|
+
private final class ExtraHeadersProvider: NICardManagementExtraHeaders {
|
|
6
|
+
private let headers: [String: String]
|
|
7
|
+
|
|
8
|
+
init(headers: [String: String]) {
|
|
9
|
+
self.headers = headers
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
func additionalNetworkHeaders() -> [String: String] {
|
|
13
|
+
return headers
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
private func parseExtraHeaders(from connectionProperties: NSDictionary?) -> [String: String] {
|
|
18
|
+
var extraHeaders = [String: String]()
|
|
19
|
+
|
|
20
|
+
// Preferred contract: JSON string in connectionProperties.extraHeaders.
|
|
21
|
+
if let extraHeadersJSON = connectionProperties?["extraHeaders"] as? String,
|
|
22
|
+
!extraHeadersJSON.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty,
|
|
23
|
+
let data = extraHeadersJSON.data(using: .utf8),
|
|
24
|
+
let parsed = try? JSONSerialization.jsonObject(with: data) as? [String: Any] {
|
|
25
|
+
for (key, value) in parsed {
|
|
26
|
+
if let stringValue = value as? String {
|
|
27
|
+
extraHeaders[key] = stringValue
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Backward compatibility: dictionary in connectionProperties.extraNetworkHeaders.
|
|
33
|
+
if extraHeaders.isEmpty,
|
|
34
|
+
let extraHeadersDict = connectionProperties?["extraNetworkHeaders"] as? NSDictionary {
|
|
35
|
+
for item in extraHeadersDict {
|
|
36
|
+
guard let key = item.key as? String else { continue }
|
|
37
|
+
if let value = item.value as? String {
|
|
38
|
+
extraHeaders[key] = value
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return extraHeaders
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private func makeBridgeError(errorCode: String?, errorMessage: String?) -> [String: Any] {
|
|
47
|
+
let parsedErrorCode = Int(errorCode ?? "") ?? 500
|
|
48
|
+
|
|
49
|
+
return [
|
|
50
|
+
"domain": "com.NICardManagementSDK",
|
|
51
|
+
"code": parsedErrorCode,
|
|
52
|
+
"message": errorMessage ?? "Unknown error",
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
|
|
5
56
|
func createNICardManagementAPIInstance(from input: NSDictionary) -> NICardManagementAPI {
|
|
6
57
|
let bankCode = input["bankCode"] as? String ?? ""
|
|
7
58
|
let cardIdentifierId = input["cardIdentifierId"] as? String ?? ""
|
|
@@ -10,26 +61,18 @@ func createNICardManagementAPIInstance(from input: NSDictionary) -> NICardManage
|
|
|
10
61
|
|
|
11
62
|
let rootUrl = connectionProperties?["rootUrl"] as? String ?? ""
|
|
12
63
|
let token = connectionProperties?["token"] as? String ?? ""
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
64
|
+
let extraHeaders = parseExtraHeaders(from: connectionProperties)
|
|
65
|
+
let extraHeadersProvider = extraHeaders.isEmpty ? nil : ExtraHeadersProvider(headers: extraHeaders)
|
|
23
66
|
|
|
24
67
|
let tokenFetchable = TokenFetcherFactory.makeSimpleWrapper(tokenValue: token)
|
|
25
|
-
|
|
68
|
+
|
|
26
69
|
let sdk = NICardManagementAPI(
|
|
27
70
|
rootUrl: rootUrl,
|
|
28
71
|
cardIdentifierId: cardIdentifierId,
|
|
29
72
|
cardIdentifierType: cardIdentifierType,
|
|
30
73
|
bankCode: bankCode,
|
|
31
74
|
tokenFetchable: tokenFetchable,
|
|
32
|
-
|
|
75
|
+
extraHeadersProvider: extraHeadersProvider
|
|
33
76
|
)
|
|
34
77
|
return sdk
|
|
35
78
|
}
|
|
@@ -50,13 +93,7 @@ class NiCardManagement: NSObject {
|
|
|
50
93
|
|
|
51
94
|
sdk.getCardDetails() { successResponse, errorResponse, completion in
|
|
52
95
|
if let error = errorResponse {
|
|
53
|
-
|
|
54
|
-
let customeError: [String: Any?] = [
|
|
55
|
-
"domain": "com.NICardManagementSDK",
|
|
56
|
-
"code": errorCode,
|
|
57
|
-
"message": error.errorMessage
|
|
58
|
-
]
|
|
59
|
-
callback([customeError, NSNull()])
|
|
96
|
+
callback([makeBridgeError(errorCode: error.errorCode, errorMessage: error.errorMessage), NSNull()])
|
|
60
97
|
} else if let success = successResponse {
|
|
61
98
|
let cardDetailsObject: [String: Any?] = [
|
|
62
99
|
"clearPan": success.clearPan,
|
|
@@ -75,15 +112,8 @@ class NiCardManagement: NSObject {
|
|
|
75
112
|
let sdk = createNICardManagementAPIInstance(from: input)
|
|
76
113
|
|
|
77
114
|
sdk.setPin(pin: pin) { successResponse, errorResponse, completion in
|
|
78
|
-
print("I am in setPin")
|
|
79
115
|
if let error = errorResponse {
|
|
80
|
-
|
|
81
|
-
let customeError: [String: Any?] = [
|
|
82
|
-
"domain": "com.NICardManagementSDK",
|
|
83
|
-
"code": errorCode,
|
|
84
|
-
"message": error.errorMessage
|
|
85
|
-
]
|
|
86
|
-
callback([customeError, NSNull()])
|
|
116
|
+
callback([makeBridgeError(errorCode: error.errorCode, errorMessage: error.errorMessage), NSNull()])
|
|
87
117
|
} else if let success = successResponse {
|
|
88
118
|
callback([NSNull(), success.message])
|
|
89
119
|
}
|
|
@@ -96,15 +126,8 @@ class NiCardManagement: NSObject {
|
|
|
96
126
|
let sdk = createNICardManagementAPIInstance(from: input)
|
|
97
127
|
|
|
98
128
|
sdk.changePin(oldPin: oldPin, newPin: newPin) { successResponse, errorResponse, completion in
|
|
99
|
-
print("I am in changePin")
|
|
100
129
|
if let error = errorResponse {
|
|
101
|
-
|
|
102
|
-
let customeError: [String: Any?] = [
|
|
103
|
-
"domain": "com.NICardManagementSDK",
|
|
104
|
-
"code": errorCode,
|
|
105
|
-
"message": error.errorMessage
|
|
106
|
-
]
|
|
107
|
-
callback([customeError, NSNull()])
|
|
130
|
+
callback([makeBridgeError(errorCode: error.errorCode, errorMessage: error.errorMessage), NSNull()])
|
|
108
131
|
} else if let success = successResponse {
|
|
109
132
|
callback([NSNull(), success.message])
|
|
110
133
|
}
|
|
@@ -116,15 +139,8 @@ class NiCardManagement: NSObject {
|
|
|
116
139
|
let sdk = createNICardManagementAPIInstance(from: input)
|
|
117
140
|
|
|
118
141
|
sdk.verifyPin(pin: pin) { successResponse, errorResponse, completion in
|
|
119
|
-
print("I am in verifyPin")
|
|
120
142
|
if let error = errorResponse {
|
|
121
|
-
|
|
122
|
-
let customeError: [String: Any?] = [
|
|
123
|
-
"domain": "com.NICardManagementSDK",
|
|
124
|
-
"code": errorCode,
|
|
125
|
-
"message": error.errorMessage
|
|
126
|
-
]
|
|
127
|
-
callback([customeError, NSNull()])
|
|
143
|
+
callback([makeBridgeError(errorCode: error.errorCode, errorMessage: error.errorMessage), NSNull()])
|
|
128
144
|
} else if let success = successResponse {
|
|
129
145
|
callback([NSNull(), success.message])
|
|
130
146
|
}
|
|
@@ -136,15 +152,8 @@ class NiCardManagement: NSObject {
|
|
|
136
152
|
let sdk = createNICardManagementAPIInstance(from: input)
|
|
137
153
|
|
|
138
154
|
sdk.getPin() { successResponse, errorResponse, completion in
|
|
139
|
-
print("I am in getPin")
|
|
140
155
|
if let error = errorResponse {
|
|
141
|
-
|
|
142
|
-
let customError: [String: Any?] = [
|
|
143
|
-
"domain": "com.NICardManagementSDK",
|
|
144
|
-
"code": errorCode,
|
|
145
|
-
"message": error.errorMessage
|
|
146
|
-
]
|
|
147
|
-
callback([customError, NSNull()])
|
|
156
|
+
callback([makeBridgeError(errorCode: error.errorCode, errorMessage: error.errorMessage), NSNull()])
|
|
148
157
|
} else if let success = successResponse {
|
|
149
158
|
callback([NSNull(), success])
|
|
150
159
|
}
|
|
@@ -17,6 +17,8 @@ var _PinState = _interopRequireDefault(require("../components/PinState/PinState"
|
|
|
17
17
|
var _useGetCardDetails = require("../hooks/useGetCardDetails");
|
|
18
18
|
var _NiInputInterfaces = require("../interfaces/NiInputInterfaces");
|
|
19
19
|
var _themeColors = require("../config/themeColors");
|
|
20
|
+
var _FeedbackPopup = require("../components/FeedbackPopup/FeedbackPopup");
|
|
21
|
+
var _localization = _interopRequireDefault(require("../utils/localization"));
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
22
24
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -28,6 +30,7 @@ function CardDetailsComponent({
|
|
|
28
30
|
displayAttributes
|
|
29
31
|
} = input || {};
|
|
30
32
|
const theme = displayAttributes?.theme || _NiInputInterfaces.NIThemeEnum.light;
|
|
33
|
+
const language = displayAttributes?.language || 'english';
|
|
31
34
|
const cardDetailsStyle = {
|
|
32
35
|
height: '100%',
|
|
33
36
|
width: '100%',
|
|
@@ -40,8 +43,10 @@ function CardDetailsComponent({
|
|
|
40
43
|
onGetCardDetails
|
|
41
44
|
} = (0, _useGetCardDetails.useGetCardDetails)();
|
|
42
45
|
(0, _react.useEffect)(() => {
|
|
43
|
-
|
|
44
|
-
|
|
46
|
+
if (input) {
|
|
47
|
+
onGetCardDetails(input, callback);
|
|
48
|
+
}
|
|
49
|
+
}, [input, callback, onGetCardDetails]);
|
|
45
50
|
const error_getCardDetailsResult = {
|
|
46
51
|
clearPan: '-',
|
|
47
52
|
maskedPan: '-',
|
|
@@ -61,7 +66,14 @@ function CardDetailsComponent({
|
|
|
61
66
|
isLoading: getCardDetailsIsLoading,
|
|
62
67
|
theme: theme,
|
|
63
68
|
isCardDetails: true
|
|
64
|
-
}))
|
|
69
|
+
})), /*#__PURE__*/_react.default.createElement(_FeedbackPopup.FeedbackPopup, {
|
|
70
|
+
error: getCardDetailsError,
|
|
71
|
+
isLoading: getCardDetailsIsLoading,
|
|
72
|
+
isSuccess: !!getCardDetailsResult,
|
|
73
|
+
language: language,
|
|
74
|
+
successMessage: (0, _localization.default)(language).cardDetailsSuccess,
|
|
75
|
+
theme: theme
|
|
76
|
+
}));
|
|
65
77
|
}
|
|
66
78
|
const styles = _reactNative.StyleSheet.create({
|
|
67
79
|
cardDetailsStyle: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_CardDetails","_PinState","_interopRequireDefault","_useGetCardDetails","_NiInputInterfaces","_themeColors","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","CardDetailsComponent","input","callback","displayAttributes","theme","NIThemeEnum","light","cardDetailsStyle","height","width","backgroundColor","themeColors","background","dark","result","getCardDetailsResult","error","getCardDetailsError","isLoading","getCardDetailsIsLoading","onGetCardDetails","useGetCardDetails","useEffect","error_getCardDetailsResult","clearPan","maskedPan","expiry","clearCVV2","cardholderName","createElement","View","style","styles","CardDetails","isError","isCardDetails","StyleSheet","create","marginTop"],"sourceRoot":"../../../src","sources":["NICardManagementComponents/CardDetailsComponent.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AAEA,IAAAO,YAAA,GAAAP,OAAA;
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_CardDetails","_PinState","_interopRequireDefault","_useGetCardDetails","_NiInputInterfaces","_themeColors","_FeedbackPopup","_localization","obj","__esModule","default","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","CardDetailsComponent","input","callback","displayAttributes","theme","NIThemeEnum","light","language","cardDetailsStyle","height","width","backgroundColor","themeColors","background","dark","result","getCardDetailsResult","error","getCardDetailsError","isLoading","getCardDetailsIsLoading","onGetCardDetails","useGetCardDetails","useEffect","error_getCardDetailsResult","clearPan","maskedPan","expiry","clearCVV2","cardholderName","createElement","View","style","styles","CardDetails","isError","isCardDetails","FeedbackPopup","isSuccess","successMessage","localLabels","cardDetailsSuccess","StyleSheet","create","marginTop"],"sourceRoot":"../../../src","sources":["NICardManagementComponents/CardDetailsComponent.tsx"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,kB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