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
package/README.md CHANGED
@@ -1,152 +1,234 @@
1
- # react-native-payengine
1
+ # react-native-payengine v2
2
2
 
3
- React Native SDK for PayEngine
3
+ ## React Native SDK Version 2
4
4
 
5
- ## Installation
5
+ ### Overview
6
6
 
7
- ```sh
8
- npm install react-native-payengine
9
- ```
10
-
11
- #### Expo managed project
12
-
13
- To be updated
7
+ The new version of the PayEngine React Native SDK is designed to provide developers with a more flexible and customizable payment experience. Its primary goal is to integrate with PayEngine native SDKs for both iOS and Android. By leveraging native SDKs (xcframework for iOS and AAR for Android), the SDK ensures a more seamless user experience without requiring codebase changes from multiple repositories.
14
8
 
15
- #### Install dependencies into a bare React Native project
9
+ ### Prerequisites
16
10
 
17
- In your project directory, run:
11
+ #### Install Package
18
12
 
19
- ```sh
20
- npm install react-native-webview
13
+ ```bash
14
+ yarn add react-native-payengine@2
21
15
  ```
22
16
 
23
- Visit https://github.com/react-native-webview/react-native-webview to view additional installation step if you're using manually linking.
17
+ #### Android
24
18
 
25
- From React Native 0.6.0 and higher, linking is automatic. So you don't need to run `react-native link`
19
+ To use secure fields components, you need to install and configure the Material Components theme in your app.
26
20
 
27
- If you're on a Mac and developing for iOS, you need to install the pods (via Cocoapods) to complete the linking.
21
+ 1. Add the following dependency to your `app/build.gradle` file with the specified version:
28
22
 
23
+ ```gradle
24
+ implementation 'com.google.android.material:material:<version>'
29
25
  ```
30
- npx pod-install ios
26
+
27
+ 2. Enable Jetifier in your app's `gradle.properties` if you encounter duplicate class issues like:
28
+
29
+ ```text
30
+ android.useAndroidX=true
31
+ android.enableJetifier=true
31
32
  ```
32
33
 
33
- ## Usage
34
+ Example error:
34
35
 
35
- #### Configuration
36
+ ```text
37
+ FAILURE: Build failed with an exception.
36
38
 
39
+ * What went wrong:
40
+ Execution failed for task ':app:checkDebugDuplicateClasses'.
41
+ > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
42
+ > Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.9.0.aar -> core-1.9.0-runtime
37
43
  ```
38
- const configuration = {
39
- publicKey: "pk_dev_lQm6u1h9yaSPO6qGJaAt4lTf5GBlehCI",
40
- scriptURL: "http://localhost:3000/js/1.0.0/embed.js",
41
- logLevel: 1
44
+
45
+ 3. Set the appropriate style in your `styles.xml` file:
46
+
47
+ ```xml
48
+ <style name="Theme.MyApp" parent="Theme.MaterialComponents.DayNight.NoActionBar">
49
+ <!-- ... -->
50
+ </style>
51
+ ```
52
+
53
+ 4. To use the Fraud Monitoring feature, change your main application class to extend `PEApplication` as shown:
54
+
55
+ ```java
56
+ public class MainApplication extends RNPEFraudAnalyticsApplication implements ReactApplication {
57
+ // ...
42
58
  }
43
59
  ```
44
60
 
45
- #### Embedded UI
61
+ ### Usage
46
62
 
47
- ```js
48
- import { PayEngine } from 'react-native-payengine';
63
+ #### Wrap the Config in a Provider
49
64
 
50
- <PayEngine
51
- type="boarding"
52
- merchant-id="07f6ee61-1548-4ffa-a1dc-f671c837ceb9"
53
- events={{
54
- stepChange: (eventData: any) => {
55
- console.log({ eventData });
56
- },
57
- }}
58
- config={configuration}
59
- />;
60
- ```
65
+ ```jsx
66
+ import { PEProvider } from 'react-native-payengine';
61
67
 
62
- #### Secure Fields
68
+ const App = () => {
69
+ return (
70
+ <PEProvider config={PE_CONFIG}>
71
+ <NavigationContainer>
72
+ <CreditCardForm />
73
+ <BankAccountForm />
74
+ <ApplePayScreen />
75
+ </NavigationContainer>
76
+ </PEProvider>
77
+ );
78
+ };
79
+ ```
63
80
 
64
- ```js
65
- import * as React from 'react';
66
- import { View, Text, StyleSheet, Button, ScrollView } from 'react-native';
67
- import { SecureFields } from 'react-native-payengine';
81
+ #### Credit Card Form
82
+
83
+ ```jsx
84
+ import React from 'react';
85
+ import { PECreditCardView, PEKeyboardType } from 'react-native-payengine';
86
+ import { Button, View } from 'react-native';
87
+
88
+ const additionalFields = [
89
+ {
90
+ name: 'address_zip',
91
+ type: 'text',
92
+ placeholder: 'Zip code',
93
+ keyboardType: PEKeyboardType.alphabet,
94
+ isRequired: true,
95
+ pattern:
96
+ '^(?:\\d{5}(?:-\\d{4})?|[ABCEGHJKLMNPRSTVXY]\\d[A-Z] ?\\d[A-Z]\\d)$',
97
+ },
98
+ ];
68
99
 
69
- export function Payment() {
70
- const secureFieldRef = React.createRef<any>()
71
- const [secureFieldsResult, setSecureFieldsResult] = React.useState('')
72
- const [submitting, setSubmitting] = React.useState(false)
100
+ const CreditCardForm = () => {
101
+ const formRef = React.createRef();
73
102
 
74
103
  const createCard = async () => {
75
104
  try {
76
- setSubmitting(true)
77
- const result = await secureFieldRef.current?.createCard()
78
- setSecureFieldsResult(result)
79
- } catch (err: any) {
80
- setSecureFieldsResult(err.message)
81
- } finally {
82
- setSubmitting(false)
105
+ const result = await formRef.current?.submit(MERCHANT_ID, {});
106
+ console.log({ result });
107
+ } catch (err) {
108
+ console.log({ err });
83
109
  }
84
- }
85
-
110
+ };
86
111
 
87
112
  return (
88
- <View style={styles.container}>
89
- <Text>Welcome to PayEngine React Native SDK example</Text>
90
- <Text>Click the hamburger menu above to browse our examples</Text>
91
-
92
- <View style={{ height: 30 }} />
93
- <Text style={{ fontSize: 18, fontWeight: '600' }}>Secure Fields</Text>
94
- <SecureFields.CollectManager ref={secureFieldRef} config={configuration}>
95
- <SecureFields.CardHolderNameField style={styles.field} />
96
- <SecureFields.CardNumberField placeholder="Card number" style={styles.field} />
97
- <View style={{ display: 'flex', flexDirection: "row", width: '100%', height: 50, margin: 8 }}>
98
- <SecureFields.ExpDateTextField style={[styles.field, { flex: 1, margin: 0, marginRight: 10 }]} />
99
- <SecureFields.CVCField style={[styles.field, { flex: 1, margin: 0 }]} />
100
- </View>
101
- <SecureFields.ZipCodeField placeholder="Zip code" style={styles.field} />
102
-
103
- <Button disabled={submitting} onPress={() => createCard()} title="Create Card" />
104
-
105
- </SecureFields.CollectManager>
106
- <ScrollView scrollEnabled={true} style={{ flex: 1, width: '100%', backgroundColor: 'lightyellow', padding: 10, marginVertical: 20 }}>
107
- <Text>{JSON.stringify(secureFieldsResult, null, 4)}</Text>
108
- </ScrollView>
113
+ <View>
114
+ <PECreditCardView ref={formRef} additionalFields={additionalFields} />
115
+ <Button onPress={createCard} title="Create Card" />
109
116
  </View>
110
117
  );
111
- }
112
-
113
- const styles = StyleSheet.create({
114
- container: {
115
- flex: 1,
116
- display: 'flex',
117
- padding: 20,
118
- alignItems: 'center',
119
- justifyContent: 'center'
120
- },
121
- field: {
122
- width: '100%',
123
- height: 50,
124
- margin: 8,
125
- padding: 5
126
- }
127
- })
128
-
118
+ };
129
119
  ```
130
120
 
121
+ #### Bank Account Form
131
122
 
132
- ## Troubleshooting
123
+ ```jsx
124
+ import React from 'react';
125
+ import { PEBankAccountView } from 'react-native-payengine';
126
+ import { Button, View } from 'react-native';
133
127
 
134
- If your android Emulator can't connect to metro bundler
128
+ const BankAccountForm = () => {
129
+ const formRef = React.createRef();
135
130
 
136
- *android/src/debug/res/xml/network.xml*
137
- ```
138
- <?xml version="1.0" encoding="utf-8"?>
139
- <network-security-config>
140
- <domain-config cleartextTrafficPermitted="true">
141
- <domain includeSubdomains="true">localhost</domain>
142
- <domain includeSubdomains="true">10.0.2.2</domain>
143
- </domain-config>
144
- </network-security-config>
145
- ```
131
+ const createBankAccount = async () => {
132
+ try {
133
+ const result = await formRef.current?.submit(MERCHANT_ID, {});
134
+ console.log({ result });
135
+ } catch (err) {
136
+ console.log({ err });
137
+ }
138
+ };
146
139
 
147
- *android/src/debug/AndroidManifest.xml*
140
+ return (
141
+ <View>
142
+ <PEBankAccountView ref={formRef} />
143
+ <Button onPress={createBankAccount} title="Create Bank Account" />
144
+ </View>
145
+ );
146
+ };
148
147
  ```
149
- ...
150
- android:networkSecurityConfig="@xml/network"
151
- ...
148
+
149
+ #### Apple Pay
150
+
151
+ ```jsx
152
+ import React from 'react';
153
+ import { View, Text, ScrollView } from 'react-native';
154
+ import {
155
+ PEApplePayButton,
156
+ PEPaymentRequest,
157
+ PayEngineNative,
158
+ PayEngineUtils,
159
+ } from 'react-native-payengine';
160
+ import axios from 'axios';
161
+
162
+ const ApplePayScreen = () => {
163
+ const [canMakePayment, setCanMakePayment] = React.useState(false);
164
+ const [paymentResult, setPaymentResult] = React.useState(null);
165
+
166
+ React.useEffect(() => {
167
+ const checkSupport = async () => {
168
+ try {
169
+ const isSupported = await PayEngineNative.isPlatformPaySupported(
170
+ MERCHANT_ID
171
+ );
172
+ console.log('isSupported', isSupported);
173
+ setCanMakePayment(isSupported);
174
+ } catch (e) {
175
+ console.error('Apple Pay not supported', e);
176
+ }
177
+ };
178
+ checkSupport();
179
+ }, []);
180
+
181
+ const paymentRequest = new PEPaymentRequest(120.5, 'USD', [
182
+ {
183
+ amount: 100.0,
184
+ label: 'Full Back Lounge Chair',
185
+ },
186
+ {
187
+ amount: 20.5,
188
+ label: 'Glass Top Oval Center Table',
189
+ },
190
+ ]);
191
+
192
+ const purchaseWithToken = async (token) => {
193
+ // send the token to your server to make a purchase
194
+ // ...
195
+ };
196
+
197
+ return (
198
+ <View style={styles.container}>
199
+ <Text>Apple Pay Demo</Text>
200
+ {canMakePayment && (
201
+ <>
202
+ <PEApplePayButton
203
+ paymentRequest={paymentRequest}
204
+ onTokenDidReturn={(token) => {
205
+ console.log('Apple Pay token', token);
206
+ // Send token to server
207
+ purchaseWithToken(token);
208
+ }}
209
+ onPaymentSheetDismissed={() => {
210
+ console.log('Payment sheet dismissed');
211
+ }}
212
+ onPaymentFailed={(error) => {
213
+ console.log('Payment failed', error);
214
+ }}
215
+ style={{ height: 40, margin: 20 }}
216
+ />
217
+ <ScrollView
218
+ scrollEnabled
219
+ style={{
220
+ flex: 1,
221
+ width: '100%',
222
+ backgroundColor: 'lightyellow',
223
+ padding: 10,
224
+ marginVertical: 20,
225
+ }}
226
+ >
227
+ <Text>{JSON.stringify(paymentResult, null, 4)}</Text>
228
+ </ScrollView>
229
+ </>
230
+ )}
231
+ </View>
232
+ );
233
+ };
152
234
  ```
@@ -1,2 +1,2 @@
1
- #Tue Sep 20 13:44:22 ICT 2022
2
- gradle.version=5.6.4
1
+ #Mon Sep 09 23:15:47 ICT 2024
2
+ gradle.version=6.1.1
@@ -0,0 +1,2 @@
1
+ #Mon Sep 09 17:19:45 ICT 2024
2
+ java.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home