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
@@ -1,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PayEngineApplePay = void 0;
7
-
8
- var _ = _interopRequireDefault(require("."));
9
-
10
- var _utils = require("../../utils");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- 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; }
15
-
16
- class PayEngineApplePay {
17
- constructor(payEngineConfig) {
18
- _defineProperty(this, "applePay", void 0);
19
-
20
- _defineProperty(this, "payEngineConfig", void 0);
21
-
22
- _defineProperty(this, "config", void 0);
23
-
24
- _defineProperty(this, "method", void 0);
25
-
26
- _defineProperty(this, "details", void 0);
27
-
28
- this.payEngineConfig = payEngineConfig;
29
- this.applePay = new _.default();
30
- }
31
-
32
- async canMakePayments(merchantId, paymentConfig) {
33
- const client = (0, _utils.createHttpClient)(this.payEngineConfig);
34
- const {
35
- data
36
- } = await client.get(`/api/mobile-payment/config?merchant_id=${merchantId}`);
37
- this.config = data.data;
38
- console.log('config', this.config);
39
- this.method = {
40
- countryCode: paymentConfig.countryCode ?? this.config.country,
41
- currencyCode: paymentConfig.currencyCode ?? this.config.currency,
42
- merchantIdentifier: 'merchant.payengine.tunnel3000cc',
43
- supportedNetworks: ['Visa', 'MasterCard', 'AmEx']
44
- };
45
- this.details = {
46
- total: {
47
- label: this.config.apple_pay.merchantName,
48
- amount: 1.00
49
- }
50
- };
51
- return await this.applePay.canMakePayments(this.method, this.details);
52
- }
53
-
54
- async start() {
55
- if (!this.config) {
56
- throw new Error('You must call `canMakePayments` first');
57
- }
58
-
59
- const result = await this.applePay.start();
60
-
61
- try {
62
- return JSON.parse(result);
63
- } catch {
64
- return result;
65
- }
66
- }
67
-
68
- }
69
-
70
- exports.PayEngineApplePay = PayEngineApplePay;
71
- //# sourceMappingURL=PayEngineApplePay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["PayEngineApplePay","constructor","payEngineConfig","applePay","ApplePay","canMakePayments","merchantId","paymentConfig","client","createHttpClient","data","get","config","console","log","method","countryCode","country","currencyCode","currency","merchantIdentifier","supportedNetworks","details","total","label","apple_pay","merchantName","amount","start","Error","result","JSON","parse"],"sources":["PayEngineApplePay.ts"],"sourcesContent":["import ApplePay from '.';\nimport type {\n IPayEngineConfig,\n MobilePaymentConfig,\n PaymentRequest,\n} from '../../interfaces';\nimport { createHttpClient } from '../../utils';\nimport type {\n ApplePayDetailsData,\n ApplePayMethodData,\n IApplePay,\n} from './interfaces';\n\nexport class PayEngineApplePay implements IApplePay {\n private applePay: ApplePay;\n private payEngineConfig: IPayEngineConfig;\n private config?: MobilePaymentConfig;\n private method?: ApplePayMethodData;\n private details?: ApplePayDetailsData;\n\n constructor(payEngineConfig: IPayEngineConfig) {\n this.payEngineConfig = payEngineConfig;\n this.applePay = new ApplePay();\n }\n\n public async canMakePayments(merchantId: string, paymentConfig: PaymentRequest) {\n const client = createHttpClient(this.payEngineConfig);\n const { data } = await client.get(\n `/api/mobile-payment/config?merchant_id=${merchantId}`\n );\n this.config = data.data;\n console.log('config', this.config);\n this.method = {\n countryCode: paymentConfig.countryCode ?? this.config!.country,\n currencyCode: paymentConfig.currencyCode ?? this.config!.currency,\n merchantIdentifier: 'merchant.payengine.tunnel3000cc',\n supportedNetworks: ['Visa', 'MasterCard', 'AmEx'],\n };\n\n this.details = {\n total: {\n label: this.config!.apple_pay.merchantName,\n amount: 1.00,\n },\n };\n return await this.applePay.canMakePayments(this.method, this.details);\n }\n\n public async start() {\n if (!this.config) {\n throw new Error('You must call `canMakePayments` first');\n }\n\n const result = await this.applePay.start();\n try {\n return JSON.parse(result);\n } catch {\n return result;\n }\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAMA;;;;;;AAOO,MAAMA,iBAAN,CAA6C;EAOlDC,WAAW,CAACC,eAAD,EAAoC;IAAA;;IAAA;;IAAA;;IAAA;;IAAA;;IAC7C,KAAKA,eAAL,GAAuBA,eAAvB;IACA,KAAKC,QAAL,GAAgB,IAAIC,SAAJ,EAAhB;EACD;;EAE2B,MAAfC,eAAe,CAACC,UAAD,EAAqBC,aAArB,EAAoD;IAC9E,MAAMC,MAAM,GAAG,IAAAC,uBAAA,EAAiB,KAAKP,eAAtB,CAAf;IACA,MAAM;MAAEQ;IAAF,IAAW,MAAMF,MAAM,CAACG,GAAP,CACpB,0CAAyCL,UAAW,EADhC,CAAvB;IAGA,KAAKM,MAAL,GAAcF,IAAI,CAACA,IAAnB;IACAG,OAAO,CAACC,GAAR,CAAY,QAAZ,EAAsB,KAAKF,MAA3B;IACA,KAAKG,MAAL,GAAc;MACZC,WAAW,EAAET,aAAa,CAACS,WAAd,IAA6B,KAAKJ,MAAL,CAAaK,OAD3C;MAEZC,YAAY,EAAEX,aAAa,CAACW,YAAd,IAA8B,KAAKN,MAAL,CAAaO,QAF7C;MAGZC,kBAAkB,EAAE,iCAHR;MAIZC,iBAAiB,EAAE,CAAC,MAAD,EAAS,YAAT,EAAuB,MAAvB;IAJP,CAAd;IAOA,KAAKC,OAAL,GAAe;MACbC,KAAK,EAAE;QACLC,KAAK,EAAE,KAAKZ,MAAL,CAAaa,SAAb,CAAuBC,YADzB;QAELC,MAAM,EAAE;MAFH;IADM,CAAf;IAMA,OAAO,MAAM,KAAKxB,QAAL,CAAcE,eAAd,CAA8B,KAAKU,MAAnC,EAA2C,KAAKO,OAAhD,CAAb;EACD;;EAEiB,MAALM,KAAK,GAAG;IACnB,IAAI,CAAC,KAAKhB,MAAV,EAAkB;MAChB,MAAM,IAAIiB,KAAJ,CAAU,uCAAV,CAAN;IACD;;IAED,MAAMC,MAAM,GAAG,MAAM,KAAK3B,QAAL,CAAcyB,KAAd,EAArB;;IACA,IAAI;MACF,OAAOG,IAAI,CAACC,KAAL,CAAWF,MAAX,CAAP;IACD,CAFD,CAEE,MAAM;MACN,OAAOA,MAAP;IACD;EACF;;AA9CiD"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _reactNative = require("react-native");
9
-
10
- 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; }
11
-
12
- const {
13
- ApplePay: RNApplePay
14
- } = _reactNative.NativeModules;
15
-
16
- class ApplePay {
17
- constructor() {
18
- _defineProperty(this, "isReady", false);
19
-
20
- if (_reactNative.Platform.OS === 'ios') {
21
- if (!RNApplePay) {
22
- throw new Error('ApplePay is not defined');
23
- }
24
- } else {
25
- throw new Error('Apple Pay is supported (iOS only)');
26
- }
27
- }
28
-
29
- async start() {
30
- if (!this.isReady) {
31
- throw new Error('Apple Pay is not ready');
32
- }
33
-
34
- return await RNApplePay.initApplePay();
35
- }
36
-
37
- async canMakePayments(method, details) {
38
- RNApplePay.invokeApplePay(method, details);
39
- this.isReady = await RNApplePay.canMakePayments();
40
- return this.isReady;
41
- }
42
-
43
- }
44
-
45
- exports.default = ApplePay;
46
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ApplePay","RNApplePay","NativeModules","constructor","Platform","OS","Error","start","isReady","initApplePay","canMakePayments","method","details","invokeApplePay"],"sources":["index.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport type { ApplePayDetailsData, ApplePayMethodData, IApplePay } from './interfaces';\n\nconst { ApplePay: RNApplePay } = NativeModules;\n\nexport default class ApplePay implements IApplePay {\n private isReady = false;\n\n constructor() {\n if (Platform.OS === 'ios') {\n if (!RNApplePay) {\n throw new Error('ApplePay is not defined');\n }\n } else {\n throw new Error('Apple Pay is supported (iOS only)');\n }\n }\n\n public async start() {\n if (!this.isReady) {\n throw new Error('Apple Pay is not ready')\n }\n\n return await RNApplePay.initApplePay();\n }\n\n public async canMakePayments(method: ApplePayMethodData, details: ApplePayDetailsData) {\n RNApplePay.invokeApplePay(method, details);\n this.isReady = await RNApplePay.canMakePayments();\n return this.isReady\n }\n}\n"],"mappings":";;;;;;;AAAA;;;;AAGA,MAAM;EAAEA,QAAQ,EAAEC;AAAZ,IAA2BC,0BAAjC;;AAEe,MAAMF,QAAN,CAAoC;EAGjDG,WAAW,GAAG;IAAA,iCAFI,KAEJ;;IACZ,IAAIC,qBAAA,CAASC,EAAT,KAAgB,KAApB,EAA2B;MACzB,IAAI,CAACJ,UAAL,EAAiB;QACf,MAAM,IAAIK,KAAJ,CAAU,yBAAV,CAAN;MACD;IACF,CAJD,MAIO;MACL,MAAM,IAAIA,KAAJ,CAAU,mCAAV,CAAN;IACD;EACF;;EAEiB,MAALC,KAAK,GAAG;IACnB,IAAI,CAAC,KAAKC,OAAV,EAAmB;MACjB,MAAM,IAAIF,KAAJ,CAAU,wBAAV,CAAN;IACD;;IAED,OAAO,MAAML,UAAU,CAACQ,YAAX,EAAb;EACD;;EAE2B,MAAfC,eAAe,CAACC,MAAD,EAA6BC,OAA7B,EAA2D;IACrFX,UAAU,CAACY,cAAX,CAA0BF,MAA1B,EAAkCC,OAAlC;IACA,KAAKJ,OAAL,GAAe,MAAMP,UAAU,CAACS,eAAX,EAArB;IACA,OAAO,KAAKF,OAAZ;EACD;;AAzBgD"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=interfaces.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["interfaces.ts"],"sourcesContent":["export interface IApplePay {\n canMakePayments: (...args: any) => Promise<boolean>\n start: (...args: any) => Promise<any>\n}\n\n\ntype Network = 'Visa' | 'MasterCard' | 'AmEx';\n\nexport interface ApplePayMethodData {\n countryCode: string;\n currencyCode: string;\n supportedNetworks: Network[];\n merchantIdentifier: string;\n}\n\nexport interface ApplePayDetail {\n label: string;\n amount: number;\n}\n\nexport interface ApplePayDetailsData {\n total: ApplePayDetail;\n}\n\nexport type ApplePayTransactionIdentifier = string;\n"],"mappings":""}
@@ -1,76 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CreditCardForm = void 0;
7
-
8
- var React = _interopRequireWildcard(require("react"));
9
-
10
- var _reactNative = require("react-native");
11
-
12
- var _SecureFields = require("../SecureFields");
13
-
14
- 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); }
15
-
16
- 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; }
17
-
18
- const CreditCardForm = /*#__PURE__*/React.forwardRef((props, ref) => {
19
- React.useImperativeHandle(ref, () => ({
20
- createCard: async merchantId => {
21
- var _secureFieldRef$curre;
22
-
23
- return await ((_secureFieldRef$curre = secureFieldRef.current) === null || _secureFieldRef$curre === void 0 ? void 0 : _secureFieldRef$curre.createCard(props.merchantId ?? merchantId));
24
- }
25
- }));
26
- const secureFieldRef = /*#__PURE__*/React.createRef();
27
- return /*#__PURE__*/React.createElement(_reactNative.View, {
28
- style: [styles.container, props.style]
29
- }, /*#__PURE__*/React.createElement(_SecureFields.SecureFields.CollectManager, {
30
- ref: secureFieldRef,
31
- config: props.config
32
- }, /*#__PURE__*/React.createElement(_SecureFields.SecureFields.CardHolderNameField, {
33
- placeholder: "Card holder name",
34
- style: styles.field
35
- }), /*#__PURE__*/React.createElement(_SecureFields.SecureFields.CardNumberField, {
36
- placeholder: "Card number",
37
- style: styles.field
38
- }), /*#__PURE__*/React.createElement(_reactNative.View, {
39
- style: {
40
- display: 'flex',
41
- flexDirection: "row",
42
- width: '100%',
43
- height: 50,
44
- margin: 8
45
- }
46
- }, /*#__PURE__*/React.createElement(_SecureFields.SecureFields.ExpDateTextField, {
47
- style: [styles.field, {
48
- flex: 1,
49
- margin: 0,
50
- marginRight: 10
51
- }]
52
- }), /*#__PURE__*/React.createElement(_SecureFields.SecureFields.CVCField, {
53
- style: [styles.field, {
54
- flex: 1,
55
- margin: 0
56
- }]
57
- })), props.showZipCode ? /*#__PURE__*/React.createElement(_SecureFields.SecureFields.ZipCodeField, {
58
- placeholder: "Zip code",
59
- style: styles.field
60
- }) : /*#__PURE__*/React.createElement(React.Fragment, null)));
61
- });
62
- exports.CreditCardForm = CreditCardForm;
63
-
64
- const styles = _reactNative.StyleSheet.create({
65
- container: {
66
- width: '100%',
67
- padding: 20
68
- },
69
- field: {
70
- width: '100%',
71
- height: 50,
72
- margin: 8,
73
- padding: 5
74
- }
75
- });
76
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CreditCardForm","React","forwardRef","props","ref","useImperativeHandle","createCard","merchantId","secureFieldRef","current","createRef","styles","container","style","config","field","display","flexDirection","width","height","margin","flex","marginRight","showZipCode","StyleSheet","create","padding"],"sources":["index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { View, StyleSheet } from 'react-native';\nimport { SecureFields } from '../SecureFields';\nimport type { CreditCardFormMethods, CreditCardFormProps } from '../../interfaces/index';\n\nexport const CreditCardForm = React.forwardRef<CreditCardFormMethods, CreditCardFormProps>((props, ref) => {\n\n React.useImperativeHandle(ref, () => ({\n createCard: async (merchantId?: string) => {\n return await secureFieldRef.current?.createCard(props.merchantId ?? merchantId)\n },\n }));\n\n const secureFieldRef = React.createRef<any>()\n\n return (\n <View style={[styles.container, props.style]}>\n <SecureFields.CollectManager ref={secureFieldRef} config={props.config}>\n <SecureFields.CardHolderNameField placeholder=\"Card holder name\" style={styles.field} />\n <SecureFields.CardNumberField placeholder=\"Card number\" style={styles.field} />\n <View style={{ display: 'flex', flexDirection: \"row\", width: '100%', height: 50, margin: 8 }}>\n <SecureFields.ExpDateTextField style={[styles.field, { flex: 1, margin: 0, marginRight: 10 }]} />\n <SecureFields.CVCField style={[styles.field, { flex: 1, margin: 0 }]} />\n </View>\n {props.showZipCode ? <SecureFields.ZipCodeField placeholder=\"Zip code\" style={styles.field} /> : <></>}\n </SecureFields.CollectManager>\n </View>\n );\n});\n\nconst styles = StyleSheet.create({\n container: {\n width: '100%',\n padding: 20,\n },\n field: {\n width: '100%',\n height: 50,\n margin: 8,\n padding: 5\n }\n});\n\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;;;AAGO,MAAMA,cAAc,gBAAGC,KAAK,CAACC,UAAN,CAA6D,CAACC,KAAD,EAAQC,GAAR,KAAgB;EAEzGH,KAAK,CAACI,mBAAN,CAA0BD,GAA1B,EAA+B,OAAO;IACpCE,UAAU,EAAE,MAAOC,UAAP,IAA+B;MAAA;;MACzC,OAAO,gCAAMC,cAAc,CAACC,OAArB,0DAAM,sBAAwBH,UAAxB,CAAmCH,KAAK,CAACI,UAAN,IAAoBA,UAAvD,CAAN,CAAP;IACD;EAHmC,CAAP,CAA/B;EAMA,MAAMC,cAAc,gBAAGP,KAAK,CAACS,SAAN,EAAvB;EAEA,oBACE,oBAAC,iBAAD;IAAM,KAAK,EAAE,CAACC,MAAM,CAACC,SAAR,EAAmBT,KAAK,CAACU,KAAzB;EAAb,gBACE,oBAAC,0BAAD,CAAc,cAAd;IAA6B,GAAG,EAAEL,cAAlC;IAAkD,MAAM,EAAEL,KAAK,CAACW;EAAhE,gBACE,oBAAC,0BAAD,CAAc,mBAAd;IAAkC,WAAW,EAAC,kBAA9C;IAAiE,KAAK,EAAEH,MAAM,CAACI;EAA/E,EADF,eAEE,oBAAC,0BAAD,CAAc,eAAd;IAA8B,WAAW,EAAC,aAA1C;IAAwD,KAAK,EAAEJ,MAAM,CAACI;EAAtE,EAFF,eAGE,oBAAC,iBAAD;IAAM,KAAK,EAAE;MAAEC,OAAO,EAAE,MAAX;MAAmBC,aAAa,EAAE,KAAlC;MAAyCC,KAAK,EAAE,MAAhD;MAAwDC,MAAM,EAAE,EAAhE;MAAoEC,MAAM,EAAE;IAA5E;EAAb,gBACE,oBAAC,0BAAD,CAAc,gBAAd;IAA+B,KAAK,EAAE,CAACT,MAAM,CAACI,KAAR,EAAe;MAAEM,IAAI,EAAE,CAAR;MAAWD,MAAM,EAAE,CAAnB;MAAsBE,WAAW,EAAE;IAAnC,CAAf;EAAtC,EADF,eAEE,oBAAC,0BAAD,CAAc,QAAd;IAAuB,KAAK,EAAE,CAACX,MAAM,CAACI,KAAR,EAAe;MAAEM,IAAI,EAAE,CAAR;MAAWD,MAAM,EAAE;IAAnB,CAAf;EAA9B,EAFF,CAHF,EAOGjB,KAAK,CAACoB,WAAN,gBAAoB,oBAAC,0BAAD,CAAc,YAAd;IAA2B,WAAW,EAAC,UAAvC;IAAkD,KAAK,EAAEZ,MAAM,CAACI;EAAhE,EAApB,gBAAgG,yCAPnG,CADF,CADF;AAaD,CAvB6B,CAAvB;;;AAyBP,MAAMJ,MAAM,GAAGa,uBAAA,CAAWC,MAAX,CAAkB;EAC/Bb,SAAS,EAAE;IACTM,KAAK,EAAE,MADE;IAETQ,OAAO,EAAE;EAFA,CADoB;EAK/BX,KAAK,EAAE;IACLG,KAAK,EAAE,MADF;IAELC,MAAM,EAAE,EAFH;IAGLC,MAAM,EAAE,CAHH;IAILM,OAAO,EAAE;EAJJ;AALwB,CAAlB,CAAf"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PayEngineGooglePay = void 0;
7
-
8
- var _ = _interopRequireDefault(require("."));
9
-
10
- var _utils = require("../../utils");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- 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; }
15
-
16
- class PayEngineGooglePay {
17
- constructor(payEngineConfig) {
18
- _defineProperty(this, "googlePay", void 0);
19
-
20
- _defineProperty(this, "payEngineConfig", void 0);
21
-
22
- _defineProperty(this, "config", void 0);
23
-
24
- this.payEngineConfig = payEngineConfig;
25
- this.googlePay = new _.default();
26
- }
27
-
28
- async canMakePayments(merchantId) {
29
- const client = (0, _utils.createHttpClient)(this.payEngineConfig);
30
- const {
31
- data
32
- } = await client.get(`/api/mobile-payment/config?merchant_id=${merchantId}`);
33
- this.config = data.data;
34
- await this.googlePay.setProduction(Boolean(this.config.google_pay.production));
35
- return await this.googlePay.canMakePayments(this.config.google_pay.cardPaymentMethod.allowedCardNetworks, this.config.google_pay.cardPaymentMethod.allowedCardAuthMethods);
36
- }
37
-
38
- async start(paymentConfig) {
39
- if (!this.config) {
40
- throw new Error('You must call `canMakePayments` first');
41
- }
42
-
43
- const payload = {
44
- cardPaymentMethod: this.config.google_pay.cardPaymentMethod,
45
- transaction: {
46
- totalPrice: String(paymentConfig.amount),
47
- totalPriceStatus: 'FINAL',
48
- currencyCode: paymentConfig.currencyCode ?? this.config.currency,
49
- countryCode: paymentConfig.countryCode ?? this.config.country
50
- },
51
- merchantName: this.config.google_pay.merchantName
52
- };
53
- const result = await this.googlePay.start(payload);
54
-
55
- try {
56
- return JSON.parse(result);
57
- } catch {
58
- return result;
59
- }
60
- }
61
-
62
- }
63
-
64
- exports.PayEngineGooglePay = PayEngineGooglePay;
65
- //# sourceMappingURL=PayEngineGooglePay.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["PayEngineGooglePay","constructor","payEngineConfig","googlePay","GooglePay","canMakePayments","merchantId","client","createHttpClient","data","get","config","setProduction","Boolean","google_pay","production","cardPaymentMethod","allowedCardNetworks","allowedCardAuthMethods","start","paymentConfig","Error","payload","transaction","totalPrice","String","amount","totalPriceStatus","currencyCode","currency","countryCode","country","merchantName","result","JSON","parse"],"sources":["PayEngineGooglePay.ts"],"sourcesContent":["import GooglePay from '.';\nimport type { IPayEngineConfig, MobilePaymentConfig, PaymentRequest } from '../../interfaces';\nimport { createHttpClient } from '../../utils';\nimport type { GooglePayRequestData, IGooglePay } from './interfaces';\n\nexport class PayEngineGooglePay implements IGooglePay {\n\n private googlePay: GooglePay;\n private payEngineConfig: IPayEngineConfig;\n private config?: MobilePaymentConfig;\n\n constructor(payEngineConfig: IPayEngineConfig) {\n this.payEngineConfig = payEngineConfig;\n this.googlePay = new GooglePay()\n }\n\n public async canMakePayments(merchantId: string) {\n const client = createHttpClient(this.payEngineConfig);\n const { data } = await client.get(`/api/mobile-payment/config?merchant_id=${merchantId}`)\n this.config = data.data\n await this.googlePay.setProduction(Boolean(this.config!.google_pay.production))\n return await this.googlePay.canMakePayments(this.config!.google_pay.cardPaymentMethod.allowedCardNetworks, this.config!.google_pay.cardPaymentMethod.allowedCardAuthMethods)\n }\n\n public async start(paymentConfig: PaymentRequest) {\n if (!this.config) {\n throw new Error('You must call `canMakePayments` first')\n }\n\n const payload: GooglePayRequestData = {\n cardPaymentMethod: this.config!.google_pay.cardPaymentMethod,\n transaction: {\n totalPrice: String(paymentConfig.amount),\n totalPriceStatus: 'FINAL',\n currencyCode: paymentConfig.currencyCode ?? this.config!.currency,\n countryCode: paymentConfig.countryCode ?? this.config!.country\n },\n merchantName: this.config!.google_pay.merchantName\n }\n\n const result = await this.googlePay.start(payload);\n try {\n return JSON.parse(result)\n } catch {\n return result;\n }\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;AAGO,MAAMA,kBAAN,CAA+C;EAMpDC,WAAW,CAACC,eAAD,EAAoC;IAAA;;IAAA;;IAAA;;IAC7C,KAAKA,eAAL,GAAuBA,eAAvB;IACA,KAAKC,SAAL,GAAiB,IAAIC,SAAJ,EAAjB;EACD;;EAE2B,MAAfC,eAAe,CAACC,UAAD,EAAqB;IAC/C,MAAMC,MAAM,GAAG,IAAAC,uBAAA,EAAiB,KAAKN,eAAtB,CAAf;IACA,MAAM;MAAEO;IAAF,IAAW,MAAMF,MAAM,CAACG,GAAP,CAAY,0CAAyCJ,UAAW,EAAhE,CAAvB;IACA,KAAKK,MAAL,GAAcF,IAAI,CAACA,IAAnB;IACA,MAAM,KAAKN,SAAL,CAAeS,aAAf,CAA6BC,OAAO,CAAC,KAAKF,MAAL,CAAaG,UAAb,CAAwBC,UAAzB,CAApC,CAAN;IACA,OAAO,MAAM,KAAKZ,SAAL,CAAeE,eAAf,CAA+B,KAAKM,MAAL,CAAaG,UAAb,CAAwBE,iBAAxB,CAA0CC,mBAAzE,EAA8F,KAAKN,MAAL,CAAaG,UAAb,CAAwBE,iBAAxB,CAA0CE,sBAAxI,CAAb;EACD;;EAEiB,MAALC,KAAK,CAACC,aAAD,EAAgC;IAChD,IAAI,CAAC,KAAKT,MAAV,EAAkB;MAChB,MAAM,IAAIU,KAAJ,CAAU,uCAAV,CAAN;IACD;;IAED,MAAMC,OAA6B,GAAG;MACpCN,iBAAiB,EAAE,KAAKL,MAAL,CAAaG,UAAb,CAAwBE,iBADP;MAEpCO,WAAW,EAAE;QACXC,UAAU,EAAEC,MAAM,CAACL,aAAa,CAACM,MAAf,CADP;QAEXC,gBAAgB,EAAE,OAFP;QAGXC,YAAY,EAAER,aAAa,CAACQ,YAAd,IAA8B,KAAKjB,MAAL,CAAakB,QAH9C;QAIXC,WAAW,EAAEV,aAAa,CAACU,WAAd,IAA6B,KAAKnB,MAAL,CAAaoB;MAJ5C,CAFuB;MAQpCC,YAAY,EAAE,KAAKrB,MAAL,CAAaG,UAAb,CAAwBkB;IARF,CAAtC;IAWA,MAAMC,MAAM,GAAG,MAAM,KAAK9B,SAAL,CAAegB,KAAf,CAAqBG,OAArB,CAArB;;IACA,IAAI;MACF,OAAOY,IAAI,CAACC,KAAL,CAAWF,MAAX,CAAP;IACD,CAFD,CAEE,MAAM;MACN,OAAOA,MAAP;IACD;EACF;;AAzCmD"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _reactNative = require("react-native");
9
-
10
- const {
11
- GooglePay: RNGooglePay
12
- } = _reactNative.NativeModules;
13
-
14
- class GooglePay {
15
- constructor() {
16
- if (_reactNative.Platform.OS === 'android') {
17
- if (!RNGooglePay) {
18
- throw new Error('GooglePay is not defined');
19
- }
20
- } else {
21
- throw new Error('Google Pay is not supported (Android only)');
22
- }
23
- }
24
-
25
- async setProduction(isProduction) {
26
- return RNGooglePay.setEnvironment(isProduction ? 1 : 3);
27
- }
28
-
29
- async canMakePayments(allowedCardNetworks, allowedCardAuthMethods) {
30
- return await RNGooglePay.isReadyToPay(allowedCardNetworks, allowedCardAuthMethods);
31
- }
32
-
33
- async start(requestData) {
34
- return await RNGooglePay.requestPayment(requestData);
35
- }
36
-
37
- }
38
-
39
- exports.default = GooglePay;
40
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["GooglePay","RNGooglePay","NativeModules","constructor","Platform","OS","Error","setProduction","isProduction","setEnvironment","canMakePayments","allowedCardNetworks","allowedCardAuthMethods","isReadyToPay","start","requestData","requestPayment"],"sources":["index.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nimport type {\n GooglePayAllowedCardAuthMethods,\n GooglePayAllowedCardNetworks,\n GooglePayRequestData,\n IGooglePay,\n} from './interfaces';\n\nconst { GooglePay: RNGooglePay } = NativeModules;\n\nexport default class GooglePay implements IGooglePay {\n constructor() {\n if (Platform.OS === 'android') {\n if (!RNGooglePay) {\n throw new Error('GooglePay is not defined');\n }\n } else {\n throw new Error('Google Pay is not supported (Android only)');\n }\n }\n\n public async setProduction(isProduction: boolean) {\n return RNGooglePay.setEnvironment(isProduction ? 1 : 3);\n }\n\n public async canMakePayments(\n allowedCardNetworks: GooglePayAllowedCardNetworks,\n allowedCardAuthMethods: GooglePayAllowedCardAuthMethods\n ) {\n return await RNGooglePay.isReadyToPay(\n allowedCardNetworks,\n allowedCardAuthMethods\n );\n }\n\n public async start(requestData: GooglePayRequestData) {\n return await RNGooglePay.requestPayment(requestData);\n }\n}\n"],"mappings":";;;;;;;AAAA;;AAQA,MAAM;EAAEA,SAAS,EAAEC;AAAb,IAA6BC,0BAAnC;;AAEe,MAAMF,SAAN,CAAsC;EACnDG,WAAW,GAAG;IACZ,IAAIC,qBAAA,CAASC,EAAT,KAAgB,SAApB,EAA+B;MAC7B,IAAI,CAACJ,WAAL,EAAkB;QAChB,MAAM,IAAIK,KAAJ,CAAU,0BAAV,CAAN;MACD;IACF,CAJD,MAIO;MACL,MAAM,IAAIA,KAAJ,CAAU,4CAAV,CAAN;IACD;EACF;;EAEyB,MAAbC,aAAa,CAACC,YAAD,EAAwB;IAChD,OAAOP,WAAW,CAACQ,cAAZ,CAA2BD,YAAY,GAAG,CAAH,GAAO,CAA9C,CAAP;EACD;;EAE2B,MAAfE,eAAe,CAC1BC,mBAD0B,EAE1BC,sBAF0B,EAG1B;IACA,OAAO,MAAMX,WAAW,CAACY,YAAZ,CACXF,mBADW,EAEXC,sBAFW,CAAb;EAID;;EAEiB,MAALE,KAAK,CAACC,WAAD,EAAoC;IACpD,OAAO,MAAMd,WAAW,CAACe,cAAZ,CAA2BD,WAA3B,CAAb;EACD;;AA3BkD"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=interfaces.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["interfaces.ts"],"sourcesContent":["export interface IGooglePay {\n canMakePayments: (...args: any) => Promise<boolean>\n start: (...args: any) => Promise<any>\n}\n\ntype NetworkType = 'AMEX' | 'DISCOVER' | 'JCB' | 'MASTERCARD' | 'VISA';\ntype MethodType = 'PAN_ONLY' | 'CRYPTOGRAM_3DS';\n\nexport type GooglePayAllowedCardNetworks = NetworkType[];\n\nexport type GooglePayAllowedCardAuthMethods = MethodType[];\n\nexport type TokenizationSpecificationType = 'PAYMENT_GATEWAY' | 'DIRECT';\n\nexport interface GooglePayRequestData {\n production?: boolean,\n cardPaymentMethod: {\n tokenizationSpecification: {\n type: TokenizationSpecificationType;\n /** only with type: PAYMENT_GATEWAY */\n gateway?: string;\n /** only with type: PAYMENT_GATEWAY */\n gatewayMerchantId?: string;\n /** only with gateway: stripe */\n stripe?: {\n publishableKey: string;\n version: string;\n };\n /** only with type: DIRECT */\n publicKey?: string;\n };\n allowedCardNetworks: GooglePayAllowedCardNetworks;\n allowedCardAuthMethods: GooglePayAllowedCardAuthMethods;\n };\n transaction: {\n totalPrice: string;\n totalPriceStatus: string;\n currencyCode: string;\n countryCode: string;\n };\n merchantName: string;\n}\n"],"mappings":""}