@os1-platform/dispatch-mobile 2.1.24 → 2.1.26

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 (51) hide show
  1. package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js +1 -0
  2. package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -1
  3. package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js +21 -0
  4. package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -1
  5. package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js +17 -1
  6. package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -1
  7. package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +11 -14
  8. package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
  9. package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
  10. package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +183 -36
  11. package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
  12. package/lib/commonjs/components/widgets/ProgressDialog.js +1 -1
  13. package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
  14. package/lib/commonjs/components/widgets/SnackBarCustom.js +44 -21
  15. package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
  16. package/lib/commonjs/icons/blurQRCode.png +0 -0
  17. package/lib/commonjs/ui/screens/CollectPaymentScreen.js +6 -2
  18. package/lib/commonjs/ui/screens/CollectPaymentScreen.js.map +1 -1
  19. package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js +2 -0
  20. package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -1
  21. package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js +21 -0
  22. package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -1
  23. package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js +14 -0
  24. package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -1
  25. package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +11 -14
  26. package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
  27. package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
  28. package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +187 -38
  29. package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
  30. package/lib/module/components/widgets/ProgressDialog.js +1 -1
  31. package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
  32. package/lib/module/components/widgets/SnackBarCustom.js +43 -21
  33. package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
  34. package/lib/module/icons/blurQRCode.png +0 -0
  35. package/lib/module/ui/screens/CollectPaymentScreen.js +6 -2
  36. package/lib/module/ui/screens/CollectPaymentScreen.js.map +1 -1
  37. package/lib/typescript/components/executiontasks/collectPayment/CollectPaymentSchema.d.ts +1 -0
  38. package/lib/typescript/components/executiontasks/collectPayment/PaymentStyles.d.ts +20 -0
  39. package/lib/typescript/components/executiontasks/collectPayment/PaymentUtils.d.ts +1 -0
  40. package/lib/typescript/components/widgets/SnackBarCustom.d.ts +2 -1
  41. package/package.json +4 -4
  42. package/src/components/executiontasks/collectPayment/CollectPaymentSchema.ts +2 -0
  43. package/src/components/executiontasks/collectPayment/PaymentStyles.ts +37 -12
  44. package/src/components/executiontasks/collectPayment/PaymentUtils.ts +17 -0
  45. package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +19 -18
  46. package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +5 -4
  47. package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +268 -91
  48. package/src/components/widgets/ProgressDialog.tsx +2 -0
  49. package/src/components/widgets/SnackBarCustom.tsx +59 -19
  50. package/src/icons/blurQRCode.png +0 -0
  51. package/src/ui/screens/CollectPaymentScreen.tsx +6 -3
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1
2
  import React from 'react';
2
3
  import {
3
4
  Animated,
@@ -12,7 +13,11 @@ import {
12
13
  import { Surface, withTheme } from 'react-native-paper';
13
14
  import { AntDesign } from '@expo/vector-icons';
14
15
  import { Fonts } from '../../styles/executionTasks/CommonStyles';
15
- import { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../analytics/sentry/SentrySdkConstants';
16
+ import {
17
+ ScreenNameSdkConstants,
18
+ SentryEventNameSdkConstants,
19
+ SeverityLevelValue,
20
+ } from '../../analytics/sentry/SentrySdkConstants';
16
21
  import { fireEventWithScreenName } from '../../analytics/sentry/SentryAnalyticsUtils';
17
22
 
18
23
  export interface SnackbarProps {
@@ -37,6 +42,7 @@ export enum SnackBarType {
37
42
  SUCCESS,
38
43
  FAILURE,
39
44
  WARNING,
45
+ PAYMENT_WARNING,
40
46
  }
41
47
 
42
48
  const SnackbarCustom = ({
@@ -52,7 +58,7 @@ const SnackbarCustom = ({
52
58
  const { current: opacity } = React.useRef<Animated.Value>(
53
59
  new Animated.Value(0.0)
54
60
  );
55
- const [hidden, setHidden] = React.useState<boolean>(!visible);
61
+ const [hidden, setHidden] = React.useState<boolean>(true);
56
62
 
57
63
  const hideTimeout = React.useRef<NodeJS.Timeout | undefined>(undefined);
58
64
  const { scale } = theme.animation;
@@ -135,7 +141,7 @@ const SnackbarCustom = ({
135
141
  },
136
142
  ],
137
143
  },
138
- { backgroundColor: colors.onSurface },
144
+ // { backgroundColor: colors.onSurface },
139
145
  ] as StyleProp<ViewStyle>
140
146
  }
141
147
  >
@@ -145,23 +151,44 @@ const SnackbarCustom = ({
145
151
  ? styles.fail
146
152
  : type && type === SnackBarType.WARNING
147
153
  ? styles.warn
154
+ : type && type === SnackBarType.PAYMENT_WARNING
155
+ ? styles.paymentWarn
148
156
  : styles.main
149
157
  }
150
158
  >
151
159
  {type && type === SnackBarType.FAILURE ? (
152
160
  <AntDesign name="exclamationcircleo" size={20} color="white" />
161
+ ) : type && type === SnackBarType.PAYMENT_WARNING ? (
162
+ <AntDesign name="infocirlceo" size={20} color="#D97706" />
153
163
  ) : (
154
164
  <AntDesign name="checkcircleo" size={20} color="white" />
155
165
  )}
156
- <Text style={styles.messageStyle}>{message}</Text>
166
+ <Text
167
+ style={[
168
+ styles.messageStyle,
169
+ type === SnackBarType.PAYMENT_WARNING && { color: '#B45309' },
170
+ ]}
171
+ >
172
+ {message}
173
+ </Text>
157
174
  <AntDesign
158
175
  name="close"
159
- size={16}
160
- color="white"
176
+ size={20}
177
+ color={
178
+ type && type === SnackBarType.PAYMENT_WARNING
179
+ ? '#3D445C'
180
+ : 'white'
181
+ }
161
182
  onPress={() => {
162
183
  setHidden(true);
163
- const cta = "Close";
164
- fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.SCAN_BAR_CUSTOM_SCREEN, cta: cta });
184
+ onDismiss();
185
+ const cta = 'Close';
186
+ fireEventWithScreenName({
187
+ severityLevel: SeverityLevelValue.LOG,
188
+ eventName: SentryEventNameSdkConstants.BUTTON_CLICKED,
189
+ screenName: ScreenNameSdkConstants.SCAN_BAR_CUSTOM_SCREEN,
190
+ cta: cta,
191
+ });
165
192
  }}
166
193
  />
167
194
  </View>
@@ -183,40 +210,53 @@ const styles = StyleSheet.create({
183
210
  justifyContent: 'space-between',
184
211
  alignItems: 'center',
185
212
  margin: 8,
186
- borderRadius: 4,
213
+ borderRadius: 8,
187
214
  },
188
215
  main: {
189
- padding: 16,
216
+ padding: 12,
190
217
  flexDirection: 'row',
191
218
  alignItems: 'center',
192
219
  backgroundColor: '#059669',
193
220
  flex: 1,
194
- borderRadius: 4,
221
+ borderRadius: 8,
195
222
  },
196
223
  fail: {
197
- padding: 16,
224
+ padding: 12,
198
225
  flexDirection: 'row',
199
226
  alignItems: 'center',
200
227
  backgroundColor: '#DC2626',
201
228
  flex: 1,
229
+ borderRadius: 8,
202
230
  },
203
231
  warn: {
204
- padding: 16,
232
+ padding: 12,
205
233
  flexDirection: 'row',
206
234
  alignItems: 'center',
207
235
  backgroundColor: '#D97706',
208
236
  flex: 1,
237
+ borderRadius: 8,
209
238
  },
210
- messageStyle: {
239
+ paymentWarn: {
240
+ padding: 16,
241
+ flexDirection: 'row',
242
+ alignItems: 'center',
243
+ backgroundColor: '#FFFBEB',
211
244
  flex: 1,
212
- marginStart: 20,
213
- marginEnd: 20,
245
+ borderRadius: 8,
246
+ },
247
+ messageStyle: {
248
+ fontSize: 14,
249
+ marginStart: 8,
250
+ marginEnd: 8,
251
+ width: '80%',
214
252
  color: '#ffffff',
215
- fontWeight: '600',
253
+ flex: 1,
254
+ fontWeight: '400',
255
+ lineHeight: 20,
216
256
  fontFamily:
217
257
  Platform.OS === 'android'
218
- ? Fonts.IBMPlexSans_600SemiBold
219
- : 'IBMPlexSans-SemiBold',
258
+ ? Fonts.IBMPlexSans_400Regular
259
+ : 'IBMPlexSans_400Regular',
220
260
  },
221
261
  });
222
262
 
Binary file
@@ -79,7 +79,6 @@ const CollectPaymentScreen = ({
79
79
  );
80
80
 
81
81
  useEffect(() => {
82
-
83
82
  if (
84
83
  taskId === ExecutionTaskID.COLLECT_PAYMENT_ET &&
85
84
  (!isMandatoryKeysPresent(route.params[RouteParams.ROOT_META_DATA], [
@@ -149,6 +148,10 @@ const CollectPaymentScreen = ({
149
148
  ...modifiedInput.allowedModes,
150
149
  ...updatedInput.allowedModes,
151
150
  ];
151
+ const index = updatedInput.allowedModes.indexOf('ONLINE');
152
+ if (index > -1) {
153
+ updatedInput.allowedModes.splice(index, 1);
154
+ }
152
155
  }
153
156
  if (!updatedInput.allowedModes?.length) {
154
157
  navigateWithError(
@@ -191,10 +194,10 @@ const CollectPaymentScreen = ({
191
194
  // };
192
195
 
193
196
  const configData = paymentResp?.data?.data?.configDetails[0];
194
- if (configData?.paymentMethods?.QR) {
197
+ if (configData?.paymentMethods?.QR === true) {
195
198
  response.methods.push('QR_CODE');
196
199
  }
197
- if (configData?.paymentMethods?.paymentLink) {
200
+ if (configData?.paymentMethods?.paymentLink === true) {
198
201
  response.methods.push('PAYMENT_LINK');
199
202
  }
200
203
  if (configData?.modesMapping) {