omnipay-reactnative-sdk 1.2.2-beta.4 → 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.
Files changed (135) hide show
  1. package/README.md +93 -43
  2. package/android/build.gradle +16 -15
  3. package/android/src/main/AndroidManifest.xml +1 -1
  4. package/android/src/main/java/com/omniretail/omnipay/OmnipayActivityPackage.java +2 -2
  5. package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessCameraView.java +153 -0
  6. package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessCameraViewManager.java +49 -0
  7. package/android/src/main/java/com/omniretail/omnipay/OmnipayLivenessModule.java +524 -0
  8. package/ios/OmnipayLivenessCameraView.h +15 -0
  9. package/ios/OmnipayLivenessCameraView.m +80 -0
  10. package/ios/OmnipayLivenessCameraViewManager.m +19 -0
  11. package/ios/OmnipayLivenessModule.h +38 -0
  12. package/ios/OmnipayLivenessModule.m +554 -0
  13. package/lib/commonjs/components/OmnipayProvider.js +2 -66
  14. package/lib/commonjs/components/OmnipayProvider.js.map +1 -1
  15. package/lib/commonjs/components/OmnipayView.js.map +1 -1
  16. package/lib/commonjs/components/biometrics/FaceVerification.js +252 -345
  17. package/lib/commonjs/components/biometrics/FaceVerification.js.map +1 -1
  18. package/lib/commonjs/components/biometrics/LivenessDetection.js +90 -198
  19. package/lib/commonjs/components/biometrics/LivenessDetection.js.map +1 -1
  20. package/lib/commonjs/components/biometrics/OmnipayLivenessCameraView.js +15 -0
  21. package/lib/commonjs/components/biometrics/OmnipayLivenessCameraView.js.map +1 -0
  22. package/lib/commonjs/components/biometrics/PermissionManager.js +279 -0
  23. package/lib/commonjs/components/biometrics/PermissionManager.js.map +1 -0
  24. package/lib/commonjs/components/biometrics/index.js +45 -0
  25. package/lib/commonjs/components/biometrics/index.js.map +1 -0
  26. package/lib/commonjs/components/biometrics/types.js +17 -0
  27. package/lib/commonjs/components/biometrics/types.js.map +1 -0
  28. package/lib/commonjs/components/views/BvnVerification.js.map +1 -1
  29. package/lib/commonjs/components/views/PaylaterAgreement.js.map +1 -1
  30. package/lib/commonjs/components/views/Registration.js.map +1 -1
  31. package/lib/commonjs/index.js +23 -18
  32. package/lib/commonjs/index.js.map +1 -1
  33. package/lib/module/components/OmnipayProvider.js +3 -67
  34. package/lib/module/components/OmnipayProvider.js.map +1 -1
  35. package/lib/module/components/OmnipayView.js.map +1 -1
  36. package/lib/module/components/biometrics/FaceVerification.js +254 -346
  37. package/lib/module/components/biometrics/FaceVerification.js.map +1 -1
  38. package/lib/module/components/biometrics/LivenessDetection.js +75 -197
  39. package/lib/module/components/biometrics/LivenessDetection.js.map +1 -1
  40. package/lib/module/components/biometrics/OmnipayLivenessCameraView.js +7 -0
  41. package/lib/module/components/biometrics/OmnipayLivenessCameraView.js.map +1 -0
  42. package/lib/module/components/biometrics/PermissionManager.js +272 -0
  43. package/lib/module/components/biometrics/PermissionManager.js.map +1 -0
  44. package/lib/module/components/biometrics/index.js +12 -0
  45. package/lib/module/components/biometrics/index.js.map +1 -0
  46. package/lib/module/components/biometrics/types.js +16 -0
  47. package/lib/module/components/biometrics/types.js.map +1 -0
  48. package/lib/module/components/views/BvnVerification.js.map +1 -1
  49. package/lib/module/components/views/PaylaterAgreement.js.map +1 -1
  50. package/lib/module/components/views/Registration.js.map +1 -1
  51. package/lib/module/index.js +5 -4
  52. package/lib/module/index.js.map +1 -1
  53. package/lib/typescript/{src/components → components}/OmnipayProvider.d.ts +1 -1
  54. package/lib/typescript/components/OmnipayProvider.d.ts.map +1 -0
  55. package/lib/typescript/{src/components → components}/OmnipayView.d.ts +21 -20
  56. package/lib/typescript/components/OmnipayView.d.ts.map +1 -0
  57. package/lib/typescript/components/biometrics/FaceVerification.d.ts +11 -0
  58. package/lib/typescript/components/biometrics/FaceVerification.d.ts.map +1 -0
  59. package/lib/typescript/components/biometrics/LivenessDetection.d.ts +33 -0
  60. package/lib/typescript/components/biometrics/LivenessDetection.d.ts.map +1 -0
  61. package/lib/typescript/components/biometrics/OmnipayLivenessCameraView.d.ts +18 -0
  62. package/lib/typescript/components/biometrics/OmnipayLivenessCameraView.d.ts.map +1 -0
  63. package/lib/typescript/components/biometrics/PermissionManager.d.ts +58 -0
  64. package/lib/typescript/components/biometrics/PermissionManager.d.ts.map +1 -0
  65. package/lib/typescript/components/biometrics/index.d.ts +5 -0
  66. package/lib/typescript/components/biometrics/index.d.ts.map +1 -0
  67. package/lib/typescript/components/biometrics/types.d.ts +73 -0
  68. package/lib/typescript/components/biometrics/types.d.ts.map +1 -0
  69. package/lib/typescript/{src/components → components}/views/BvnVerification.d.ts +2 -1
  70. package/lib/typescript/components/views/BvnVerification.d.ts.map +1 -0
  71. package/lib/typescript/{src/components → components}/views/PaylaterAgreement.d.ts +2 -1
  72. package/lib/typescript/components/views/PaylaterAgreement.d.ts.map +1 -0
  73. package/lib/typescript/{src/components → components}/views/Registration.d.ts +2 -1
  74. package/lib/typescript/components/views/Registration.d.ts.map +1 -0
  75. package/lib/typescript/functions.d.ts.map +1 -0
  76. package/lib/typescript/hooks/useOmnipay.d.ts +28 -0
  77. package/lib/typescript/hooks/useOmnipay.d.ts.map +1 -0
  78. package/lib/typescript/index.d.ts +7 -0
  79. package/lib/typescript/index.d.ts.map +1 -0
  80. package/lib/typescript/lib/colors.d.ts.map +1 -0
  81. package/lib/typescript/lib/config.d.ts.map +1 -0
  82. package/omnipay-reactnative-sdk.podspec +32 -29
  83. package/package.json +15 -10
  84. package/src/components/OmnipayProvider.tsx +3 -106
  85. package/src/components/OmnipayView.tsx +1 -1
  86. package/src/components/biometrics/FaceVerification.tsx +291 -368
  87. package/src/components/biometrics/LivenessDetection.ts +113 -250
  88. package/src/components/biometrics/OmnipayLivenessCameraView.tsx +19 -0
  89. package/src/components/biometrics/PermissionManager.ts +317 -0
  90. package/src/components/biometrics/index.ts +11 -0
  91. package/src/components/biometrics/types.ts +86 -0
  92. package/src/components/views/BvnVerification.tsx +1 -1
  93. package/src/components/views/PaylaterAgreement.tsx +1 -1
  94. package/src/components/views/Registration.tsx +1 -1
  95. package/src/index.tsx +4 -15
  96. package/android/src/main/java/com/omniretail/omnipay/LivenessCameraViewManager.java +0 -116
  97. package/android/src/main/java/com/omniretail/omnipay/LivenessDetectionModule.java +0 -588
  98. package/ios/LivenessCameraView.h +0 -22
  99. package/ios/LivenessCameraView.m +0 -135
  100. package/ios/LivenessCameraViewManager.h +0 -12
  101. package/ios/LivenessCameraViewManager.m +0 -24
  102. package/ios/LivenessDetectionModule.h +0 -46
  103. package/ios/LivenessDetectionModule.m +0 -603
  104. package/lib/commonjs/components/biometrics/LivenessCameraView.js +0 -45
  105. package/lib/commonjs/components/biometrics/LivenessCameraView.js.map +0 -1
  106. package/lib/module/components/biometrics/LivenessCameraView.js +0 -39
  107. package/lib/module/components/biometrics/LivenessCameraView.js.map +0 -1
  108. package/lib/typescript/demo/src/App.d.ts +0 -3
  109. package/lib/typescript/demo/src/App.d.ts.map +0 -1
  110. package/lib/typescript/demo/src/Body.d.ts +0 -3
  111. package/lib/typescript/demo/src/Body.d.ts.map +0 -1
  112. package/lib/typescript/demo/src/NotificationsExample.d.ts +0 -4
  113. package/lib/typescript/demo/src/NotificationsExample.d.ts.map +0 -1
  114. package/lib/typescript/src/components/OmnipayProvider.d.ts.map +0 -1
  115. package/lib/typescript/src/components/OmnipayView.d.ts.map +0 -1
  116. package/lib/typescript/src/components/biometrics/FaceVerification.d.ts +0 -12
  117. package/lib/typescript/src/components/biometrics/FaceVerification.d.ts.map +0 -1
  118. package/lib/typescript/src/components/biometrics/LivenessCameraView.d.ts +0 -22
  119. package/lib/typescript/src/components/biometrics/LivenessCameraView.d.ts.map +0 -1
  120. package/lib/typescript/src/components/biometrics/LivenessDetection.d.ts +0 -73
  121. package/lib/typescript/src/components/biometrics/LivenessDetection.d.ts.map +0 -1
  122. package/lib/typescript/src/components/views/BvnVerification.d.ts.map +0 -1
  123. package/lib/typescript/src/components/views/PaylaterAgreement.d.ts.map +0 -1
  124. package/lib/typescript/src/components/views/Registration.d.ts.map +0 -1
  125. package/lib/typescript/src/functions.d.ts.map +0 -1
  126. package/lib/typescript/src/hooks/useOmnipay.d.ts +0 -28
  127. package/lib/typescript/src/hooks/useOmnipay.d.ts.map +0 -1
  128. package/lib/typescript/src/index.d.ts +0 -8
  129. package/lib/typescript/src/index.d.ts.map +0 -1
  130. package/lib/typescript/src/lib/colors.d.ts.map +0 -1
  131. package/lib/typescript/src/lib/config.d.ts.map +0 -1
  132. package/src/components/biometrics/LivenessCameraView.tsx +0 -61
  133. /package/lib/typescript/{src/functions.d.ts → functions.d.ts} +0 -0
  134. /package/lib/typescript/{src/lib → lib}/colors.d.ts +0 -0
  135. /package/lib/typescript/{src/lib → lib}/config.d.ts +0 -0
@@ -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,12 +0,0 @@
1
- //
2
- // LivenessCameraViewManager.h
3
- // omnipay-reactnative-sdk
4
- //
5
- // Created by React Native Auto-generated
6
- //
7
-
8
- #import <React/RCTViewManager.h>
9
-
10
- @interface LivenessCameraViewManager : RCTViewManager
11
-
12
- @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