@sanctum-key/react-native-sdk 1.0.18 → 1.0.20

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 (48) hide show
  1. package/README.md +1 -1
  2. package/build/package.json +3 -2
  3. package/build/src/components/EnhancedCameraView.d.ts.map +1 -1
  4. package/build/src/components/EnhancedCameraView.js +19 -182
  5. package/build/src/components/EnhancedCameraView.js.map +1 -1
  6. package/build/src/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
  7. package/build/src/components/KYCElements/CountrySelectionTemplate.js +40 -128
  8. package/build/src/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
  9. package/build/src/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  10. package/build/src/components/KYCElements/IDCardCapture.js +224 -189
  11. package/build/src/components/KYCElements/IDCardCapture.js.map +1 -1
  12. package/build/src/components/KYCElements/PhoneVerificationTemplate.d.ts.map +1 -1
  13. package/build/src/components/KYCElements/PhoneVerificationTemplate.js +0 -2
  14. package/build/src/components/KYCElements/PhoneVerificationTemplate.js.map +1 -1
  15. package/build/src/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -1
  16. package/build/src/components/KYCElements/VerificationProgressTemplate.js +38 -33
  17. package/build/src/components/KYCElements/VerificationProgressTemplate.js.map +1 -1
  18. package/build/src/components/OverLay/IdCard.d.ts +6 -1
  19. package/build/src/components/OverLay/IdCard.d.ts.map +1 -1
  20. package/build/src/components/OverLay/IdCard.js +36 -34
  21. package/build/src/components/OverLay/IdCard.js.map +1 -1
  22. package/build/src/config/countriesData.d.ts.map +1 -1
  23. package/build/src/config/countriesData.js.map +1 -1
  24. package/build/src/hooks/useTemplateKYCFlow.js +1 -1
  25. package/build/src/hooks/useTemplateKYCFlow.js.map +1 -1
  26. package/build/src/modules/api/CardAuthentification.d.ts +5 -0
  27. package/build/src/modules/api/CardAuthentification.d.ts.map +1 -1
  28. package/build/src/modules/api/CardAuthentification.js +67 -14
  29. package/build/src/modules/api/CardAuthentification.js.map +1 -1
  30. package/build/src/modules/api/KYCService.d.ts +10 -0
  31. package/build/src/modules/api/KYCService.d.ts.map +1 -1
  32. package/build/src/modules/api/KYCService.js +135 -49
  33. package/build/src/modules/api/KYCService.js.map +1 -1
  34. package/build/src/web/WebKYCEntry.d.ts.map +1 -1
  35. package/build/src/web/WebKYCEntry.js +34 -6
  36. package/build/src/web/WebKYCEntry.js.map +1 -1
  37. package/package.json +3 -2
  38. package/src/components/EnhancedCameraView.tsx +28 -219
  39. package/src/components/KYCElements/CountrySelectionTemplate.tsx +53 -133
  40. package/src/components/KYCElements/IDCardCapture.tsx +606 -570
  41. package/src/components/KYCElements/PhoneVerificationTemplate.tsx +0 -2
  42. package/src/components/KYCElements/VerificationProgressTemplate.tsx +54 -66
  43. package/src/components/OverLay/IdCard.tsx +48 -36
  44. package/src/config/countriesData.ts +0 -4
  45. package/src/hooks/useTemplateKYCFlow.tsx +14 -14
  46. package/src/modules/api/CardAuthentification.ts +133 -67
  47. package/src/modules/api/KYCService.ts +189 -66
  48. package/src/web/WebKYCEntry.tsx +42 -7
@@ -59,14 +59,12 @@ export const PhoneVerificationTemplate: React.FC<PhoneVerificationTemplateProps>
59
59
  const sendButtonText = t('common.sendCode') || 'Send Verification Code';
60
60
  const buttonText = step === 'phone' ? sendButtonText : verifyButtonText;
61
61
 
62
- // --- AUTO SUBMIT LOGIC ---
63
62
  useEffect(() => {
64
63
  if (otp.length === CODE_LENGTH && step === 'otp' && !isSimulating) {
65
64
  handleVerifyCode();
66
65
  }
67
66
  }, [otp]);
68
67
 
69
- // --- SAFE AUTO FOCUS LOGIC ---
70
68
  useEffect(() => {
71
69
  let focusTimer: ReturnType<typeof setTimeout>;
72
70
  if (step === 'otp' && !isSimulating) {
@@ -22,7 +22,6 @@ export const VerificationProgressTemplate: React.FC<VerificationProgressTemplate
22
22
  const [timeoutId, setTimeoutId] = useState<number | null>(null);
23
23
 
24
24
  const verification = state.verification;
25
-
26
25
  const isSuccess = verification.status === 'success';
27
26
  const isFailed = verification.status === 'failed';
28
27
 
@@ -30,38 +29,47 @@ export const VerificationProgressTemplate: React.FC<VerificationProgressTemplate
30
29
  const getVerificationResult = async (currentRetryCount = 0, maxRetries = 40) => {
31
30
  try {
32
31
  logger.log(`Starting verification check (attempt ${currentRetryCount + 1}/${maxRetries + 1})`);
32
+ const result: any = await kycService.getVerificationResult(state.session.session_id);
33
+
34
+ logger.log('getVerificationResult raw result:', JSON.stringify(result, null, 2));
35
+
36
+ if (result?.status === 'Failed.' || result?.status === 'failed' || result?.status === 'rejected') {
37
+ actions.setVerificationState({
38
+ status: 'failed',
39
+ result: {
40
+ referenceId: state.session.session_id,
41
+ issues: [result?.message || 'Verification failed. Sent for manual review.']
42
+ } as any
43
+ });
44
+ setIsRetrying(false);
45
+ return; // Break out of the function so it DOES NOT RETRY
46
+ }
33
47
 
34
- const result = await kycService.getVerificationResult(state.session.session_id);
35
- const responseData = (result as any)?.data;
48
+ // Check standard nested payload format
49
+ const responseData = result?.data;
36
50
  const verificationResult = responseData?.[state.session.session_id]?.data;
37
51
 
38
52
  if (!verificationResult) {
53
+ // If we still didn't get data and the status wasn't failed, throw to trigger a retry
39
54
  throw new Error('Verification payload missing for current session');
40
55
  }
41
56
 
42
- logger.log('getVerificationResult result', JSON.stringify({result,verificationResult}, null, 2));
43
-
44
57
  // Vérifier le statut de vérification
45
58
  if (verificationResult.verification_status === null || verificationResult.verification_status === "processing" || verificationResult.verification_status === "pending") {
46
59
  if (currentRetryCount < maxRetries) {
47
60
  const nextRetryCount = currentRetryCount + 1;
48
61
  setRetryCount(nextRetryCount);
49
62
  setIsRetrying(true);
50
-
51
63
  logger.log(`Verification still processing, retrying in 10s... (${nextRetryCount}/${maxRetries})`);
52
-
53
- // Nettoyer le timeout précédent s'il existe
54
- if (timeoutId) {
55
- clearTimeout(timeoutId);
56
- }
57
-
58
- // Attendre 10 secondes avant de relancer
64
+
65
+ if (timeoutId) clearTimeout(timeoutId);
66
+
59
67
  const newTimeoutId = setTimeout(() => {
60
68
  getVerificationResult(nextRetryCount, maxRetries);
61
69
  }, 10000);
62
-
63
- setTimeoutId(newTimeoutId);
64
- return; // Sortir de la fonction pour éviter de traiter le résultat
70
+
71
+ setTimeoutId(newTimeoutId as any);
72
+ return;
65
73
  } else {
66
74
  logger.error('Max retries reached, verification still processing');
67
75
  setIsRetrying(false);
@@ -70,51 +78,39 @@ export const VerificationProgressTemplate: React.FC<VerificationProgressTemplate
70
78
  }
71
79
 
72
80
  // Traiter le résultat final (success, failed, etc.)
73
- if (verificationResult.verification_status === "completed" ||
74
- verificationResult.verification_status === "approved") {
75
- // Mettre à jour l'état avec le succès
81
+ if (verificationResult.verification_status === "completed" || verificationResult.verification_status === "approved") {
76
82
  actions.setVerificationState({
77
83
  status: 'success',
78
84
  result: result
79
85
  });
80
- } else if (verificationResult.verification_status === "failed" ||
81
- verificationResult.verification_status === "rejected") {
82
- // Mettre à jour l'état avec l'échec
86
+ } else if (verificationResult.verification_status === "failed" || verificationResult.verification_status === "rejected") {
83
87
  actions.setVerificationState({
84
88
  status: 'failed',
85
89
  result: {
86
- referenceId: verificationResult.verification_id,
87
- issues: ['Verification failed']
90
+ referenceId: verificationResult.verification_id || state.session.session_id,
91
+ issues: ['Verification failed during processing.']
88
92
  } as any
89
93
  });
90
94
  }
91
-
95
+
92
96
  setIsRetrying(false);
93
97
 
94
98
  } catch (error: any) {
95
- logger.error(
96
- 'getVerificationResult error',
97
- JSON.stringify(errorMessage(error) || { message: error?.message || 'Unknown error' }, null, 2)
98
- );
99
-
100
- // En cas d'erreur, on peut aussi retry
99
+ logger.error('getVerificationResult error', JSON.stringify(errorMessage(error) || { message: error?.message || 'Unknown error' }, null, 2));
100
+
101
101
  if (currentRetryCount < maxRetries) {
102
102
  const nextRetryCount = currentRetryCount + 1;
103
103
  setRetryCount(nextRetryCount);
104
104
  setIsRetrying(true);
105
-
106
105
  logger.log(`getVerificationResult Error occurred, retrying in 10s... (${nextRetryCount}/${maxRetries})`);
107
-
108
- // Nettoyer le timeout précédent s'il existe
109
- if (timeoutId) {
110
- clearTimeout(timeoutId);
111
- }
112
-
106
+
107
+ if (timeoutId) clearTimeout(timeoutId);
108
+
113
109
  const newTimeoutId = setTimeout(() => {
114
110
  getVerificationResult(nextRetryCount, maxRetries);
115
111
  }, 10000);
116
-
117
- setTimeoutId(newTimeoutId);
112
+
113
+ setTimeoutId(newTimeoutId as any);
118
114
  } else {
119
115
  setIsRetrying(false);
120
116
  logger.error('Max retries reached after errors');
@@ -128,12 +124,9 @@ export const VerificationProgressTemplate: React.FC<VerificationProgressTemplate
128
124
  }
129
125
  }, [state.session.session_id]);
130
126
 
131
- // Nettoyage des timeouts lors du démontage du composant
132
127
  useEffect(() => {
133
128
  return () => {
134
- if (timeoutId) {
135
- clearTimeout(timeoutId);
136
- }
129
+ if (timeoutId) clearTimeout(timeoutId);
137
130
  };
138
131
  }, [timeoutId]);
139
132
 
@@ -156,19 +149,27 @@ export const VerificationProgressTemplate: React.FC<VerificationProgressTemplate
156
149
  return (
157
150
  <View style={styles.container}>
158
151
  <Text style={styles.title}>{t('kyc.verificationProgress.status.failed')}</Text>
159
- <Text style={styles.subtitle}>{t('errors.validationError')}</Text>
152
+
160
153
  <View style={styles.issuesBox}>
161
154
  <Text style={styles.issuesTitle}>{t('common.error')}</Text>
162
155
  {Array.isArray(verification.result?.issues) && verification.result.issues.map((issue: string, idx: number) => (
163
156
  <Text key={idx} style={styles.issueItem}>• {issue}</Text>
164
157
  ))}
165
158
  </View>
166
- <TouchableOpacity style={[styles.button, styles.primary]} onPress={() => actions.resetTemplate()}>
167
- <Text style={styles.buttonText}>{t('kyc.verificationProgress.status.retry')}</Text>
159
+
160
+ {/* 🚨 FIX 2: Give the user actionable options to End or Restart */}
161
+ <TouchableOpacity style={[styles.button, styles.primary]} onPress={() => actions.submitVerification()}>
162
+ <Text style={styles.buttonText}>
163
+ {state.currentLanguage === 'en' ? 'OK / Finish' : 'Terminer'}
164
+ </Text>
168
165
  </TouchableOpacity>
169
- <TouchableOpacity style={[styles.button, styles.secondary]}>
170
- <Text style={styles.secondaryText}>{t('common.info')}</Text>
166
+
167
+ <TouchableOpacity style={[styles.button, styles.secondary]} onPress={() => actions.resetTemplate()}>
168
+ <Text style={styles.secondaryText}>
169
+ {state.currentLanguage === 'en' ? 'Start Over' : 'Recommencer'}
170
+ </Text>
171
171
  </TouchableOpacity>
172
+
172
173
  {verification.result?.referenceId ? (
173
174
  <Text style={styles.refText}>{`Reference ID: ${verification.result.referenceId}`}</Text>
174
175
  ) : null}
@@ -176,12 +177,6 @@ export const VerificationProgressTemplate: React.FC<VerificationProgressTemplate
176
177
  );
177
178
  }
178
179
 
179
-
180
-
181
-
182
-
183
-
184
-
185
180
  return (
186
181
  <View style={styles.container}>
187
182
  <Text style={styles.title}>{t('kyc.verificationProgress.title')}</Text>
@@ -191,7 +186,6 @@ export const VerificationProgressTemplate: React.FC<VerificationProgressTemplate
191
186
  : t('kyc.verificationProgress.estimatedTime')
192
187
  }
193
188
  </Text>
194
-
195
189
  <View style={styles.timeline}>
196
190
  <View style={[styles.dot, styles.done]}><Text style={styles.stepCheckmark}>✓</Text></View>
197
191
  <View style={styles.line} />
@@ -199,13 +193,11 @@ export const VerificationProgressTemplate: React.FC<VerificationProgressTemplate
199
193
  <View style={styles.line} />
200
194
  <View style={[styles.dot, styles.pending]}><Text style={styles.stepCheckmark}>3</Text></View>
201
195
  </View>
202
-
203
196
  <View style={styles.row}>
204
197
  <Text style={styles.stepLabel}>{t('kyc.verificationProgress.status.completed')}</Text>
205
198
  <Text style={styles.stepLabel}>{t('kyc.verificationProgress.steps.analyzing')}</Text>
206
199
  <Text style={styles.stepLabel}>{t('kyc.verificationProgress.steps.verifying')}</Text>
207
200
  </View>
208
-
209
201
  <View style={styles.card}>
210
202
  <Text style={styles.cardTitle}>{t('kyc.idCardCapture.title')}</Text>
211
203
  <Text style={styles.cardLine}>{t('kyc.verificationProgress.steps.extracting')}</Text>
@@ -239,17 +231,13 @@ const styles = StyleSheet.create({
239
231
  card: { backgroundColor: 'white', padding: 16, borderRadius: 16, marginTop: 24 },
240
232
  cardTitle: { fontSize: 16, color: '#6B7280', marginTop: 8 },
241
233
  cardLine: { fontSize: 18, color: '#111827', fontWeight: '600', marginTop: 2 },
242
- // Success/Failure specific
243
- button: { paddingVertical: 14, borderRadius: 10, alignItems: 'center', marginTop: 20 },
234
+ button: { paddingVertical: 14, borderRadius: 10, alignItems: 'center', marginTop: 14 },
244
235
  primary: { backgroundColor: '#2DBD60' },
245
236
  buttonText: { color: 'white', fontSize: 16, fontWeight: '600' },
246
237
  refText: { marginTop: 12, textAlign: 'center', color: '#6B7280' },
247
238
  issuesBox: { backgroundColor: '#FEF2F2', borderRadius: 16, padding: 16, marginTop: 20 },
248
239
  issuesTitle: { color: '#991B1B', fontWeight: '700', marginBottom: 8 },
249
240
  issueItem: { color: '#991B1B', marginTop: 4 },
250
- secondary: { backgroundColor: '#F3F4F6' },
251
- secondaryText: { color: '#111827', fontSize: 16, fontWeight: '600' },
252
- });
253
-
254
-
255
-
241
+ secondary: { backgroundColor: '#F3F4F6', borderWidth: 1, borderColor: '#D1D5DB' },
242
+ secondaryText: { color: '#374151', fontSize: 16, fontWeight: '600' },
243
+ });
@@ -1,13 +1,13 @@
1
- import React from 'react';
1
+ import React, { useState } from 'react';
2
2
  import {
3
3
  Animated,
4
- Dimensions,
5
4
  Platform,
6
5
  SafeAreaView,
7
6
  StatusBar,
8
7
  StyleSheet,
9
8
  Text,
10
9
  View,
10
+ useWindowDimensions,
11
11
  } from 'react-native';
12
12
  import Svg, {
13
13
  Defs,
@@ -22,44 +22,41 @@ import ScanningLine from '../Svgs/scanningLine';
22
22
  import StepOverlay from './StepOverlay';
23
23
  import { IdCardOverlayProps } from './type';
24
24
 
25
- const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
26
-
27
25
  const IdCardOverlay = ({
28
26
  cornerOpacity,
29
27
  instructions,
30
28
  stepperProps,
31
29
  isSuccess,
32
30
  language = 'en',
33
- // Note: xMinPercent, yMinPercent, etc. are intentionally ignored below
34
- // to force a mathematically perfect ID card aspect ratio.
35
- }: IdCardOverlayProps) => {
31
+ xMin: xMinPercent = 5,
32
+ xMax: xMaxPercent = 95,
33
+ yMin: yMinPercent = 34,
34
+ yMax: yMaxPercent = 66,
35
+ }: IdCardOverlayProps & { xMin?: number, xMax?: number, yMin?: number, yMax?: number }) => {
36
36
  const AnimatedG = Animated.createAnimatedComponent(G);
37
-
38
- // --- 🚨 GEOMETRY FIX: Perfect ID Card Ratio ---
39
- // Standard ISO ID-1 ratio is 1.586 (85.6mm / 53.98mm)
40
- const ID_ASPECT_RATIO = 1.586;
41
37
 
42
- // Set width to 85% of the screen, and calculate perfect height
43
- const boxWidth = screenWidth * 0.85;
44
- const boxHeight = boxWidth / ID_ASPECT_RATIO;
38
+ // 1. Get baseline window dimensions (fallback for Native mobile)
39
+ const { width: windowWidth, height: windowHeight } = useWindowDimensions();
40
+
41
+ // 2. Track actual container dimensions (Crucial for Web Modals where window != container)
42
+ const [container, setContainer] = useState({ width: windowWidth, height: windowHeight });
45
43
 
46
- // Center horizontally
47
- const xMin = (screenWidth - boxWidth) / 2;
48
- const xMax = xMin + boxWidth;
44
+ // 3. Convert parent percentages to exact pixels within the container
45
+ const xMin = (container.width * xMinPercent) / 100;
46
+ const xMax = (container.width * xMaxPercent) / 100;
47
+ const yMin = (container.height * yMinPercent) / 100;
48
+ const yMax = (container.height * yMaxPercent) / 100;
49
49
 
50
- // Center vertically (shifted slightly up for better holding ergonomics)
51
- const yMin = (screenHeight - boxHeight) * 0.42;
52
- const yMax = yMin + boxHeight;
50
+ const boxWidth = xMax - xMin;
51
+ const boxHeight = yMax - yMin;
53
52
 
54
53
  // --- Clean, Professional Copy Formatting ---
55
54
  const formatDocType = (type?: string) => {
56
55
  if (!type) return 'document';
57
- // e.g., "identity_card" -> "identity card"
58
56
  return type.replace(/_/g, ' ').toLowerCase();
59
57
  };
60
58
 
61
59
  const getSideText = (side?: string) => {
62
- // Using "recto/verso" for French as it is much more professional for documents
63
60
  if (side === 'front') return language === 'en' ? 'front' : 'recto';
64
61
  return language === 'en' ? 'back' : 'verso';
65
62
  };
@@ -80,19 +77,34 @@ const IdCardOverlay = ({
80
77
  : 'Pas de reflets • Coins visibles • Maintenez stable';
81
78
 
82
79
  // --- SVG Constants ---
83
- const CORNER_SIZE = 40;
80
+ const CORNER_SIZE = 40;
84
81
  const STROKE_WIDTH = 4;
85
- const BORDER_RADIUS = 16; // Reduced slightly for a tighter, more realistic card feel
82
+ const BORDER_RADIUS = 16;
83
+
84
+ // Safety check to prevent SVG NaN errors during initial render
85
+ if (container.width === 0 || container.height === 0 || boxWidth <= 0) {
86
+ return <View style={StyleSheet.absoluteFill} />;
87
+ }
86
88
 
87
89
  return (
88
- <View style={StyleSheet.absoluteFill} pointerEvents="box-none">
90
+ <View
91
+ style={StyleSheet.absoluteFill}
92
+ pointerEvents="box-none"
93
+ onLayout={(e) => {
94
+ // Update container dimensions only if they change to prevent loops
95
+ const { width, height } = e.nativeEvent.layout;
96
+ if (width !== container.width || height !== container.height) {
97
+ setContainer({ width, height });
98
+ }
99
+ }}
100
+ >
89
101
  <StatusBar translucent backgroundColor="transparent" barStyle="light-content" />
90
-
102
+
91
103
  {/* SVG Overlay */}
92
- <Svg width={screenWidth} height={screenHeight} style={styles.svg}>
104
+ <Svg width={container.width} height={container.height} style={styles.svg}>
93
105
  <Defs>
94
106
  <Mask id="cameraMask">
95
- <Rect x="0" y="0" width={screenWidth} height={screenHeight} fill="white" />
107
+ <Rect x="0" y="0" width={container.width} height={container.height} fill="white" />
96
108
  {/* Transparent Cutout */}
97
109
  <Rect
98
110
  x={xMin}
@@ -109,10 +121,10 @@ const IdCardOverlay = ({
109
121
  <Stop offset="100%" stopColor="#22C55E" />
110
122
  </LinearGradient>
111
123
  </Defs>
112
-
124
+
113
125
  {/* Dim background */}
114
- <Rect x="0" y="0" width={screenWidth} height={screenHeight} fill="rgba(0,0,0,0.85)" mask="url(#cameraMask)" />
115
-
126
+ <Rect x="0" y="0" width={container.width} height={container.height} fill="rgba(0,0,0,0.85)" mask="url(#cameraMask)" />
127
+
116
128
  {/* Main Card Border */}
117
129
  <Rect
118
130
  x={xMin}
@@ -121,11 +133,11 @@ const IdCardOverlay = ({
121
133
  height={boxHeight}
122
134
  rx={BORDER_RADIUS}
123
135
  ry={BORDER_RADIUS}
124
- stroke="rgba(255,255,255,0.25)" // Subtle inner frame
125
- strokeWidth={1.5}
136
+ stroke={isSuccess ? '#2DBD60' : "rgba(255,255,255,0.25)"}
137
+ strokeWidth={isSuccess ? 3 : 1.5}
126
138
  fill="transparent"
127
139
  />
128
-
140
+
129
141
  {/* Professional Corner Guides */}
130
142
  <AnimatedG opacity={cornerOpacity || 1}>
131
143
  {/* Top Left */}
@@ -165,7 +177,7 @@ const IdCardOverlay = ({
165
177
 
166
178
  {/* Scanning animation */}
167
179
  {!isSuccess && (
168
- <ScanningLine yMin={yMin} yMax={yMax} screenWidth={screenWidth} height={screenHeight} />
180
+ <ScanningLine yMin={yMin} yMax={yMax} screenWidth={container.width} height={container.height} />
169
181
  )}
170
182
 
171
183
  {/* Top UI Zone */}
@@ -187,7 +199,7 @@ const IdCardOverlay = ({
187
199
  </View>
188
200
 
189
201
  {/* Bottom UI Zone */}
190
- <View style={[styles.bottomZone, { top: yMax + 30 }]} pointerEvents="box-none">
202
+ <View style={[styles.bottomZone, { top: yMax + 20 }]} pointerEvents="box-none">
191
203
  <Text style={styles.bottomTitle}>{bottomTitle}</Text>
192
204
  <Text style={styles.bottomSubtitle}>{bottomSubtitle}</Text>
193
205
  <View style={styles.helperPill}>
@@ -1,9 +1,5 @@
1
1
  import { Country } from "../types/KYC.types";
2
2
 
3
-
4
-
5
-
6
-
7
3
  export const countryData: Record<string, Country> = {
8
4
  FR: { name: 'France', name_en: "France", flag: '🇫🇷' },
9
5
  CM: { name: 'Cameroun', name_en: "Cameroon", flag: '🇨🇲' },
@@ -698,21 +698,21 @@ export const useTemplateKYCFlow = (
698
698
  const templateId = chooseTemplateId(templateWithReviewAndVerification);
699
699
 
700
700
  // This is the API call that we know succeeds
701
- await kycService.verificationSession({
702
- session_id: resolvedSessionId,
703
- step: 0,
704
- data: {
705
- template_id: templateId,
706
- metadata: {
707
- language: initialLanguage,
708
- ...(referenceId ? { reference_id: referenceId } : {}),
709
- },
701
+ await kycService.verificationSession({
702
+ session_id: resolvedSessionId,
703
+ step: 0,
704
+ data: {
705
+ template_id: templateId,
706
+ ...(referenceId ? { reference_id: referenceId } : {}),
707
+ metadata: {
708
+ language: initialLanguage,
710
709
  },
711
- templateId: templateId,
712
- token: token ?? "",
713
- action: 'initialize_session',
714
- apiKey: apiKey,
715
- });
710
+ },
711
+ templateId: templateId,
712
+ token: token ?? "",
713
+ action: 'initialize_session',
714
+ apiKey: apiKey,
715
+ });
716
716
 
717
717
 
718
718
  setState(prev => ({