@networkinternational/ni-card-management-sdk 1.0.8 → 2.0.0

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.
Files changed (152) hide show
  1. package/README.md +140 -38
  2. package/android/build.gradle +14 -3
  3. package/android/gradle.properties +1 -0
  4. package/ios/NiCardManagement.swift +60 -51
  5. package/lib/commonjs/NICardManagementComponents/CardDetailsComponent.js +4 -2
  6. package/lib/commonjs/NICardManagementComponents/CardDetailsComponent.js.map +1 -1
  7. package/lib/commonjs/NICardManagementComponents/NiInputInterfaces.js.map +1 -1
  8. package/lib/commonjs/NICardManagementComponents/ViewPinComponent.js +4 -2
  9. package/lib/commonjs/NICardManagementComponents/ViewPinComponent.js.map +1 -1
  10. package/lib/commonjs/components/CardDetails/CardHolderNameGroups.js +1 -1
  11. package/lib/commonjs/components/CardDetails/CardNumberGroup.js +1 -1
  12. package/lib/commonjs/components/CardDetails/DateCVVGroupOneRow.js.map +1 -1
  13. package/lib/commonjs/components/NIButton/NIButton.js +28 -6
  14. package/lib/commonjs/components/NIButton/NIButton.js.map +1 -1
  15. package/lib/commonjs/config/localization.js.map +1 -1
  16. package/lib/commonjs/hooks/useChangePin.js +6 -4
  17. package/lib/commonjs/hooks/useChangePin.js.map +1 -1
  18. package/lib/commonjs/hooks/useGetCardDetails.js +6 -4
  19. package/lib/commonjs/hooks/useGetCardDetails.js.map +1 -1
  20. package/lib/commonjs/hooks/useSetPin.js +6 -4
  21. package/lib/commonjs/hooks/useSetPin.js.map +1 -1
  22. package/lib/commonjs/hooks/useVerifyPin.js +6 -4
  23. package/lib/commonjs/hooks/useVerifyPin.js.map +1 -1
  24. package/lib/commonjs/hooks/useViewPin.js +6 -4
  25. package/lib/commonjs/hooks/useViewPin.js.map +1 -1
  26. package/lib/commonjs/types/jsx-compat.d.js +6 -0
  27. package/lib/commonjs/types/jsx-compat.d.js.map +1 -0
  28. package/lib/commonjs/utils/normalizeNativeError.js +33 -0
  29. package/lib/commonjs/utils/normalizeNativeError.js.map +1 -0
  30. package/lib/module/NICardManagementComponents/CardDetailsComponent.js +4 -2
  31. package/lib/module/NICardManagementComponents/CardDetailsComponent.js.map +1 -1
  32. package/lib/module/NICardManagementComponents/NiInputInterfaces.js.map +1 -1
  33. package/lib/module/NICardManagementComponents/ViewPinComponent.js +4 -2
  34. package/lib/module/NICardManagementComponents/ViewPinComponent.js.map +1 -1
  35. package/lib/module/components/CardDetails/CardHolderNameGroups.js +1 -1
  36. package/lib/module/components/CardDetails/CardNumberGroup.js +1 -1
  37. package/lib/module/components/CardDetails/DateCVVGroupOneRow.js.map +1 -1
  38. package/lib/module/components/NIButton/NIButton.js +28 -6
  39. package/lib/module/components/NIButton/NIButton.js.map +1 -1
  40. package/lib/module/config/localization.js.map +1 -1
  41. package/lib/module/hooks/useChangePin.js +7 -5
  42. package/lib/module/hooks/useChangePin.js.map +1 -1
  43. package/lib/module/hooks/useGetCardDetails.js +7 -5
  44. package/lib/module/hooks/useGetCardDetails.js.map +1 -1
  45. package/lib/module/hooks/useSetPin.js +7 -5
  46. package/lib/module/hooks/useSetPin.js.map +1 -1
  47. package/lib/module/hooks/useVerifyPin.js +7 -5
  48. package/lib/module/hooks/useVerifyPin.js.map +1 -1
  49. package/lib/module/hooks/useViewPin.js +7 -5
  50. package/lib/module/hooks/useViewPin.js.map +1 -1
  51. package/lib/module/types/jsx-compat.d.js +2 -0
  52. package/lib/module/types/jsx-compat.d.js.map +1 -0
  53. package/lib/module/utils/normalizeNativeError.js +27 -0
  54. package/lib/module/utils/normalizeNativeError.js.map +1 -0
  55. package/lib/typescript/src/NICardManagementComponents/CardDetailsComponent.d.ts +0 -1
  56. package/lib/typescript/src/NICardManagementComponents/CardDetailsComponent.d.ts.map +1 -1
  57. package/lib/typescript/src/NICardManagementComponents/ChangePinView.d.ts +0 -1
  58. package/lib/typescript/src/NICardManagementComponents/ChangePinView.d.ts.map +1 -1
  59. package/lib/typescript/src/NICardManagementComponents/NiInputInterfaces.d.ts +1 -0
  60. package/lib/typescript/src/NICardManagementComponents/NiInputInterfaces.d.ts.map +1 -1
  61. package/lib/typescript/src/NICardManagementComponents/SetPinView.d.ts +0 -1
  62. package/lib/typescript/src/NICardManagementComponents/SetPinView.d.ts.map +1 -1
  63. package/lib/typescript/src/NICardManagementComponents/VerifyPinView.d.ts +0 -1
  64. package/lib/typescript/src/NICardManagementComponents/VerifyPinView.d.ts.map +1 -1
  65. package/lib/typescript/src/NICardManagementComponents/ViewPinComponent.d.ts +0 -1
  66. package/lib/typescript/src/NICardManagementComponents/ViewPinComponent.d.ts.map +1 -1
  67. package/lib/typescript/src/components/CardDetails/CardDetails.d.ts +0 -1
  68. package/lib/typescript/src/components/CardDetails/CardDetails.d.ts.map +1 -1
  69. package/lib/typescript/src/components/CardDetails/CardDetailsBackgroundImage.d.ts +0 -1
  70. package/lib/typescript/src/components/CardDetails/CardDetailsBackgroundImage.d.ts.map +1 -1
  71. package/lib/typescript/src/components/CardDetails/CardDetailsGroups.d.ts +0 -1
  72. package/lib/typescript/src/components/CardDetails/CardDetailsGroups.d.ts.map +1 -1
  73. package/lib/typescript/src/components/CardDetails/CardHolderNameGroups.d.ts +0 -1
  74. package/lib/typescript/src/components/CardDetails/CardHolderNameGroups.d.ts.map +1 -1
  75. package/lib/typescript/src/components/CardDetails/CardNumberGroup.d.ts +0 -1
  76. package/lib/typescript/src/components/CardDetails/CardNumberGroup.d.ts.map +1 -1
  77. package/lib/typescript/src/components/CardDetails/DateCVVGroupOneRow.d.ts +0 -1
  78. package/lib/typescript/src/components/CardDetails/DateCVVGroupOneRow.d.ts.map +1 -1
  79. package/lib/typescript/src/components/ChangePin/CaptureCurrentPin.d.ts +0 -1
  80. package/lib/typescript/src/components/ChangePin/CaptureCurrentPin.d.ts.map +1 -1
  81. package/lib/typescript/src/components/ChangePin/CaptureNewPin.d.ts +0 -1
  82. package/lib/typescript/src/components/ChangePin/CaptureNewPin.d.ts.map +1 -1
  83. package/lib/typescript/src/components/ChangePin/ChangePin.d.ts +0 -1
  84. package/lib/typescript/src/components/ChangePin/ChangePin.d.ts.map +1 -1
  85. package/lib/typescript/src/components/ChangePin/ConfirmPin.d.ts +0 -1
  86. package/lib/typescript/src/components/ChangePin/ConfirmPin.d.ts.map +1 -1
  87. package/lib/typescript/src/components/ChangePin/ReenterNewPin.d.ts +0 -1
  88. package/lib/typescript/src/components/ChangePin/ReenterNewPin.d.ts.map +1 -1
  89. package/lib/typescript/src/components/NIButton/NIButton.d.ts +0 -1
  90. package/lib/typescript/src/components/NIButton/NIButton.d.ts.map +1 -1
  91. package/lib/typescript/src/components/Pin/CapturePin.d.ts +0 -1
  92. package/lib/typescript/src/components/Pin/CapturePin.d.ts.map +1 -1
  93. package/lib/typescript/src/components/Pin/NextButton.d.ts +0 -1
  94. package/lib/typescript/src/components/Pin/NextButton.d.ts.map +1 -1
  95. package/lib/typescript/src/components/Pin/ShowHideButton.d.ts +0 -1
  96. package/lib/typescript/src/components/Pin/ShowHideButton.d.ts.map +1 -1
  97. package/lib/typescript/src/components/PinState/LoadingState.d.ts +0 -1
  98. package/lib/typescript/src/components/PinState/LoadingState.d.ts.map +1 -1
  99. package/lib/typescript/src/components/PinState/PinState.d.ts +0 -1
  100. package/lib/typescript/src/components/PinState/PinState.d.ts.map +1 -1
  101. package/lib/typescript/src/components/SetPin/ConfirmPin.d.ts +0 -1
  102. package/lib/typescript/src/components/SetPin/ConfirmPin.d.ts.map +1 -1
  103. package/lib/typescript/src/components/SetPin/ReenterCardPin.d.ts +0 -1
  104. package/lib/typescript/src/components/SetPin/ReenterCardPin.d.ts.map +1 -1
  105. package/lib/typescript/src/components/SetPin/SetPin.d.ts +0 -1
  106. package/lib/typescript/src/components/SetPin/SetPin.d.ts.map +1 -1
  107. package/lib/typescript/src/components/SetPin/SetUpNewCardPin.d.ts +0 -1
  108. package/lib/typescript/src/components/SetPin/SetUpNewCardPin.d.ts.map +1 -1
  109. package/lib/typescript/src/components/VerifyPin/CaptureVerifyPin.d.ts +0 -1
  110. package/lib/typescript/src/components/VerifyPin/CaptureVerifyPin.d.ts.map +1 -1
  111. package/lib/typescript/src/components/VerifyPin/ConfirmPin.d.ts +0 -1
  112. package/lib/typescript/src/components/VerifyPin/ConfirmPin.d.ts.map +1 -1
  113. package/lib/typescript/src/components/VerifyPin/VerifyPin.d.ts +0 -1
  114. package/lib/typescript/src/components/VerifyPin/VerifyPin.d.ts.map +1 -1
  115. package/lib/typescript/src/components/ViewPin/ViewPin.d.ts +0 -1
  116. package/lib/typescript/src/components/ViewPin/ViewPin.d.ts.map +1 -1
  117. package/lib/typescript/src/components/icons/PredeterminedIcon.d.ts +2 -2
  118. package/lib/typescript/src/components/icons/PredeterminedIcon.d.ts.map +1 -1
  119. package/lib/typescript/src/config/localization.d.ts.map +1 -1
  120. package/lib/typescript/src/hooks/useChangePin.d.ts.map +1 -1
  121. package/lib/typescript/src/hooks/useGetCardDetails.d.ts.map +1 -1
  122. package/lib/typescript/src/hooks/useSetPin.d.ts.map +1 -1
  123. package/lib/typescript/src/hooks/useVerifyPin.d.ts.map +1 -1
  124. package/lib/typescript/src/hooks/useViewPin.d.ts +1 -1
  125. package/lib/typescript/src/hooks/useViewPin.d.ts.map +1 -1
  126. package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts +1 -1
  127. package/lib/typescript/src/interfaces/NiCardManagementInterfaces.d.ts.map +1 -1
  128. package/lib/typescript/src/interfaces/NiInputInterfaces.d.ts +4 -2
  129. package/lib/typescript/src/interfaces/NiInputInterfaces.d.ts.map +1 -1
  130. package/lib/typescript/src/nativeComponents/NICardManagementSDKModule.d.ts.map +1 -1
  131. package/lib/typescript/src/utils/formatInput.d.ts.map +1 -1
  132. package/lib/typescript/src/utils/normalizeNativeError.d.ts +4 -0
  133. package/lib/typescript/src/utils/normalizeNativeError.d.ts.map +1 -0
  134. package/package.json +26 -26
  135. package/react-native-ni-card-management.podspec +24 -17
  136. package/src/NICardManagementComponents/CardDetailsComponent.tsx +4 -2
  137. package/src/NICardManagementComponents/NiInputInterfaces.ts +2 -0
  138. package/src/NICardManagementComponents/ViewPinComponent.tsx +4 -2
  139. package/src/components/CardDetails/CardHolderNameGroups.tsx +1 -1
  140. package/src/components/CardDetails/CardNumberGroup.tsx +1 -1
  141. package/src/components/CardDetails/DateCVVGroupOneRow.tsx +1 -1
  142. package/src/components/NIButton/NIButton.tsx +31 -7
  143. package/src/config/localization.ts +2 -1
  144. package/src/hooks/useChangePin.ts +29 -24
  145. package/src/hooks/useGetCardDetails.ts +25 -20
  146. package/src/hooks/useSetPin.ts +27 -22
  147. package/src/hooks/useVerifyPin.ts +27 -22
  148. package/src/hooks/useViewPin.ts +25 -20
  149. package/src/interfaces/NiCardManagementInterfaces.ts +1 -1
  150. package/src/interfaces/NiInputInterfaces.ts +6 -2
  151. package/src/types/jsx-compat.d.ts +20 -0
  152. 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 Network International React Native Card Management SDK requires minimum react native version 0.71.0 and later and works with iOS version 12 and above.
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: react-native-paper, @react-native-community/clipboard, react-native-linear-gradient. If you did not already, please install them before installing the SDK.
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 react-native-paper @react-native-community/clipboard react-native-linear-gradient packages only if you did not already.
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 react-native-paper @react-native-community/clipboard react-native-linear-gradient
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 react-native-paper @react-native-community/clipboard react-native-linear-gradient packages only if you did not already.
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 react-native-paper @react-native-community/clipboard react-native-linear-gradient
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 used it.
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: NIConnectionProperties = {
91
- rootUrl: [rootUrl], token: [token],
105
+ connectionProperties: {
106
+ rootUrl: [rootUrl],
107
+ token: [token],
108
+ extraHeaders: JSON.stringify({
109
+ 'custom-header': 'custom-value',
110
+ }),
92
111
  },
93
- displayAttributes: NIDisplayAttributes = {
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 ['path/to/your/object/config'];
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 ['path/to/your/object/config'];
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 ['path/to/your/object/config'];
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 ['path/to/your/object/config'];
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: NIConnectionProperties = {
411
- rootUrl: [rootUrl], token: [token],
450
+ connectionProperties: {
451
+ rootUrl: [rootUrl],
452
+ token: [token],
453
+ extraHeaders: JSON.stringify({
454
+ 'custom-header': 'custom-value',
455
+ }),
412
456
  },
413
- displayAttributes: NIDisplayAttributes = {
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 View
466
+ ##### Display View Pin Component
423
467
 
424
- A view of NIViewPinView type can be added into storyboard, then set the input and start the flow as below:
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
- ViewPinView,
471
+ ViewPinComponent,
428
472
  type NIErrorResponse,
429
473
  NIPinTypeEnum,
430
474
  } from '@networkinternational/ni-card-management-sdk';
431
475
 
432
- import { input } from ['path/to/your/object/config'];
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
- <ViewPinView
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
- <ViewPinView
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
- #### Programatic Interface
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 ['path/to/your/object/config'];
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 ['path/to/your/object/config'];
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 ['path/to/your/object/config'];
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 ['path/to/your/object/config'];
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
- import { input } from ['path/to/your/object/config'];
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).
@@ -15,7 +15,11 @@ buildscript {
15
15
  }
16
16
 
17
17
  def isNewArchitectureEnabled() {
18
- return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
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 { url "https://jitpack.io" }
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 'com.github.network-international:card-management-sdk-android:1.0.49-alpha.4'
105
+ implementation "com.github.network-international:card-management-sdk-android:$native_sdk_version"
95
106
  }
96
107
 
@@ -2,4 +2,5 @@ NiCardManagement_kotlinVersion=1.7.0
2
2
  NiCardManagement_minSdkVersion=21
3
3
  NiCardManagement_targetSdkVersion=31
4
4
  NiCardManagement_compileSdkVersion=31
5
+ NiCardManagement_nativeSdkVersion=2.2.2
5
6
  NiCardManagement_ndkversion=21.4.7075529
@@ -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
- 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
-
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
- extraHeaders: extraHeaders
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
- let errorCode = Int(error.errorCode) ?? 500
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
- let errorCode = Int(error.errorCode) ?? 500
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
- let errorCode = Int(error.errorCode) ?? 500
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
- let errorCode = Int(error.errorCode) ?? 500
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
- let errorCode = Int(error.errorCode) ?? 500
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
  }
@@ -40,8 +40,10 @@ function CardDetailsComponent({
40
40
  onGetCardDetails
41
41
  } = (0, _useGetCardDetails.useGetCardDetails)();
42
42
  (0, _react.useEffect)(() => {
43
- input && onGetCardDetails(input, callback);
44
- }, []);
43
+ if (input) {
44
+ onGetCardDetails(input, callback);
45
+ }
46
+ }, [input, callback, onGetCardDetails]);
45
47
  const error_getCardDetailsResult = {
46
48
  clearPan: '-',
47
49
  maskedPan: '-',
@@ -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":"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"}
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":"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"}
@@ -1 +1 @@
1
- {"version":3,"names":["_NiInputInterfaces","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../src","sources":["NICardManagementComponents/NiInputInterfaces.ts"],"mappings":";;;;;AAaA,IAAAA,kBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,kBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,kBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,kBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":["_NiInputInterfaces","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get"],"sourceRoot":"../../../src","sources":["NICardManagementComponents/NiInputInterfaces.ts"],"mappings":";;;;;AAeA,IAAAA,kBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,kBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,kBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,kBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA"}
@@ -37,8 +37,10 @@ function ViewPinComponent({
37
37
  isViewPinLoading
38
38
  });
39
39
  (0, _react.useEffect)(() => {
40
- input && onViewPin(input, callback);
41
- }, []);
40
+ if (input) {
41
+ onViewPin(input, callback);
42
+ }
43
+ }, [input, callback, onViewPin]);
42
44
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ViewPin.default, {
43
45
  input: input,
44
46
  pinType: pinType || _NiInputInterfaces.NIPinTypeEnum.dynamicFourToSix,