omnipay-reactnative-sdk 1.2.2-beta.3 → 1.2.2-beta.6
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 +93 -43
- package/android/build.gradle +16 -15
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/omniretail/omnipay/OmnipayActivityPackage.java +2 -2
- package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessCameraView.java +153 -0
- package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessCameraViewManager.java +49 -0
- package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessModule.java +524 -0
- package/ios/OmnipayLivenessCameraView.h +15 -0
- package/ios/OmnipayLivenessCameraView.m +80 -0
- package/ios/OmnipayLivenessCameraViewManager.m +19 -0
- package/ios/OmnipayLivenessModule.h +38 -0
- package/ios/OmnipayLivenessModule.m +554 -0
- package/lib/commonjs/components/OmnipayProvider.js +2 -66
- package/lib/commonjs/components/OmnipayProvider.js.map +1 -1
- package/lib/commonjs/components/OmnipayView.js.map +1 -1
- package/lib/commonjs/components/biometrics/FaceVerification.js +252 -345
- package/lib/commonjs/components/biometrics/FaceVerification.js.map +1 -1
- package/lib/commonjs/components/biometrics/LivenessDetection.js +90 -198
- package/lib/commonjs/components/biometrics/LivenessDetection.js.map +1 -1
- package/lib/commonjs/components/biometrics/OmnipayLivenessCameraView.js +15 -0
- package/lib/commonjs/components/biometrics/OmnipayLivenessCameraView.js.map +1 -0
- package/lib/commonjs/components/biometrics/PermissionManager.js +279 -0
- package/lib/commonjs/components/biometrics/PermissionManager.js.map +1 -0
- package/lib/commonjs/components/biometrics/index.js +45 -0
- package/lib/commonjs/components/biometrics/index.js.map +1 -0
- package/lib/commonjs/components/biometrics/types.js +17 -0
- package/lib/commonjs/components/biometrics/types.js.map +1 -0
- package/lib/commonjs/components/views/BvnVerification.js.map +1 -1
- package/lib/commonjs/components/views/PaylaterAgreement.js.map +1 -1
- package/lib/commonjs/components/views/Registration.js.map +1 -1
- package/lib/commonjs/index.js +23 -18
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/OmnipayProvider.js +3 -67
- package/lib/module/components/OmnipayProvider.js.map +1 -1
- package/lib/module/components/OmnipayView.js.map +1 -1
- package/lib/module/components/biometrics/FaceVerification.js +254 -346
- package/lib/module/components/biometrics/FaceVerification.js.map +1 -1
- package/lib/module/components/biometrics/LivenessDetection.js +75 -197
- package/lib/module/components/biometrics/LivenessDetection.js.map +1 -1
- package/lib/module/components/biometrics/OmnipayLivenessCameraView.js +7 -0
- package/lib/module/components/biometrics/OmnipayLivenessCameraView.js.map +1 -0
- package/lib/module/components/biometrics/PermissionManager.js +272 -0
- package/lib/module/components/biometrics/PermissionManager.js.map +1 -0
- package/lib/module/components/biometrics/index.js +12 -0
- package/lib/module/components/biometrics/index.js.map +1 -0
- package/lib/module/components/biometrics/types.js +16 -0
- package/lib/module/components/biometrics/types.js.map +1 -0
- 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/index.js +5 -4
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/{src/components → components}/OmnipayProvider.d.ts +1 -1
- package/lib/typescript/components/OmnipayProvider.d.ts.map +1 -0
- package/lib/typescript/{src/components → components}/OmnipayView.d.ts +21 -20
- package/lib/typescript/components/OmnipayView.d.ts.map +1 -0
- package/lib/typescript/components/biometrics/FaceVerification.d.ts +11 -0
- package/lib/typescript/components/biometrics/FaceVerification.d.ts.map +1 -0
- package/lib/typescript/components/biometrics/LivenessDetection.d.ts +33 -0
- package/lib/typescript/components/biometrics/LivenessDetection.d.ts.map +1 -0
- package/lib/typescript/components/biometrics/OmnipayLivenessCameraView.d.ts +18 -0
- package/lib/typescript/components/biometrics/OmnipayLivenessCameraView.d.ts.map +1 -0
- package/lib/typescript/components/biometrics/PermissionManager.d.ts +58 -0
- package/lib/typescript/components/biometrics/PermissionManager.d.ts.map +1 -0
- package/lib/typescript/components/biometrics/index.d.ts +5 -0
- package/lib/typescript/components/biometrics/index.d.ts.map +1 -0
- package/lib/typescript/components/biometrics/types.d.ts +73 -0
- package/lib/typescript/components/biometrics/types.d.ts.map +1 -0
- package/lib/typescript/{src/components → components}/views/BvnVerification.d.ts +2 -1
- package/lib/typescript/components/views/BvnVerification.d.ts.map +1 -0
- package/lib/typescript/{src/components → components}/views/PaylaterAgreement.d.ts +2 -1
- package/lib/typescript/components/views/PaylaterAgreement.d.ts.map +1 -0
- package/lib/typescript/{src/components → components}/views/Registration.d.ts +2 -1
- package/lib/typescript/components/views/Registration.d.ts.map +1 -0
- package/lib/typescript/functions.d.ts.map +1 -0
- package/lib/typescript/hooks/useOmnipay.d.ts +28 -0
- package/lib/typescript/hooks/useOmnipay.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +7 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/lib/colors.d.ts.map +1 -0
- package/lib/typescript/lib/config.d.ts.map +1 -0
- package/omnipay-reactnative-sdk.podspec +32 -29
- package/package.json +16 -11
- package/src/components/OmnipayProvider.tsx +3 -106
- package/src/components/OmnipayView.tsx +1 -1
- package/src/components/biometrics/FaceVerification.tsx +291 -368
- package/src/components/biometrics/LivenessDetection.ts +113 -250
- package/src/components/biometrics/OmnipayLivenessCameraView.tsx +19 -0
- package/src/components/biometrics/PermissionManager.ts +317 -0
- package/src/components/biometrics/index.ts +11 -0
- package/src/components/biometrics/types.ts +86 -0
- 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/index.tsx +4 -15
- package/android/src/main/java/com/omniretail/omnipay/LivenessCameraViewManager.java +0 -116
- package/android/src/main/java/com/omniretail/omnipay/LivenessDetectionModule.java +0 -588
- package/ios/LivenessCameraView.h +0 -22
- package/ios/LivenessCameraView.m +0 -135
- package/ios/LivenessCameraViewManager.h +0 -12
- package/ios/LivenessCameraViewManager.m +0 -24
- package/ios/LivenessDetectionModule.h +0 -46
- package/ios/LivenessDetectionModule.m +0 -603
- package/lib/commonjs/components/biometrics/LivenessCameraView.js +0 -45
- package/lib/commonjs/components/biometrics/LivenessCameraView.js.map +0 -1
- package/lib/module/components/biometrics/LivenessCameraView.js +0 -39
- package/lib/module/components/biometrics/LivenessCameraView.js.map +0 -1
- package/lib/typescript/demo/src/App.d.ts +0 -3
- package/lib/typescript/demo/src/App.d.ts.map +0 -1
- package/lib/typescript/demo/src/Body.d.ts +0 -3
- package/lib/typescript/demo/src/Body.d.ts.map +0 -1
- package/lib/typescript/demo/src/NotificationsExample.d.ts +0 -4
- package/lib/typescript/demo/src/NotificationsExample.d.ts.map +0 -1
- package/lib/typescript/src/components/OmnipayProvider.d.ts.map +0 -1
- package/lib/typescript/src/components/OmnipayView.d.ts.map +0 -1
- package/lib/typescript/src/components/biometrics/FaceVerification.d.ts +0 -12
- package/lib/typescript/src/components/biometrics/FaceVerification.d.ts.map +0 -1
- package/lib/typescript/src/components/biometrics/LivenessCameraView.d.ts +0 -22
- package/lib/typescript/src/components/biometrics/LivenessCameraView.d.ts.map +0 -1
- package/lib/typescript/src/components/biometrics/LivenessDetection.d.ts +0 -73
- package/lib/typescript/src/components/biometrics/LivenessDetection.d.ts.map +0 -1
- package/lib/typescript/src/components/views/BvnVerification.d.ts.map +0 -1
- package/lib/typescript/src/components/views/PaylaterAgreement.d.ts.map +0 -1
- package/lib/typescript/src/components/views/Registration.d.ts.map +0 -1
- package/lib/typescript/src/functions.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useOmnipay.d.ts +0 -28
- package/lib/typescript/src/hooks/useOmnipay.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -8
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/lib/colors.d.ts.map +0 -1
- package/lib/typescript/src/lib/config.d.ts.map +0 -1
- package/src/components/biometrics/LivenessCameraView.tsx +0 -61
- /package/lib/typescript/{src/functions.d.ts → functions.d.ts} +0 -0
- /package/lib/typescript/{src/lib → lib}/colors.d.ts +0 -0
- /package/lib/typescript/{src/lib → lib}/config.d.ts +0 -0
package/ios/LivenessCameraView.m
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// LivenessCameraView.m
|
|
3
|
-
// omnipay-reactnative-sdk
|
|
4
|
-
//
|
|
5
|
-
// Created by React Native Auto-generated
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import "LivenessCameraView.h"
|
|
9
|
-
#import "LivenessDetectionModule.h"
|
|
10
|
-
#import <React/RCTBridge.h>
|
|
11
|
-
#import <React/RCTLog.h>
|
|
12
|
-
|
|
13
|
-
@interface LivenessCameraView()
|
|
14
|
-
|
|
15
|
-
@property (nonatomic, weak) RCTBridge *bridge;
|
|
16
|
-
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer;
|
|
17
|
-
@property (nonatomic, strong) LivenessDetectionModule *livenessModule;
|
|
18
|
-
|
|
19
|
-
@end
|
|
20
|
-
|
|
21
|
-
@implementation LivenessCameraView
|
|
22
|
-
|
|
23
|
-
- (instancetype)initWithBridge:(RCTBridge *)bridge {
|
|
24
|
-
self = [super init];
|
|
25
|
-
if (self) {
|
|
26
|
-
_bridge = bridge;
|
|
27
|
-
_scaleType = @"fillCenter"; // Default scale type
|
|
28
|
-
[self setupCameraView];
|
|
29
|
-
}
|
|
30
|
-
return self;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
- (void)setupCameraView {
|
|
34
|
-
// Get the liveness detection module
|
|
35
|
-
self.livenessModule = [self.bridge moduleForClass:[LivenessDetectionModule class]];
|
|
36
|
-
|
|
37
|
-
if (!self.livenessModule) {
|
|
38
|
-
RCTLogError(@"LivenessDetectionModule not found");
|
|
39
|
-
if (self.onCameraError) {
|
|
40
|
-
self.onCameraError(@{@"error": @"LivenessDetectionModule not found"});
|
|
41
|
-
}
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// Get the preview layer from the module
|
|
46
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
47
|
-
self.previewLayer = [self.livenessModule getPreviewLayer];
|
|
48
|
-
|
|
49
|
-
if (self.previewLayer) {
|
|
50
|
-
[self addPreviewLayer];
|
|
51
|
-
if (self.onCameraReady) {
|
|
52
|
-
self.onCameraReady(@{});
|
|
53
|
-
}
|
|
54
|
-
} else {
|
|
55
|
-
RCTLogError(@"Failed to get camera preview layer");
|
|
56
|
-
if (self.onCameraError) {
|
|
57
|
-
self.onCameraError(@{@"error": @"Failed to initialize camera"});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
- (void)addPreviewLayer {
|
|
64
|
-
if (!self.previewLayer) return;
|
|
65
|
-
|
|
66
|
-
// Remove any existing preview layer
|
|
67
|
-
[self.previewLayer removeFromSuperlayer];
|
|
68
|
-
|
|
69
|
-
// Set the frame to match the view
|
|
70
|
-
self.previewLayer.frame = self.bounds;
|
|
71
|
-
|
|
72
|
-
// Apply scale type
|
|
73
|
-
[self applyScaleType];
|
|
74
|
-
|
|
75
|
-
// Add the preview layer
|
|
76
|
-
[self.layer addSublayer:self.previewLayer];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
- (void)applyScaleType {
|
|
80
|
-
if (!self.previewLayer) return;
|
|
81
|
-
|
|
82
|
-
if ([self.scaleType isEqualToString:@"fillStart"]) {
|
|
83
|
-
self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
|
|
84
|
-
// Additional positioning for "start" alignment would go here
|
|
85
|
-
} else if ([self.scaleType isEqualToString:@"fillCenter"]) {
|
|
86
|
-
self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
|
|
87
|
-
} else if ([self.scaleType isEqualToString:@"fillEnd"]) {
|
|
88
|
-
self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
|
|
89
|
-
// Additional positioning for "end" alignment would go here
|
|
90
|
-
} else if ([self.scaleType isEqualToString:@"fitStart"]) {
|
|
91
|
-
self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspect;
|
|
92
|
-
// Additional positioning for "start" alignment would go here
|
|
93
|
-
} else if ([self.scaleType isEqualToString:@"fitCenter"]) {
|
|
94
|
-
self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspect;
|
|
95
|
-
} else if ([self.scaleType isEqualToString:@"fitEnd"]) {
|
|
96
|
-
self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspect;
|
|
97
|
-
// Additional positioning for "end" alignment would go here
|
|
98
|
-
} else {
|
|
99
|
-
// Default to fill center
|
|
100
|
-
self.previewLayer.videoGravity = AVLayerVideoGravityResizeAspectFill;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
- (void)layoutSubviews {
|
|
105
|
-
[super layoutSubviews];
|
|
106
|
-
|
|
107
|
-
// Update preview layer frame when view layout changes
|
|
108
|
-
if (self.previewLayer) {
|
|
109
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
110
|
-
self.previewLayer.frame = self.bounds;
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
- (void)setScaleType:(NSString *)scaleType {
|
|
116
|
-
_scaleType = scaleType;
|
|
117
|
-
[self applyScaleType];
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
- (void)removeFromSuperview {
|
|
121
|
-
// Clean up preview layer when view is removed
|
|
122
|
-
if (self.previewLayer) {
|
|
123
|
-
[self.previewLayer removeFromSuperlayer];
|
|
124
|
-
}
|
|
125
|
-
[super removeFromSuperview];
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
- (void)dealloc {
|
|
129
|
-
// Clean up
|
|
130
|
-
if (self.previewLayer) {
|
|
131
|
-
[self.previewLayer removeFromSuperlayer];
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
@end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// LivenessCameraViewManager.m
|
|
3
|
-
// omnipay-reactnative-sdk
|
|
4
|
-
//
|
|
5
|
-
// Created by React Native Auto-generated
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import "LivenessCameraViewManager.h"
|
|
9
|
-
#import "LivenessCameraView.h"
|
|
10
|
-
#import <React/RCTBridge.h>
|
|
11
|
-
|
|
12
|
-
@implementation LivenessCameraViewManager
|
|
13
|
-
|
|
14
|
-
RCT_EXPORT_MODULE(LivenessCameraView)
|
|
15
|
-
|
|
16
|
-
- (UIView *)view {
|
|
17
|
-
return [[LivenessCameraView alloc] initWithBridge:self.bridge];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
RCT_EXPORT_VIEW_PROPERTY(scaleType, NSString)
|
|
21
|
-
RCT_EXPORT_VIEW_PROPERTY(onCameraReady, RCTDirectEventBlock)
|
|
22
|
-
RCT_EXPORT_VIEW_PROPERTY(onCameraError, RCTDirectEventBlock)
|
|
23
|
-
|
|
24
|
-
@end
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// LivenessDetectionModule.h
|
|
3
|
-
// omnipay-reactnative-sdk
|
|
4
|
-
//
|
|
5
|
-
// Created by React Native Auto-generated
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <React/RCTBridgeModule.h>
|
|
9
|
-
#import <React/RCTEventEmitter.h>
|
|
10
|
-
#import <AVFoundation/AVFoundation.h>
|
|
11
|
-
#import <Vision/Vision.h>
|
|
12
|
-
|
|
13
|
-
@interface LivenessDetectionModule : RCTEventEmitter <RCTBridgeModule, AVCaptureVideoDataOutputSampleBufferDelegate, AVCapturePhotoCaptureDelegate>
|
|
14
|
-
|
|
15
|
-
// Camera session and components
|
|
16
|
-
@property (nonatomic, strong) AVCaptureSession *captureSession;
|
|
17
|
-
@property (nonatomic, strong) AVCaptureVideoPreviewLayer *previewLayer;
|
|
18
|
-
@property (nonatomic, strong) AVCaptureVideoDataOutput *videoDataOutput;
|
|
19
|
-
@property (nonatomic, strong) AVCapturePhotoOutput *photoOutput;
|
|
20
|
-
@property (nonatomic, strong) AVCaptureDevice *captureDevice;
|
|
21
|
-
@property (nonatomic, strong) dispatch_queue_t videoDataOutputQueue;
|
|
22
|
-
|
|
23
|
-
// Detection state
|
|
24
|
-
@property (nonatomic, assign) BOOL isDetectionActive;
|
|
25
|
-
@property (nonatomic, strong) NSMutableArray<NSString *> *pendingChallenges;
|
|
26
|
-
@property (nonatomic, strong) NSString *currentChallenge;
|
|
27
|
-
@property (nonatomic, assign) NSTimeInterval challengeStartTime;
|
|
28
|
-
@property (nonatomic, assign) NSTimeInterval challengeTimeout;
|
|
29
|
-
|
|
30
|
-
// Challenge validation state
|
|
31
|
-
@property (nonatomic, assign) BOOL lastSmileState;
|
|
32
|
-
@property (nonatomic, assign) BOOL lastLeftEyeOpen;
|
|
33
|
-
@property (nonatomic, assign) BOOL lastRightEyeOpen;
|
|
34
|
-
@property (nonatomic, assign) CGFloat lastHeadYaw;
|
|
35
|
-
|
|
36
|
-
// Detection thresholds
|
|
37
|
-
@property (nonatomic, assign, readonly) CGFloat smileThreshold;
|
|
38
|
-
@property (nonatomic, assign, readonly) CGFloat eyeOpenThreshold;
|
|
39
|
-
@property (nonatomic, assign, readonly) CGFloat headYawThreshold;
|
|
40
|
-
|
|
41
|
-
// Public methods
|
|
42
|
-
- (AVCaptureVideoPreviewLayer *)getPreviewLayer;
|
|
43
|
-
- (void)startCamera;
|
|
44
|
-
- (void)stopCamera;
|
|
45
|
-
|
|
46
|
-
@end
|