omnipay-reactnative-sdk 1.2.3-beta.9 → 1.2.4
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/README.md +14 -64
- package/android/build.gradle +4 -15
- package/android/src/main/java/com/omniretail/omnipay/OmnipayActivityPackage.java +0 -5
- package/lib/commonjs/components/OmnipayProvider.js +98 -20
- package/lib/commonjs/components/OmnipayProvider.js.map +1 -1
- package/lib/commonjs/utils/buildUrlWithMetadata.js +14 -0
- package/lib/commonjs/utils/buildUrlWithMetadata.js.map +1 -0
- package/lib/module/components/OmnipayProvider.js +99 -21
- package/lib/module/components/OmnipayProvider.js.map +1 -1
- package/lib/module/components/OmnipayView.js.map +1 -1
- package/lib/module/components/views/BvnVerification.js.map +1 -1
- package/lib/module/components/views/PaylaterAgreement.js.map +1 -1
- package/lib/module/components/views/Registration.js.map +1 -1
- package/lib/module/utils/buildUrlWithMetadata.js +8 -0
- package/lib/module/utils/buildUrlWithMetadata.js.map +1 -0
- package/lib/typescript/components/OmnipayProvider.d.ts +5 -2
- package/lib/typescript/components/OmnipayProvider.d.ts.map +1 -1
- package/lib/typescript/hooks/useOmnipay.d.ts +4 -1
- package/lib/typescript/hooks/useOmnipay.d.ts.map +1 -1
- package/lib/typescript/utils/buildUrlWithMetadata.d.ts +2 -0
- package/lib/typescript/utils/buildUrlWithMetadata.d.ts.map +1 -0
- package/package.json +12 -29
- package/src/components/OmnipayProvider.tsx +154 -31
- package/src/components/OmnipayView.tsx +1 -1
- package/src/components/views/BvnVerification.tsx +1 -1
- package/src/components/views/PaylaterAgreement.tsx +1 -1
- package/src/components/views/Registration.tsx +1 -1
- package/src/hooks/useOmnipay.tsx +1 -1
- package/src/utils/buildUrlWithMetadata.ts +21 -0
- package/android/src/main/java/com/omniretail/omnipay/FaceVerificationFrameProcessor.kt +0 -111
- package/ios/FaceVerificationFrameProcessor.swift +0 -138
- package/ios/FaceVerificationFrameProcessorPlugin.m +0 -4
- package/ios/OmnipayReactnativeSdk.m +0 -5
- package/ios/OmnipayReactnativeSdk.swift +0 -10
- package/ios/omnipay-reactnative-sdk-Bridging-Header.h +0 -8
- package/ios/omnipay_reactnative_sdk.h +0 -6
- package/lib/commonjs/components/Button.js +0 -68
- package/lib/commonjs/components/Button.js.map +0 -1
- package/lib/commonjs/components/biometrics/FaceVerification.js +0 -380
- package/lib/commonjs/components/biometrics/FaceVerification.js.map +0 -1
- package/lib/commonjs/components/biometrics/useFaceVerification.js +0 -85
- package/lib/commonjs/components/biometrics/useFaceVerification.js.map +0 -1
- package/lib/commonjs/components/biometrics/useFaceVerificationFlow.js +0 -157
- package/lib/commonjs/components/biometrics/useFaceVerificationFlow.js.map +0 -1
- package/lib/module/components/Button.js +0 -61
- package/lib/module/components/Button.js.map +0 -1
- package/lib/module/components/biometrics/FaceVerification.js +0 -372
- package/lib/module/components/biometrics/FaceVerification.js.map +0 -1
- package/lib/module/components/biometrics/useFaceVerification.js +0 -78
- package/lib/module/components/biometrics/useFaceVerification.js.map +0 -1
- package/lib/module/components/biometrics/useFaceVerificationFlow.js +0 -150
- package/lib/module/components/biometrics/useFaceVerificationFlow.js.map +0 -1
- package/lib/typescript/components/Button.d.ts +0 -17
- package/lib/typescript/components/Button.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/FaceVerification.d.ts +0 -9
- package/lib/typescript/components/biometrics/FaceVerification.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/useFaceVerification.d.ts +0 -38
- package/lib/typescript/components/biometrics/useFaceVerification.d.ts.map +0 -1
- package/lib/typescript/components/biometrics/useFaceVerificationFlow.d.ts +0 -29
- package/lib/typescript/components/biometrics/useFaceVerificationFlow.d.ts.map +0 -1
- package/omnipay_reactnative_sdk.podspec +0 -52
- package/src/components/Button.tsx +0 -86
- package/src/components/biometrics/FaceVerification.tsx +0 -429
- package/src/components/biometrics/useFaceVerification.ts +0 -120
- package/src/components/biometrics/useFaceVerificationFlow.ts +0 -224
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { useFrameProcessor, VisionCameraProxy } from 'react-native-vision-camera';
|
|
2
|
-
// Note: For production use, you would typically use shared values or state management
|
|
3
|
-
// to communicate results from the worklet back to the React component.
|
|
4
|
-
// This simplified version just logs results for debugging.
|
|
5
|
-
|
|
6
|
-
// Initialize the plugin
|
|
7
|
-
const plugin = VisionCameraProxy.initFrameProcessorPlugin('detectFaces', {});
|
|
8
|
-
export const useFaceVerification = () => {
|
|
9
|
-
const frameProcessor = useFrameProcessor(frame => {
|
|
10
|
-
'worklet';
|
|
11
|
-
|
|
12
|
-
try {
|
|
13
|
-
if (plugin == null) {
|
|
14
|
-
console.error('Failed to load Frame Processor Plugin "detectFaces"!');
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
const result = plugin.call(frame, {});
|
|
18
|
-
|
|
19
|
-
// For debugging - this works in worklets
|
|
20
|
-
if (result && result.faceDetected) {
|
|
21
|
-
console.log('Face detected:', result);
|
|
22
|
-
}
|
|
23
|
-
return result;
|
|
24
|
-
} catch (error) {
|
|
25
|
-
console.error('Face verification error:', error);
|
|
26
|
-
return {
|
|
27
|
-
faceDetected: false,
|
|
28
|
-
error: error instanceof Error ? error.message : 'Unknown error'
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}, []);
|
|
32
|
-
return frameProcessor;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// Utility functions for interpreting results
|
|
36
|
-
export const FaceVerificationUtils = {
|
|
37
|
-
// Check if head is turned left (yaw > 20 degrees)
|
|
38
|
-
isHeadTurnedLeft: result => {
|
|
39
|
-
var _result$headPose;
|
|
40
|
-
return (_result$headPose = result.headPose) !== null && _result$headPose !== void 0 && _result$headPose.yaw ? result.headPose.yaw > 20 : false;
|
|
41
|
-
},
|
|
42
|
-
// Check if head is turned right (yaw < -20 degrees)
|
|
43
|
-
isHeadTurnedRight: result => {
|
|
44
|
-
var _result$headPose2;
|
|
45
|
-
return (_result$headPose2 = result.headPose) !== null && _result$headPose2 !== void 0 && _result$headPose2.yaw ? result.headPose.yaw < -20 : false;
|
|
46
|
-
},
|
|
47
|
-
// Check if head is tilted up (pitch > 10 degrees)
|
|
48
|
-
isHeadTiltedUp: result => {
|
|
49
|
-
var _result$headPose3;
|
|
50
|
-
return (_result$headPose3 = result.headPose) !== null && _result$headPose3 !== void 0 && _result$headPose3.pitch ? result.headPose.pitch > 10 : false;
|
|
51
|
-
},
|
|
52
|
-
// Check if head is tilted down (pitch < -10 degrees)
|
|
53
|
-
isHeadTiltedDown: result => {
|
|
54
|
-
var _result$headPose4;
|
|
55
|
-
return (_result$headPose4 = result.headPose) !== null && _result$headPose4 !== void 0 && _result$headPose4.pitch ? result.headPose.pitch < -10 : false;
|
|
56
|
-
},
|
|
57
|
-
// Check if face is centered (within ±10 degrees)
|
|
58
|
-
isFaceCentered: result => {
|
|
59
|
-
if (!result.headPose) return false;
|
|
60
|
-
const {
|
|
61
|
-
yaw,
|
|
62
|
-
pitch
|
|
63
|
-
} = result.headPose;
|
|
64
|
-
return Math.abs(yaw) <= 10 && Math.abs(pitch) <= 10;
|
|
65
|
-
},
|
|
66
|
-
// Check if smile is confident (high probability)
|
|
67
|
-
isConfidentSmile: result => {
|
|
68
|
-
return result.smileProbability ? result.smileProbability > 0.8 : result.isSmiling || false;
|
|
69
|
-
},
|
|
70
|
-
// Check if both eyes are confidently closed
|
|
71
|
-
isConfidentBlink: result => {
|
|
72
|
-
if (result.leftEyeOpenProbability !== undefined && result.rightEyeOpenProbability !== undefined) {
|
|
73
|
-
return result.leftEyeOpenProbability < 0.2 && result.rightEyeOpenProbability < 0.2;
|
|
74
|
-
}
|
|
75
|
-
return result.isBlinking || false;
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
//# sourceMappingURL=useFaceVerification.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useFrameProcessor","VisionCameraProxy","plugin","initFrameProcessorPlugin","useFaceVerification","frameProcessor","frame","console","error","result","call","faceDetected","log","Error","message","FaceVerificationUtils","isHeadTurnedLeft","_result$headPose","headPose","yaw","isHeadTurnedRight","_result$headPose2","isHeadTiltedUp","_result$headPose3","pitch","isHeadTiltedDown","_result$headPose4","isFaceCentered","Math","abs","isConfidentSmile","smileProbability","isSmiling","isConfidentBlink","leftEyeOpenProbability","undefined","rightEyeOpenProbability","isBlinking"],"sourceRoot":"../../../../src","sources":["components/biometrics/useFaceVerification.ts"],"mappings":"AAAA,SACEA,iBAAiB,EACjBC,iBAAiB,QACZ,4BAA4B;AA8BnC;AACA;AACA;;AAEA;AACA,MAAMC,MAAM,GAAGD,iBAAiB,CAACE,wBAAwB,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;AAE5E,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACvC,MAAMC,cAAc,GAAGL,iBAAiB,CAAEM,KAAK,IAAK;IAClD,SAAS;;IAET,IAAI;MACF,IAAIJ,MAAM,IAAI,IAAI,EAAE;QAClBK,OAAO,CAACC,KAAK,CAAC,sDAAsD,CAAC;QACrE,OAAO,IAAI;MACb;MAEA,MAAMC,MAAM,GAAGP,MAAM,CAACQ,IAAI,CAACJ,KAAK,EAAE,CAAC,CAAC,CAAQ;;MAE5C;MACA,IAAIG,MAAM,IAAIA,MAAM,CAACE,YAAY,EAAE;QACjCJ,OAAO,CAACK,GAAG,CAAC,gBAAgB,EAAEH,MAAM,CAAC;MACvC;MAEA,OAAOA,MAAM;IACf,CAAC,CAAC,OAAOD,KAAK,EAAE;MACdD,OAAO,CAACC,KAAK,CAAC,0BAA0B,EAAEA,KAAK,CAAC;MAChD,OAAO;QACLG,YAAY,EAAE,KAAK;QACnBH,KAAK,EAAEA,KAAK,YAAYK,KAAK,GAAGL,KAAK,CAACM,OAAO,GAAG;MAClD,CAAC;IACH;EACF,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOT,cAAc;AACvB,CAAC;;AAED;AACA,OAAO,MAAMU,qBAAqB,GAAG;E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D,CAAC;EAED;EACAM,gBAAgB,EAAGrB,MAA8B,IAAc;IAC7D,OAAOA,MAAM,CAACsB,gBAAgB,GAC1BtB,MAAM,CAACsB,gBAAgB,GAAG,GAAG,GAC7BtB,MAAM,CAACuB,SAAS,IAAI,KAAK;EAC/B,CAAC;EAED;EACAC,gBAAgB,EAAGxB,MAA8B,IAAc;IAC7D,IACEA,MAAM,CAACyB,sBAAsB,KAAKC,SAAS,IAC3C1B,MAAM,CAAC2B,uBAAuB,KAAKD,SAAS,EAC5C;MACA,OACE1B,MAAM,CAACyB,sBAAsB,GAAG,GAAG,IACnCzB,MAAM,CAAC2B,uBAAuB,GAAG,GAAG;IAExC;IACA,OAAO3B,MAAM,CAAC4B,UAAU,IAAI,KAAK;EACnC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useCallback } from 'react';
|
|
2
|
-
import { FaceVerificationUtils } from './useFaceVerification';
|
|
3
|
-
const DEFAULT_CONFIG = {
|
|
4
|
-
stepTimeout: 10000,
|
|
5
|
-
// 10 seconds per step
|
|
6
|
-
totalTimeout: 60000,
|
|
7
|
-
// 1 minute total
|
|
8
|
-
confirmationFrames: 5,
|
|
9
|
-
// 5 consecutive frames
|
|
10
|
-
requiredSteps: ['position_face', 'smile', 'blink', 'turn_left', 'turn_right']
|
|
11
|
-
};
|
|
12
|
-
const STEP_INSTRUCTIONS = {
|
|
13
|
-
position_face: 'Position your face in the center of the frame',
|
|
14
|
-
smile: 'Please smile for the camera',
|
|
15
|
-
blink: 'Please blink your eyes',
|
|
16
|
-
turn_left: 'Slowly turn your head to the left',
|
|
17
|
-
turn_right: 'Slowly turn your head to the right',
|
|
18
|
-
completed: 'Verification completed successfully!',
|
|
19
|
-
failed: 'Verification failed. Please try again.'
|
|
20
|
-
};
|
|
21
|
-
export const useFaceVerificationFlow = (config = {}) => {
|
|
22
|
-
const fullConfig = {
|
|
23
|
-
...DEFAULT_CONFIG,
|
|
24
|
-
...config
|
|
25
|
-
};
|
|
26
|
-
const [state, setState] = useState({
|
|
27
|
-
currentStep: 'position_face',
|
|
28
|
-
completedSteps: [],
|
|
29
|
-
stepStartTime: Date.now(),
|
|
30
|
-
totalStartTime: Date.now(),
|
|
31
|
-
isProcessing: false,
|
|
32
|
-
progress: 0,
|
|
33
|
-
instruction: STEP_INSTRUCTIONS.position_face
|
|
34
|
-
});
|
|
35
|
-
const [confirmationCount, setConfirmationCount] = useState(0);
|
|
36
|
-
|
|
37
|
-
// Reset verification flow
|
|
38
|
-
const resetFlow = useCallback(() => {
|
|
39
|
-
const now = Date.now();
|
|
40
|
-
setState({
|
|
41
|
-
currentStep: 'position_face',
|
|
42
|
-
completedSteps: [],
|
|
43
|
-
stepStartTime: now,
|
|
44
|
-
totalStartTime: now,
|
|
45
|
-
isProcessing: false,
|
|
46
|
-
progress: 0,
|
|
47
|
-
instruction: STEP_INSTRUCTIONS.position_face
|
|
48
|
-
});
|
|
49
|
-
setConfirmationCount(0);
|
|
50
|
-
}, []);
|
|
51
|
-
|
|
52
|
-
// Check if current step is completed based on face detection result
|
|
53
|
-
const checkStepCompletion = useCallback(result => {
|
|
54
|
-
if (!result.faceDetected) return false;
|
|
55
|
-
switch (state.currentStep) {
|
|
56
|
-
case 'position_face':
|
|
57
|
-
return FaceVerificationUtils.isFaceCentered(result);
|
|
58
|
-
case 'smile':
|
|
59
|
-
return FaceVerificationUtils.isConfidentSmile(result);
|
|
60
|
-
case 'blink':
|
|
61
|
-
return FaceVerificationUtils.isConfidentBlink(result);
|
|
62
|
-
case 'turn_left':
|
|
63
|
-
return FaceVerificationUtils.isHeadTurnedLeft(result);
|
|
64
|
-
case 'turn_right':
|
|
65
|
-
return FaceVerificationUtils.isHeadTurnedRight(result);
|
|
66
|
-
default:
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
}, [state.currentStep]);
|
|
70
|
-
|
|
71
|
-
// Get next step in sequence
|
|
72
|
-
const getNextStep = useCallback(currentStep => {
|
|
73
|
-
const currentIndex = fullConfig.requiredSteps.indexOf(currentStep);
|
|
74
|
-
if (currentIndex === -1 || currentIndex === fullConfig.requiredSteps.length - 1) {
|
|
75
|
-
return 'completed';
|
|
76
|
-
}
|
|
77
|
-
const nextStep = fullConfig.requiredSteps[currentIndex + 1];
|
|
78
|
-
return nextStep || 'completed';
|
|
79
|
-
}, [fullConfig.requiredSteps]);
|
|
80
|
-
|
|
81
|
-
// Process face detection result
|
|
82
|
-
const processFaceResult = useCallback(result => {
|
|
83
|
-
if (state.currentStep === 'completed' || state.currentStep === 'failed') {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
const now = Date.now();
|
|
87
|
-
|
|
88
|
-
// Check for timeouts
|
|
89
|
-
if (now - state.totalStartTime > fullConfig.totalTimeout) {
|
|
90
|
-
setState(prev => ({
|
|
91
|
-
...prev,
|
|
92
|
-
currentStep: 'failed',
|
|
93
|
-
instruction: 'Verification timed out. Please try again.',
|
|
94
|
-
error: 'Total verification timeout exceeded'
|
|
95
|
-
}));
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (now - state.stepStartTime > fullConfig.stepTimeout) {
|
|
99
|
-
setState(prev => ({
|
|
100
|
-
...prev,
|
|
101
|
-
currentStep: 'failed',
|
|
102
|
-
instruction: 'Step timed out. Please try again.',
|
|
103
|
-
error: 'Step timeout exceeded'
|
|
104
|
-
}));
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Check if current step is completed
|
|
109
|
-
const stepCompleted = checkStepCompletion(result);
|
|
110
|
-
if (stepCompleted) {
|
|
111
|
-
setConfirmationCount(prev => prev + 1);
|
|
112
|
-
|
|
113
|
-
// Require multiple consecutive confirmations
|
|
114
|
-
if (confirmationCount + 1 >= fullConfig.confirmationFrames) {
|
|
115
|
-
const nextStep = getNextStep(state.currentStep);
|
|
116
|
-
const newCompletedSteps = [...state.completedSteps, state.currentStep];
|
|
117
|
-
const newProgress = newCompletedSteps.length / fullConfig.requiredSteps.length * 100;
|
|
118
|
-
setState(prev => ({
|
|
119
|
-
...prev,
|
|
120
|
-
currentStep: nextStep,
|
|
121
|
-
completedSteps: newCompletedSteps,
|
|
122
|
-
stepStartTime: now,
|
|
123
|
-
progress: newProgress,
|
|
124
|
-
instruction: STEP_INSTRUCTIONS[nextStep],
|
|
125
|
-
isProcessing: nextStep === 'completed'
|
|
126
|
-
}));
|
|
127
|
-
setConfirmationCount(0);
|
|
128
|
-
}
|
|
129
|
-
} else {
|
|
130
|
-
// Reset confirmation count if step not completed
|
|
131
|
-
setConfirmationCount(0);
|
|
132
|
-
}
|
|
133
|
-
}, [state, fullConfig.totalTimeout, fullConfig.stepTimeout, fullConfig.confirmationFrames, fullConfig.requiredSteps.length, confirmationCount, checkStepCompletion, getNextStep]);
|
|
134
|
-
|
|
135
|
-
// Auto-reset on mount
|
|
136
|
-
useEffect(() => {
|
|
137
|
-
resetFlow();
|
|
138
|
-
}, [resetFlow]);
|
|
139
|
-
return {
|
|
140
|
-
state,
|
|
141
|
-
processFaceResult,
|
|
142
|
-
resetFlow,
|
|
143
|
-
isCompleted: state.currentStep === 'completed',
|
|
144
|
-
isFailed: state.currentStep === 'failed',
|
|
145
|
-
isActive: state.currentStep !== 'completed' && state.currentStep !== 'failed',
|
|
146
|
-
remainingTime: Math.max(0, fullConfig.stepTimeout - (Date.now() - state.stepStartTime)),
|
|
147
|
-
totalRemainingTime: Math.max(0, fullConfig.totalTimeout - (Date.now() - state.totalStartTime))
|
|
148
|
-
};
|
|
149
|
-
};
|
|
150
|
-
//# sourceMappingURL=useFaceVerificationFlow.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useState","useEffect","useCallback","FaceVerificationUtils","DEFAULT_CONFIG","stepTimeout","totalTimeout","confirmationFrames","requiredSteps","STEP_INSTRUCTIONS","position_face","smile","blink","turn_left","turn_right","completed","failed","useFaceVerificationFlow","config","fullConfig","state","setState","currentStep","completedSteps","stepStartTime","Date","now","totalStartTime","isProcessing","progress","instruction","confirmationCount","setConfirmationCount","resetFlow","checkStepCompletion","result","faceDetected","isFaceCentered","isConfidentSmile","isConfidentBlink","isHeadTurnedLeft","isHeadTurnedRight","getNextStep","currentIndex","indexOf","length","nextStep","processFaceResult","prev","error","stepCompleted","newCompletedSteps","newProgress","isCompleted","isFailed","isActive","remainingTime","Math","max","totalRemainingTime"],"sourceRoot":"../../../../src","sources":["components/biometrics/useFaceVerificationFlow.ts"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,SAAS,EAAEC,WAAW,QAAQ,OAAO;AACxD,SAEEC,qBAAqB,QAChB,uBAAuB;AA6B9B,MAAMC,cAAsC,GAAG;EAC7CC,WAAW,EAAE,KAAK;EAAE;EACpBC,YAAY,EAAE,KAAK;EAAE;EACrBC,kBAAkB,EAAE,CAAC;EAAE;EACvBC,aAAa,EAAE,CAAC,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,YAAY;AAC9E,CAAC;AAED,MAAMC,iBAAmD,GAAG;EAC1DC,aAAa,EAAE,+CAA+C;EAC9DC,KAAK,EAAE,6BAA6B;EACpCC,KAAK,EAAE,wBAAwB;EAC/BC,SAAS,EAAE,mCAAmC;EAC9CC,UAAU,EAAE,oCAAoC;EAChDC,SAAS,EAAE,sCAAsC;EACjDC,MAAM,EAAE;AACV,CAAC;AAED,OAAO,MAAMC,uBAAuB,GAAGA,CACrCC,MAAuC,GAAG,CAAC,CAAC,KACzC;EACH,MAAMC,UAAU,GAAG;IAAE,GAAGf,cAAc;IAAE,GAAGc;EAAO,CAAC;EAEnD,MAAM,CAACE,KAAK,EAAEC,QAAQ,CAAC,GAAGrB,QAAQ,CAAwB;IACxDsB,WAAW,EAAE,eAAe;IAC5BC,cAAc,EAAE,EAAE;IAClBC,aAAa,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC;IACzBC,cAAc,EAAEF,IAAI,CAACC,GAAG,CAAC,CAAC;IAC1BE,YA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AAW,KAAK,WAAW,IAAIF,KAAK,CAACE,WAAW,KAAK,QAAQ;IACrEkC,aAAa,EAAEC,IAAI,CAACC,GAAG,CACrB,CAAC,EACDvC,UAAU,CAACd,WAAW,IAAIoB,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGN,KAAK,CAACI,aAAa,CAC5D,CAAC;IACDmC,kBAAkB,EAAEF,IAAI,CAACC,GAAG,CAC1B,CAAC,EACDvC,UAAU,CAACb,YAAY,IAAImB,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGN,KAAK,CAACO,cAAc,CAC9D;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle } from 'react-native';
|
|
3
|
-
type ButtonProps = {
|
|
4
|
-
title: string;
|
|
5
|
-
onPress: () => void;
|
|
6
|
-
backgroundColor?: string;
|
|
7
|
-
borderColor?: string;
|
|
8
|
-
textColor?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
loading?: boolean;
|
|
11
|
-
style?: ViewStyle;
|
|
12
|
-
textStyle?: TextStyle;
|
|
13
|
-
activeOpacity?: number;
|
|
14
|
-
};
|
|
15
|
-
declare const Button: React.FC<ButtonProps>;
|
|
16
|
-
export default Button;
|
|
17
|
-
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAKL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAEtB,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,QAAA,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA0CjC,CAAC;AAoBF,eAAe,MAAM,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
type FaceVerificationProps = {
|
|
3
|
-
onClose: () => void;
|
|
4
|
-
onSuccess: () => void;
|
|
5
|
-
primaryColor: string;
|
|
6
|
-
};
|
|
7
|
-
declare const FaceVerification: React.FC<FaceVerificationProps>;
|
|
8
|
-
export default FaceVerification;
|
|
9
|
-
//# sourceMappingURL=FaceVerification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FaceVerification.d.ts","sourceRoot":"","sources":["../../../../src/components/biometrics/FaceVerification.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAoBnD,KAAK,qBAAqB,GAAG;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAmKrD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface FaceVerificationResult {
|
|
2
|
-
faceDetected: boolean;
|
|
3
|
-
isSmiling?: boolean;
|
|
4
|
-
isBlinking?: boolean;
|
|
5
|
-
leftEyeClosed?: boolean;
|
|
6
|
-
rightEyeClosed?: boolean;
|
|
7
|
-
headPose?: {
|
|
8
|
-
yaw: number;
|
|
9
|
-
pitch: number;
|
|
10
|
-
roll: number;
|
|
11
|
-
};
|
|
12
|
-
boundingBox?: {
|
|
13
|
-
x?: number;
|
|
14
|
-
y?: number;
|
|
15
|
-
width?: number;
|
|
16
|
-
height?: number;
|
|
17
|
-
left?: number;
|
|
18
|
-
top?: number;
|
|
19
|
-
right?: number;
|
|
20
|
-
bottom?: number;
|
|
21
|
-
};
|
|
22
|
-
smileProbability?: number;
|
|
23
|
-
leftEyeOpenProbability?: number;
|
|
24
|
-
rightEyeOpenProbability?: number;
|
|
25
|
-
trackingId?: number;
|
|
26
|
-
error?: string;
|
|
27
|
-
}
|
|
28
|
-
export declare const useFaceVerification: () => import("react-native-vision-camera").ReadonlyFrameProcessor;
|
|
29
|
-
export declare const FaceVerificationUtils: {
|
|
30
|
-
isHeadTurnedLeft: (result: FaceVerificationResult) => boolean;
|
|
31
|
-
isHeadTurnedRight: (result: FaceVerificationResult) => boolean;
|
|
32
|
-
isHeadTiltedUp: (result: FaceVerificationResult) => boolean;
|
|
33
|
-
isHeadTiltedDown: (result: FaceVerificationResult) => boolean;
|
|
34
|
-
isFaceCentered: (result: FaceVerificationResult) => boolean;
|
|
35
|
-
isConfidentSmile: (result: FaceVerificationResult) => boolean;
|
|
36
|
-
isConfidentBlink: (result: FaceVerificationResult) => boolean;
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=useFaceVerification.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFaceVerification.d.ts","sourceRoot":"","sources":["../../../../src/components/biometrics/useFaceVerification.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,sBAAsB;IACrC,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE;QACT,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,WAAW,CAAC,EAAE;QACZ,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,CAAC,CAAC,EAAE,MAAM,CAAC;QACX,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AASD,eAAO,MAAM,mBAAmB,mEA4B/B,CAAC;AAGF,eAAO,MAAM,qBAAqB;+BAEL,sBAAsB,KAAG,OAAO;gCAK/B,sBAAsB,KAAG,OAAO;6BAKnC,sBAAsB,KAAG,OAAO;+BAK9B,sBAAsB,KAAG,OAAO;6BAKlC,sBAAsB,KAAG,OAAO;+BAO9B,sBAAsB,KAAG,OAAO;+BAOhC,sBAAsB,KAAG,OAAO;CAY5D,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { FaceVerificationResult } from './useFaceVerification';
|
|
2
|
-
export type VerificationStep = 'position_face' | 'smile' | 'blink' | 'turn_left' | 'turn_right' | 'completed' | 'failed';
|
|
3
|
-
export interface VerificationFlowState {
|
|
4
|
-
currentStep: VerificationStep;
|
|
5
|
-
completedSteps: VerificationStep[];
|
|
6
|
-
stepStartTime: number;
|
|
7
|
-
totalStartTime: number;
|
|
8
|
-
isProcessing: boolean;
|
|
9
|
-
progress: number;
|
|
10
|
-
instruction: string;
|
|
11
|
-
error?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface VerificationFlowConfig {
|
|
14
|
-
stepTimeout: number;
|
|
15
|
-
totalTimeout: number;
|
|
16
|
-
confirmationFrames: number;
|
|
17
|
-
requiredSteps: VerificationStep[];
|
|
18
|
-
}
|
|
19
|
-
export declare const useFaceVerificationFlow: (config?: Partial<VerificationFlowConfig>) => {
|
|
20
|
-
state: VerificationFlowState;
|
|
21
|
-
processFaceResult: (result: FaceVerificationResult) => void;
|
|
22
|
-
resetFlow: () => void;
|
|
23
|
-
isCompleted: boolean;
|
|
24
|
-
isFailed: boolean;
|
|
25
|
-
isActive: boolean;
|
|
26
|
-
remainingTime: number;
|
|
27
|
-
totalRemainingTime: number;
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=useFaceVerificationFlow.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFaceVerificationFlow.d.ts","sourceRoot":"","sources":["../../../../src/components/biometrics/useFaceVerificationFlow.ts"],"names":[],"mappings":"AACA,OAAO,EACL,sBAAsB,EAEvB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,OAAO,GACP,OAAO,GACP,WAAW,GACX,YAAY,GACZ,WAAW,GACX,QAAQ,CAAC;AAEb,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,gBAAgB,CAAC;IAC9B,cAAc,EAAE,gBAAgB,EAAE,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAmBD,eAAO,MAAM,uBAAuB,GAClC,SAAQ,OAAO,CAAC,sBAAsB,CAAM;;gCA6EjC,sBAAsB;;;;;;;CA+FlC,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
require "json"
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = "omnipay_reactnative_sdk"
|
|
7
|
-
s.version = package["version"]
|
|
8
|
-
s.summary = package["description"]
|
|
9
|
-
s.description = <<-DESC
|
|
10
|
-
Omnipay React Native SDK with built-in face verification capabilities.
|
|
11
|
-
DESC
|
|
12
|
-
s.homepage = "https://github.com/engrtitus/omnipay-reactnative-sdk"
|
|
13
|
-
s.license = "MIT"
|
|
14
|
-
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
|
|
15
|
-
s.authors = { "engrtitus" => "titus.salisu@omnibiz.com" }
|
|
16
|
-
s.platforms = { :ios => "13.4" }
|
|
17
|
-
s.source = { :git => "https://github.com/engrtitus/omnipay-reactnative-sdk.git", :tag => "#{s.version}" }
|
|
18
|
-
|
|
19
|
-
s.source_files = "ios/**/*.{h,c,cc,cpp,m,mm,swift}"
|
|
20
|
-
s.public_header_files = "ios/*.h"
|
|
21
|
-
s.requires_arc = true
|
|
22
|
-
|
|
23
|
-
# Swift support configuration
|
|
24
|
-
s.swift_version = '5.0'
|
|
25
|
-
s.pod_target_xcconfig = {
|
|
26
|
-
'DEFINES_MODULE' => 'YES',
|
|
27
|
-
'SWIFT_COMPILATION_MODE' => 'wholemodule',
|
|
28
|
-
'SWIFT_OBJC_BRIDGING_HEADER' => '$(PODS_TARGET_SRCROOT)/ios/omnipay-reactnative-sdk-Bridging-Header.h'
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
# Essential dependencies only
|
|
32
|
-
s.dependency "React-Core"
|
|
33
|
-
s.dependency "VisionCamera"
|
|
34
|
-
|
|
35
|
-
# iOS Vision Framework for face detection
|
|
36
|
-
s.framework = "Vision"
|
|
37
|
-
|
|
38
|
-
# New Architecture support
|
|
39
|
-
if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
|
|
40
|
-
s.compiler_flags = "-DRCT_NEW_ARCH_ENABLED=1"
|
|
41
|
-
s.pod_target_xcconfig = {
|
|
42
|
-
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost\"",
|
|
43
|
-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
|
|
44
|
-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17"
|
|
45
|
-
}
|
|
46
|
-
s.dependency "React-Codegen"
|
|
47
|
-
s.dependency "RCT-Folly"
|
|
48
|
-
s.dependency "RCTRequired"
|
|
49
|
-
s.dependency "RCTTypeSafety"
|
|
50
|
-
s.dependency "ReactCommon/turbomodule/core"
|
|
51
|
-
end
|
|
52
|
-
end
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
TouchableOpacity,
|
|
4
|
-
Text,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
ActivityIndicator,
|
|
7
|
-
ViewStyle,
|
|
8
|
-
TextStyle,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
|
|
11
|
-
type ButtonProps = {
|
|
12
|
-
title: string;
|
|
13
|
-
onPress: () => void;
|
|
14
|
-
backgroundColor?: string;
|
|
15
|
-
borderColor?: string;
|
|
16
|
-
textColor?: string;
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
loading?: boolean;
|
|
19
|
-
style?: ViewStyle;
|
|
20
|
-
textStyle?: TextStyle;
|
|
21
|
-
activeOpacity?: number;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
const Button: React.FC<ButtonProps> = ({
|
|
25
|
-
title,
|
|
26
|
-
onPress,
|
|
27
|
-
backgroundColor = '#007AFF',
|
|
28
|
-
borderColor,
|
|
29
|
-
textColor = 'white',
|
|
30
|
-
disabled = false,
|
|
31
|
-
loading = false,
|
|
32
|
-
style,
|
|
33
|
-
textStyle,
|
|
34
|
-
activeOpacity = 0.8,
|
|
35
|
-
}) => {
|
|
36
|
-
const buttonStyle: ViewStyle = {
|
|
37
|
-
...styles.button,
|
|
38
|
-
backgroundColor: disabled ? '#cccccc' : backgroundColor,
|
|
39
|
-
borderColor: disabled ? '#cccccc' : borderColor || backgroundColor,
|
|
40
|
-
...style,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const finalTextStyle: TextStyle = {
|
|
44
|
-
...styles.buttonText,
|
|
45
|
-
color: disabled ? '#666666' : textColor,
|
|
46
|
-
...textStyle,
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return (
|
|
50
|
-
<TouchableOpacity
|
|
51
|
-
style={buttonStyle}
|
|
52
|
-
onPress={onPress}
|
|
53
|
-
disabled={disabled || loading}
|
|
54
|
-
activeOpacity={activeOpacity}
|
|
55
|
-
accessibilityRole="button"
|
|
56
|
-
accessibilityLabel={title}
|
|
57
|
-
accessibilityState={{ disabled: disabled || loading }}
|
|
58
|
-
>
|
|
59
|
-
{loading ? (
|
|
60
|
-
<ActivityIndicator color={textColor} size="small" />
|
|
61
|
-
) : (
|
|
62
|
-
<Text style={finalTextStyle}>{title}</Text>
|
|
63
|
-
)}
|
|
64
|
-
</TouchableOpacity>
|
|
65
|
-
);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
const styles = StyleSheet.create({
|
|
69
|
-
button: {
|
|
70
|
-
borderRadius: 6,
|
|
71
|
-
paddingHorizontal: 12,
|
|
72
|
-
paddingVertical: 14,
|
|
73
|
-
borderWidth: 1,
|
|
74
|
-
alignItems: 'center',
|
|
75
|
-
justifyContent: 'center',
|
|
76
|
-
minHeight: 48,
|
|
77
|
-
},
|
|
78
|
-
buttonText: {
|
|
79
|
-
color: 'white',
|
|
80
|
-
fontSize: 16,
|
|
81
|
-
fontWeight: '600',
|
|
82
|
-
paddingHorizontal: 30,
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
export default Button;
|