react-native-payengine 1.0.6 → 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 (300) 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/fileHashes/resourceHashesCache.bin → 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/gradle.xml +2 -3
  14. package/android/.idea/kotlinc.xml +6 -0
  15. package/android/.idea/migrations.xml +10 -0
  16. package/android/.idea/misc.xml +1 -1
  17. package/android/build.gradle +24 -3
  18. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  19. package/android/paymentsdk-debug.aar +0 -0
  20. package/android/paymentsdk-release.aar +0 -0
  21. package/android/src/main/java/com/reactnativepayengine/PayengineModule.java +1 -5
  22. package/android/src/main/java/com/reactnativepayengine/PayenginePackage.java +7 -33
  23. package/android/src/main/java/com/reactnativepayengine/util/MetricsUtil.kt +44 -0
  24. package/android/src/main/java/com/reactnativepayengine/v2/RNPEFraudAnalyticsApplication.java +55 -0
  25. package/android/src/main/java/com/reactnativepayengine/v2/RNPayEngineNative.kt +71 -0
  26. package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEEvents.kt +8 -0
  27. package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEField.kt +17 -0
  28. package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNBankAccountViewManager.kt +103 -0
  29. package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNPEBankAccountView.kt +77 -0
  30. package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardView.kt +77 -0
  31. package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardViewManager.kt +103 -0
  32. package/ios/PayEngineSDK.xcframework/Info.plist +44 -0
  33. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
  34. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
  35. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
  36. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
  37. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +622 -0
  38. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
  39. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
  40. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
  41. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
  42. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +15143 -0
  43. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +326 -0
  44. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +326 -0
  45. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  46. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +326 -0
  47. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +326 -0
  48. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/module.modulemap +11 -0
  49. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
  50. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
  51. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  52. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/browserInfo.html +136 -0
  53. package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/perform3ds.html +467 -0
  54. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
  55. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
  56. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
  57. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
  58. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +1240 -0
  59. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
  60. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
  61. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
  62. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
  63. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +15143 -0
  64. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +326 -0
  65. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +326 -0
  66. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  67. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +326 -0
  68. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +326 -0
  69. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +15143 -0
  70. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +326 -0
  71. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +326 -0
  72. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  73. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +326 -0
  74. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +326 -0
  75. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/module.modulemap +11 -0
  76. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
  77. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
  78. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
  79. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/browserInfo.html +136 -0
  80. package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/perform3ds.html +467 -0
  81. package/ios/Payengine.xcodeproj/project.pbxproj +14 -4
  82. package/ios/Payengine.xcodeproj/project.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  83. package/ios/Payengine.xcworkspace/contents.xcworkspacedata +7 -0
  84. package/ios/Payengine.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  85. package/ios/Sources/Classes/ApplePay/RNPEApplePayButton.swift +111 -0
  86. package/ios/Sources/Classes/ApplePay/RNPEApplePayPaymentRequest.swift +43 -0
  87. package/ios/Sources/Classes/RNPEError.swift +12 -0
  88. package/ios/Sources/Classes/RNPEEventEmitter.swift +29 -0
  89. package/ios/Sources/Classes/RNPEUtils.swift +30 -0
  90. package/ios/Sources/Classes/RNPayEngineNative.swift +87 -0
  91. package/ios/Sources/Classes/SecureFields/RNPEBankAccountView.swift +130 -0
  92. package/ios/Sources/Classes/SecureFields/RNPECreditCardView.swift +129 -0
  93. package/ios/Sources/Classes/SecureFields/RNPEEvents.swift +15 -0
  94. package/ios/Sources/Classes/SecureFields/RNPEField.swift +26 -0
  95. package/ios/Sources/Payengine.m +73 -0
  96. package/ios/Sources/Payengine.swift +13 -0
  97. package/lib/commonjs/components/PayEngine.js +2 -123
  98. package/lib/commonjs/components/PayEngine.js.map +1 -1
  99. package/lib/commonjs/components/{SecureFields/VGS/ExpDateField.js → v2/ApplePay/PEApplePayButton.js} +38 -13
  100. package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
  101. package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js +29 -0
  102. package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
  103. package/lib/commonjs/components/v2/PayEngineNative.js +34 -0
  104. package/lib/commonjs/components/v2/PayEngineNative.js.map +1 -0
  105. package/lib/commonjs/components/{SecureFields/VGS/TextField.js → v2/PayEngineProvider.js} +28 -12
  106. package/lib/commonjs/components/v2/PayEngineProvider.js.map +1 -0
  107. package/lib/commonjs/components/v2/SecureFields/BankAccountView.js +89 -0
  108. package/lib/commonjs/components/v2/SecureFields/BankAccountView.js.map +1 -0
  109. package/lib/commonjs/components/v2/SecureFields/CreditCardView.js +90 -0
  110. package/lib/commonjs/components/v2/SecureFields/CreditCardView.js.map +1 -0
  111. package/lib/commonjs/components/v2/SecureFields/IPEField.js +6 -0
  112. package/lib/commonjs/components/v2/SecureFields/IPEField.js.map +1 -0
  113. package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js +6 -0
  114. package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js.map +1 -0
  115. package/lib/commonjs/components/v2/SecureFields/PECard.js +6 -0
  116. package/lib/commonjs/components/v2/SecureFields/PECard.js.map +1 -0
  117. package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js +18 -0
  118. package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
  119. package/lib/commonjs/index.js +54 -18
  120. package/lib/commonjs/index.js.map +1 -1
  121. package/lib/commonjs/interfaces/index.js +0 -4
  122. package/lib/commonjs/interfaces/index.js.map +1 -1
  123. package/lib/commonjs/utils/index.js +10 -38
  124. package/lib/commonjs/utils/index.js.map +1 -1
  125. package/lib/module/components/PayEngine.js +3 -118
  126. package/lib/module/components/PayEngine.js.map +1 -1
  127. package/lib/module/components/v2/ApplePay/PEApplePayButton.js +37 -0
  128. package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
  129. package/lib/module/components/v2/ApplePay/PEPaymentRequest.js +20 -0
  130. package/lib/module/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
  131. package/lib/module/components/v2/PayEngineNative.js +23 -0
  132. package/lib/module/components/v2/PayEngineNative.js.map +1 -0
  133. package/lib/module/components/v2/PayEngineProvider.js +30 -0
  134. package/lib/module/components/v2/PayEngineProvider.js.map +1 -0
  135. package/lib/module/components/v2/SecureFields/BankAccountView.js +75 -0
  136. package/lib/module/components/v2/SecureFields/BankAccountView.js.map +1 -0
  137. package/lib/module/components/v2/SecureFields/CreditCardView.js +76 -0
  138. package/lib/module/components/v2/SecureFields/CreditCardView.js.map +1 -0
  139. package/lib/module/components/v2/SecureFields/IPEField.js +2 -0
  140. package/lib/module/components/v2/SecureFields/IPEField.js.map +1 -0
  141. package/lib/module/components/v2/SecureFields/PEBankAccount.js +2 -0
  142. package/lib/module/components/v2/SecureFields/PEBankAccount.js.map +1 -0
  143. package/lib/module/components/v2/SecureFields/PECard.js +2 -0
  144. package/lib/module/components/v2/SecureFields/PECard.js.map +1 -0
  145. package/lib/module/components/v2/SecureFields/PEKeyboardType.js +11 -0
  146. package/lib/module/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
  147. package/lib/module/index.js +14 -6
  148. package/lib/module/index.js.map +1 -1
  149. package/lib/module/interfaces/index.js +1 -1
  150. package/lib/module/interfaces/index.js.map +1 -1
  151. package/lib/module/utils/index.js +6 -37
  152. package/lib/module/utils/index.js.map +1 -1
  153. package/lib/typescript/components/PayEngine.d.ts +1 -14
  154. package/lib/typescript/components/v2/ApplePay/PEApplePayButton.d.ts +12 -0
  155. package/lib/typescript/components/v2/ApplePay/PEPaymentRequest.d.ts +12 -0
  156. package/lib/typescript/components/v2/PayEngineNative.d.ts +5 -0
  157. package/lib/typescript/components/v2/PayEngineProvider.d.ts +8 -0
  158. package/lib/typescript/components/v2/SecureFields/BankAccountView.d.ts +14 -0
  159. package/lib/typescript/components/v2/SecureFields/CreditCardView.d.ts +14 -0
  160. package/lib/typescript/components/v2/SecureFields/IPEField.d.ts +10 -0
  161. package/lib/typescript/components/v2/SecureFields/PEBankAccount.d.ts +11 -0
  162. package/lib/typescript/components/v2/SecureFields/PECard.d.ts +13 -0
  163. package/lib/typescript/components/v2/SecureFields/PEKeyboardType.d.ts +7 -0
  164. package/lib/typescript/index.d.ts +12 -6
  165. package/lib/typescript/interfaces/index.d.ts +0 -27
  166. package/lib/typescript/utils/index.d.ts +3 -36
  167. package/package.json +12 -7
  168. package/react-native-payengine.podspec +2 -2
  169. package/src/components/PayEngine.tsx +5 -118
  170. package/src/components/v2/ApplePay/PEApplePayButton.tsx +70 -0
  171. package/src/components/v2/ApplePay/PEPaymentRequest.ts +18 -0
  172. package/src/components/v2/PayEngineNative.tsx +20 -0
  173. package/src/components/v2/PayEngineProvider.tsx +30 -0
  174. package/src/components/v2/SecureFields/BankAccountView.tsx +95 -0
  175. package/src/components/v2/SecureFields/CreditCardView.tsx +96 -0
  176. package/src/components/v2/SecureFields/IPEField.ts +12 -0
  177. package/src/components/v2/SecureFields/PEBankAccount.ts +12 -0
  178. package/src/components/v2/SecureFields/PECard.ts +14 -0
  179. package/src/components/v2/SecureFields/PEKeyboardType.ts +8 -0
  180. package/src/index.tsx +47 -22
  181. package/src/interfaces/index.ts +0 -32
  182. package/src/utils/index.ts +8 -36
  183. package/android/.gradle/5.6.4/executionHistory/executionHistory.bin +0 -0
  184. package/android/.gradle/5.6.4/executionHistory/executionHistory.lock +0 -0
  185. package/android/.gradle/5.6.4/fileContent/fileContent.lock +0 -0
  186. package/android/.gradle/5.6.4/fileHashes/fileHashes.bin +0 -0
  187. package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
  188. package/android/.gradle/5.6.4/javaCompile/classAnalysis.bin +0 -0
  189. package/android/.gradle/5.6.4/javaCompile/jarAnalysis.bin +0 -0
  190. package/android/.gradle/5.6.4/javaCompile/javaCompile.lock +0 -0
  191. package/android/.gradle/5.6.4/javaCompile/taskHistory.bin +0 -0
  192. package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectModule.java +0 -153
  193. package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectOnCreateViewInstanceListener.java +0 -6
  194. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCVCField.java +0 -67
  195. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardHolderNameField.java +0 -53
  196. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardNumberField.java +0 -57
  197. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSExpDateField.java +0 -54
  198. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSTextField.java +0 -57
  199. package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSZipCodeField.java +0 -62
  200. package/android/src/main/java/com/reactnativepayengine/util/ResourceUtil.java +0 -14
  201. package/ios/Payengine.m +0 -72
  202. package/ios/Payengine.swift +0 -720
  203. package/lib/commonjs/components/ApplePay/PayEngineApplePay.js +0 -71
  204. package/lib/commonjs/components/ApplePay/PayEngineApplePay.js.map +0 -1
  205. package/lib/commonjs/components/ApplePay/index.js +0 -46
  206. package/lib/commonjs/components/ApplePay/index.js.map +0 -1
  207. package/lib/commonjs/components/ApplePay/interfaces.js +0 -2
  208. package/lib/commonjs/components/ApplePay/interfaces.js.map +0 -1
  209. package/lib/commonjs/components/CreditCardForm/index.js +0 -76
  210. package/lib/commonjs/components/CreditCardForm/index.js.map +0 -1
  211. package/lib/commonjs/components/GooglePay/PayEngineGooglePay.js +0 -65
  212. package/lib/commonjs/components/GooglePay/PayEngineGooglePay.js.map +0 -1
  213. package/lib/commonjs/components/GooglePay/index.js +0 -40
  214. package/lib/commonjs/components/GooglePay/index.js.map +0 -1
  215. package/lib/commonjs/components/GooglePay/interfaces.js +0 -2
  216. package/lib/commonjs/components/GooglePay/interfaces.js.map +0 -1
  217. package/lib/commonjs/components/Legacy/CreditCardFormLegacy.js +0 -323
  218. package/lib/commonjs/components/Legacy/CreditCardFormLegacy.js.map +0 -1
  219. package/lib/commonjs/components/SecureFields/VGS/CVCField.js +0 -26
  220. package/lib/commonjs/components/SecureFields/VGS/CVCField.js.map +0 -1
  221. package/lib/commonjs/components/SecureFields/VGS/CardHolderNameField.js +0 -26
  222. package/lib/commonjs/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
  223. package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js +0 -26
  224. package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js.map +0 -1
  225. package/lib/commonjs/components/SecureFields/VGS/CollectManager.js +0 -60
  226. package/lib/commonjs/components/SecureFields/VGS/CollectManager.js.map +0 -1
  227. package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js.map +0 -1
  228. package/lib/commonjs/components/SecureFields/VGS/TextField.js.map +0 -1
  229. package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js +0 -26
  230. package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
  231. package/lib/commonjs/components/SecureFields/index.js +0 -34
  232. package/lib/commonjs/components/SecureFields/index.js.map +0 -1
  233. package/lib/module/components/ApplePay/PayEngineApplePay.js +0 -58
  234. package/lib/module/components/ApplePay/PayEngineApplePay.js.map +0 -1
  235. package/lib/module/components/ApplePay/index.js +0 -35
  236. package/lib/module/components/ApplePay/index.js.map +0 -1
  237. package/lib/module/components/ApplePay/interfaces.js +0 -2
  238. package/lib/module/components/ApplePay/interfaces.js.map +0 -1
  239. package/lib/module/components/CreditCardForm/index.js +0 -60
  240. package/lib/module/components/CreditCardForm/index.js.map +0 -1
  241. package/lib/module/components/GooglePay/PayEngineGooglePay.js +0 -52
  242. package/lib/module/components/GooglePay/PayEngineGooglePay.js.map +0 -1
  243. package/lib/module/components/GooglePay/index.js +0 -29
  244. package/lib/module/components/GooglePay/index.js.map +0 -1
  245. package/lib/module/components/GooglePay/interfaces.js +0 -2
  246. package/lib/module/components/GooglePay/interfaces.js.map +0 -1
  247. package/lib/module/components/Legacy/CreditCardFormLegacy.js +0 -302
  248. package/lib/module/components/Legacy/CreditCardFormLegacy.js.map +0 -1
  249. package/lib/module/components/SecureFields/VGS/CVCField.js +0 -14
  250. package/lib/module/components/SecureFields/VGS/CVCField.js.map +0 -1
  251. package/lib/module/components/SecureFields/VGS/CardHolderNameField.js +0 -14
  252. package/lib/module/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
  253. package/lib/module/components/SecureFields/VGS/CardNumberField.js +0 -14
  254. package/lib/module/components/SecureFields/VGS/CardNumberField.js.map +0 -1
  255. package/lib/module/components/SecureFields/VGS/CollectManager.js +0 -45
  256. package/lib/module/components/SecureFields/VGS/CollectManager.js.map +0 -1
  257. package/lib/module/components/SecureFields/VGS/ExpDateField.js +0 -14
  258. package/lib/module/components/SecureFields/VGS/ExpDateField.js.map +0 -1
  259. package/lib/module/components/SecureFields/VGS/TextField.js +0 -17
  260. package/lib/module/components/SecureFields/VGS/TextField.js.map +0 -1
  261. package/lib/module/components/SecureFields/VGS/ZipCodeField.js +0 -14
  262. package/lib/module/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
  263. package/lib/module/components/SecureFields/index.js +0 -17
  264. package/lib/module/components/SecureFields/index.js.map +0 -1
  265. package/lib/typescript/components/ApplePay/PayEngineApplePay.d.ts +0 -12
  266. package/lib/typescript/components/ApplePay/index.d.ts +0 -7
  267. package/lib/typescript/components/ApplePay/interfaces.d.ts +0 -20
  268. package/lib/typescript/components/CreditCardForm/index.d.ts +0 -3
  269. package/lib/typescript/components/GooglePay/PayEngineGooglePay.d.ts +0 -10
  270. package/lib/typescript/components/GooglePay/index.d.ts +0 -7
  271. package/lib/typescript/components/GooglePay/interfaces.d.ts +0 -38
  272. package/lib/typescript/components/Legacy/CreditCardFormLegacy.d.ts +0 -4
  273. package/lib/typescript/components/SecureFields/VGS/CVCField.d.ts +0 -10
  274. package/lib/typescript/components/SecureFields/VGS/CardHolderNameField.d.ts +0 -10
  275. package/lib/typescript/components/SecureFields/VGS/CardNumberField.d.ts +0 -10
  276. package/lib/typescript/components/SecureFields/VGS/CollectManager.d.ts +0 -12
  277. package/lib/typescript/components/SecureFields/VGS/ExpDateField.d.ts +0 -10
  278. package/lib/typescript/components/SecureFields/VGS/TextField.d.ts +0 -14
  279. package/lib/typescript/components/SecureFields/VGS/ZipCodeField.d.ts +0 -10
  280. package/lib/typescript/components/SecureFields/index.d.ts +0 -16
  281. package/src/components/ApplePay/PayEngineApplePay.ts +0 -61
  282. package/src/components/ApplePay/index.ts +0 -32
  283. package/src/components/ApplePay/interfaces.ts +0 -25
  284. package/src/components/CreditCardForm/index.tsx +0 -43
  285. package/src/components/GooglePay/PayEngineGooglePay.ts +0 -48
  286. package/src/components/GooglePay/index.ts +0 -39
  287. package/src/components/GooglePay/interfaces.ts +0 -42
  288. package/src/components/Legacy/CreditCardFormLegacy.tsx +0 -292
  289. package/src/components/SecureFields/VGS/CVCField.tsx +0 -21
  290. package/src/components/SecureFields/VGS/CardHolderNameField.tsx +0 -21
  291. package/src/components/SecureFields/VGS/CardNumberField.tsx +0 -21
  292. package/src/components/SecureFields/VGS/CollectManager.tsx +0 -74
  293. package/src/components/SecureFields/VGS/ExpDateField.tsx +0 -21
  294. package/src/components/SecureFields/VGS/TextField.tsx +0 -27
  295. package/src/components/SecureFields/VGS/ZipCodeField.tsx +0 -21
  296. package/src/components/SecureFields/index.ts +0 -17
  297. /package/android/.gradle/{5.6.4 → 6.1.1}/fileChanges/last-build.bin +0 -0
  298. /package/android/.gradle/{5.6.4 → 6.1.1}/gc.properties +0 -0
  299. /package/android/{vgscollect-1.7.2-debug.aar → securefields-1.7.2-debug.aar} +0 -0
  300. /package/ios/{Payengine-Bridging-Header.h → Sources/Payengine-Bridging-Header.h} +0 -0
@@ -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,57 +3,93 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "CreditCardForm", {
6
+ Object.defineProperty(exports, "PEApplePayButton", {
7
7
  enumerable: true,
8
8
  get: function () {
9
- return _index2.CreditCardForm;
9
+ return _PEApplePayButton.PEApplePayButton;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "CreditCardFormLegacy", {
12
+ Object.defineProperty(exports, "PEBankAccountView", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _CreditCardFormLegacy.default;
15
+ return _BankAccountView.PEBankAccountView;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "PayEngine", {
18
+ Object.defineProperty(exports, "PEBankAccountViewMethods", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _PayEngine.default;
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;
22
40
  }
23
41
  });
24
- Object.defineProperty(exports, "PayEngineApplePay", {
42
+ Object.defineProperty(exports, "PEPaymentRequest", {
25
43
  enumerable: true,
26
44
  get: function () {
27
- return _PayEngineApplePay.PayEngineApplePay;
45
+ return _PEPaymentRequest.PEPaymentRequest;
46
+ }
47
+ });
48
+ Object.defineProperty(exports, "PayEngine", {
49
+ enumerable: true,
50
+ get: function () {
51
+ return _PayEngine.default;
28
52
  }
29
53
  });
30
- Object.defineProperty(exports, "PayEngineGooglePay", {
54
+ Object.defineProperty(exports, "PayEngineNative", {
31
55
  enumerable: true,
32
56
  get: function () {
33
- return _PayEngineGooglePay.PayEngineGooglePay;
57
+ return _PayEngineNative.default;
34
58
  }
35
59
  });
36
- exports.PayEngineStatic = void 0;
37
- Object.defineProperty(exports, "SecureFields", {
60
+ Object.defineProperty(exports, "PayEngineProvider", {
38
61
  enumerable: true,
39
62
  get: function () {
40
- return _index.SecureFields;
63
+ return _PayEngineProvider.PayEngineProvider;
41
64
  }
42
65
  });
66
+ exports.PayEngineUtils = exports.PayEngineStatic = void 0;
43
67
 
44
68
  var _PayEngine = _interopRequireDefault(require("./components/PayEngine"));
45
69
 
46
70
  var _reactNative = require("react-native");
47
71
 
48
- 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"));
49
85
 
50
- var _index2 = require("./components/CreditCardForm/index");
86
+ exports.PayEngineUtils = PayEngineUtils;
51
87
 
52
- var _CreditCardFormLegacy = _interopRequireDefault(require("./components/Legacy/CreditCardFormLegacy"));
88
+ var _PEKeyboardType = _interopRequireDefault(require("./components/v2/SecureFields/PEKeyboardType"));
53
89
 
54
- var _PayEngineGooglePay = require("./components/GooglePay/PayEngineGooglePay");
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); }
55
91
 
56
- var _PayEngineApplePay = require("./components/ApplePay/PayEngineApplePay");
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; }
57
93
 
58
94
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
59
95
 
@@ -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 { CreditCardForm } from './components/CreditCardForm/index';\nimport CreditCardFormLegacy from './components/Legacy/CreditCardFormLegacy';\nimport type { IPayEngineConfig } from './interfaces/index';\nimport { PayEngineGooglePay } from './components/GooglePay/PayEngineGooglePay';\nimport { PayEngineApplePay } from './components/ApplePay/PayEngineApplePay';\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\nexport {\n PayEngineStatic,\n PayEngine,\n SecureFields,\n CreditCardForm,\n CreditCardFormLegacy,\n IPayEngineConfig,\n PayEngineGooglePay,\n PayEngineApplePay\n}\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAEA;;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,GAA0BD,0BAAA,CAAcC,SAAxC,GAAoD,IAAIC,KAAJ,CAC1E,EAD0E,EAE1E;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUV,aAAV,CAAN;EACD;;AAHH,CAF0E,CAA5E"}
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"}
@@ -1,6 +1,2 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["import type { StyleProp, ViewStyle } from 'react-native';\nimport type { GooglePayRequestData } from '../components/GooglePay/interfaces';\n\nexport interface IPayEngineConfig {\n publicKey: string;\n version?: string;\n scriptURL?: string;\n logLevel?: number;\n}\n\nexport interface CreditCardFormProps {\n style?: StyleProp<ViewStyle>;\n merchantId?: string;\n showZipCode?: boolean;\n config: IPayEngineConfig;\n}\n\nexport interface CreditCardFormMethods {\n createCard: (merchantId?: string) => Promise<any>;\n}\n\nexport interface MobilePaymentConfig {\n base_url: string;\n country: string;\n currency: string;\n gateway: string; // nmi | converge\n google_pay: GooglePayRequestData;\n apple_pay: {\n merchantName: string;\n supportedCardNetworks: string[];\n };\n}\n\nexport interface PaymentRequest {\n amount: number;\n currencyCode?: string;\n countryCode?: string;\n}\n"],"mappings":""}
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,13 +3,22 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getHttpHeaders = exports.getBaseURL = 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
+ 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
+
13
22
  const getHttpHeaders = config => {
14
23
  return {
15
24
  Authorization: `Signature key="${config.publicKey}",algorithm="hmac-sha256",identifier="secure-fields",signature=""`
@@ -57,43 +66,6 @@ function getScriptURL(config) {
57
66
 
58
67
  return scriptURL;
59
68
  }
60
- /**
61
- * <script>
62
- console.log("AAAAAAAA")
63
- var component = document.getElementById("component");
64
- var onEvent = function(event) {
65
- console.log({ event })
66
- }
67
- console.log('component')
68
- component.addEventListener('stepChange', function(e) {
69
- console.log('step change')
70
- })
71
- function addEventListenerAll(target, listener, ...otherArguments) {
72
-
73
- // install listeners for all natively triggered events
74
- for (const key in target) {
75
- if (/^on/.test(key)) {
76
- const eventType = key.substr(2);
77
- target.addEventListener(eventType, listener, ...otherArguments);
78
- }
79
- }
80
-
81
- // dynamically install listeners for all manually triggered events, just-in-time before they're dispatched ;D
82
- const dispatchEvent_original = EventTarget.prototype.dispatchEvent;
83
- function dispatchEvent(event) {
84
- console.log('event test', event.type)
85
- target.addEventListener(event.type, listener, ...otherArguments); // multiple identical listeners are automatically discarded
86
- dispatchEvent_original.apply(this, arguments);
87
- }
88
- EventTarget.prototype.dispatchEvent = dispatchEvent;
89
- if (EventTarget.prototype.dispatchEvent !== dispatchEvent) throw new Error('Browser is smarter than you think');
90
-
91
- }
92
-
93
- // addEventListenerAll(component, onEvent);
94
- </script>
95
- */
96
-
97
69
 
98
70
  const debuggingScript = `
99
71
  const consoleLog = (type, ...log) => window.ReactNativeWebView.postMessage(JSON.stringify({'type': 'Console', 'data': {'type': type, 'log': log}}));
@@ -1 +1 @@
1
- {"version":3,"names":["getHttpHeaders","config","Authorization","publicKey","getBaseURL","baseUrl","includes","scriptURL","replace","createHttpClient","axios","create","baseURL","headers","getScriptURL","Error","logLevelStr","logLevel","version","debuggingScript"],"sources":["index.ts"],"sourcesContent":["import axios from 'axios';\nimport type { IPayEngineConfig } from '../interfaces/index';\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\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;;;;AAGO,MAAMA,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;;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;;;;AAWA,MAAMI,gBAAgB,GAAIR,MAAD,IAA8B;EAC5D,OAAOS,cAAA,CAAMC,MAAN,CAAa;IAClBC,OAAO,EAAER,UAAU,CAACH,MAAD,CADD;IAElBY,OAAO,EAAEb,cAAc,CAACC,MAAD;EAFL,CAAb,CAAP;AAID,CALM;;;;AAOA,SAASa,YAAT,CAAsBb,MAAtB,EAAgD;EACrD,IAAI,CAACA,MAAM,CAACE,SAAZ,EAAuB;IACrB,MAAM,IAAIY,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,IAAIR,SAAS,GAAG,EAAhB;EACA,MAAMS,WAAW,GAAGf,MAAM,CAACgB,QAAP,GAAmB,aAAYhB,MAAM,CAACgB,QAAS,EAA/C,GAAmD,EAAvE;;EACA,IAAIhB,MAAM,CAACM,SAAX,EAAsB;IACpBA,SAAS,GAAI,GAAEN,MAAM,CAACM,SAAU,QAAON,MAAM,CAACE,SAAU,GAAEa,WAAY,EAAtE;EACD,CAFD,MAEO;IACL,MAAMJ,OAAO,GAAGX,MAAM,CAACE,SAAP,CAAiBG,QAAjB,CAA0B,QAA1B,IACZ,8BADY,GAEZ,+BAFJ;IAGA,MAAMY,OAAO,GAAGjB,MAAM,CAACiB,OAAP,IAAkB,OAAlC;IACAX,SAAS,GAAI,GAAEK,OAAQ,OAAMM,OAAQ,iBAAgBjB,MAAM,CAACE,SAAU,GAAEa,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;;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;;;;AAWA,MAAMI,gBAAgB,GAAIR,MAAD,IAA8B;EAC5D,OAAOS,cAAA,CAAMC,MAAN,CAAa;IAClBC,OAAO,EAAER,UAAU,CAACH,MAAD,CADD;IAElBY,OAAO,EAAEb,cAAc,CAACC,MAAD;EAFL,CAAb,CAAP;AAID,CALM;;;;AAOA,SAASa,YAAT,CAAsBb,MAAtB,EAAgD;EACrD,IAAI,CAACA,MAAM,CAACE,SAAZ,EAAuB;IACrB,MAAM,IAAIL,KAAJ,CAAU,iCAAV,CAAN;EACD;;EACD,IAAIS,SAAS,GAAG,EAAhB;EACA,MAAMQ,WAAW,GAAGd,MAAM,CAACe,QAAP,GAAmB,aAAYf,MAAM,CAACe,QAAS,EAA/C,GAAmD,EAAvE;;EACA,IAAIf,MAAM,CAACM,SAAX,EAAsB;IACpBA,SAAS,GAAI,GAAEN,MAAM,CAACM,SAAU,QAAON,MAAM,CAACE,SAAU,GAAEY,WAAY,EAAtE;EACD,CAFD,MAEO;IACL,MAAMH,OAAO,GAAGX,MAAM,CAACE,SAAP,CAAiBG,QAAjB,CAA0B,QAA1B,IACZ,8BADY,GAEZ,+BAFJ;IAGA,MAAMW,OAAO,GAAGhB,MAAM,CAACgB,OAAP,IAAkB,OAAlC;IACAV,SAAS,GAAI,GAAEK,OAAQ,OAAMK,OAAQ,iBAAgBhB,MAAM,CAACE,SAAU,GAAEY,WAAY,EAApF;EACD;;EAED,OAAOR,SAAP;AACD;;AAEM,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,124 +1,9 @@
1
1
  import React from 'react';
2
- import { Platform, StyleSheet, Text, View } from 'react-native';
3
- import { WebView } from 'react-native-webview';
4
- import { getScriptURL, debuggingScript } from '../utils';
5
- import LoadingIndicator from './LoadingIndicator';
2
+ import { Text } from 'react-native';
6
3
 
7
- const getHtmlTag = props => {
8
- const allowedProps = Object.keys(props).filter(x => !['config', 'events', 'style'].includes(x));
9
- return `<pay-engine id="component"
10
- style="z-index: 100"
11
- ${allowedProps.map(propName => `${propName}="${props[propName]}"`).join(' ')}
12
- ></pay-engine>`;
4
+ const PayEngine = () => {
5
+ return /*#__PURE__*/React.createElement(Text, null, "Obsolete. Please check out the package readme");
13
6
  };
14
7
 
15
- const generateHTML = (scriptURL, props) => {
16
- return `<!DOCTYPE html>
17
- <html>
18
- <head>
19
- <title>PayEngine Elements</title>
20
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
21
- <script src="${scriptURL}" async defer type="text/javascript"></script>
22
- </head>
23
- <body>
24
- ${getHtmlTag(props)}
25
- <script>
26
- setInterval(function() {
27
- window.ReactNativeWebView.postMessage(JSON.stringify({
28
- type: 'PayEngine-height',
29
- height: document.body.scrollHeight
30
- }))
31
- }, 500);
32
- </script>
33
- </body>
34
- </html>`;
35
- };
36
-
37
- const PayEngine = props => {
38
- const [scriptURL] = React.useState(getScriptURL(props.config));
39
- const [height, setHeight] = React.useState(30);
40
- const html = generateHTML(scriptURL, props);
41
-
42
- const onMessage = payload => {
43
- var _props$events;
44
-
45
- const isDebug = props.config.logLevel > 0;
46
- let dataPayload;
47
-
48
- try {
49
- dataPayload = JSON.parse(payload.nativeEvent.data);
50
- } catch (e) {}
51
-
52
- if (dataPayload) {
53
- switch (dataPayload.type) {
54
- case 'Console':
55
- if (isDebug) {
56
- console.info(`[Console] ${JSON.stringify(dataPayload.data)}`);
57
- }
58
-
59
- break;
60
-
61
- case 'PayEngine':
62
- const {
63
- type,
64
- detail
65
- } = dataPayload.event;
66
-
67
- if ((_props$events = props.events) !== null && _props$events !== void 0 && _props$events[type]) {
68
- var _props$events2, _props$events2$type;
69
-
70
- (_props$events2 = props.events) === null || _props$events2 === void 0 ? void 0 : (_props$events2$type = _props$events2[type]) === null || _props$events2$type === void 0 ? void 0 : _props$events2$type.call(_props$events2, detail);
71
- }
72
-
73
- break;
74
-
75
- case 'PayEngine-height':
76
- setHeight(dataPayload.height);
77
- break;
78
-
79
- default:
80
- if (isDebug) {
81
- console.log(dataPayload);
82
- }
83
-
84
- break;
85
- }
86
- }
87
- };
88
-
89
- return /*#__PURE__*/React.createElement(View, {
90
- style: [{
91
- flex: 1,
92
- height: height
93
- }, props.style]
94
- }, /*#__PURE__*/React.createElement(View, {
95
- style: styles.yellowBox
96
- }, /*#__PURE__*/React.createElement(Text, null, "Script URL: ", scriptURL)), /*#__PURE__*/React.createElement(View, {
97
- style: styles.yellowBox
98
- }, /*#__PURE__*/React.createElement(Text, null, getHtmlTag(props))), /*#__PURE__*/React.createElement(WebView, {
99
- originWhitelist: ['*'],
100
- source: {
101
- html: html,
102
- baseUrl: ''
103
- } // source={{ uri: 'https://google.com' }}
104
- ,
105
- applicationNameForUserAgent: `PayEngine-RN/${Platform.OS}`,
106
- injectedJavaScript: debuggingScript,
107
- renderLoading: LoadingIndicator,
108
- startInLoadingState: true,
109
- onMessage: onMessage
110
- }));
111
- };
112
-
113
- const styles = StyleSheet.create({
114
- yellowBox: {
115
- marginVertical: 5,
116
- marginHorizontal: 10,
117
- padding: 10,
118
- backgroundColor: 'yellow',
119
- borderWidth: 1,
120
- borderColor: 'yellow'
121
- }
122
- });
123
8
  export default PayEngine;
124
9
  //# sourceMappingURL=PayEngine.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","Platform","StyleSheet","Text","View","WebView","getScriptURL","debuggingScript","LoadingIndicator","getHtmlTag","props","allowedProps","Object","keys","filter","x","includes","map","propName","join","generateHTML","scriptURL","PayEngine","useState","config","height","setHeight","html","onMessage","payload","isDebug","logLevel","dataPayload","JSON","parse","nativeEvent","data","e","type","console","info","stringify","detail","event","events","log","flex","style","styles","yellowBox","baseUrl","OS","create","marginVertical","marginHorizontal","padding","backgroundColor","borderWidth","borderColor"],"sources":["PayEngine.tsx"],"sourcesContent":["import React from 'react';\nimport { Platform, StyleProp, StyleSheet, Text, View, ViewStyle } from 'react-native';\nimport { WebView } from 'react-native-webview';\nimport { getScriptURL, debuggingScript } from '../utils';\nimport LoadingIndicator from './LoadingIndicator';\nimport type { IPayEngineConfig } from '../interfaces/index';\n\ninterface IProps {\n config: IPayEngineConfig\n type: string\n merchantId?: string\n hash?: string\n events: {\n [key: string]: (eventData: any) => void\n }\n style?: StyleProp<ViewStyle>\n [key: string]: any\n}\n\nconst getHtmlTag = (props: IProps) => {\n const allowedProps = Object.keys(props).filter(x => !['config', 'events', 'style'].includes(x))\n return `<pay-engine id=\"component\"\n style=\"z-index: 100\"\n ${allowedProps.map((propName: string) => `${propName}=\"${props[propName]}\"`).join(' ')}\n ></pay-engine>`\n}\n\nconst generateHTML = (scriptURL: string, props: IProps) => {\n return `<!DOCTYPE html>\n <html>\n <head>\n <title>PayEngine Elements</title>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <script src=\"${scriptURL}\" async defer type=\"text/javascript\"></script>\n </head>\n <body>\n ${getHtmlTag(props)}\n <script>\n setInterval(function() {\n window.ReactNativeWebView.postMessage(JSON.stringify({\n type: 'PayEngine-height',\n height: document.body.scrollHeight\n }))\n }, 500);\n </script>\n </body>\n </html>`\n}\n\nconst PayEngine = (props: IProps) => {\n\n const [scriptURL] = React.useState(getScriptURL(props.config))\n const [height, setHeight] = React.useState(30)\n\n const html = generateHTML(scriptURL, props)\n\n const onMessage = (payload: any) => {\n const isDebug = props.config.logLevel! > 0\n let dataPayload;\n try {\n dataPayload = JSON.parse(payload.nativeEvent.data);\n } catch (e) { }\n\n if (dataPayload) {\n switch (dataPayload.type) {\n case 'Console':\n if (isDebug) {\n console.info(`[Console] ${JSON.stringify(dataPayload.data)}`);\n }\n break;\n case 'PayEngine':\n const { type, detail } = dataPayload.event\n if (props.events?.[type]) {\n props.events?.[type]?.(detail)\n }\n break;\n case 'PayEngine-height':\n setHeight(dataPayload.height)\n break;\n default:\n if (isDebug) {\n console.log(dataPayload)\n }\n break;\n }\n }\n };\n\n return <View style={[{ flex: 1, height: height }, props.style]}>\n <View style={styles.yellowBox}>\n <Text>Script URL: {scriptURL}</Text>\n </View>\n <View style={styles.yellowBox}>\n <Text>{getHtmlTag(props)}</Text>\n </View>\n <WebView\n originWhitelist={['*']}\n source={{ html: html, baseUrl: '' }}\n // source={{ uri: 'https://google.com' }}\n applicationNameForUserAgent={`PayEngine-RN/${Platform.OS}`}\n injectedJavaScript={debuggingScript}\n renderLoading={LoadingIndicator}\n startInLoadingState={true}\n onMessage={onMessage}\n />\n </View>\n}\n\nconst styles = StyleSheet.create({\n yellowBox: {\n marginVertical: 5,\n marginHorizontal: 10,\n padding: 10,\n backgroundColor: 'yellow',\n borderWidth: 1,\n borderColor: 'yellow'\n }\n})\n\n\nexport default PayEngine\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,QAAT,EAA8BC,UAA9B,EAA0CC,IAA1C,EAAgDC,IAAhD,QAAuE,cAAvE;AACA,SAASC,OAAT,QAAwB,sBAAxB;AACA,SAASC,YAAT,EAAuBC,eAAvB,QAA8C,UAA9C;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;;AAeA,MAAMC,UAAU,GAAIC,KAAD,IAAmB;EACpC,MAAMC,YAAY,GAAGC,MAAM,CAACC,IAAP,CAAYH,KAAZ,EAAmBI,MAAnB,CAA0BC,CAAC,IAAI,CAAC,CAAC,QAAD,EAAW,QAAX,EAAqB,OAArB,EAA8BC,QAA9B,CAAuCD,CAAvC,CAAhC,CAArB;EACA,OAAQ;AACV;AACA,MAAMJ,YAAY,CAACM,GAAb,CAAkBC,QAAD,IAAuB,GAAEA,QAAS,KAAIR,KAAK,CAACQ,QAAD,CAAW,GAAvE,EAA2EC,IAA3E,CAAgF,GAAhF,CAAqF;AAC3F,iBAHE;AAID,CAND;;AAQA,MAAMC,YAAY,GAAG,CAACC,SAAD,EAAoBX,KAApB,KAAsC;EACzD,OAAQ;AACV;AACA;AACA;AACA;AACA,qBAAqBW,SAAU;AAC/B;AACA;AACA,QAAQZ,UAAU,CAACC,KAAD,CAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAlBE;AAmBD,CApBD;;AAsBA,MAAMY,SAAS,GAAIZ,KAAD,IAAmB;EAEnC,MAAM,CAACW,SAAD,IAAcrB,KAAK,CAACuB,QAAN,CAAejB,YAAY,CAACI,KAAK,CAACc,MAAP,CAA3B,CAApB;EACA,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsB1B,KAAK,CAACuB,QAAN,CAAe,EAAf,CAA5B;EAEA,MAAMI,IAAI,GAAGP,YAAY,CAACC,SAAD,EAAYX,KAAZ,CAAzB;;EAEA,MAAMkB,SAAS,GAAIC,OAAD,IAAkB;IAAA;;IAClC,MAAMC,OAAO,GAAGpB,KAAK,CAACc,MAAN,CAAaO,QAAb,GAAyB,CAAzC;IACA,IAAIC,WAAJ;;IACA,IAAI;MACFA,WAAW,GAAGC,IAAI,CAACC,KAAL,CAAWL,OAAO,CAACM,WAAR,CAAoBC,IAA/B,CAAd;IACD,CAFD,CAEE,OAAOC,CAAP,EAAU,CAAG;;IAEf,IAAIL,WAAJ,EAAiB;MACf,QAAQA,WAAW,CAACM,IAApB;QACE,KAAK,SAAL;UACE,IAAIR,OAAJ,EAAa;YACXS,OAAO,CAACC,IAAR,CAAc,aAAYP,IAAI,CAACQ,SAAL,CAAeT,WAAW,CAACI,IAA3B,CAAiC,EAA3D;UACD;;UACD;;QACF,KAAK,WAAL;UACE,MAAM;YAAEE,IAAF;YAAQI;UAAR,IAAmBV,WAAW,CAACW,KAArC;;UACA,qBAAIjC,KAAK,CAACkC,MAAV,0CAAI,cAAeN,IAAf,CAAJ,EAA0B;YAAA;;YACxB,kBAAA5B,KAAK,CAACkC,MAAN,yFAAeN,IAAf,kGAAuBI,MAAvB;UACD;;UACD;;QACF,KAAK,kBAAL;UACEhB,SAAS,CAACM,WAAW,CAACP,MAAb,CAAT;UACA;;QACF;UACE,IAAIK,OAAJ,EAAa;YACXS,OAAO,CAACM,GAAR,CAAYb,WAAZ;UACD;;UACD;MAnBJ;IAqBD;EACF,CA9BD;;EAgCA,oBAAO,oBAAC,IAAD;IAAM,KAAK,EAAE,CAAC;MAAEc,IAAI,EAAE,CAAR;MAAWrB,MAAM,EAAEA;IAAnB,CAAD,EAA8Bf,KAAK,CAACqC,KAApC;EAAb,gBACL,oBAAC,IAAD;IAAM,KAAK,EAAEC,MAAM,CAACC;EAApB,gBACE,oBAAC,IAAD,wBAAmB5B,SAAnB,CADF,CADK,eAIL,oBAAC,IAAD;IAAM,KAAK,EAAE2B,MAAM,CAACC;EAApB,gBACE,oBAAC,IAAD,QAAOxC,UAAU,CAACC,KAAD,CAAjB,CADF,CAJK,eAOL,oBAAC,OAAD;IACE,eAAe,EAAE,CAAC,GAAD,CADnB;IAEE,MAAM,EAAE;MAAEiB,IAAI,EAAEA,IAAR;MAAcuB,OAAO,EAAE;IAAvB,CAFV,CAGE;IAHF;IAIE,2BAA2B,EAAG,gBAAejD,QAAQ,CAACkD,EAAG,EAJ3D;IAKE,kBAAkB,EAAE5C,eALtB;IAME,aAAa,EAAEC,gBANjB;IAOE,mBAAmB,EAAE,IAPvB;IAQE,SAAS,EAAEoB;EARb,EAPK,CAAP;AAkBD,CAzDD;;AA2DA,MAAMoB,MAAM,GAAG9C,UAAU,CAACkD,MAAX,CAAkB;EAC/BH,SAAS,EAAE;IACTI,cAAc,EAAE,CADP;IAETC,gBAAgB,EAAE,EAFT;IAGTC,OAAO,EAAE,EAHA;IAITC,eAAe,EAAE,QAJR;IAKTC,WAAW,EAAE,CALJ;IAMTC,WAAW,EAAE;EANJ;AADoB,CAAlB,CAAf;AAYA,eAAepC,SAAf"}
1
+ {"version":3,"names":["React","Text","PayEngine"],"sources":["PayEngine.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\n\nconst PayEngine = () => {\n return <Text>Obsolete. Please check out the package readme</Text>;\n};\n\nexport default PayEngine;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;;AAEA,MAAMC,SAAS,GAAG,MAAM;EACtB,oBAAO,oBAAC,IAAD,wDAAP;AACD,CAFD;;AAIA,eAAeA,SAAf"}
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+ import { requireNativeComponent } from 'react-native';
3
+ const RNPEApplePayButton = requireNativeComponent('RNPEApplePayButton');
4
+ export const PEApplePayButton = /*#__PURE__*/React.forwardRef((props, ref) => {
5
+ React.useImperativeHandle(ref, () => ({}));
6
+
7
+ const pmError = event => {
8
+ if (props.onPaymentFailed) {
9
+ props.onPaymentFailed(new Error(event.nativeEvent.error));
10
+ }
11
+ };
12
+
13
+ const pmTokenDidReturn = event => {
14
+ if (props.onTokenDidReturn) {
15
+ props.onTokenDidReturn(event.nativeEvent.token);
16
+ }
17
+ };
18
+
19
+ const pmSheetDidDismiss = () => {
20
+ if (props.onPaymentSheetDismissed) {
21
+ props.onPaymentSheetDismissed();
22
+ }
23
+ };
24
+
25
+ return /*#__PURE__*/React.createElement(RNPEApplePayButton, {
26
+ style: {
27
+ height: 32,
28
+ width: '100%',
29
+ ...props.style
30
+ },
31
+ paymentRequest: JSON.stringify(props.paymentRequest),
32
+ onPmError: pmError,
33
+ onPmTokenDidReturn: pmTokenDidReturn,
34
+ onPmSheetDidDismiss: pmSheetDidDismiss
35
+ });
36
+ });
37
+ //# sourceMappingURL=PEApplePayButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","requireNativeComponent","RNPEApplePayButton","PEApplePayButton","forwardRef","props","ref","useImperativeHandle","pmError","event","onPaymentFailed","Error","nativeEvent","error","pmTokenDidReturn","onTokenDidReturn","token","pmSheetDidDismiss","onPaymentSheetDismissed","height","width","style","JSON","stringify","paymentRequest"],"sources":["PEApplePayButton.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { requireNativeComponent, ViewProps } from 'react-native';\nimport type { PEPaymentRequest } from './PEPaymentRequest';\n\n\nconst RNPEApplePayButton = requireNativeComponent<NativePECreditCardViewProps>('RNPEApplePayButton');\n\ntype NativePEApplePayEvent = {\n nativeEvent: {\n error?: string;\n token?: string\n };\n};\n\ninterface NativePECreditCardViewProps extends ViewProps {\n paymentRequest: string;\n onPmSheetDidDismiss: (event: NativePEApplePayEvent) => void;\n onPmTokenDidReturn: (event: NativePEApplePayEvent) => void;\n onPmError: (event: NativePEApplePayEvent) => void;\n}\n\nexport interface PEApplePayButtonProps extends ViewProps {\n paymentRequest: PEPaymentRequest;\n onTokenDidReturn?: (token: string) => void;\n onPaymentSheetDismissed?: () => void;\n onPaymentFailed?: (error: Error) => void;\n}\n\nexport interface PEApplePayButtonMethods {\n \n}\n\n\nexport const PEApplePayButton = React.forwardRef<\nPEApplePayButtonMethods,\n PEApplePayButtonProps\n>((props, ref) => {\n\n React.useImperativeHandle(ref, () => ({\n }));\n\n const pmError = (event: NativePEApplePayEvent) => {\n if (props.onPaymentFailed) {\n props.onPaymentFailed(new Error(event.nativeEvent.error));\n }\n };\n\n const pmTokenDidReturn = (event: NativePEApplePayEvent) => {\n if (props.onTokenDidReturn) {\n props.onTokenDidReturn(event.nativeEvent.token!);\n }\n };\n\n const pmSheetDidDismiss = () => {\n if (props.onPaymentSheetDismissed) {\n props.onPaymentSheetDismissed();\n }\n }\n \n return (\n <RNPEApplePayButton \n style={{ height: 32, width: '100%', ...(props.style as object) }} \n paymentRequest={JSON.stringify(props.paymentRequest)} \n onPmError={pmError} \n onPmTokenDidReturn={pmTokenDidReturn} \n onPmSheetDidDismiss={pmSheetDidDismiss} \n />\n );\n});\n"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,sBAAT,QAAkD,cAAlD;AAIA,MAAMC,kBAAkB,GAAGD,sBAAsB,CAA8B,oBAA9B,CAAjD;AA4BA,OAAO,MAAME,gBAAgB,gBAAGH,KAAK,CAACI,UAAN,CAG9B,CAACC,KAAD,EAAQC,GAAR,KAAgB;EAEhBN,KAAK,CAACO,mBAAN,CAA0BD,GAA1B,EAA+B,OAAO,EAAP,CAA/B;;EAGA,MAAME,OAAO,GAAIC,KAAD,IAAkC;IAChD,IAAIJ,KAAK,CAACK,eAAV,EAA2B;MACzBL,KAAK,CAACK,eAAN,CAAsB,IAAIC,KAAJ,CAAUF,KAAK,CAACG,WAAN,CAAkBC,KAA5B,CAAtB;IACD;EACF,CAJD;;EAMA,MAAMC,gBAAgB,GAAIL,KAAD,IAAkC;IACzD,IAAIJ,KAAK,CAACU,gBAAV,EAA4B;MAC1BV,KAAK,CAACU,gBAAN,CAAuBN,KAAK,CAACG,WAAN,CAAkBI,KAAzC;IACD;EACF,CAJD;;EAMA,MAAMC,iBAAiB,GAAG,MAAM;IAC9B,IAAIZ,KAAK,CAACa,uBAAV,EAAmC;MACjCb,KAAK,CAACa,uBAAN;IACD;EACF,CAJD;;EAMA,oBACE,oBAAC,kBAAD;IACE,KAAK,EAAE;MAAEC,MAAM,EAAE,EAAV;MAAcC,KAAK,EAAE,MAArB;MAA6B,GAAIf,KAAK,CAACgB;IAAvC,CADT;IAEE,cAAc,EAAEC,IAAI,CAACC,SAAL,CAAelB,KAAK,CAACmB,cAArB,CAFlB;IAGE,SAAS,EAAEhB,OAHb;IAIE,kBAAkB,EAAEM,gBAJtB;IAKE,mBAAmB,EAAEG;EALvB,EADF;AASD,CAnC+B,CAAzB"}
@@ -0,0 +1,20 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ export class PEPaymentRequest {
4
+ constructor(paymentAmount) {
5
+ let currencyCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'USD';
6
+ let paymentItems = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
7
+
8
+ _defineProperty(this, "paymentAmount", void 0);
9
+
10
+ _defineProperty(this, "currencyCode", void 0);
11
+
12
+ _defineProperty(this, "paymentItems", void 0);
13
+
14
+ this.paymentAmount = paymentAmount;
15
+ this.currencyCode = currencyCode;
16
+ this.paymentItems = paymentItems;
17
+ }
18
+
19
+ }
20
+ //# sourceMappingURL=PEPaymentRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PEPaymentRequest","constructor","paymentAmount","currencyCode","paymentItems"],"sources":["PEPaymentRequest.ts"],"sourcesContent":["\nexport class PEPaymentRequest {\n paymentAmount: number;\n currencyCode: 'USD' | 'CAD';\n paymentItems: {\n amount: number;\n label: string;\n }[]\n\n constructor(paymentAmount: number, currencyCode: 'USD' | 'CAD' = 'USD', paymentItems: {\n amount: number;\n label: string;\n }[] = []) {\n this.paymentAmount = paymentAmount;\n this.currencyCode = currencyCode;\n this.paymentItems = paymentItems;\n }\n}"],"mappings":";;AACA,OAAO,MAAMA,gBAAN,CAAuB;EAQ5BC,WAAW,CAACC,aAAD,EAGD;IAAA,IAHyBC,YAGzB,uEAHuD,KAGvD;IAAA,IAH8DC,YAG9D,uEAAJ,EAAI;;IAAA;;IAAA;;IAAA;;IACR,KAAKF,aAAL,GAAqBA,aAArB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,YAAL,GAAoBA,YAApB;EACD;;AAf2B"}
@@ -0,0 +1,23 @@
1
+ import { NativeModules, Platform } from "react-native";
2
+ const {
3
+ RNPayEngineNative
4
+ } = NativeModules;
5
+ export default class PayEngineNative {
6
+ static async createFraudMonitorSession(merchantId) {
7
+ return RNPayEngineNative.createFraudMonitorSession(merchantId);
8
+ }
9
+
10
+ static async getBrowserInfo() {
11
+ return RNPayEngineNative.getBrowserInfo();
12
+ }
13
+
14
+ static async isPlatformPaySupported(merchantId) {
15
+ if (Platform.OS === 'ios') {
16
+ return await RNPayEngineNative.isApplePaySupported(merchantId);
17
+ }
18
+
19
+ return false;
20
+ }
21
+
22
+ }
23
+ //# sourceMappingURL=PayEngineNative.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["NativeModules","Platform","RNPayEngineNative","PayEngineNative","createFraudMonitorSession","merchantId","getBrowserInfo","isPlatformPaySupported","OS","isApplePaySupported"],"sources":["PayEngineNative.tsx"],"sourcesContent":["import { NativeModules, Platform } from \"react-native\";\n\nconst { RNPayEngineNative } = NativeModules;\n\nexport default class PayEngineNative {\n static async createFraudMonitorSession(merchantId: string) {\n return RNPayEngineNative.createFraudMonitorSession(merchantId);\n }\n\n static async getBrowserInfo() {\n return RNPayEngineNative.getBrowserInfo();\n }\n\n static async isPlatformPaySupported(merchantId: string) {\n if (Platform.OS === 'ios') {\n return await RNPayEngineNative.isApplePaySupported(merchantId);\n }\n return false;\n }\n}"],"mappings":"AAAA,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAM;EAAEC;AAAF,IAAwBF,aAA9B;AAEA,eAAe,MAAMG,eAAN,CAAsB;EACG,aAAzBC,yBAAyB,CAACC,UAAD,EAAqB;IACzD,OAAOH,iBAAiB,CAACE,yBAAlB,CAA4CC,UAA5C,CAAP;EACD;;EAE0B,aAAdC,cAAc,GAAG;IAC5B,OAAOJ,iBAAiB,CAACI,cAAlB,EAAP;EACD;;EAEkC,aAAtBC,sBAAsB,CAACF,UAAD,EAAqB;IACtD,IAAIJ,QAAQ,CAACO,EAAT,KAAgB,KAApB,EAA2B;MACzB,OAAO,MAAMN,iBAAiB,CAACO,mBAAlB,CAAsCJ,UAAtC,CAAb;IACD;;IACD,OAAO,KAAP;EACD;;AAdkC"}
@@ -0,0 +1,30 @@
1
+ import React, { createContext } from "react";
2
+ import { ActivityIndicator, NativeModules } from "react-native";
3
+ const {
4
+ RNPayEngineNative
5
+ } = NativeModules;
6
+ const PayEngineContext = /*#__PURE__*/createContext(undefined);
7
+
8
+ const PayEngineProvider = _ref => {
9
+ let {
10
+ config,
11
+ children
12
+ } = _ref;
13
+ const [loading, setLoading] = React.useState(true);
14
+ React.useEffect(() => {
15
+ setLoading(true);
16
+ RNPayEngineNative.setConfig(config.publicKey, config.scriptURL);
17
+ setLoading(false);
18
+ }, [config]);
19
+
20
+ if (!config) {
21
+ throw new Error('PayEngineProvider: config is required');
22
+ }
23
+
24
+ return /*#__PURE__*/React.createElement(PayEngineContext.Provider, {
25
+ value: config
26
+ }, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, null) : children);
27
+ };
28
+
29
+ export { PayEngineContext, PayEngineProvider };
30
+ //# sourceMappingURL=PayEngineProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","createContext","ActivityIndicator","NativeModules","RNPayEngineNative","PayEngineContext","undefined","PayEngineProvider","config","children","loading","setLoading","useState","useEffect","setConfig","publicKey","scriptURL","Error"],"sources":["PayEngineProvider.tsx"],"sourcesContent":["import React, { createContext } from \"react\";\nimport type { IPayEngineConfig } from \"../../interfaces\";\nimport { ActivityIndicator, NativeModules } from \"react-native\";\n\nconst { RNPayEngineNative } = NativeModules;\n\nconst PayEngineContext = createContext<IPayEngineConfig | undefined>(undefined);\n\nconst PayEngineProvider = ({ config, children }: { config: IPayEngineConfig, children: React.ReactNode }) => {\n const [loading, setLoading] = React.useState(true);\n\n React.useEffect(() => {\n setLoading(true);\n RNPayEngineNative.setConfig(config.publicKey, config.scriptURL)\n setLoading(false);\n }, [config]);\n\n if (!config) {\n throw new Error('PayEngineProvider: config is required');\n }\n\n return <PayEngineContext.Provider value={config}>\n {loading ? <ActivityIndicator /> : children}\n </PayEngineContext.Provider>\n}\n\nexport {\n PayEngineContext,\n PayEngineProvider\n};"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,aAAhB,QAAqC,OAArC;AAEA,SAASC,iBAAT,EAA4BC,aAA5B,QAAiD,cAAjD;AAEA,MAAM;EAAEC;AAAF,IAAwBD,aAA9B;AAEA,MAAME,gBAAgB,gBAAGJ,aAAa,CAA+BK,SAA/B,CAAtC;;AAEA,MAAMC,iBAAiB,GAAG,QAAmF;EAAA,IAAlF;IAAEC,MAAF;IAAUC;EAAV,CAAkF;EAC3G,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBX,KAAK,CAACY,QAAN,CAAe,IAAf,CAA9B;EAEAZ,KAAK,CAACa,SAAN,CAAgB,MAAM;IACpBF,UAAU,CAAC,IAAD,CAAV;IACAP,iBAAiB,CAACU,SAAlB,CAA4BN,MAAM,CAACO,SAAnC,EAA8CP,MAAM,CAACQ,SAArD;IACAL,UAAU,CAAC,KAAD,CAAV;EACD,CAJD,EAIG,CAACH,MAAD,CAJH;;EAMA,IAAI,CAACA,MAAL,EAAa;IACX,MAAM,IAAIS,KAAJ,CAAU,uCAAV,CAAN;EACD;;EAED,oBAAO,oBAAC,gBAAD,CAAkB,QAAlB;IAA2B,KAAK,EAAET;EAAlC,GACJE,OAAO,gBAAG,oBAAC,iBAAD,OAAH,GAA2BD,QAD9B,CAAP;AAGD,CAhBD;;AAkBA,SACEJ,gBADF,EAEEE,iBAFF"}
@@ -0,0 +1,75 @@
1
+ import * as React from 'react';
2
+ import { requireNativeComponent, NativeModules, NativeEventEmitter, findNodeHandle, UIManager, ActivityIndicator, Platform } from 'react-native';
3
+ const {
4
+ RNPEEventEmitter
5
+ } = NativeModules;
6
+ const COMPONENT_NAME = 'RNPEBankAccountView';
7
+ const RNPEBankAccountView = requireNativeComponent(COMPONENT_NAME); // @ts-ignore
8
+
9
+ const RNPEBankAccountViewManager = UIManager[COMPONENT_NAME];
10
+ const peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);
11
+ export const PEBankAccountView = /*#__PURE__*/React.forwardRef((props, ref) => {
12
+ const formRef = React.useRef();
13
+ const [height, setHeight] = React.useState(0);
14
+ React.useImperativeHandle(ref, () => ({
15
+ submit: async function (merchantId) {
16
+ let additionalData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
17
+ return new Promise((resolve, reject) => {
18
+ if (height === 0) {
19
+ return reject(new Error('Form is not ready'));
20
+ }
21
+
22
+ const listener = peEventEmitter.addListener('onBankAccountRespond', args => {
23
+ listener.remove();
24
+ const {
25
+ error,
26
+ bankAccount: json
27
+ } = args;
28
+
29
+ if (error) {
30
+ reject(new Error(error));
31
+ } else {
32
+ const bankAccount = JSON.parse(json);
33
+ resolve(bankAccount);
34
+ }
35
+ });
36
+ callNativeMethod("submit", [merchantId, additionalData]);
37
+ });
38
+ },
39
+ showKeyboard: () => {
40
+ callNativeMethod("showKeyboard");
41
+ },
42
+ hideKeyboard: () => {
43
+ callNativeMethod("hideKeyboard");
44
+ }
45
+ }));
46
+ const callNativeMethod = React.useCallback(function (methodName) {
47
+ let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
48
+ const viewId = findNodeHandle(formRef.current);
49
+ let commandId = RNPEBankAccountViewManager.Commands[methodName].toString();
50
+
51
+ if (Platform.OS === 'ios') {
52
+ commandId = Number(commandId);
53
+ }
54
+
55
+ UIManager.dispatchViewManagerCommand(viewId, commandId, params);
56
+ }, [formRef.current]);
57
+ React.useEffect(() => {
58
+ const eventListener = peEventEmitter.addListener('onSizeChanges', args => {
59
+ const {
60
+ width: _,
61
+ height: frameHeight
62
+ } = args;
63
+ setHeight(frameHeight);
64
+ });
65
+ return () => eventListener.remove();
66
+ }, []);
67
+ return /*#__PURE__*/React.createElement(React.Fragment, null, height === 0 && /*#__PURE__*/React.createElement(ActivityIndicator, null), /*#__PURE__*/React.createElement(RNPEBankAccountView, {
68
+ ref: formRef,
69
+ additionalFields: JSON.stringify(props.additionalFields ?? []),
70
+ style: {
71
+ height: height
72
+ }
73
+ }));
74
+ });
75
+ //# sourceMappingURL=BankAccountView.js.map