@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.
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js +21 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js +17 -1
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +11 -14
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +183 -36
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +44 -21
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/icons/blurQRCode.png +0 -0
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js +6 -2
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js +2 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js +21 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js +14 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +11 -14
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +187 -38
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/module/components/widgets/ProgressDialog.js +1 -1
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +43 -21
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/icons/blurQRCode.png +0 -0
- package/lib/module/ui/screens/CollectPaymentScreen.js +6 -2
- package/lib/module/ui/screens/CollectPaymentScreen.js.map +1 -1
- package/lib/typescript/components/executiontasks/collectPayment/CollectPaymentSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentStyles.d.ts +20 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentUtils.d.ts +1 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +2 -1
- package/package.json +4 -4
- package/src/components/executiontasks/collectPayment/CollectPaymentSchema.ts +2 -0
- package/src/components/executiontasks/collectPayment/PaymentStyles.ts +37 -12
- package/src/components/executiontasks/collectPayment/PaymentUtils.ts +17 -0
- package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +19 -18
- package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +5 -4
- package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +268 -91
- package/src/components/widgets/ProgressDialog.tsx +2 -0
- package/src/components/widgets/SnackBarCustom.tsx +59 -19
- package/src/icons/blurQRCode.png +0 -0
- 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 {
|
|
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>(
|
|
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
|
|
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={
|
|
160
|
-
color=
|
|
176
|
+
size={20}
|
|
177
|
+
color={
|
|
178
|
+
type && type === SnackBarType.PAYMENT_WARNING
|
|
179
|
+
? '#3D445C'
|
|
180
|
+
: 'white'
|
|
181
|
+
}
|
|
161
182
|
onPress={() => {
|
|
162
183
|
setHidden(true);
|
|
163
|
-
|
|
164
|
-
|
|
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:
|
|
213
|
+
borderRadius: 8,
|
|
187
214
|
},
|
|
188
215
|
main: {
|
|
189
|
-
padding:
|
|
216
|
+
padding: 12,
|
|
190
217
|
flexDirection: 'row',
|
|
191
218
|
alignItems: 'center',
|
|
192
219
|
backgroundColor: '#059669',
|
|
193
220
|
flex: 1,
|
|
194
|
-
borderRadius:
|
|
221
|
+
borderRadius: 8,
|
|
195
222
|
},
|
|
196
223
|
fail: {
|
|
197
|
-
padding:
|
|
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:
|
|
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
|
-
|
|
239
|
+
paymentWarn: {
|
|
240
|
+
padding: 16,
|
|
241
|
+
flexDirection: 'row',
|
|
242
|
+
alignItems: 'center',
|
|
243
|
+
backgroundColor: '#FFFBEB',
|
|
211
244
|
flex: 1,
|
|
212
|
-
|
|
213
|
-
|
|
245
|
+
borderRadius: 8,
|
|
246
|
+
},
|
|
247
|
+
messageStyle: {
|
|
248
|
+
fontSize: 14,
|
|
249
|
+
marginStart: 8,
|
|
250
|
+
marginEnd: 8,
|
|
251
|
+
width: '80%',
|
|
214
252
|
color: '#ffffff',
|
|
215
|
-
|
|
253
|
+
flex: 1,
|
|
254
|
+
fontWeight: '400',
|
|
255
|
+
lineHeight: 20,
|
|
216
256
|
fontFamily:
|
|
217
257
|
Platform.OS === 'android'
|
|
218
|
-
? Fonts.
|
|
219
|
-
: '
|
|
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) {
|