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
@@ -1,16 +1,28 @@
1
- import axios from "axios";
2
- export const createHttpClient = config => {
3
- let baseUrl = config.publicKey.includes('_prod_') ? "https://console.payengine.co" : "https://console.payengine.dev";
1
+ import axios from 'axios';
2
+ export class PEDeprecationError extends Error {
3
+ constructor() {
4
+ super('This method is obsolete and can not be used anymore. Please check out the package README');
5
+ }
6
+
7
+ }
8
+ export const getHttpHeaders = config => {
9
+ return {
10
+ Authorization: `Signature key="${config.publicKey}",algorithm="hmac-sha256",identifier="secure-fields",signature=""`
11
+ };
12
+ };
13
+ export const getBaseURL = config => {
14
+ let baseUrl = config.publicKey.includes('_prod_') ? 'https://console.payengine.co' : 'https://console.payengine.dev';
4
15
 
5
16
  if (config.scriptURL) {
6
17
  baseUrl = config.scriptURL.replace(/^((\w+:)?\/\/[^\/]+\/?).*$/, '$1');
7
18
  }
8
19
 
20
+ return baseUrl;
21
+ };
22
+ export const createHttpClient = config => {
9
23
  return axios.create({
10
- baseURL: baseUrl,
11
- headers: {
12
- Authorization: `Signature key="${config.publicKey}",algorithm="hmac-sha256",identifier="secure-fields",signature=""`
13
- }
24
+ baseURL: getBaseURL(config),
25
+ headers: getHttpHeaders(config)
14
26
  });
15
27
  };
16
28
  export function getScriptURL(config) {
@@ -24,50 +36,13 @@ export function getScriptURL(config) {
24
36
  if (config.scriptURL) {
25
37
  scriptURL = `${config.scriptURL}?key=${config.publicKey}${logLevelStr}`;
26
38
  } else {
27
- const baseURL = config.publicKey.includes('_prod_') ? "https://console.payengine.co" : "https://console.payengine.dev";
39
+ const baseURL = config.publicKey.includes('_prod_') ? 'https://console.payengine.co' : 'https://console.payengine.dev';
28
40
  const version = config.version ?? '1.0.0';
29
41
  scriptURL = `${baseURL}/js/${version}/embed.js?key=${config.publicKey}${logLevelStr}`;
30
42
  }
31
43
 
32
44
  return scriptURL;
33
45
  }
34
- /**
35
- * <script>
36
- console.log("AAAAAAAA")
37
- var component = document.getElementById("component");
38
- var onEvent = function(event) {
39
- console.log({ event })
40
- }
41
- console.log('component')
42
- component.addEventListener('stepChange', function(e) {
43
- console.log('step change')
44
- })
45
- function addEventListenerAll(target, listener, ...otherArguments) {
46
-
47
- // install listeners for all natively triggered events
48
- for (const key in target) {
49
- if (/^on/.test(key)) {
50
- const eventType = key.substr(2);
51
- target.addEventListener(eventType, listener, ...otherArguments);
52
- }
53
- }
54
-
55
- // dynamically install listeners for all manually triggered events, just-in-time before they're dispatched ;D
56
- const dispatchEvent_original = EventTarget.prototype.dispatchEvent;
57
- function dispatchEvent(event) {
58
- console.log('event test', event.type)
59
- target.addEventListener(event.type, listener, ...otherArguments); // multiple identical listeners are automatically discarded
60
- dispatchEvent_original.apply(this, arguments);
61
- }
62
- EventTarget.prototype.dispatchEvent = dispatchEvent;
63
- if (EventTarget.prototype.dispatchEvent !== dispatchEvent) throw new Error('Browser is smarter than you think');
64
-
65
- }
66
-
67
- // addEventListenerAll(component, onEvent);
68
- </script>
69
- */
70
-
71
46
  export const debuggingScript = `
72
47
  const consoleLog = (type, ...log) => window.ReactNativeWebView.postMessage(JSON.stringify({'type': 'Console', 'data': {'type': type, 'log': log}}));
73
48
  console = {
@@ -1 +1 @@
1
- {"version":3,"names":["axios","createHttpClient","config","baseUrl","publicKey","includes","scriptURL","replace","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,OAAOA,KAAP,MAAkB,OAAlB;AASA,OAAO,MAAMC,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,OAAOP,KAAK,CAACQ,MAAN,CAAa;IAClBC,OAAO,EAAEN,OADS;IAElBO,OAAO,EAAE;MACPC,aAAa,EAAG,kBAAiBT,MAAM,CAACE,SAAU;IAD3C;EAFS,CAAb,CAAP;AAMD,CAdM;AAgBP,OAAO,SAASQ,YAAT,CAAsBV,MAAtB,EAAgD;EAErD,IAAI,CAACA,MAAM,CAACE,SAAZ,EAAuB;IACrB,MAAM,IAAIS,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,IAAIP,SAAS,GAAG,EAAhB;EACA,MAAMQ,WAAW,GAAGZ,MAAM,CAACa,QAAP,GAAmB,aAAYb,MAAM,CAACa,QAAS,EAA/C,GAAmD,EAAvE;;EACA,IAAIb,MAAM,CAACI,SAAX,EAAsB;IACpBA,SAAS,GAAI,GAAEJ,MAAM,CAACI,SAAU,QAAOJ,MAAM,CAACE,SAAU,GAAEU,WAAY,EAAtE;EACD,CAFD,MAEO;IACL,MAAML,OAAO,GAAGP,MAAM,CAACE,SAAP,CAAiBC,QAAjB,CAA0B,QAA1B,IACZ,8BADY,GAEZ,+BAFJ;IAGA,MAAMW,OAAO,GAAGd,MAAM,CAACc,OAAP,IAAkB,OAAlC;IACAV,SAAS,GAAI,GAAEG,OAAQ,OAAMO,OAAQ,iBAAgBd,MAAM,CAACE,SAAU,GAAEU,WAAY,EAApF;EACD;;EAED,OAAOR,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;;AACA,OAAO,MAAMW,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":["axios","PEDeprecationError","Error","constructor","getHttpHeaders","config","Authorization","publicKey","getBaseURL","baseUrl","includes","scriptURL","replace","createHttpClient","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,OAAOA,KAAP,MAAkB,OAAlB;AAGA,OAAO,MAAMC,kBAAN,SAAiCC,KAAjC,CAAuC;EAC5CC,WAAW,GAAG;IACZ,MACE,0FADF;EAGD;;AAL2C;AAQ9C,OAAO,MAAMC,cAAc,GAAIC,MAAD,IAA8B;EAC1D,OAAO;IACLC,aAAa,EAAG,kBAAiBD,MAAM,CAACE,SAAU;EAD7C,CAAP;AAGD,CAJM;AAMP,OAAO,MAAMC,UAAU,GAAIH,MAAD,IAA8B;EACtD,IAAII,OAAO,GAAGJ,MAAM,CAACE,SAAP,CAAiBG,QAAjB,CAA0B,QAA1B,IACV,8BADU,GAEV,+BAFJ;;EAIA,IAAIL,MAAM,CAACM,SAAX,EAAsB;IACpBF,OAAO,GAAGJ,MAAM,CAACM,SAAP,CAAiBC,OAAjB,CAAyB,4BAAzB,EAAuD,IAAvD,CAAV;EACD;;EACD,OAAOH,OAAP;AACD,CATM;AAWP,OAAO,MAAMI,gBAAgB,GAAIR,MAAD,IAA8B;EAC5D,OAAOL,KAAK,CAACc,MAAN,CAAa;IAClBC,OAAO,EAAEP,UAAU,CAACH,MAAD,CADD;IAElBW,OAAO,EAAEZ,cAAc,CAACC,MAAD;EAFL,CAAb,CAAP;AAID,CALM;AAOP,OAAO,SAASY,YAAT,CAAsBZ,MAAtB,EAAgD;EACrD,IAAI,CAACA,MAAM,CAACE,SAAZ,EAAuB;IACrB,MAAM,IAAIL,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,IAAIS,SAAS,GAAG,EAAhB;EACA,MAAMO,WAAW,GAAGb,MAAM,CAACc,QAAP,GAAmB,aAAYd,MAAM,CAACc,QAAS,EAA/C,GAAmD,EAAvE;;EACA,IAAId,MAAM,CAACM,SAAX,EAAsB;IACpBA,SAAS,GAAI,GAAEN,MAAM,CAACM,SAAU,QAAON,MAAM,CAACE,SAAU,GAAEW,WAAY,EAAtE;EACD,CAFD,MAEO;IACL,MAAMH,OAAO,GAAGV,MAAM,CAACE,SAAP,CAAiBG,QAAjB,CAA0B,QAA1B,IACZ,8BADY,GAEZ,+BAFJ;IAGA,MAAMU,OAAO,GAAGf,MAAM,CAACe,OAAP,IAAkB,OAAlC;IACAT,SAAS,GAAI,GAAEI,OAAQ,OAAMK,OAAQ,iBAAgBf,MAAM,CAACE,SAAU,GAAEW,WAAY,EAApF;EACD;;EAED,OAAOP,SAAP;AACD;AAED,OAAO,MAAMU,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,15 +1,2 @@
1
- import { StyleProp, ViewStyle } from 'react-native';
2
- import { IPayEngineConfig } from '../utils';
3
- interface IProps {
4
- config: IPayEngineConfig;
5
- type: string;
6
- merchantId?: string;
7
- hash?: string;
8
- events: {
9
- [key: string]: (eventData: any) => void;
10
- };
11
- style?: StyleProp<ViewStyle>;
12
- [key: string]: any;
13
- }
14
- declare const PayEngine: (props: IProps) => JSX.Element;
1
+ declare const PayEngine: () => JSX.Element;
15
2
  export default PayEngine;
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ import { ViewProps } from 'react-native';
3
+ import type { PEPaymentRequest } from './PEPaymentRequest';
4
+ export interface PEApplePayButtonProps extends ViewProps {
5
+ paymentRequest: PEPaymentRequest;
6
+ onTokenDidReturn?: (token: string) => void;
7
+ onPaymentSheetDismissed?: () => void;
8
+ onPaymentFailed?: (error: Error) => void;
9
+ }
10
+ export interface PEApplePayButtonMethods {
11
+ }
12
+ export declare const PEApplePayButton: React.ForwardRefExoticComponent<PEApplePayButtonProps & React.RefAttributes<PEApplePayButtonMethods>>;
@@ -0,0 +1,12 @@
1
+ export declare class PEPaymentRequest {
2
+ paymentAmount: number;
3
+ currencyCode: 'USD' | 'CAD';
4
+ paymentItems: {
5
+ amount: number;
6
+ label: string;
7
+ }[];
8
+ constructor(paymentAmount: number, currencyCode?: 'USD' | 'CAD', paymentItems?: {
9
+ amount: number;
10
+ label: string;
11
+ }[]);
12
+ }
@@ -0,0 +1,5 @@
1
+ export default class PayEngineNative {
2
+ static createFraudMonitorSession(merchantId: string): Promise<any>;
3
+ static getBrowserInfo(): Promise<any>;
4
+ static isPlatformPaySupported(merchantId: string): Promise<any>;
5
+ }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import type { IPayEngineConfig } from "../../interfaces";
3
+ declare const PayEngineContext: React.Context<IPayEngineConfig | undefined>;
4
+ declare const PayEngineProvider: ({ config, children }: {
5
+ config: IPayEngineConfig;
6
+ children: React.ReactNode;
7
+ }) => JSX.Element;
8
+ export { PayEngineContext, PayEngineProvider };
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import type IPEField from './IPEField';
3
+ import type PEBankAccount from './PEBankAccount';
4
+ export interface PEBankAccountViewProps {
5
+ additionalFields?: IPEField[];
6
+ }
7
+ export interface PEBankAccountViewMethods {
8
+ submit: (merchantId: string, additionalData: {
9
+ [key: string]: string;
10
+ }) => Promise<PEBankAccount>;
11
+ showKeyboard: () => void;
12
+ hideKeyboard: () => void;
13
+ }
14
+ export declare const PEBankAccountView: React.ForwardRefExoticComponent<PEBankAccountViewProps & React.RefAttributes<PEBankAccountViewMethods>>;
@@ -0,0 +1,14 @@
1
+ import * as React from 'react';
2
+ import type IPEField from './IPEField';
3
+ import type PECard from './PECard';
4
+ export interface PECreditCardViewProps {
5
+ additionalFields?: IPEField[];
6
+ }
7
+ export interface PECreditCardViewMethods {
8
+ submit: (merchantId: string, additionalData: {
9
+ [key: string]: string;
10
+ }) => Promise<PECard>;
11
+ showKeyboard: () => void;
12
+ hideKeyboard: () => void;
13
+ }
14
+ export declare const PECreditCardView: React.ForwardRefExoticComponent<PECreditCardViewProps & React.RefAttributes<PECreditCardViewMethods>>;
@@ -0,0 +1,10 @@
1
+ import type PEKeyboardType from "./PEKeyboardType";
2
+ interface IPEField {
3
+ name: string;
4
+ type: string;
5
+ placeholder: string;
6
+ keyboardType: PEKeyboardType;
7
+ isRequired: boolean;
8
+ pattern?: string;
9
+ }
10
+ export default IPEField;
@@ -0,0 +1,11 @@
1
+ interface PEBankAccount {
2
+ id: string;
3
+ token: string;
4
+ account_data: {
5
+ first_name: string;
6
+ last_name: string;
7
+ routing_number: string;
8
+ last_4: string;
9
+ };
10
+ }
11
+ export default PEBankAccount;
@@ -0,0 +1,13 @@
1
+ interface PECard {
2
+ token: string;
3
+ card_data: {
4
+ id: string;
5
+ brand: string;
6
+ last_4: string;
7
+ exp_year: string;
8
+ exp_month: string;
9
+ name: string;
10
+ address_zip?: string;
11
+ };
12
+ }
13
+ export default PECard;
@@ -0,0 +1,7 @@
1
+ declare enum PEKeyboardType {
2
+ alphabet = "alphabet",
3
+ number = "number",
4
+ phone = "phone",
5
+ normal = "normal"
6
+ }
7
+ export default PEKeyboardType;
@@ -1,5 +1,15 @@
1
1
  import PayEngine from './components/PayEngine';
2
- import { SecureFields } from './components/SecureFields/index';
3
- import type { IPayEngineConfig } from './utils';
2
+ import type { IPayEngineConfig } from './interfaces/index';
3
+ import { PECreditCardView, PECreditCardViewMethods } from './components/v2/SecureFields/CreditCardView';
4
+ import { PEBankAccountView, PEBankAccountViewMethods } from './components/v2/SecureFields/BankAccountView';
5
+ import type IPEField from './components/v2/SecureFields/IPEField';
6
+ import type PECard from './components/v2/SecureFields/PECard';
7
+ import type PEBankAccount from './components/v2/SecureFields/PEBankAccount';
8
+ import { PayEngineProvider } from './components/v2/PayEngineProvider';
9
+ import PayEngineNative from './components/v2/PayEngineNative';
10
+ import { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';
11
+ import { PEPaymentRequest } from './components/v2/ApplePay/PEPaymentRequest';
12
+ import * as PayEngineUtils from './utils/index';
13
+ import PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';
4
14
  declare const PayEngineStatic: any;
5
- export { PayEngineStatic, PayEngine, SecureFields, IPayEngineConfig };
15
+ export { PayEngineStatic, PayEngine, IPayEngineConfig, PayEngineUtils, PayEngineProvider, PayEngineNative, PEKeyboardType, IPEField, PECreditCardView, PECreditCardViewMethods, PECard, PEBankAccountView, PEBankAccountViewMethods, PEBankAccount, PEApplePayButton, PEPaymentRequest, };
@@ -0,0 +1,6 @@
1
+ export interface IPayEngineConfig {
2
+ publicKey: string;
3
+ version?: string;
4
+ scriptURL?: string;
5
+ logLevel?: number;
6
+ }
@@ -1,45 +1,11 @@
1
- export interface IPayEngineConfig {
2
- publicKey: string;
3
- version?: string;
4
- scriptURL?: string;
5
- logLevel?: number;
1
+ import type { IPayEngineConfig } from '../interfaces/index';
2
+ export declare class PEDeprecationError extends Error {
3
+ constructor();
6
4
  }
5
+ export declare const getHttpHeaders: (config: IPayEngineConfig) => {
6
+ Authorization: string;
7
+ };
8
+ export declare const getBaseURL: (config: IPayEngineConfig) => string;
7
9
  export declare const createHttpClient: (config: IPayEngineConfig) => import("axios").AxiosInstance;
8
10
  export declare function getScriptURL(config: IPayEngineConfig): string;
9
- /**
10
- * <script>
11
- console.log("AAAAAAAA")
12
- var component = document.getElementById("component");
13
- var onEvent = function(event) {
14
- console.log({ event })
15
- }
16
- console.log('component')
17
- component.addEventListener('stepChange', function(e) {
18
- console.log('step change')
19
- })
20
- function addEventListenerAll(target, listener, ...otherArguments) {
21
-
22
- // install listeners for all natively triggered events
23
- for (const key in target) {
24
- if (/^on/.test(key)) {
25
- const eventType = key.substr(2);
26
- target.addEventListener(eventType, listener, ...otherArguments);
27
- }
28
- }
29
-
30
- // dynamically install listeners for all manually triggered events, just-in-time before they're dispatched ;D
31
- const dispatchEvent_original = EventTarget.prototype.dispatchEvent;
32
- function dispatchEvent(event) {
33
- console.log('event test', event.type)
34
- target.addEventListener(event.type, listener, ...otherArguments); // multiple identical listeners are automatically discarded
35
- dispatchEvent_original.apply(this, arguments);
36
- }
37
- EventTarget.prototype.dispatchEvent = dispatchEvent;
38
- if (EventTarget.prototype.dispatchEvent !== dispatchEvent) throw new Error('Browser is smarter than you think');
39
-
40
- }
41
-
42
- // addEventListenerAll(component, onEvent);
43
- </script>
44
- */
45
11
  export declare 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";
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "react-native-payengine",
3
- "version": "1.0.5",
3
+ "version": "2.0.2",
4
4
  "description": "PayEngine SDK for React Native",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
7
7
  "types": "lib/typescript/index.d.ts",
8
- "react-native": "lib/commonjs/index",
9
- "source": "lib/commonjs/index",
8
+ "react-native": "src",
9
+ "source": "src",
10
10
  "files": [
11
+ "src",
11
12
  "lib",
12
13
  "android",
13
14
  "ios",
14
15
  "cpp",
15
16
  "android/src",
16
17
  "react-native-payengine.podspec",
17
- "!./src",
18
18
  "!lib/typescript/example",
19
19
  "!android/build",
20
20
  "!ios/build",
@@ -29,6 +29,8 @@
29
29
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
30
30
  "prepare": "bob build",
31
31
  "release": "release-it",
32
+ "update-release": "release-it --no-increment",
33
+ "beta": "release-it major --preRelease=beta",
32
34
  "example": "yarn --cwd example",
33
35
  "bootstrap": "yarn example && yarn && yarn example pods"
34
36
  },
@@ -62,7 +64,6 @@
62
64
  "react": "17.0.2",
63
65
  "react-native": "0.68.2",
64
66
  "react-native-builder-bob": "^0.18.3",
65
- "react-native-webview": "^11.23.0",
66
67
  "release-it": "^15.0.0",
67
68
  "typescript": "^4.5.2"
68
69
  },
@@ -71,8 +72,7 @@
71
72
  },
72
73
  "peerDependencies": {
73
74
  "react": "*",
74
- "react-native": "*",
75
- "react-native-webview": "^11.23.0"
75
+ "react-native": "*"
76
76
  },
77
77
  "jest": {
78
78
  "preset": "react-native",
@@ -89,13 +89,17 @@
89
89
  "release-it": {
90
90
  "git": {
91
91
  "commitMessage": "chore: release ${version}",
92
- "tagName": "v${version}"
92
+ "tagName": "v${version}",
93
+ "commit": true,
94
+ "tag": true,
95
+ "push": true,
96
+ "requireCleanWorkingDir": false
93
97
  },
94
98
  "npm": {
95
99
  "publish": true
96
100
  },
97
101
  "github": {
98
- "release": true
102
+ "release": false
99
103
  },
100
104
  "plugins": {
101
105
  "@release-it/conventional-changelog": {
@@ -149,6 +153,8 @@
149
153
  ]
150
154
  },
151
155
  "dependencies": {
152
- "axios": "^0.27.2"
156
+ "axios": "^0.27.2",
157
+ "caniuse-lite": "^1.0.30001658",
158
+ "events": "^3.3.0"
153
159
  }
154
- }
160
+ }
@@ -11,15 +11,15 @@ Pod::Spec.new do |s|
11
11
  s.license = package["license"]
12
12
  s.authors = package["author"]
13
13
 
14
- s.platforms = { :ios => "10.0" }
14
+ s.platforms = { :ios => "12.0" }
15
15
  s.source = { :git => "https://bitbucket.org/payfac0/pf-react-native-payengine", :tag => "#{s.version}" }
16
16
 
17
- s.source_files = "ios/**/*.{h,m,mm,swift}"
17
+ s.source_files = "ios/Sources/**/*.{h,m,mm,swift}"
18
18
 
19
19
  s.dependency "React-Core"
20
20
 
21
21
  # VGS collect
22
- s.dependency 'VGSCollectSDK'
22
+ s.vendored_frameworks = 'ios/PayEngineSDK.xcframework'
23
23
 
24
24
  # Don't install the dependencies when we run `pod install` in the old architecture.
25
25
  if ENV['RCT_NEW_ARCH_ENABLED'] == '1' then
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import { StyleSheet, ActivityIndicator, View } from 'react-native';
3
+
4
+ const LoadingIndicator = () => {
5
+ return (
6
+ <View style={styles.container}>
7
+ <ActivityIndicator size="small" color="#0000ff" />
8
+ </View>
9
+ );
10
+ };
11
+
12
+ export default LoadingIndicator;
13
+
14
+ const styles = StyleSheet.create({
15
+ container: {
16
+ alignItems: 'center',
17
+ justifyContent: 'center',
18
+ position: 'absolute',
19
+ top: 0,
20
+ left: 0,
21
+ height: '100%',
22
+ width: '100%'
23
+ },
24
+ activityIndicatorStyle: {
25
+ // flex: 1,
26
+ // justifyContent: "center",
27
+ },
28
+ });
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { Text } from 'react-native';
3
+
4
+ const PayEngine = () => {
5
+ return <Text>Obsolete. Please check out the package readme</Text>;
6
+ };
7
+
8
+ export default PayEngine;
@@ -0,0 +1,70 @@
1
+
2
+ import * as React from 'react';
3
+ import { requireNativeComponent, ViewProps } from 'react-native';
4
+ import type { PEPaymentRequest } from './PEPaymentRequest';
5
+
6
+
7
+ const RNPEApplePayButton = requireNativeComponent<NativePECreditCardViewProps>('RNPEApplePayButton');
8
+
9
+ type NativePEApplePayEvent = {
10
+ nativeEvent: {
11
+ error?: string;
12
+ token?: string
13
+ };
14
+ };
15
+
16
+ interface NativePECreditCardViewProps extends ViewProps {
17
+ paymentRequest: string;
18
+ onPmSheetDidDismiss: (event: NativePEApplePayEvent) => void;
19
+ onPmTokenDidReturn: (event: NativePEApplePayEvent) => void;
20
+ onPmError: (event: NativePEApplePayEvent) => void;
21
+ }
22
+
23
+ export interface PEApplePayButtonProps extends ViewProps {
24
+ paymentRequest: PEPaymentRequest;
25
+ onTokenDidReturn?: (token: string) => void;
26
+ onPaymentSheetDismissed?: () => void;
27
+ onPaymentFailed?: (error: Error) => void;
28
+ }
29
+
30
+ export interface PEApplePayButtonMethods {
31
+
32
+ }
33
+
34
+
35
+ export const PEApplePayButton = React.forwardRef<
36
+ PEApplePayButtonMethods,
37
+ PEApplePayButtonProps
38
+ >((props, ref) => {
39
+
40
+ React.useImperativeHandle(ref, () => ({
41
+ }));
42
+
43
+ const pmError = (event: NativePEApplePayEvent) => {
44
+ if (props.onPaymentFailed) {
45
+ props.onPaymentFailed(new Error(event.nativeEvent.error));
46
+ }
47
+ };
48
+
49
+ const pmTokenDidReturn = (event: NativePEApplePayEvent) => {
50
+ if (props.onTokenDidReturn) {
51
+ props.onTokenDidReturn(event.nativeEvent.token!);
52
+ }
53
+ };
54
+
55
+ const pmSheetDidDismiss = () => {
56
+ if (props.onPaymentSheetDismissed) {
57
+ props.onPaymentSheetDismissed();
58
+ }
59
+ }
60
+
61
+ return (
62
+ <RNPEApplePayButton
63
+ style={{ height: 32, width: '100%', ...(props.style as object) }}
64
+ paymentRequest={JSON.stringify(props.paymentRequest)}
65
+ onPmError={pmError}
66
+ onPmTokenDidReturn={pmTokenDidReturn}
67
+ onPmSheetDidDismiss={pmSheetDidDismiss}
68
+ />
69
+ );
70
+ });
@@ -0,0 +1,18 @@
1
+
2
+ export class PEPaymentRequest {
3
+ paymentAmount: number;
4
+ currencyCode: 'USD' | 'CAD';
5
+ paymentItems: {
6
+ amount: number;
7
+ label: string;
8
+ }[]
9
+
10
+ constructor(paymentAmount: number, currencyCode: 'USD' | 'CAD' = 'USD', paymentItems: {
11
+ amount: number;
12
+ label: string;
13
+ }[] = []) {
14
+ this.paymentAmount = paymentAmount;
15
+ this.currencyCode = currencyCode;
16
+ this.paymentItems = paymentItems;
17
+ }
18
+ }
@@ -0,0 +1,20 @@
1
+ import { NativeModules, Platform } from "react-native";
2
+
3
+ const { RNPayEngineNative } = NativeModules;
4
+
5
+ export default class PayEngineNative {
6
+ static async createFraudMonitorSession(merchantId: string) {
7
+ return RNPayEngineNative.createFraudMonitorSession(merchantId);
8
+ }
9
+
10
+ static async getBrowserInfo() {
11
+ return RNPayEngineNative.getBrowserInfo();
12
+ }
13
+
14
+ static async isPlatformPaySupported(merchantId: string) {
15
+ if (Platform.OS === 'ios') {
16
+ return await RNPayEngineNative.isApplePaySupported(merchantId);
17
+ }
18
+ return false;
19
+ }
20
+ }
@@ -0,0 +1,30 @@
1
+ import React, { createContext } from "react";
2
+ import type { IPayEngineConfig } from "../../interfaces";
3
+ import { ActivityIndicator, NativeModules } from "react-native";
4
+
5
+ const { RNPayEngineNative } = NativeModules;
6
+
7
+ const PayEngineContext = createContext<IPayEngineConfig | undefined>(undefined);
8
+
9
+ const PayEngineProvider = ({ config, children }: { config: IPayEngineConfig, children: React.ReactNode }) => {
10
+ const [loading, setLoading] = React.useState(true);
11
+
12
+ React.useEffect(() => {
13
+ setLoading(true);
14
+ RNPayEngineNative.setConfig(config.publicKey, config.scriptURL)
15
+ setLoading(false);
16
+ }, [config]);
17
+
18
+ if (!config) {
19
+ throw new Error('PayEngineProvider: config is required');
20
+ }
21
+
22
+ return <PayEngineContext.Provider value={config}>
23
+ {loading ? <ActivityIndicator /> : children}
24
+ </PayEngineContext.Provider>
25
+ }
26
+
27
+ export {
28
+ PayEngineContext,
29
+ PayEngineProvider
30
+ };