omnipay-reactnative-sdk 1.2.2-beta.0 → 1.2.2-beta.3

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 (129) hide show
  1. package/README.md +45 -136
  2. package/android/build.gradle +13 -0
  3. package/android/src/main/AndroidManifest.xml +5 -0
  4. package/android/src/main/java/com/omniretail/omnipay/LivenessCameraViewManager.java +116 -0
  5. package/android/src/main/java/com/omniretail/omnipay/LivenessDetectionModule.java +588 -0
  6. package/android/src/main/java/com/omniretail/omnipay/OmnipayActivityPackage.java +4 -1
  7. package/ios/LivenessCameraView.h +22 -0
  8. package/ios/LivenessCameraView.m +135 -0
  9. package/ios/LivenessCameraViewManager.h +12 -0
  10. package/ios/LivenessCameraViewManager.m +24 -0
  11. package/ios/LivenessDetectionModule.h +46 -0
  12. package/ios/LivenessDetectionModule.m +603 -0
  13. package/lib/commonjs/components/OmnipayProvider.js +48 -104
  14. package/lib/commonjs/components/OmnipayProvider.js.map +1 -1
  15. package/lib/commonjs/components/OmnipayView.js +11 -14
  16. package/lib/commonjs/components/OmnipayView.js.map +1 -1
  17. package/lib/commonjs/components/biometrics/FaceVerification.js +435 -0
  18. package/lib/commonjs/components/biometrics/FaceVerification.js.map +1 -0
  19. package/lib/commonjs/components/biometrics/LivenessCameraView.js +45 -0
  20. package/lib/commonjs/components/biometrics/LivenessCameraView.js.map +1 -0
  21. package/lib/commonjs/components/biometrics/LivenessDetection.js +251 -0
  22. package/lib/commonjs/components/biometrics/LivenessDetection.js.map +1 -0
  23. package/lib/commonjs/components/views/BvnVerification.js +10 -12
  24. package/lib/commonjs/components/views/BvnVerification.js.map +1 -1
  25. package/lib/commonjs/components/views/PaylaterAgreement.js +14 -16
  26. package/lib/commonjs/components/views/PaylaterAgreement.js.map +1 -1
  27. package/lib/commonjs/components/views/Registration.js +13 -11
  28. package/lib/commonjs/components/views/Registration.js.map +1 -1
  29. package/lib/commonjs/functions.js.map +1 -1
  30. package/lib/commonjs/hooks/useOmnipay.js.map +1 -1
  31. package/lib/commonjs/index.js +30 -3
  32. package/lib/commonjs/index.js.map +1 -1
  33. package/lib/commonjs/lib/colors.js +1 -2
  34. package/lib/commonjs/lib/colors.js.map +1 -1
  35. package/lib/commonjs/lib/config.js +2 -4
  36. package/lib/commonjs/lib/config.js.map +1 -1
  37. package/lib/module/components/OmnipayProvider.js +45 -99
  38. package/lib/module/components/OmnipayProvider.js.map +1 -1
  39. package/lib/module/components/OmnipayView.js +9 -10
  40. package/lib/module/components/OmnipayView.js.map +1 -1
  41. package/lib/module/components/biometrics/FaceVerification.js +427 -0
  42. package/lib/module/components/biometrics/FaceVerification.js.map +1 -0
  43. package/lib/module/components/biometrics/LivenessCameraView.js +39 -0
  44. package/lib/module/components/biometrics/LivenessCameraView.js.map +1 -0
  45. package/lib/module/components/biometrics/LivenessDetection.js +245 -0
  46. package/lib/module/components/biometrics/LivenessDetection.js.map +1 -0
  47. package/lib/module/components/views/BvnVerification.js +9 -10
  48. package/lib/module/components/views/BvnVerification.js.map +1 -1
  49. package/lib/module/components/views/PaylaterAgreement.js +13 -14
  50. package/lib/module/components/views/PaylaterAgreement.js.map +1 -1
  51. package/lib/module/components/views/Registration.js +13 -9
  52. package/lib/module/components/views/Registration.js.map +1 -1
  53. package/lib/module/functions.js.map +1 -1
  54. package/lib/module/hooks/useOmnipay.js.map +1 -1
  55. package/lib/module/index.js +5 -0
  56. package/lib/module/index.js.map +1 -1
  57. package/lib/module/lib/colors.js.map +1 -1
  58. package/lib/module/lib/config.js.map +1 -1
  59. package/lib/typescript/demo/src/App.d.ts +3 -0
  60. package/lib/typescript/demo/src/App.d.ts.map +1 -0
  61. package/lib/typescript/demo/src/Body.d.ts +3 -0
  62. package/lib/typescript/demo/src/Body.d.ts.map +1 -0
  63. package/lib/typescript/demo/src/NotificationsExample.d.ts +4 -0
  64. package/lib/typescript/demo/src/NotificationsExample.d.ts.map +1 -0
  65. package/lib/typescript/{components → src/components}/OmnipayProvider.d.ts +5 -5
  66. package/lib/typescript/src/components/OmnipayProvider.d.ts.map +1 -0
  67. package/lib/typescript/{components → src/components}/OmnipayView.d.ts +1 -3
  68. package/lib/typescript/src/components/OmnipayView.d.ts.map +1 -0
  69. package/lib/typescript/src/components/biometrics/FaceVerification.d.ts +12 -0
  70. package/lib/typescript/src/components/biometrics/FaceVerification.d.ts.map +1 -0
  71. package/lib/typescript/src/components/biometrics/LivenessCameraView.d.ts +22 -0
  72. package/lib/typescript/src/components/biometrics/LivenessCameraView.d.ts.map +1 -0
  73. package/lib/typescript/src/components/biometrics/LivenessDetection.d.ts +73 -0
  74. package/lib/typescript/src/components/biometrics/LivenessDetection.d.ts.map +1 -0
  75. package/lib/typescript/{components → src/components}/views/BvnVerification.d.ts +1 -3
  76. package/lib/typescript/src/components/views/BvnVerification.d.ts.map +1 -0
  77. package/lib/typescript/{components → src/components}/views/PaylaterAgreement.d.ts +2 -4
  78. package/lib/typescript/src/components/views/PaylaterAgreement.d.ts.map +1 -0
  79. package/lib/typescript/{components → src/components}/views/Registration.d.ts +2 -4
  80. package/lib/typescript/src/components/views/Registration.d.ts.map +1 -0
  81. package/lib/typescript/src/functions.d.ts.map +1 -0
  82. package/lib/typescript/src/hooks/useOmnipay.d.ts.map +1 -0
  83. package/lib/typescript/src/index.d.ts +8 -0
  84. package/lib/typescript/src/index.d.ts.map +1 -0
  85. package/lib/typescript/src/lib/colors.d.ts.map +1 -0
  86. package/lib/typescript/src/lib/config.d.ts.map +1 -0
  87. package/omnipay-reactnative-sdk.podspec +47 -0
  88. package/package.json +6 -11
  89. package/src/components/OmnipayProvider.tsx +9 -66
  90. package/src/components/biometrics/FaceVerification.tsx +484 -0
  91. package/src/components/biometrics/LivenessCameraView.tsx +61 -0
  92. package/src/components/biometrics/LivenessDetection.ts +305 -0
  93. package/src/index.tsx +18 -0
  94. package/lib/commonjs/components/FaceVerification.js +0 -755
  95. package/lib/commonjs/components/FaceVerification.js.map +0 -1
  96. package/lib/commonjs/types/faceVerification.js +0 -2
  97. package/lib/commonjs/types/faceVerification.js.map +0 -1
  98. package/lib/commonjs/types/index.js +0 -17
  99. package/lib/commonjs/types/index.js.map +0 -1
  100. package/lib/module/components/FaceVerification.js +0 -746
  101. package/lib/module/components/FaceVerification.js.map +0 -1
  102. package/lib/module/types/faceVerification.js +0 -2
  103. package/lib/module/types/faceVerification.js.map +0 -1
  104. package/lib/module/types/index.js +0 -2
  105. package/lib/module/types/index.js.map +0 -1
  106. package/lib/typescript/components/FaceVerification.d.ts +0 -10
  107. package/lib/typescript/components/FaceVerification.d.ts.map +0 -1
  108. package/lib/typescript/components/OmnipayProvider.d.ts.map +0 -1
  109. package/lib/typescript/components/OmnipayView.d.ts.map +0 -1
  110. package/lib/typescript/components/views/BvnVerification.d.ts.map +0 -1
  111. package/lib/typescript/components/views/PaylaterAgreement.d.ts.map +0 -1
  112. package/lib/typescript/components/views/Registration.d.ts.map +0 -1
  113. package/lib/typescript/functions.d.ts.map +0 -1
  114. package/lib/typescript/hooks/useOmnipay.d.ts.map +0 -1
  115. package/lib/typescript/index.d.ts +0 -5
  116. package/lib/typescript/index.d.ts.map +0 -1
  117. package/lib/typescript/lib/colors.d.ts.map +0 -1
  118. package/lib/typescript/lib/config.d.ts.map +0 -1
  119. package/lib/typescript/types/faceVerification.d.ts +0 -18
  120. package/lib/typescript/types/faceVerification.d.ts.map +0 -1
  121. package/lib/typescript/types/index.d.ts +0 -2
  122. package/lib/typescript/types/index.d.ts.map +0 -1
  123. package/src/components/FaceVerification.tsx +0 -884
  124. package/src/types/faceVerification.ts +0 -27
  125. package/src/types/index.ts +0 -1
  126. /package/lib/typescript/{functions.d.ts → src/functions.d.ts} +0 -0
  127. /package/lib/typescript/{hooks → src/hooks}/useOmnipay.d.ts +0 -0
  128. /package/lib/typescript/{lib → src/lib}/colors.d.ts +0 -0
  129. /package/lib/typescript/{lib → src/lib}/config.d.ts +0 -0
@@ -0,0 +1,73 @@
1
+ export interface LivenessDetectionConfig {
2
+ challenges: ('smile' | 'blink' | 'turn_left' | 'turn_right')[];
3
+ timeout?: number;
4
+ }
5
+ export interface ChallengeResult {
6
+ challenge: string;
7
+ success: boolean;
8
+ timestamp: number;
9
+ duration?: number;
10
+ }
11
+ export interface LivenessResult {
12
+ success: boolean;
13
+ screenshot?: string;
14
+ challengeResults: ChallengeResult[];
15
+ error?: string;
16
+ }
17
+ export interface LivenessCallbacks {
18
+ onChallengeStart?: (challenge: string) => void;
19
+ onChallengeSuccess?: (challenge: string) => void;
20
+ onChallengeFailure?: (challenge: string, reason: string) => void;
21
+ onAllChallengesComplete?: (result: LivenessResult) => void;
22
+ onScreenshotCaptured?: (screenshot: string) => void;
23
+ }
24
+ declare class LivenessDetectionManager {
25
+ private eventEmitter;
26
+ private listeners;
27
+ private callbacks;
28
+ private isActive;
29
+ private challengeResults;
30
+ private startTime;
31
+ constructor();
32
+ private setupEventListeners;
33
+ /**
34
+ * Start liveness detection with specified challenges
35
+ * @param config - Configuration including challenges array
36
+ * @param callbacks - Event callbacks
37
+ * @returns Promise resolving to LivenessResult
38
+ */
39
+ startLivenessDetection(config: LivenessDetectionConfig, callbacks?: LivenessCallbacks): Promise<LivenessResult>;
40
+ /**
41
+ * Stop liveness detection
42
+ */
43
+ stopDetection(): void;
44
+ /**
45
+ * Check if liveness detection is currently active
46
+ */
47
+ isDetectionActive(): boolean;
48
+ /**
49
+ * Get available challenge types
50
+ */
51
+ getAvailableChallenges(): string[];
52
+ /**
53
+ * Check if camera permission is granted
54
+ */
55
+ checkCameraPermission(): Promise<boolean>;
56
+ /**
57
+ * Request camera permission from the user
58
+ */
59
+ requestCameraPermission(): Promise<boolean>;
60
+ /**
61
+ * Cleanup - remove all event listeners
62
+ */
63
+ cleanup(): void;
64
+ }
65
+ export declare const LivenessDetection: LivenessDetectionManager;
66
+ export declare const LivenessConstants: {
67
+ readonly CHALLENGE_SMILE: "smile";
68
+ readonly CHALLENGE_BLINK: "blink";
69
+ readonly CHALLENGE_TURN_LEFT: "turn_left";
70
+ readonly CHALLENGE_TURN_RIGHT: "turn_right";
71
+ };
72
+ export {};
73
+ //# sourceMappingURL=LivenessDetection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LivenessDetection.d.ts","sourceRoot":"","sources":["../../../../../src/components/biometrics/LivenessDetection.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,CAAC,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,eAAe,EAAE,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,MAAM,WAAW,iBAAiB;IAChC,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACjE,uBAAuB,CAAC,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,CAAC;IAC3D,oBAAoB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACrD;AAGD,cAAM,wBAAwB;IAC5B,OAAO,CAAC,YAAY,CAAmC;IACvD,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,SAAS,CAAyB;IAC1C,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,gBAAgB,CAAyB;IACjD,OAAO,CAAC,SAAS,CAAa;;IAS9B,OAAO,CAAC,mBAAmB;IAwF3B;;;;;OAKG;IACG,sBAAsB,CAC1B,MAAM,EAAE,uBAAuB,EAC/B,SAAS,CAAC,EAAE,iBAAiB,GAC5B,OAAO,CAAC,cAAc,CAAC;IA0E1B;;OAEG;IACH,aAAa,IAAI,IAAI;IAUrB;;OAEG;IACH,iBAAiB,IAAI,OAAO;IAI5B;;OAEG;IACH,sBAAsB,IAAI,MAAM,EAAE;IAIlC;;OAEG;IACG,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC;IAa/C;;OAEG;IACG,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC;IAajD;;OAEG;IACH,OAAO,IAAI,IAAI;CAShB;AAGD,eAAO,MAAM,iBAAiB,0BAAiC,CAAC;AAKhE,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC"}
@@ -1,6 +1,4 @@
1
- /// <reference types="react" />
2
- /// <reference types="react" />
3
- declare type OmnipayProps = {
1
+ type OmnipayProps = {
4
2
  color: string;
5
3
  env: 'dev' | 'prod';
6
4
  publicKey: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BvnVerification.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/BvnVerification.tsx"],"names":[],"mappings":"AAWA,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAIF,eAAO,MAAM,eAAe,4FAQzB,YAAY,KAAG,WA6FjB,CAAC"}
@@ -1,9 +1,7 @@
1
- /// <reference types="react" />
2
- /// <reference types="react" />
3
- declare type AgreementSubmittedType = {
1
+ type AgreementSubmittedType = {
4
2
  agreementId: string;
5
3
  };
6
- declare type OmnipayProps = {
4
+ type OmnipayProps = {
7
5
  color: string;
8
6
  env: 'dev' | 'prod';
9
7
  publicKey: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PaylaterAgreement.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/PaylaterAgreement.tsx"],"names":[],"mappings":"AAWA,KAAK,sBAAsB,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACvE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAIF,eAAO,MAAM,iBAAiB,6HAY3B,YAAY,KAAG,WA+FjB,CAAC"}
@@ -1,10 +1,8 @@
1
- /// <reference types="react" />
2
- /// <reference types="react" />
3
- declare type RegisterSuccessType = {
1
+ type RegisterSuccessType = {
4
2
  customerRef: string;
5
3
  walletId: string;
6
4
  };
7
- declare type OmnipayProps = {
5
+ type OmnipayProps = {
8
6
  color: string;
9
7
  env: 'dev' | 'prod';
10
8
  publicKey: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Registration.d.ts","sourceRoot":"","sources":["../../../../../src/components/views/Registration.tsx"],"names":[],"mappings":"AAWA,KAAK,mBAAmB,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,KAAK,GAAG,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,wBAAwB,CAAC,EAAE,CAAC,EAC1B,WAAW,EACX,QAAQ,GACT,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAQF,eAAO,MAAM,YAAY,+EAOtB,YAAY,KAAG,WA2FjB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../../src/functions.ts"],"names":[],"mappings":"AAGA,wBAAsB,oBAAoB,qBAoBzC;AAED,wBAAsB,UAAU;;;GAe/B;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,oEAK7C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useOmnipay.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useOmnipay.tsx"],"names":[],"mappings":"AAMA,wBAAgB,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;EAQzB"}
@@ -0,0 +1,8 @@
1
+ import Omnipay from './components/OmnipayView';
2
+ export { OmnipayProvider } from './components/OmnipayProvider';
3
+ export { useOmnipay } from './hooks/useOmnipay';
4
+ export { LivenessDetection, LivenessConstants, type LivenessDetectionConfig, type ChallengeResult, type LivenessResult, type LivenessCallbacks, } from './components/biometrics/LivenessDetection';
5
+ export { default as LivenessCameraView, type LivenessCameraViewProps, } from './components/biometrics/LivenessCameraView';
6
+ export { default as FaceVerification } from './components/biometrics/FaceVerification';
7
+ export default Omnipay;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,0BAA0B,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EACL,OAAO,IAAI,kBAAkB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAEvF,eAAe,OAAO,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../src/lib/colors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BlB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/lib/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;CAG5B,CAAC"}
@@ -0,0 +1,47 @@
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.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => "11.0" }
14
+ s.source = { :git => "https://github.com/engrtitus/omnipay-reactnative-sdk.git", :tag => "#{s.version}" }
15
+
16
+ # Source files
17
+ s.source_files = "ios/**/*.{h,m,mm,swift}"
18
+
19
+ # Required frameworks for liveness detection
20
+ s.frameworks = [
21
+ "AVFoundation",
22
+ "Vision",
23
+ "CoreMedia",
24
+ "CoreVideo",
25
+ "ImageIO",
26
+ "UIKit",
27
+ "Foundation"
28
+ ]
29
+
30
+ # React Native dependencies
31
+ s.dependency "React-Core"
32
+
33
+ # iOS deployment target
34
+ s.ios.deployment_target = '11.0'
35
+
36
+ # Compiler flags
37
+ s.compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1'
38
+
39
+ # Pod configuration
40
+ s.pod_target_xcconfig = {
41
+ "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/boost-for-react-native\" \"$(PODS_ROOT)/Folly\""
42
+ }
43
+
44
+ # Minimum iOS version for Vision framework
45
+ s.ios.deployment_target = '11.0'
46
+
47
+ end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omnipay-reactnative-sdk",
3
- "version": "1.2.2-beta.0",
3
+ "version": "1.2.2-beta.3",
4
4
  "description": "Omnipay react native sdk",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -35,8 +35,7 @@
35
35
  "example": "yarn --cwd example",
36
36
  "bootstrap": "yarn example && yarn install && yarn example pods",
37
37
  "format": "prettier --write '**'",
38
- "lint-fix": "eslint --fix --ext .ts,.tsx .",
39
- "publish": "npm publish --tag beta"
38
+ "lint-fix": "eslint --fix --ext .ts,.tsx ."
40
39
  },
41
40
  "keywords": [
42
41
  "react-native",
@@ -81,8 +80,7 @@
81
80
  "peerDependencies": {
82
81
  "react": "*",
83
82
  "react-native": "*",
84
- "react-native-share": "^10.2.1",
85
- "react-native-svg": "^13.4.0"
83
+ "react-native-share": "^10.2.1"
86
84
  },
87
85
  "jest": {
88
86
  "preset": "react-native",
@@ -160,10 +158,7 @@
160
158
  "dependencies": {
161
159
  "@react-native-async-storage/async-storage": "^1.19.0",
162
160
  "react-native-select-contact": "^1.6.3",
163
- "react-native-webview": "^11.23.1",
164
- "react-native-vision-camera": "^3.9.0",
165
- "react-native-vision-camera-face-detector": "^1.3.5",
166
- "react-native-svg": "^13.4.0",
167
- "react-native-worklets-core": "^1.0.0"
168
- }
161
+ "react-native-webview": "^11.23.1"
162
+ },
163
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
169
164
  }
@@ -19,7 +19,7 @@ import WebView, { WebViewMessageEvent } from 'react-native-webview';
19
19
  import { getContact } from '../functions';
20
20
  import Share from 'react-native-share';
21
21
  import AsyncStorage from '@react-native-async-storage/async-storage';
22
- import FaceVerification from './FaceVerification';
22
+ import FaceVerification from './biometrics/FaceVerification';
23
23
 
24
24
  const OmnipayActivity = NativeModules.OmnipayActivity || {};
25
25
 
@@ -112,7 +112,7 @@ export const OmnipayProvider = ({
112
112
  publicKey,
113
113
  env,
114
114
  color,
115
- }: OmnipayProviderProps) => {
115
+ }: OmnipayProviderProps): React.ReactElement => {
116
116
  const [webviewStatus, setWebviewStatus] = useState<Status>('loading');
117
117
  const [isVisible, setIsVisible] = useState(false);
118
118
  const webviewRef = useRef<WebView>(null);
@@ -125,11 +125,7 @@ export const OmnipayProvider = ({
125
125
  const isValidColor = color.length > 2;
126
126
  const onCloseRef = useRef<(() => void) | undefined>(undefined);
127
127
  const [canUsePos, setCanUsePos] = useState(false);
128
-
129
- // Face verification state
130
128
  const [showFaceVerification, setShowFaceVerification] = useState(false);
131
- const [faceVerificationOptions, setFaceVerificationOptions] =
132
- useState<any>(null);
133
129
 
134
130
  useEffect(() => {
135
131
  checkPaymentApp();
@@ -287,9 +283,6 @@ export const OmnipayProvider = ({
287
283
  if (dataKey === 'startPosTransaction') {
288
284
  startPosTransaction(JSON.parse(dataValue));
289
285
  }
290
- if (dataKey === 'startFaceVerification') {
291
- startFaceVerification(dataValue ? JSON.parse(dataValue) : {});
292
- }
293
286
  }
294
287
  } catch (error) {}
295
288
  }
@@ -373,44 +366,6 @@ export const OmnipayProvider = ({
373
366
  }
374
367
  }
375
368
 
376
- function startFaceVerification(options: any) {
377
- setFaceVerificationOptions(options);
378
- setShowFaceVerification(true);
379
- }
380
-
381
- function handleFaceVerificationSuccess(base64Image: string) {
382
- setShowFaceVerification(false);
383
- postMessage({
384
- dataKey: 'faceVerificationComplete',
385
- dataValue: {
386
- success: true,
387
- image: base64Image,
388
- ...(faceVerificationOptions || {}),
389
- },
390
- });
391
- }
392
-
393
- function handleFaceVerificationFailure() {
394
- setShowFaceVerification(false);
395
- postMessage({
396
- dataKey: 'faceVerificationComplete',
397
- dataValue: {
398
- success: false,
399
- error: 'Face verification failed',
400
- },
401
- });
402
- }
403
-
404
- function handleFaceVerificationCancel() {
405
- setShowFaceVerification(false);
406
- postMessage({
407
- dataKey: 'faceVerificationCancelled',
408
- dataValue: {
409
- cancelled: true,
410
- },
411
- });
412
- }
413
-
414
369
  const webviewStyle = getWebviewStyle();
415
370
  const isPropsValid = isValidColor && !!publicKey && isValidEnv;
416
371
  const isWalletView = webviewUrl.includes('view=wallet');
@@ -503,24 +458,16 @@ export const OmnipayProvider = ({
503
458
  </TouchableOpacity>
504
459
  </Modal>
505
460
  )}
506
-
507
- {/* Face Verification Modal */}
508
- <Modal
509
- visible={showFaceVerification}
510
- transparent
511
- animationType="slide"
512
- >
513
- <View style={styles.faceVerificationContainer}>
514
- <FaceVerification
515
- onSuccess={handleFaceVerificationSuccess}
516
- onFailure={handleFaceVerificationFailure}
517
- onCancel={handleFaceVerificationCancel}
518
- />
519
- </View>
520
- </Modal>
521
461
  </>
522
462
  )}
523
463
  {children}
464
+ {showFaceVerification && (
465
+ <FaceVerification
466
+ onClose={() => setShowFaceVerification(false)}
467
+ onSuccess={() => setShowFaceVerification(false)}
468
+ primaryColor={color}
469
+ />
470
+ )}
524
471
  </OmnipayContext.Provider>
525
472
  );
526
473
  };
@@ -640,8 +587,4 @@ const styles = StyleSheet.create({
640
587
  justifyContent: 'center',
641
588
  },
642
589
  buttonText: { color: 'white', fontSize: 16, paddingHorizontal: 30 },
643
- faceVerificationContainer: {
644
- flex: 1,
645
- backgroundColor: 'white',
646
- },
647
590
  });