quivio-transaction-processor 1.23.2-beta → 1.23.2

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 (27) hide show
  1. package/dist/emvPaymentProvider/EMVPaymentProvider.js +63 -144
  2. package/dist/emvPaymentProvider/EMVPaymentProvider.js.map +1 -1
  3. package/dist/emvPaymentProvider/types.d.ts +2 -5
  4. package/dist/example/EMVPaymentScreen.d.ts +1 -4
  5. package/dist/example/EMVPaymentScreen.js +8 -101
  6. package/dist/example/EMVPaymentScreen.js.map +1 -1
  7. package/dist/example/EMVSettingsScreen.js +6 -4
  8. package/dist/example/EMVSettingsScreen.js.map +1 -1
  9. package/dist/example/ExternalSystemsScreen.js +3 -123
  10. package/dist/example/ExternalSystemsScreen.js.map +1 -1
  11. package/dist/example/MainScreen.js +1 -1
  12. package/dist/example/MainScreen.js.map +1 -1
  13. package/libs/emvCardReaderLib/src/main/java/com/rohan/emvcardreaderlib/POSTransactionExecutor.kt +25 -29
  14. package/libs/emvCardReaderLib/src/main/java/com/rohan/emvcardreaderlib/builder/DsiEMVRequestBuilder.kt +7 -14
  15. package/libs/emvCardReaderLib/src/main/java/com/rohan/emvcardreaderlib/manager/EMVPaymentManager.kt +20 -28
  16. package/libs/emvNative/src/main/java/com/quivio_transaction_processor/EMVPaymentManagerModule.kt +7 -16
  17. package/package.json +1 -1
  18. package/src/emvPaymentProvider/EMVPaymentProvider.tsx +64 -105
  19. package/src/emvPaymentProvider/types.ts +2 -5
  20. package/src/example/EMVPaymentScreen.tsx +18 -75
  21. package/src/example/EMVSettingsScreen.tsx +5 -3
  22. package/src/example/ExternalSystemsScreen.tsx +27 -116
  23. package/src/example/MainScreen.tsx +1 -1
  24. package/dist/example/helper/deviceStore.d.ts +0 -11
  25. package/dist/example/helper/deviceStore.js +0 -37
  26. package/dist/example/helper/deviceStore.js.map +0 -1
  27. package/src/example/helper/deviceStore.ts +0 -40
@@ -10,7 +10,6 @@ import {
10
10
  } from 'react-native';
11
11
  import { useEMVPayment } from '../emvPaymentProvider/useEMVPayment';
12
12
  import { EMVConfig } from '../emvPaymentProvider/types';
13
- import { addDevice } from './helper/deviceStore';
14
13
 
15
14
  type Props = {
16
15
  config: EMVConfig | null;
@@ -18,22 +17,18 @@ type Props = {
18
17
  };
19
18
 
20
19
  const ExternalSystemsScreen = ({ config, onBackPress }: Props) => {
21
- const {
20
+ const {
22
21
  isConfigured,
23
- deviceSerialNumber,
24
22
  isDeviceConnected,
25
- getDeviceDetails,
26
23
  isCancellationRunning,
27
24
  cancelOperation,
28
25
  runConfiguration,
29
26
  isConfigurationInProgress,
30
- displayMessage,
27
+ displayMessage
31
28
  } = useEMVPayment();
32
-
29
+
33
30
  const [deviceInfo] = useState('');
34
31
 
35
- const [isFetchingDeviceDetails, setFetchingDeviceDetails] = useState(false);
36
-
37
32
  const [infoVisible, setInfoVisible] = useState(false);
38
33
 
39
34
  // Auto-close info modal when device connects
@@ -43,75 +38,8 @@ const ExternalSystemsScreen = ({ config, onBackPress }: Props) => {
43
38
  }
44
39
  }, [isDeviceConnected, infoVisible]);
45
40
 
46
- // useEffect(() => {
47
- // let timer: NodeJS.Timeout;
48
- // if (isConfigured) {
49
- // if (deviceSerialNumber?.trim()) {
50
- // addDevice({
51
- // isConfigured: true,
52
- // isSandbox: true,
53
- // MerchantId: config?.merchantID ?? '',
54
- // serialNumber: deviceSerialNumber,
55
- // });
56
- // } else {
57
- // setFetchingDeviceDetails(true);
58
- // timer = setTimeout(() => {
59
- // getDeviceDetails();
60
- // }, 3000);
61
- // }
62
- // }
63
- // return () => {
64
- // if (timer) clearTimeout(timer);
65
- // };
66
- // }, [isConfigured]);
67
-
68
- // useEffect(() => {
69
- // if (deviceSerialNumber?.trim()) {
70
- // setFetchingDeviceDetails(false);
71
- // addDevice({
72
- // isConfigured: true,
73
- // isSandbox: true,
74
- // MerchantId: config?.merchantID ?? '',
75
- // serialNumber: deviceSerialNumber,
76
- // });
77
- // }
78
- // }, [deviceSerialNumber]);
79
- useEffect(() => {
80
- let timer: NodeJS.Timeout;
81
- const handleSerial = async () => {
82
- if (isConfigured) {
83
- const serialNumberToBeStored = !deviceSerialNumber?.trim()
84
- ? await getDeviceDetails()
85
- : deviceSerialNumber;
86
-
87
- if (serialNumberToBeStored) {
88
- addDevice({
89
- MerchantId: config?.merchantID ?? '',
90
- isSandbox: config?.isSandBox ?? true,
91
- isConfigured: true,
92
- serialNumber: serialNumberToBeStored,
93
- });
94
- }
95
- }
96
- setFetchingDeviceDetails(false);
97
- };
98
-
99
- timer = setTimeout(() => {
100
- setFetchingDeviceDetails(true);
101
- handleSerial();
102
- }, 3000);
103
-
104
- return () => {
105
- if (timer) {
106
- clearTimeout(timer);
107
- setFetchingDeviceDetails(false);
108
- }
109
- };
110
- }, [isConfigured, deviceSerialNumber]);
111
-
112
41
  const onConfigureDevice = useCallback(() => {
113
42
  if (!config) return;
114
-
115
43
  runConfiguration(config);
116
44
  }, [config, runConfiguration]);
117
45
 
@@ -161,8 +89,9 @@ const ExternalSystemsScreen = ({ config, onBackPress }: Props) => {
161
89
  >
162
90
  <Pressable style={styles.modalContainer}>
163
91
  <Text style={styles.modalText}>
164
- 1. Do not disconnect the device while configuring. \n2. Do not put
165
- app in the background while configuring. \n
92
+ 1. Do not disconnect the device
93
+ while configuring. \n2. Do not put app in the background while
94
+ configuring. \n
166
95
  {displayMessage}
167
96
  </Text>
168
97
  <Pressable style={styles.closeButton} onPress={() => {}}>
@@ -173,21 +102,6 @@ const ExternalSystemsScreen = ({ config, onBackPress }: Props) => {
173
102
  </Modal>
174
103
  );
175
104
 
176
- const DeviceDetailsModal = () => (
177
- <Modal
178
- visible={isFetchingDeviceDetails}
179
- transparent
180
- animationType="fade"
181
- onRequestClose={() => {}}
182
- >
183
- <Pressable style={styles.modalBackground} onPress={() => {}}>
184
- <Pressable style={styles.modalContainer}>
185
- <Text style={styles.modalText}>Saving Device Details.....</Text>
186
- </Pressable>
187
- </Pressable>
188
- </Modal>
189
- );
190
-
191
105
  const CancelModal = () => (
192
106
  <Modal
193
107
  visible={isCancellationRunning}
@@ -212,30 +126,30 @@ const ExternalSystemsScreen = ({ config, onBackPress }: Props) => {
212
126
  );
213
127
 
214
128
  const InfoModal = () => (
215
- <Modal
216
- visible={infoVisible}
217
- transparent
218
- animationType="fade"
219
- onRequestClose={() => setInfoVisible(false)}
220
- >
221
- <Pressable
222
- style={styles.modalBackground}
223
- onPress={() => setInfoVisible(false)}
224
- >
225
- <Pressable style={styles.modalContainer}>
226
- <Text style={styles.modalText}>
227
- Connect IDTECH VP3350 device via USB cable
228
- </Text>
129
+ <Modal
130
+ visible={infoVisible}
131
+ transparent
132
+ animationType="fade"
133
+ onRequestClose={() => setInfoVisible(false)}
134
+ >
229
135
  <Pressable
230
- style={styles.closeButton}
136
+ style={styles.modalBackground}
231
137
  onPress={() => setInfoVisible(false)}
232
138
  >
233
- <Text style={styles.closeButtonText}>Close</Text>
139
+ <Pressable style={styles.modalContainer}>
140
+ <Text style={styles.modalText}>
141
+ Connect IDTECH VP3350 device via USB cable
142
+ </Text>
143
+ <Pressable
144
+ style={styles.closeButton}
145
+ onPress={() => setInfoVisible(false)}
146
+ >
147
+ <Text style={styles.closeButtonText}>Close</Text>
148
+ </Pressable>
149
+ </Pressable>
234
150
  </Pressable>
235
- </Pressable>
236
- </Pressable>
237
- </Modal>
238
- );
151
+ </Modal>
152
+ )
239
153
 
240
154
  const ConfigurationDetails = ({
241
155
  merchantId,
@@ -327,14 +241,11 @@ const ExternalSystemsScreen = ({ config, onBackPress }: Props) => {
327
241
  {/** Loader Modal */}
328
242
  <LoaderModal />
329
243
 
330
- {/** Device Fetching Modal */}
331
- <DeviceDetailsModal />
332
-
333
244
  {/** Cancel Modal */}
334
245
  <CancelModal />
335
246
 
336
247
  {/* Configure CTA */}
337
- {isDeviceConnected && <ConfigureCTA />}
248
+ {isDeviceConnected && !isConfigured && <ConfigureCTA />}
338
249
 
339
250
  <BackCTA />
340
251
  </View>
@@ -7,7 +7,7 @@ const MainScreen: React.FC<{ config: EMVConfig }> = ({ config }) => {
7
7
  const [showEMV, setShowEMV] = useState(false);
8
8
 
9
9
  if (showEMV) {
10
- return <EMVPaymentScreen posConfig={config}/>;
10
+ return <EMVPaymentScreen />;
11
11
  }
12
12
 
13
13
  return (
@@ -1,11 +0,0 @@
1
- export type DeviceConfig = {
2
- serialNumber: string;
3
- MerchantId: string;
4
- isSandbox: boolean;
5
- isConfigured: boolean;
6
- };
7
- export declare let IDTECH_LOCAL_DB: DeviceConfig[];
8
- export declare const addDevice: (device: DeviceConfig) => void;
9
- export declare const updateDevice: (serialNumber: string, updated: Partial<DeviceConfig>) => void;
10
- export declare const deleteDevice: (serialNumber: string) => void;
11
- export declare const getDeviceBySerial: (serialNumber: string) => DeviceConfig | undefined;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.getDeviceBySerial = exports.deleteDevice = exports.updateDevice = exports.addDevice = exports.IDTECH_LOCAL_DB = void 0;
15
- exports.IDTECH_LOCAL_DB = [];
16
- var addDevice = function (device) {
17
- console.log('ADDING Device: ', device);
18
- exports.IDTECH_LOCAL_DB.push(device);
19
- console.log('After Device ADDED : ', exports.IDTECH_LOCAL_DB);
20
- };
21
- exports.addDevice = addDevice;
22
- var updateDevice = function (serialNumber, updated) {
23
- var index = exports.IDTECH_LOCAL_DB.findIndex(function (d) { return d.serialNumber === serialNumber; });
24
- if (index !== -1) {
25
- exports.IDTECH_LOCAL_DB[index] = __assign(__assign({}, exports.IDTECH_LOCAL_DB[index]), updated);
26
- }
27
- };
28
- exports.updateDevice = updateDevice;
29
- var deleteDevice = function (serialNumber) {
30
- exports.IDTECH_LOCAL_DB = exports.IDTECH_LOCAL_DB.filter(function (d) { return d.serialNumber !== serialNumber; });
31
- };
32
- exports.deleteDevice = deleteDevice;
33
- var getDeviceBySerial = function (serialNumber) {
34
- return exports.IDTECH_LOCAL_DB.find(function (d) { return d.serialNumber === serialNumber; });
35
- };
36
- exports.getDeviceBySerial = getDeviceBySerial;
37
- //# sourceMappingURL=deviceStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deviceStore.js","sourceRoot":"","sources":["../../../src/example/helper/deviceStore.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAOW,QAAA,eAAe,GAAmB,EAE5C,CAAC;AAEK,IAAM,SAAS,GAAG,UAAC,MAAoB;IAC5C,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;IACvC,uBAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,uBAAe,CAAC,CAAC;AACxD,CAAC,CAAC;AAJW,QAAA,SAAS,aAIpB;AAEK,IAAM,YAAY,GAAG,UAC1B,YAAoB,EACpB,OAA8B;IAE9B,IAAM,KAAK,GAAG,uBAAe,CAAC,SAAS,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,YAAY,KAAK,YAAY,EAA/B,CAA+B,CAAC,CAAC;IAE9E,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;QAChB,uBAAe,CAAC,KAAK,CAAC,yBACjB,uBAAe,CAAC,KAAK,CAAC,GACtB,OAAO,CACX,CAAC;KACH;AACH,CAAC,CAAC;AAZW,QAAA,YAAY,gBAYvB;AAEK,IAAM,YAAY,GAAG,UAAC,YAAoB;IAC/C,uBAAe,GAAG,uBAAe,CAAC,MAAM,CACtC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,YAAY,KAAK,YAAY,EAA/B,CAA+B,CACrC,CAAC;AACJ,CAAC,CAAC;AAJW,QAAA,YAAY,gBAIvB;AAEK,IAAM,iBAAiB,GAAG,UAAC,YAAoB;IACpD,OAAO,uBAAe,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,YAAY,KAAK,YAAY,EAA/B,CAA+B,CAAC,CAAC;AACpE,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B"}
@@ -1,40 +0,0 @@
1
- export type DeviceConfig = {
2
- serialNumber: string;
3
- MerchantId: string;
4
- isSandbox: boolean;
5
- isConfigured: boolean;
6
- };
7
-
8
- export let IDTECH_LOCAL_DB: DeviceConfig[] = [
9
-
10
- ];
11
-
12
- export const addDevice = (device: DeviceConfig) => {
13
- console.log('ADDING Device: ', device);
14
- IDTECH_LOCAL_DB.push(device);
15
- console.log('After Device ADDED : ', IDTECH_LOCAL_DB);
16
- };
17
-
18
- export const updateDevice = (
19
- serialNumber: string,
20
- updated: Partial<DeviceConfig>,
21
- ) => {
22
- const index = IDTECH_LOCAL_DB.findIndex(d => d.serialNumber === serialNumber);
23
-
24
- if (index !== -1) {
25
- IDTECH_LOCAL_DB[index] = {
26
- ...IDTECH_LOCAL_DB[index],
27
- ...updated,
28
- };
29
- }
30
- };
31
-
32
- export const deleteDevice = (serialNumber: string) => {
33
- IDTECH_LOCAL_DB = IDTECH_LOCAL_DB.filter(
34
- d => d.serialNumber !== serialNumber,
35
- );
36
- };
37
-
38
- export const getDeviceBySerial = (serialNumber: string) => {
39
- return IDTECH_LOCAL_DB.find(d => d.serialNumber === serialNumber);
40
- };