react-native-payengine 1.0.5 → 2.0.2

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 (242) hide show
  1. package/README.md +193 -111
  2. package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
  3. package/android/.gradle/{5.6.4 → 6.1.1}/fileHashes/fileHashes.bin +0 -0
  4. package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  6. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  7. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  8. package/android/.gradle/checksums/checksums.lock +0 -0
  9. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  10. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  11. package/android/.gradle/config.properties +2 -0
  12. package/android/.idea/caches/deviceStreaming.xml +318 -0
  13. package/android/.idea/compiler.xml +1 -1
  14. package/android/.idea/gradle.xml +2 -2
  15. package/android/.idea/kotlinc.xml +6 -0
  16. package/android/.idea/migrations.xml +10 -0
  17. package/android/.idea/misc.xml +1 -1
  18. package/android/build.gradle +42 -6
  19. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  20. package/android/paymentsdk-debug.aar +0 -0
  21. package/android/paymentsdk-release.aar +0 -0
  22. package/android/src/legacy/AndroidManifest.xml +4 -0
  23. package/android/src/main/java/com/reactnativepayengine/GooglePayModule.java +196 -0
  24. package/android/src/main/java/com/reactnativepayengine/PayengineModule.java +1 -5
  25. package/android/src/main/java/com/reactnativepayengine/PayenginePackage.java +8 -33
  26. package/android/src/main/java/com/reactnativepayengine/util/MetricsUtil.kt +44 -0
  27. package/android/src/main/java/com/reactnativepayengine/util/PaymentsUtil.java +113 -0
  28. package/android/src/main/java/com/reactnativepayengine/v2/RNPEFraudAnalyticsApplication.java +55 -0
  29. package/android/src/main/java/com/reactnativepayengine/v2/RNPayEngineNative.kt +71 -0
  30. package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEEvents.kt +8 -0
  31. package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEField.kt +17 -0
  32. package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNBankAccountViewManager.kt +103 -0
  33. package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNPEBankAccountView.kt +77 -0
  34. package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardView.kt +77 -0
  35. package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardViewManager.kt +103 -0
  36. package/ios/PayEngineSDK.xcframework/Info.plist +44 -0
  37. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
  38. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
  39. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
  40. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
  41. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +622 -0
  42. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
  43. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
  44. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
  45. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
  46. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +15143 -0
  47. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +326 -0
  48. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +326 -0
  49. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  50. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +326 -0
  51. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +326 -0
  52. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/module.modulemap +11 -0
  53. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
  54. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
  55. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  56. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/browserInfo.html +136 -0
  57. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/perform3ds.html +467 -0
  58. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
  59. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
  60. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
  61. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
  62. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +1240 -0
  63. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
  64. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
  65. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
  66. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
  67. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +15143 -0
  68. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +326 -0
  69. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +326 -0
  70. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  71. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +326 -0
  72. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +326 -0
  73. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +15143 -0
  74. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +326 -0
  75. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +326 -0
  76. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  77. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +326 -0
  78. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +326 -0
  79. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/module.modulemap +11 -0
  80. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
  81. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
  82. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  83. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/browserInfo.html +136 -0
  84. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/perform3ds.html +467 -0
  85. package/ios/Payengine.xcodeproj/project.pbxproj +30 -9
  86. package/ios/Payengine.xcodeproj/project.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  87. package/ios/Payengine.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +4 -4
  88. package/ios/Payengine.xcworkspace/contents.xcworkspacedata +7 -0
  89. package/ios/Payengine.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  90. package/ios/Sources/Classes/ApplePay/RNPEApplePayButton.swift +111 -0
  91. package/ios/Sources/Classes/ApplePay/RNPEApplePayPaymentRequest.swift +43 -0
  92. package/ios/Sources/Classes/RNPEError.swift +12 -0
  93. package/ios/Sources/Classes/RNPEEventEmitter.swift +29 -0
  94. package/ios/Sources/Classes/RNPEUtils.swift +30 -0
  95. package/ios/Sources/Classes/RNPayEngineNative.swift +87 -0
  96. package/ios/Sources/Classes/SecureFields/RNPEBankAccountView.swift +130 -0
  97. package/ios/Sources/Classes/SecureFields/RNPECreditCardView.swift +129 -0
  98. package/ios/Sources/Classes/SecureFields/RNPEEvents.swift +15 -0
  99. package/ios/Sources/Classes/SecureFields/RNPEField.swift +26 -0
  100. package/ios/Sources/Payengine.m +73 -0
  101. package/ios/Sources/Payengine.swift +13 -0
  102. package/lib/commonjs/components/PayEngine.js +2 -123
  103. package/lib/commonjs/components/PayEngine.js.map +1 -1
  104. package/lib/commonjs/components/{SecureFields/VGS/CardHolderNameField.js → v2/ApplePay/PEApplePayButton.js} +38 -13
  105. package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
  106. package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js +29 -0
  107. package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
  108. package/lib/commonjs/components/v2/PayEngineNative.js +34 -0
  109. package/lib/commonjs/components/v2/PayEngineNative.js.map +1 -0
  110. package/lib/commonjs/components/{SecureFields/VGS/TextField.js → v2/PayEngineProvider.js} +28 -12
  111. package/lib/commonjs/components/v2/PayEngineProvider.js.map +1 -0
  112. package/lib/commonjs/components/v2/SecureFields/BankAccountView.js +89 -0
  113. package/lib/commonjs/components/v2/SecureFields/BankAccountView.js.map +1 -0
  114. package/lib/commonjs/components/v2/SecureFields/CreditCardView.js +90 -0
  115. package/lib/commonjs/components/v2/SecureFields/CreditCardView.js.map +1 -0
  116. package/lib/commonjs/components/v2/SecureFields/IPEField.js +6 -0
  117. package/lib/commonjs/components/v2/SecureFields/IPEField.js.map +1 -0
  118. package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js +6 -0
  119. package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js.map +1 -0
  120. package/lib/commonjs/components/v2/SecureFields/PECard.js +6 -0
  121. package/lib/commonjs/components/v2/SecureFields/PECard.js.map +1 -0
  122. package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js +18 -0
  123. package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
  124. package/lib/commonjs/index.js +73 -8
  125. package/lib/commonjs/index.js.map +1 -1
  126. package/lib/commonjs/interfaces/index.js +2 -0
  127. package/lib/commonjs/interfaces/index.js.map +1 -0
  128. package/lib/commonjs/utils/index.js +29 -45
  129. package/lib/commonjs/utils/index.js.map +1 -1
  130. package/lib/module/components/PayEngine.js +3 -118
  131. package/lib/module/components/PayEngine.js.map +1 -1
  132. package/lib/module/components/v2/ApplePay/PEApplePayButton.js +37 -0
  133. package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
  134. package/lib/module/components/v2/ApplePay/PEPaymentRequest.js +20 -0
  135. package/lib/module/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
  136. package/lib/module/components/v2/PayEngineNative.js +23 -0
  137. package/lib/module/components/v2/PayEngineNative.js.map +1 -0
  138. package/lib/module/components/v2/PayEngineProvider.js +30 -0
  139. package/lib/module/components/v2/PayEngineProvider.js.map +1 -0
  140. package/lib/module/components/v2/SecureFields/BankAccountView.js +75 -0
  141. package/lib/module/components/v2/SecureFields/BankAccountView.js.map +1 -0
  142. package/lib/module/components/v2/SecureFields/CreditCardView.js +76 -0
  143. package/lib/module/components/v2/SecureFields/CreditCardView.js.map +1 -0
  144. package/lib/module/components/v2/SecureFields/IPEField.js +2 -0
  145. package/lib/module/components/v2/SecureFields/IPEField.js.map +1 -0
  146. package/lib/module/components/v2/SecureFields/PEBankAccount.js +2 -0
  147. package/lib/module/components/v2/SecureFields/PEBankAccount.js.map +1 -0
  148. package/lib/module/components/v2/SecureFields/PECard.js +2 -0
  149. package/lib/module/components/v2/SecureFields/PECard.js.map +1 -0
  150. package/lib/module/components/v2/SecureFields/PEKeyboardType.js +11 -0
  151. package/lib/module/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
  152. package/lib/module/index.js +15 -6
  153. package/lib/module/index.js.map +1 -1
  154. package/lib/module/interfaces/index.js +2 -0
  155. package/lib/module/interfaces/index.js.map +1 -0
  156. package/lib/module/utils/index.js +20 -45
  157. package/lib/module/utils/index.js.map +1 -1
  158. package/lib/typescript/components/PayEngine.d.ts +1 -14
  159. package/lib/typescript/components/v2/ApplePay/PEApplePayButton.d.ts +12 -0
  160. package/lib/typescript/components/v2/ApplePay/PEPaymentRequest.d.ts +12 -0
  161. package/lib/typescript/components/v2/PayEngineNative.d.ts +5 -0
  162. package/lib/typescript/components/v2/PayEngineProvider.d.ts +8 -0
  163. package/lib/typescript/components/v2/SecureFields/BankAccountView.d.ts +14 -0
  164. package/lib/typescript/components/v2/SecureFields/CreditCardView.d.ts +14 -0
  165. package/lib/typescript/components/v2/SecureFields/IPEField.d.ts +10 -0
  166. package/lib/typescript/components/v2/SecureFields/PEBankAccount.d.ts +11 -0
  167. package/lib/typescript/components/v2/SecureFields/PECard.d.ts +13 -0
  168. package/lib/typescript/components/v2/SecureFields/PEKeyboardType.d.ts +7 -0
  169. package/lib/typescript/index.d.ts +13 -3
  170. package/lib/typescript/interfaces/index.d.ts +6 -0
  171. package/lib/typescript/utils/index.d.ts +7 -41
  172. package/package.json +17 -11
  173. package/react-native-payengine.podspec +3 -3
  174. package/src/components/LoadingIndicator.tsx +28 -0
  175. package/src/components/PayEngine.tsx +8 -0
  176. package/src/components/v2/ApplePay/PEApplePayButton.tsx +70 -0
  177. package/src/components/v2/ApplePay/PEPaymentRequest.ts +18 -0
  178. package/src/components/v2/PayEngineNative.tsx +20 -0
  179. package/src/components/v2/PayEngineProvider.tsx +30 -0
  180. package/src/components/v2/SecureFields/BankAccountView.tsx +95 -0
  181. package/src/components/v2/SecureFields/CreditCardView.tsx +96 -0
  182. package/src/components/v2/SecureFields/IPEField.ts +12 -0
  183. package/src/components/v2/SecureFields/PEBankAccount.ts +12 -0
  184. package/src/components/v2/SecureFields/PECard.ts +14 -0
  185. package/src/components/v2/SecureFields/PEKeyboardType.ts +8 -0
  186. package/src/index.tsx +62 -0
  187. package/src/interfaces/index.ts +6 -0
  188. package/src/utils/index.ts +79 -0
  189. package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
  190. package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectModule.java +0 -148
  191. package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectOnCreateViewInstanceListener.java +0 -6
  192. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCVCField.java +0 -67
  193. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardHolderNameField.java +0 -53
  194. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardNumberField.java +0 -57
  195. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSExpDateField.java +0 -54
  196. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSTextField.java +0 -57
  197. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSZipCodeField.java +0 -62
  198. package/android/src/main/java/com/reactnativepayengine/util/ResourceUtil.java +0 -14
  199. package/ios/Payengine.m +0 -55
  200. package/ios/Payengine.swift +0 -637
  201. package/lib/commonjs/components/SecureFields/VGS/CVCField.js +0 -26
  202. package/lib/commonjs/components/SecureFields/VGS/CVCField.js.map +0 -1
  203. package/lib/commonjs/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
  204. package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js +0 -26
  205. package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js.map +0 -1
  206. package/lib/commonjs/components/SecureFields/VGS/CollectManager.js +0 -65
  207. package/lib/commonjs/components/SecureFields/VGS/CollectManager.js.map +0 -1
  208. package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js +0 -26
  209. package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js.map +0 -1
  210. package/lib/commonjs/components/SecureFields/VGS/TextField.js.map +0 -1
  211. package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js +0 -26
  212. package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
  213. package/lib/commonjs/components/SecureFields/index.js +0 -34
  214. package/lib/commonjs/components/SecureFields/index.js.map +0 -1
  215. package/lib/module/components/SecureFields/VGS/CVCField.js +0 -14
  216. package/lib/module/components/SecureFields/VGS/CVCField.js.map +0 -1
  217. package/lib/module/components/SecureFields/VGS/CardHolderNameField.js +0 -14
  218. package/lib/module/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
  219. package/lib/module/components/SecureFields/VGS/CardNumberField.js +0 -14
  220. package/lib/module/components/SecureFields/VGS/CardNumberField.js.map +0 -1
  221. package/lib/module/components/SecureFields/VGS/CollectManager.js +0 -50
  222. package/lib/module/components/SecureFields/VGS/CollectManager.js.map +0 -1
  223. package/lib/module/components/SecureFields/VGS/ExpDateField.js +0 -14
  224. package/lib/module/components/SecureFields/VGS/ExpDateField.js.map +0 -1
  225. package/lib/module/components/SecureFields/VGS/TextField.js +0 -17
  226. package/lib/module/components/SecureFields/VGS/TextField.js.map +0 -1
  227. package/lib/module/components/SecureFields/VGS/ZipCodeField.js +0 -14
  228. package/lib/module/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
  229. package/lib/module/components/SecureFields/index.js +0 -17
  230. package/lib/module/components/SecureFields/index.js.map +0 -1
  231. package/lib/typescript/components/SecureFields/VGS/CVCField.d.ts +0 -10
  232. package/lib/typescript/components/SecureFields/VGS/CardHolderNameField.d.ts +0 -10
  233. package/lib/typescript/components/SecureFields/VGS/CardNumberField.d.ts +0 -10
  234. package/lib/typescript/components/SecureFields/VGS/CollectManager.d.ts +0 -12
  235. package/lib/typescript/components/SecureFields/VGS/ExpDateField.d.ts +0 -10
  236. package/lib/typescript/components/SecureFields/VGS/TextField.d.ts +0 -14
  237. package/lib/typescript/components/SecureFields/VGS/ZipCodeField.d.ts +0 -10
  238. package/lib/typescript/components/SecureFields/index.d.ts +0 -16
  239. /package/android/.gradle/{5.6.4 → 6.1.1}/fileChanges/last-build.bin +0 -0
  240. /package/android/.gradle/{5.6.4 → 6.1.1}/gc.properties +0 -0
  241. /package/android/{vgscollect-1.7.2-debug.aar → securefields-1.7.2-debug.aar} +0 -0
  242. /package/ios/{Payengine-Bridging-Header.h → Sources/Payengine-Bridging-Header.h} +0 -0
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PEBankAccountView = void 0;
7
+
8
+ var React = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+
16
+ const {
17
+ RNPEEventEmitter
18
+ } = _reactNative.NativeModules;
19
+ const COMPONENT_NAME = 'RNPEBankAccountView';
20
+ const RNPEBankAccountView = (0, _reactNative.requireNativeComponent)(COMPONENT_NAME); // @ts-ignore
21
+
22
+ const RNPEBankAccountViewManager = _reactNative.UIManager[COMPONENT_NAME];
23
+ const peEventEmitter = new _reactNative.NativeEventEmitter(RNPEEventEmitter);
24
+ const PEBankAccountView = /*#__PURE__*/React.forwardRef((props, ref) => {
25
+ const formRef = React.useRef();
26
+ const [height, setHeight] = React.useState(0);
27
+ React.useImperativeHandle(ref, () => ({
28
+ submit: async function (merchantId) {
29
+ let additionalData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
30
+ return new Promise((resolve, reject) => {
31
+ if (height === 0) {
32
+ return reject(new Error('Form is not ready'));
33
+ }
34
+
35
+ const listener = peEventEmitter.addListener('onBankAccountRespond', args => {
36
+ listener.remove();
37
+ const {
38
+ error,
39
+ bankAccount: json
40
+ } = args;
41
+
42
+ if (error) {
43
+ reject(new Error(error));
44
+ } else {
45
+ const bankAccount = JSON.parse(json);
46
+ resolve(bankAccount);
47
+ }
48
+ });
49
+ callNativeMethod("submit", [merchantId, additionalData]);
50
+ });
51
+ },
52
+ showKeyboard: () => {
53
+ callNativeMethod("showKeyboard");
54
+ },
55
+ hideKeyboard: () => {
56
+ callNativeMethod("hideKeyboard");
57
+ }
58
+ }));
59
+ const callNativeMethod = React.useCallback(function (methodName) {
60
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
61
+ const viewId = (0, _reactNative.findNodeHandle)(formRef.current);
62
+ let commandId = RNPEBankAccountViewManager.Commands[methodName].toString();
63
+
64
+ if (_reactNative.Platform.OS === 'ios') {
65
+ commandId = Number(commandId);
66
+ }
67
+
68
+ _reactNative.UIManager.dispatchViewManagerCommand(viewId, commandId, params);
69
+ }, [formRef.current]);
70
+ React.useEffect(() => {
71
+ const eventListener = peEventEmitter.addListener('onSizeChanges', args => {
72
+ const {
73
+ width: _,
74
+ height: frameHeight
75
+ } = args;
76
+ setHeight(frameHeight);
77
+ });
78
+ return () => eventListener.remove();
79
+ }, []);
80
+ return /*#__PURE__*/React.createElement(React.Fragment, null, height === 0 && /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, null), /*#__PURE__*/React.createElement(RNPEBankAccountView, {
81
+ ref: formRef,
82
+ additionalFields: JSON.stringify(props.additionalFields ?? []),
83
+ style: {
84
+ height: height
85
+ }
86
+ }));
87
+ });
88
+ exports.PEBankAccountView = PEBankAccountView;
89
+ //# sourceMappingURL=BankAccountView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RNPEEventEmitter","NativeModules","COMPONENT_NAME","RNPEBankAccountView","requireNativeComponent","RNPEBankAccountViewManager","UIManager","peEventEmitter","NativeEventEmitter","PEBankAccountView","React","forwardRef","props","ref","formRef","useRef","height","setHeight","useState","useImperativeHandle","submit","merchantId","additionalData","Promise","resolve","reject","Error","listener","addListener","args","remove","error","bankAccount","json","JSON","parse","callNativeMethod","showKeyboard","hideKeyboard","useCallback","methodName","params","viewId","findNodeHandle","current","commandId","Commands","toString","Platform","OS","Number","dispatchViewManagerCommand","useEffect","eventListener","width","_","frameHeight","stringify","additionalFields"],"sources":["BankAccountView.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { requireNativeComponent, NativeModules, NativeEventEmitter, ViewProps, findNodeHandle, UIManager, ActivityIndicator, Platform } from 'react-native';\nimport type IPEField from './IPEField';\nimport type PEBankAccount from './PEBankAccount';\n\nconst { RNPEEventEmitter } = NativeModules;\n\ninterface NativePEBankAccountViewProps extends ViewProps {\n additionalFields: string;\n}\n\nconst COMPONENT_NAME = 'RNPEBankAccountView'\nconst RNPEBankAccountView = requireNativeComponent<NativePEBankAccountViewProps>(COMPONENT_NAME);\n// @ts-ignore\nconst RNPEBankAccountViewManager = UIManager[COMPONENT_NAME]\n\nconst peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);\n\nexport interface PEBankAccountViewProps {\n additionalFields?: IPEField[];\n}\n\nexport interface PEBankAccountViewMethods {\n submit: (merchantId: string, additionalData: { [key: string]: string }) => Promise<PEBankAccount>;\n showKeyboard: () => void;\n hideKeyboard: () => void;\n}\n\nexport const PEBankAccountView = React.forwardRef<\n PEBankAccountViewMethods,\n PEBankAccountViewProps\n>((props, ref) => {\n const formRef = React.useRef<any>();\n const [height, setHeight] = React.useState(0);\n\n React.useImperativeHandle(ref, () => ({\n submit: async (merchantId: string, additionalData: any = {}) => {\n return new Promise((resolve, reject) => {\n if (height === 0) {\n return reject(new Error('Form is not ready'))\n }\n \n const listener = peEventEmitter.addListener('onBankAccountRespond', args => {\n listener.remove()\n\n const { error, bankAccount: json } = args;\n if (error) {\n reject(new Error(error))\n } else {\n const bankAccount = JSON.parse(json) as PEBankAccount;\n resolve(bankAccount)\n }\n });\n\n callNativeMethod(\"submit\", [merchantId, additionalData],)\n });\n },\n showKeyboard: () => {\n callNativeMethod(\"showKeyboard\")\n },\n hideKeyboard: () => {\n callNativeMethod(\"hideKeyboard\")\n }\n }));\n\n const callNativeMethod = React.useCallback((methodName: string, params: any[] = []) => {\n const viewId = findNodeHandle(formRef.current);\n let commandId = RNPEBankAccountViewManager.Commands[methodName].toString()\n if (Platform.OS === 'ios') {\n commandId = Number(commandId)\n }\n UIManager.dispatchViewManagerCommand(\n viewId,\n commandId,\n params,\n );\n }, [formRef.current])\n\n\n React.useEffect(() => {\n const eventListener = peEventEmitter.addListener('onSizeChanges', args => {\n const { width: _, height: frameHeight } = args;\n setHeight(frameHeight);\n });\n return () => eventListener.remove();\n }, []);\n\n return (\n <>\n {height === 0 && <ActivityIndicator />}\n <RNPEBankAccountView ref={formRef} additionalFields={JSON.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BAAD;IAAqB,GAAG,EAAEF,OAA1B;IAAmC,gBAAgB,EAAEoB,IAAI,CAACuB,SAAL,CAAe7C,KAAK,CAAC8C,gBAAN,IAA0B,EAAzC,CAArD;IAAmG,KAAK,EAAE;MAAE1C,MAAM,EAAEA;IAAV;EAA1G,EAFF,CADF;AAMD,CAjEgC,CAA1B"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PECreditCardView = void 0;
7
+
8
+ var React = _interopRequireWildcard(require("react"));
9
+
10
+ var _reactNative = require("react-native");
11
+
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+
16
+ const {
17
+ RNPEEventEmitter
18
+ } = _reactNative.NativeModules;
19
+ const COMPONENT_NAME = 'RNPECreditCardView';
20
+ const RNPECreditCardView = (0, _reactNative.requireNativeComponent)(COMPONENT_NAME); // @ts-ignore
21
+
22
+ const RNPECreditCardViewManager = _reactNative.UIManager[COMPONENT_NAME];
23
+ const peEventEmitter = new _reactNative.NativeEventEmitter(RNPEEventEmitter);
24
+ const PECreditCardView = /*#__PURE__*/React.forwardRef((props, ref) => {
25
+ const formRef = React.useRef();
26
+ const [height, setHeight] = React.useState(0);
27
+ React.useImperativeHandle(ref, () => ({
28
+ submit: async function (merchantId) {
29
+ let additionalData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
30
+ return new Promise((resolve, reject) => {
31
+ if (height === 0) {
32
+ return reject(new Error('Form is not ready'));
33
+ }
34
+
35
+ const listener = peEventEmitter.addListener('onCardRespond', args => {
36
+ listener.remove();
37
+ const {
38
+ error,
39
+ card: json
40
+ } = args;
41
+
42
+ if (error) {
43
+ reject(new Error(error));
44
+ } else {
45
+ const card = JSON.parse(json);
46
+ resolve(card);
47
+ }
48
+ });
49
+ callNativeMethod("submit", [merchantId, additionalData]);
50
+ });
51
+ },
52
+ showKeyboard: () => {
53
+ callNativeMethod("showKeyboard");
54
+ },
55
+ hideKeyboard: () => {
56
+ callNativeMethod("hideKeyboard");
57
+ }
58
+ }));
59
+ const callNativeMethod = React.useCallback(function (methodName) {
60
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
61
+ console.log("callNativeMethod", methodName, params);
62
+ const viewId = (0, _reactNative.findNodeHandle)(formRef.current);
63
+ let commandId = RNPECreditCardViewManager.Commands[methodName].toString();
64
+
65
+ if (_reactNative.Platform.OS === 'ios') {
66
+ commandId = Number(commandId);
67
+ }
68
+
69
+ _reactNative.UIManager.dispatchViewManagerCommand(viewId, commandId, params);
70
+ }, [formRef.current]);
71
+ React.useEffect(() => {
72
+ const eventListener = peEventEmitter.addListener('onSizeChanges', args => {
73
+ const {
74
+ width: _,
75
+ height: frameHeight
76
+ } = args;
77
+ setHeight(frameHeight);
78
+ });
79
+ return () => eventListener.remove();
80
+ }, []);
81
+ return /*#__PURE__*/React.createElement(React.Fragment, null, height === 0 && /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, null), /*#__PURE__*/React.createElement(RNPECreditCardView, {
82
+ ref: formRef,
83
+ additionalFields: JSON.stringify(props.additionalFields ?? []),
84
+ style: {
85
+ height: height
86
+ }
87
+ }));
88
+ });
89
+ exports.PECreditCardView = PECreditCardView;
90
+ //# sourceMappingURL=CreditCardView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["RNPEEventEmitter","NativeModules","COMPONENT_NAME","RNPECreditCardView","requireNativeComponent","RNPECreditCardViewManager","UIManager","peEventEmitter","NativeEventEmitter","PECreditCardView","React","forwardRef","props","ref","formRef","useRef","height","setHeight","useState","useImperativeHandle","submit","merchantId","additionalData","Promise","resolve","reject","Error","listener","addListener","args","remove","error","card","json","JSON","parse","callNativeMethod","showKeyboard","hideKeyboard","useCallback","methodName","params","console","log","viewId","findNodeHandle","current","commandId","Commands","toString","Platform","OS","Number","dispatchViewManagerCommand","useEffect","eventListener","width","_","frameHeight","stringify","additionalFields"],"sources":["CreditCardView.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { requireNativeComponent, NativeModules, NativeEventEmitter, ViewProps, Platform, findNodeHandle, UIManager, ActivityIndicator } from 'react-native';\nimport type IPEField from './IPEField';\nimport type PECard from './PECard';\n\nconst { RNPEEventEmitter } = NativeModules;\n\ninterface NativePECreditCardViewProps extends ViewProps {\n additionalFields: string;\n}\n\nconst COMPONENT_NAME = 'RNPECreditCardView'\nconst RNPECreditCardView = requireNativeComponent<NativePECreditCardViewProps>(COMPONENT_NAME);\n// @ts-ignore\nconst RNPECreditCardViewManager = UIManager[COMPONENT_NAME]\nconst peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);\n\nexport interface PECreditCardViewProps {\n additionalFields?: IPEField[];\n}\n\nexport interface PECreditCardViewMethods {\n submit: (merchantId: string, additionalData: { [key: string]: string }) => Promise<PECard>;\n showKeyboard: () => void;\n hideKeyboard: () => void;\n}\n\nexport const PECreditCardView = React.forwardRef<\n PECreditCardViewMethods,\n PECreditCardViewProps\n>((props, ref) => {\n const formRef = React.useRef<any>();\n const [height, setHeight] = React.useState(0);\n\n React.useImperativeHandle(ref, () => ({\n submit: async (merchantId: string, additionalData: any = {}) => {\n return new Promise((resolve, reject) => {\n if (height === 0) {\n return reject(new Error('Form is not ready'))\n }\n\n const listener = peEventEmitter.addListener('onCardRespond', args => {\n listener.remove()\n\n const { error, card: json } = args;\n if (error) {\n reject(new Error(error))\n } else {\n const card = JSON.parse(json) as PECard;\n resolve(card)\n }\n });\n\n callNativeMethod(\"submit\", [merchantId, additionalData])\n });\n },\n showKeyboard: () => {\n callNativeMethod(\"showKeyboard\")\n },\n hideKeyboard: () => {\n callNativeMethod(\"hideKeyboard\")\n }\n }));\n\n const callNativeMethod = React.useCallback((methodName: string, params: any[] = []) => {\n console.log(\"callNativeMethod\", methodName, params)\n const viewId = findNodeHandle(formRef.current);\n let commandId = RNPECreditCardViewManager.Commands[methodName].toString()\n if (Platform.OS === 'ios') {\n commandId = Number(commandId)\n }\n UIManager.dispatchViewManagerCommand(\n viewId,\n commandId,\n params,\n );\n }, [formRef.current])\n\n React.useEffect(() => {\n const eventListener = peEventEmitter.addListener('onSizeChanges', args => {\n const { width: _, height: frameHeight } = args;\n setHeight(frameHeight);\n });\n\n return () => eventListener.remove();\n }, []);\n\n\n return (\n <>\n {height === 0 && <ActivityIndicator />}\n <RNPECreditCardView ref={formRef} additionalFields={JSON.stringify(props.additionalFields ?? [])} style={{ height: height }} />\n </>\n );\n});\n"],"mappings":";;;;;;;AACA;;AACA;;;;;;AAIA,MAAM;EAAEA;AAAF,IAAuBC,0BAA7B;AAMA,MAAMC,cAAc,GAAG,oBAAvB;AACA,MAAMC,kBAAkB,GAAG,IAAAC,mCAAA,EAAoDF,cAApD,CAA3B,C,CACA;;AACA,MAAMG,yBAAyB,GAAGC,sBAAA,CAAUJ,cAAV,CAAlC;AACA,MAAMK,cAAc,GAAG,IAAIC,+BAAJ,CAAuBR,gBAAvB,CAAvB;AAYO,MAAMS,gBAAgB,gBAAGC,KAAK,CAACC,UAAN,CAG9B,CAACC,K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
+ {"version":3,"names":[],"sources":["IPEField.ts"],"sourcesContent":["import type PEKeyboardType from \"./PEKeyboardType\";\n\ninterface IPEField {\n name: string;\n type: string;\n placeholder: string;\n keyboardType: PEKeyboardType;\n isRequired: boolean;\n pattern?: string;\n}\n\nexport default IPEField;\n"],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=PEBankAccount.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["PEBankAccount.ts"],"sourcesContent":["interface PEBankAccount {\n id: string;\n token: string;\n account_data: {\n first_name: string;\n last_name: string;\n routing_number: string;\n last_4: string;\n };\n}\n\nexport default PEBankAccount;"],"mappings":""}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=PECard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["PECard.ts"],"sourcesContent":["interface PECard {\n token: string;\n card_data: {\n id: string;\n brand: string;\n last_4: string;\n exp_year: string;\n exp_month: string;\n name: string;\n address_zip?: string;\n };\n}\n\nexport default PECard;"],"mappings":""}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var PEKeyboardType;
8
+
9
+ (function (PEKeyboardType) {
10
+ PEKeyboardType["alphabet"] = "alphabet";
11
+ PEKeyboardType["number"] = "number";
12
+ PEKeyboardType["phone"] = "phone";
13
+ PEKeyboardType["normal"] = "normal";
14
+ })(PEKeyboardType || (PEKeyboardType = {}));
15
+
16
+ var _default = PEKeyboardType;
17
+ exports.default = _default;
18
+ //# sourceMappingURL=PEKeyboardType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PEKeyboardType"],"sources":["PEKeyboardType.ts"],"sourcesContent":["enum PEKeyboardType {\n alphabet = 'alphabet',\n number = 'number',\n phone = 'phone',\n normal = 'normal',\n}\n\nexport default PEKeyboardType;\n"],"mappings":";;;;;;IAAKA,c;;WAAAA,c;EAAAA,c;EAAAA,c;EAAAA,c;EAAAA,c;GAAAA,c,KAAAA,c;;eAOUA,c"}
@@ -3,25 +3,93 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "PEApplePayButton", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _PEApplePayButton.PEApplePayButton;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "PEBankAccountView", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _BankAccountView.PEBankAccountView;
16
+ }
17
+ });
18
+ Object.defineProperty(exports, "PEBankAccountViewMethods", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _BankAccountView.PEBankAccountViewMethods;
22
+ }
23
+ });
24
+ Object.defineProperty(exports, "PECreditCardView", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _CreditCardView.PECreditCardView;
28
+ }
29
+ });
30
+ Object.defineProperty(exports, "PECreditCardViewMethods", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _CreditCardView.PECreditCardViewMethods;
34
+ }
35
+ });
36
+ Object.defineProperty(exports, "PEKeyboardType", {
37
+ enumerable: true,
38
+ get: function () {
39
+ return _PEKeyboardType.default;
40
+ }
41
+ });
42
+ Object.defineProperty(exports, "PEPaymentRequest", {
43
+ enumerable: true,
44
+ get: function () {
45
+ return _PEPaymentRequest.PEPaymentRequest;
46
+ }
47
+ });
6
48
  Object.defineProperty(exports, "PayEngine", {
7
49
  enumerable: true,
8
50
  get: function () {
9
51
  return _PayEngine.default;
10
52
  }
11
53
  });
12
- exports.PayEngineStatic = void 0;
13
- Object.defineProperty(exports, "SecureFields", {
54
+ Object.defineProperty(exports, "PayEngineNative", {
14
55
  enumerable: true,
15
56
  get: function () {
16
- return _index.SecureFields;
57
+ return _PayEngineNative.default;
17
58
  }
18
59
  });
60
+ Object.defineProperty(exports, "PayEngineProvider", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _PayEngineProvider.PayEngineProvider;
64
+ }
65
+ });
66
+ exports.PayEngineUtils = exports.PayEngineStatic = void 0;
19
67
 
20
68
  var _PayEngine = _interopRequireDefault(require("./components/PayEngine"));
21
69
 
22
70
  var _reactNative = require("react-native");
23
71
 
24
- var _index = require("./components/SecureFields/index");
72
+ var _CreditCardView = require("./components/v2/SecureFields/CreditCardView");
73
+
74
+ var _BankAccountView = require("./components/v2/SecureFields/BankAccountView");
75
+
76
+ var _PayEngineProvider = require("./components/v2/PayEngineProvider");
77
+
78
+ var _PayEngineNative = _interopRequireDefault(require("./components/v2/PayEngineNative"));
79
+
80
+ var _PEApplePayButton = require("./components/v2/ApplePay/PEApplePayButton");
81
+
82
+ var _PEPaymentRequest = require("./components/v2/ApplePay/PEPaymentRequest");
83
+
84
+ var PayEngineUtils = _interopRequireWildcard(require("./utils/index"));
85
+
86
+ exports.PayEngineUtils = PayEngineUtils;
87
+
88
+ var _PEKeyboardType = _interopRequireDefault(require("./components/v2/SecureFields/PEKeyboardType"));
89
+
90
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
91
+
92
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
25
93
 
26
94
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
95
 
@@ -34,9 +102,6 @@ const PayEngineStatic = _reactNative.NativeModules.Payengine ? _reactNative.Nati
34
102
  throw new Error(LINKING_ERROR);
35
103
  }
36
104
 
37
- }); // function multiply(a: number, b: number): Promise<number> {
38
- // return PayEngineStatic.multiply(a, b);
39
- // }
40
-
105
+ });
41
106
  exports.PayEngineStatic = PayEngineStatic;
42
107
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","PayEngineStatic","NativeModules","Payengine","Proxy","get","Error"],"sources":["index.tsx"],"sourcesContent":["import PayEngine from './components/PayEngine'\nimport { NativeModules, Platform } from 'react-native';\nimport { SecureFields } from './components/SecureFields/index';\nimport type { IPayEngineConfig } from './utils';\n\nconst LINKING_ERROR =\n `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PayEngineStatic = NativeModules.Payengine ? NativeModules.Payengine : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n);\n\n// function multiply(a: number, b: number): Promise<number> {\n// return PayEngineStatic.multiply(a, b);\n// }\n\nexport {\n PayEngineStatic,\n PayEngine,\n SecureFields,\n IPayEngineConfig\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;AAGA,MAAMA,aAAa,GAChB,iFAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,eAAe,GAAGC,0BAAA,CAAcC,SAAd,GAA0BD,0BAAA,CAAcC,SAAxC,GAAoD,IAAIC,KAAJ,CAC1E,EAD0E,EAE1E;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUV,aAAV,CAAN;EACD;;AAHH,CAF0E,CAA5E,C,CASA;AACA;AACA"}
1
+ {"version":3,"names":["LINKING_ERROR","Platform","select","ios","default","PayEngineStatic","NativeModules","Payengine","Proxy","get","Error"],"sources":["index.tsx"],"sourcesContent":["import PayEngine from './components/PayEngine';\nimport { NativeModules, Platform } from 'react-native';\nimport type { IPayEngineConfig } from './interfaces/index';\nimport {\n PECreditCardView,\n PECreditCardViewMethods,\n} from './components/v2/SecureFields/CreditCardView';\nimport {\n PEBankAccountView,\n PEBankAccountViewMethods,\n} from './components/v2/SecureFields/BankAccountView';\nimport type IPEField from './components/v2/SecureFields/IPEField';\nimport type PECard from './components/v2/SecureFields/PECard';\nimport type PEBankAccount from './components/v2/SecureFields/PEBankAccount';\nimport { PayEngineProvider } from './components/v2/PayEngineProvider';\nimport PayEngineNative from './components/v2/PayEngineNative';\nimport { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';\nimport { PEPaymentRequest } from './components/v2/ApplePay/PEPaymentRequest';\nimport * as PayEngineUtils from './utils/index';\nimport PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';\n\nconst LINKING_ERROR =\n `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PayEngineStatic = NativeModules.Payengine\n ? NativeModules.Payengine\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport {\n PayEngineStatic,\n PayEngine,\n IPayEngineConfig,\n\n // v2 starting here\n PayEngineUtils,\n PayEngineProvider,\n PayEngineNative,\n // securefields\n PEKeyboardType,\n IPEField,\n // credit card\n PECreditCardView,\n PECreditCardViewMethods,\n PECard,\n // bank account\n PEBankAccountView,\n PEBankAccountViewMethods,\n PEBankAccount,\n // Apple Pay\n PEApplePayButton,\n PEPaymentRequest,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AAIA;;AAOA;;AACA;;AACA;;AACA;;AACA;;;;AACA;;;;;;;;AAEA,MAAMA,aAAa,GAChB,iFAAD,GACAC,qBAAA,CAASC,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,eAAe,GAAGC,0BAAA,CAAcC,SAAd,GACpBD,0BAAA,CAAcC,SADM,GAEpB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUV,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export interface IPayEngineConfig {\n publicKey: string;\n version?: string;\n scriptURL?: string;\n logLevel?: number;\n}\n"],"mappings":""}
@@ -3,25 +3,46 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.debuggingScript = exports.createHttpClient = void 0;
6
+ exports.getHttpHeaders = exports.getBaseURL = exports.debuggingScript = exports.createHttpClient = exports.PEDeprecationError = void 0;
7
7
  exports.getScriptURL = getScriptURL;
8
8
 
9
9
  var _axios = _interopRequireDefault(require("axios"));
10
10
 
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
12
 
13
- const createHttpClient = config => {
14
- let baseUrl = config.publicKey.includes('_prod_') ? "https://console.payengine.co" : "https://console.payengine.dev";
13
+ class PEDeprecationError extends Error {
14
+ constructor() {
15
+ super('This method is obsolete and can not be used anymore. Please check out the package README');
16
+ }
17
+
18
+ }
19
+
20
+ exports.PEDeprecationError = PEDeprecationError;
21
+
22
+ const getHttpHeaders = config => {
23
+ return {
24
+ Authorization: `Signature key="${config.publicKey}",algorithm="hmac-sha256",identifier="secure-fields",signature=""`
25
+ };
26
+ };
27
+
28
+ exports.getHttpHeaders = getHttpHeaders;
29
+
30
+ const getBaseURL = config => {
31
+ let baseUrl = config.publicKey.includes('_prod_') ? 'https://console.payengine.co' : 'https://console.payengine.dev';
15
32
 
16
33
  if (config.scriptURL) {
17
34
  baseUrl = config.scriptURL.replace(/^((\w+:)?\/\/[^\/]+\/?).*$/, '$1');
18
35
  }
19
36
 
37
+ return baseUrl;
38
+ };
39
+
40
+ exports.getBaseURL = getBaseURL;
41
+
42
+ const createHttpClient = config => {
20
43
  return _axios.default.create({
21
- baseURL: baseUrl,
22
- headers: {
23
- Authorization: `Signature key="${config.publicKey}",algorithm="hmac-sha256",identifier="secure-fields",signature=""`
24
- }
44
+ baseURL: getBaseURL(config),
45
+ headers: getHttpHeaders(config)
25
46
  });
26
47
  };
27
48
 
@@ -38,50 +59,13 @@ function getScriptURL(config) {
38
59
  if (config.scriptURL) {
39
60
  scriptURL = `${config.scriptURL}?key=${config.publicKey}${logLevelStr}`;
40
61
  } else {
41
- const baseURL = config.publicKey.includes('_prod_') ? "https://console.payengine.co" : "https://console.payengine.dev";
62
+ const baseURL = config.publicKey.includes('_prod_') ? 'https://console.payengine.co' : 'https://console.payengine.dev';
42
63
  const version = config.version ?? '1.0.0';
43
64
  scriptURL = `${baseURL}/js/${version}/embed.js?key=${config.publicKey}${logLevelStr}`;
44
65
  }
45
66
 
46
67
  return scriptURL;
47
68
  }
48
- /**
49
- * <script>
50
- console.log("AAAAAAAA")
51
- var component = document.getElementById("component");
52
- var onEvent = function(event) {
53
- console.log({ event })
54
- }
55
- console.log('component')
56
- component.addEventListener('stepChange', function(e) {
57
- console.log('step change')
58
- })
59
- function addEventListenerAll(target, listener, ...otherArguments) {
60
-
61
- // install listeners for all natively triggered events
62
- for (const key in target) {
63
- if (/^on/.test(key)) {
64
- const eventType = key.substr(2);
65
- target.addEventListener(eventType, listener, ...otherArguments);
66
- }
67
- }
68
-
69
- // dynamically install listeners for all manually triggered events, just-in-time before they're dispatched ;D
70
- const dispatchEvent_original = EventTarget.prototype.dispatchEvent;
71
- function dispatchEvent(event) {
72
- console.log('event test', event.type)
73
- target.addEventListener(event.type, listener, ...otherArguments); // multiple identical listeners are automatically discarded
74
- dispatchEvent_original.apply(this, arguments);
75
- }
76
- EventTarget.prototype.dispatchEvent = dispatchEvent;
77
- if (EventTarget.prototype.dispatchEvent !== dispatchEvent) throw new Error('Browser is smarter than you think');
78
-
79
- }
80
-
81
- // addEventListenerAll(component, onEvent);
82
- </script>
83
- */
84
-
85
69
 
86
70
  const debuggingScript = `
87
71
  const consoleLog = (type, ...log) => window.ReactNativeWebView.postMessage(JSON.stringify({'type': 'Console', 'data': {'type': type, 'log': log}}));
@@ -1 +1 @@
1
- {"version":3,"names":["createHttpClient","config","baseUrl","publicKey","includes","scriptURL","replace","axios","create","baseURL","headers","Authorization","getScriptURL","Error","logLevelStr","logLevel","version","debuggingScript"],"sources":["index.ts"],"sourcesContent":["import axios from \"axios\"\n\nexport interface IPayEngineConfig {\n publicKey: string\n version?: string\n scriptURL?: string\n logLevel?: number\n}\n\nexport const createHttpClient = (config: IPayEngineConfig) => {\n let baseUrl = config.publicKey.includes('_prod_')\n ? \"https://console.payengine.co\"\n : \"https://console.payengine.dev\"\n\n if (config.scriptURL) {\n baseUrl = config.scriptURL.replace(/^((\\w+:)?\\/\\/[^\\/]+\\/?).*$/,'$1')\n }\n return axios.create({\n baseURL: baseUrl,\n headers: {\n Authorization: `Signature key=\"${config.publicKey}\",algorithm=\"hmac-sha256\",identifier=\"secure-fields\",signature=\"\"`\n }\n })\n}\n\nexport function getScriptURL(config: IPayEngineConfig) {\n\n if (!config.publicKey) {\n throw new Error('PayEngine Public Key is missing')\n }\n let scriptURL = ''\n const logLevelStr = config.logLevel ? `&loglevel=${config.logLevel}` : ''\n if (config.scriptURL) {\n scriptURL = `${config.scriptURL}?key=${config.publicKey}${logLevelStr}`\n } else {\n const baseURL = config.publicKey.includes('_prod_')\n ? \"https://console.payengine.co\"\n : \"https://console.payengine.dev\"\n const version = config.version ?? '1.0.0'\n scriptURL = `${baseURL}/js/${version}/embed.js?key=${config.publicKey}${logLevelStr}`\n }\n\n return scriptURL\n}\n\n/**\n * <script>\n console.log(\"AAAAAAAA\")\n var component = document.getElementById(\"component\");\n var onEvent = function(event) {\n console.log({ event })\n }\n console.log('component')\n component.addEventListener('stepChange', function(e) {\n console.log('step change')\n })\n function addEventListenerAll(target, listener, ...otherArguments) {\n\n // install listeners for all natively triggered events\n for (const key in target) {\n if (/^on/.test(key)) {\n const eventType = key.substr(2);\n target.addEventListener(eventType, listener, ...otherArguments);\n }\n }\n\n // dynamically install listeners for all manually triggered events, just-in-time before they're dispatched ;D\n const dispatchEvent_original = EventTarget.prototype.dispatchEvent;\n function dispatchEvent(event) {\n console.log('event test', event.type)\n target.addEventListener(event.type, listener, ...otherArguments); // multiple identical listeners are automatically discarded\n dispatchEvent_original.apply(this, arguments);\n }\n EventTarget.prototype.dispatchEvent = dispatchEvent;\n if (EventTarget.prototype.dispatchEvent !== dispatchEvent) throw new Error('Browser is smarter than you think');\n\n }\n\n // addEventListenerAll(component, onEvent);\n </script>\n */\nexport const debuggingScript = `\nconst consoleLog = (type, ...log) => window.ReactNativeWebView.postMessage(JSON.stringify({'type': 'Console', 'data': {'type': type, 'log': log}}));\nconsole = {\n log: (...log) => consoleLog('log', ...log),\n debug: (...log) => consoleLog('debug', ...log),\n info: (...log) => consoleLog('info', ...log),\n warn: (...log) => consoleLog('warn', ...log),\n error: (...log) => consoleLog('error', ...log),\n verbose: (...log) => consoleLog('verbose', ...log),\n};\n\nconst dispatchEvent_original = EventTarget.prototype.dispatchEvent;\nfunction dispatchEvent(event) {\n if (event.type && !event.type.startsWith('react')) {\n ReactNativeWebView.postMessage(JSON.stringify({\n type: 'PayEngine',\n event: {\n type: event.type,\n detail: event.detail\n }\n }))\n }\n}\nEventTarget.prototype.dispatchEvent = dispatchEvent;\n`;\n"],"mappings":";;;;;;;;AAAA;;;;AASO,MAAMA,gBAAgB,GAAIC,MAAD,IAA8B;EAC5D,IAAIC,OAAO,GAAGD,MAAM,CAACE,SAAP,CAAiBC,QAAjB,CAA0B,QAA1B,IACR,8BADQ,GAEV,+BAFJ;;EAIA,IAAIH,MAAM,CAACI,SAAX,EAAsB;IACpBH,OAAO,GAAGD,MAAM,CAACI,SAAP,CAAiBC,OAAjB,CAAyB,4BAAzB,EAAsD,IAAtD,CAAV;EACD;;EACD,OAAOC,cAAA,CAAMC,MAAN,CAAa;IAClBC,OAAO,EAAEP,OADS;IAElBQ,OAAO,EAAE;MACPC,aAAa,EAAG,kBAAiBV,MAAM,CAACE,SAAU;IAD3C;EAFS,CAAb,CAAP;AAMD,CAdM;;;;AAgBA,SAASS,YAAT,CAAsBX,MAAtB,EAAgD;EAErD,IAAI,CAACA,MAAM,CAACE,SAAZ,EAAuB;IACrB,MAAM,IAAIU,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,IAAIR,SAAS,GAAG,EAAhB;EACA,MAAMS,WAAW,GAAGb,MAAM,CAACc,QAAP,GAAmB,aAAYd,MAAM,CAACc,QAAS,EAA/C,GAAmD,EAAvE;;EACA,IAAId,MAAM,CAACI,SAAX,EAAsB;IACpBA,SAAS,GAAI,GAAEJ,MAAM,CAACI,SAAU,QAAOJ,MAAM,CAACE,SAAU,GAAEW,WAAY,EAAtE;EACD,CAFD,MAEO;IACL,MAAML,OAAO,GAAGR,MAAM,CAACE,SAAP,CAAiBC,QAAjB,CAA0B,QAA1B,IACZ,8BADY,GAEZ,+BAFJ;IAGA,MAAMY,OAAO,GAAGf,MAAM,CAACe,OAAP,IAAkB,OAAlC;IACAX,SAAS,GAAI,GAAEI,OAAQ,OAAMO,OAAQ,iBAAgBf,MAAM,CAACE,SAAU,GAAEW,WAAY,EAApF;EACD;;EAED,OAAOT,SAAP;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAMY,eAAe,GAAI;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAxBO"}
1
+ {"version":3,"names":["PEDeprecationError","Error","constructor","getHttpHeaders","config","Authorization","publicKey","getBaseURL","baseUrl","includes","scriptURL","replace","createHttpClient","axios","create","baseURL","headers","getScriptURL","logLevelStr","logLevel","version","debuggingScript"],"sources":["index.ts"],"sourcesContent":["import axios from 'axios';\nimport type { IPayEngineConfig } from '../interfaces/index';\n\nexport class PEDeprecationError extends Error {\n constructor() {\n super(\n 'This method is obsolete and can not be used anymore. Please check out the package README'\n );\n }\n}\n\nexport const getHttpHeaders = (config: IPayEngineConfig) => {\n return {\n Authorization: `Signature key=\"${config.publicKey}\",algorithm=\"hmac-sha256\",identifier=\"secure-fields\",signature=\"\"`,\n };\n};\n\nexport const getBaseURL = (config: IPayEngineConfig) => {\n let baseUrl = config.publicKey.includes('_prod_')\n ? 'https://console.payengine.co'\n : 'https://console.payengine.dev';\n\n if (config.scriptURL) {\n baseUrl = config.scriptURL.replace(/^((\\w+:)?\\/\\/[^\\/]+\\/?).*$/, '$1');\n }\n return baseUrl;\n};\n\nexport const createHttpClient = (config: IPayEngineConfig) => {\n return axios.create({\n baseURL: getBaseURL(config),\n headers: getHttpHeaders(config),\n });\n};\n\nexport function getScriptURL(config: IPayEngineConfig) {\n if (!config.publicKey) {\n throw new Error('PayEngine Public Key is missing');\n }\n let scriptURL = '';\n const logLevelStr = config.logLevel ? `&loglevel=${config.logLevel}` : '';\n if (config.scriptURL) {\n scriptURL = `${config.scriptURL}?key=${config.publicKey}${logLevelStr}`;\n } else {\n const baseURL = config.publicKey.includes('_prod_')\n ? 'https://console.payengine.co'\n : 'https://console.payengine.dev';\n const version = config.version ?? '1.0.0';\n scriptURL = `${baseURL}/js/${version}/embed.js?key=${config.publicKey}${logLevelStr}`;\n }\n\n return scriptURL;\n}\n\nexport const debuggingScript = `\nconst consoleLog = (type, ...log) => window.ReactNativeWebView.postMessage(JSON.stringify({'type': 'Console', 'data': {'type': type, 'log': log}}));\nconsole = {\n log: (...log) => consoleLog('log', ...log),\n debug: (...log) => consoleLog('debug', ...log),\n info: (...log) => consoleLog('info', ...log),\n warn: (...log) => consoleLog('warn', ...log),\n error: (...log) => consoleLog('error', ...log),\n verbose: (...log) => consoleLog('verbose', ...log),\n};\n\nconst dispatchEvent_original = EventTarget.prototype.dispatchEvent;\nfunction dispatchEvent(event) {\n if (event.type && !event.type.startsWith('react')) {\n ReactNativeWebView.postMessage(JSON.stringify({\n type: 'PayEngine',\n event: {\n type: event.type,\n detail: event.detail\n }\n }))\n }\n}\nEventTarget.prototype.dispatchEvent = dispatchEvent;\n`;\n"],"mappings":";;;;;;;;AAAA;;;;AAGO,MAAMA,kBAAN,SAAiCC,KAAjC,CAAuC;EAC5CC,WAAW,GAAG;IACZ,MACE,0FADF;EAGD;;AAL2C;;;;AAQvC,MAAMC,cAAc,GAAIC,MAAD,IAA8B;EAC1D,OAAO;IACLC,aAAa,EAAG,kBAAiBD,MAAM,CAACE,SAAU;EAD7C,CAAP;AAGD,CAJM;;;;AAMA,MAAMC,UAAU,GAAIH,MAAD,IAA8B;EACtD,IAAII,OAAO,GAAGJ,MAAM,CAACE,SAAP,CAAiBG,QAAjB,CAA0B,QAA1B,IACV,8BADU,GAEV,+BAFJ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