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.
- package/README.md +193 -111
- package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/{5.6.4 → 6.1.1}/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.idea/caches/deviceStreaming.xml +318 -0
- package/android/.idea/compiler.xml +1 -1
- package/android/.idea/gradle.xml +2 -2
- package/android/.idea/kotlinc.xml +6 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +1 -1
- package/android/build.gradle +42 -6
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/paymentsdk-debug.aar +0 -0
- package/android/paymentsdk-release.aar +0 -0
- package/android/src/legacy/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativepayengine/GooglePayModule.java +196 -0
- package/android/src/main/java/com/reactnativepayengine/PayengineModule.java +1 -5
- package/android/src/main/java/com/reactnativepayengine/PayenginePackage.java +8 -33
- package/android/src/main/java/com/reactnativepayengine/util/MetricsUtil.kt +44 -0
- package/android/src/main/java/com/reactnativepayengine/util/PaymentsUtil.java +113 -0
- package/android/src/main/java/com/reactnativepayengine/v2/RNPEFraudAnalyticsApplication.java +55 -0
- package/android/src/main/java/com/reactnativepayengine/v2/RNPayEngineNative.kt +71 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEEvents.kt +8 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEField.kt +17 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNBankAccountViewManager.kt +103 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNPEBankAccountView.kt +77 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardView.kt +77 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardViewManager.kt +103 -0
- package/ios/PayEngineSDK.xcframework/Info.plist +44 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +622 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/module.modulemap +11 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/browserInfo.html +136 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/perform3ds.html +467 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +1240 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/module.modulemap +11 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/browserInfo.html +136 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/perform3ds.html +467 -0
- package/ios/Payengine.xcodeproj/project.pbxproj +30 -9
- package/ios/Payengine.xcodeproj/project.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Payengine.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +4 -4
- package/ios/Payengine.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Payengine.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Sources/Classes/ApplePay/RNPEApplePayButton.swift +111 -0
- package/ios/Sources/Classes/ApplePay/RNPEApplePayPaymentRequest.swift +43 -0
- package/ios/Sources/Classes/RNPEError.swift +12 -0
- package/ios/Sources/Classes/RNPEEventEmitter.swift +29 -0
- package/ios/Sources/Classes/RNPEUtils.swift +30 -0
- package/ios/Sources/Classes/RNPayEngineNative.swift +87 -0
- package/ios/Sources/Classes/SecureFields/RNPEBankAccountView.swift +130 -0
- package/ios/Sources/Classes/SecureFields/RNPECreditCardView.swift +129 -0
- package/ios/Sources/Classes/SecureFields/RNPEEvents.swift +15 -0
- package/ios/Sources/Classes/SecureFields/RNPEField.swift +26 -0
- package/ios/Sources/Payengine.m +73 -0
- package/ios/Sources/Payengine.swift +13 -0
- package/lib/commonjs/components/PayEngine.js +2 -123
- package/lib/commonjs/components/PayEngine.js.map +1 -1
- package/lib/commonjs/components/{SecureFields/VGS/CardHolderNameField.js → v2/ApplePay/PEApplePayButton.js} +38 -13
- package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js +29 -0
- package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
- package/lib/commonjs/components/v2/PayEngineNative.js +34 -0
- package/lib/commonjs/components/v2/PayEngineNative.js.map +1 -0
- package/lib/commonjs/components/{SecureFields/VGS/TextField.js → v2/PayEngineProvider.js} +28 -12
- package/lib/commonjs/components/v2/PayEngineProvider.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js +89 -0
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js +90 -0
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/IPEField.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/IPEField.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PECard.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/PECard.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js +18 -0
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
- package/lib/commonjs/index.js +73 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/index.js +2 -0
- package/lib/commonjs/interfaces/index.js.map +1 -0
- package/lib/commonjs/utils/index.js +29 -45
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/components/PayEngine.js +3 -118
- package/lib/module/components/PayEngine.js.map +1 -1
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js +37 -0
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/module/components/v2/ApplePay/PEPaymentRequest.js +20 -0
- package/lib/module/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
- package/lib/module/components/v2/PayEngineNative.js +23 -0
- package/lib/module/components/v2/PayEngineNative.js.map +1 -0
- package/lib/module/components/v2/PayEngineProvider.js +30 -0
- package/lib/module/components/v2/PayEngineProvider.js.map +1 -0
- package/lib/module/components/v2/SecureFields/BankAccountView.js +75 -0
- package/lib/module/components/v2/SecureFields/BankAccountView.js.map +1 -0
- package/lib/module/components/v2/SecureFields/CreditCardView.js +76 -0
- package/lib/module/components/v2/SecureFields/CreditCardView.js.map +1 -0
- package/lib/module/components/v2/SecureFields/IPEField.js +2 -0
- package/lib/module/components/v2/SecureFields/IPEField.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PEBankAccount.js +2 -0
- package/lib/module/components/v2/SecureFields/PEBankAccount.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PECard.js +2 -0
- package/lib/module/components/v2/SecureFields/PECard.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js +11 -0
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
- package/lib/module/index.js +15 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/index.js +2 -0
- package/lib/module/interfaces/index.js.map +1 -0
- package/lib/module/utils/index.js +20 -45
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/components/PayEngine.d.ts +1 -14
- package/lib/typescript/components/v2/ApplePay/PEApplePayButton.d.ts +12 -0
- package/lib/typescript/components/v2/ApplePay/PEPaymentRequest.d.ts +12 -0
- package/lib/typescript/components/v2/PayEngineNative.d.ts +5 -0
- package/lib/typescript/components/v2/PayEngineProvider.d.ts +8 -0
- package/lib/typescript/components/v2/SecureFields/BankAccountView.d.ts +14 -0
- package/lib/typescript/components/v2/SecureFields/CreditCardView.d.ts +14 -0
- package/lib/typescript/components/v2/SecureFields/IPEField.d.ts +10 -0
- package/lib/typescript/components/v2/SecureFields/PEBankAccount.d.ts +11 -0
- package/lib/typescript/components/v2/SecureFields/PECard.d.ts +13 -0
- package/lib/typescript/components/v2/SecureFields/PEKeyboardType.d.ts +7 -0
- package/lib/typescript/index.d.ts +13 -3
- package/lib/typescript/interfaces/index.d.ts +6 -0
- package/lib/typescript/utils/index.d.ts +7 -41
- package/package.json +17 -11
- package/react-native-payengine.podspec +3 -3
- package/src/components/LoadingIndicator.tsx +28 -0
- package/src/components/PayEngine.tsx +8 -0
- package/src/components/v2/ApplePay/PEApplePayButton.tsx +70 -0
- package/src/components/v2/ApplePay/PEPaymentRequest.ts +18 -0
- package/src/components/v2/PayEngineNative.tsx +20 -0
- package/src/components/v2/PayEngineProvider.tsx +30 -0
- package/src/components/v2/SecureFields/BankAccountView.tsx +95 -0
- package/src/components/v2/SecureFields/CreditCardView.tsx +96 -0
- package/src/components/v2/SecureFields/IPEField.ts +12 -0
- package/src/components/v2/SecureFields/PEBankAccount.ts +12 -0
- package/src/components/v2/SecureFields/PECard.ts +14 -0
- package/src/components/v2/SecureFields/PEKeyboardType.ts +8 -0
- package/src/index.tsx +62 -0
- package/src/interfaces/index.ts +6 -0
- package/src/utils/index.ts +79 -0
- package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
- package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectModule.java +0 -148
- package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectOnCreateViewInstanceListener.java +0 -6
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCVCField.java +0 -67
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardHolderNameField.java +0 -53
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardNumberField.java +0 -57
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSExpDateField.java +0 -54
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSTextField.java +0 -57
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSZipCodeField.java +0 -62
- package/android/src/main/java/com/reactnativepayengine/util/ResourceUtil.java +0 -14
- package/ios/Payengine.m +0 -55
- package/ios/Payengine.swift +0 -637
- package/lib/commonjs/components/SecureFields/VGS/CVCField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/CVCField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/CollectManager.js +0 -65
- package/lib/commonjs/components/SecureFields/VGS/CollectManager.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/TextField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/index.js +0 -34
- package/lib/commonjs/components/SecureFields/index.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CVCField.js +0 -14
- package/lib/module/components/SecureFields/VGS/CVCField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CardHolderNameField.js +0 -14
- package/lib/module/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CardNumberField.js +0 -14
- package/lib/module/components/SecureFields/VGS/CardNumberField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CollectManager.js +0 -50
- package/lib/module/components/SecureFields/VGS/CollectManager.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/ExpDateField.js +0 -14
- package/lib/module/components/SecureFields/VGS/ExpDateField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/TextField.js +0 -17
- package/lib/module/components/SecureFields/VGS/TextField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/ZipCodeField.js +0 -14
- package/lib/module/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
- package/lib/module/components/SecureFields/index.js +0 -17
- package/lib/module/components/SecureFields/index.js.map +0 -1
- package/lib/typescript/components/SecureFields/VGS/CVCField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/CardHolderNameField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/CardNumberField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/CollectManager.d.ts +0 -12
- package/lib/typescript/components/SecureFields/VGS/ExpDateField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/TextField.d.ts +0 -14
- package/lib/typescript/components/SecureFields/VGS/ZipCodeField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/index.d.ts +0 -16
- /package/android/.gradle/{5.6.4 → 6.1.1}/fileChanges/last-build.bin +0 -0
- /package/android/.gradle/{5.6.4 → 6.1.1}/gc.properties +0 -0
- /package/android/{vgscollect-1.7.2-debug.aar → securefields-1.7.2-debug.aar} +0 -0
- /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
|
|
3
|
+
## React Native SDK Version 2
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
### Overview
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
9
|
+
### Prerequisites
|
|
16
10
|
|
|
17
|
-
|
|
11
|
+
#### Install Package
|
|
18
12
|
|
|
19
|
-
```
|
|
20
|
-
|
|
13
|
+
```bash
|
|
14
|
+
yarn add react-native-payengine@2
|
|
21
15
|
```
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
#### Android
|
|
24
18
|
|
|
25
|
-
|
|
19
|
+
To use secure fields components, you need to install and configure the Material Components theme in your app.
|
|
26
20
|
|
|
27
|
-
|
|
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
|
-
|
|
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
|
-
|
|
34
|
+
Example error:
|
|
34
35
|
|
|
35
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
61
|
+
### Usage
|
|
46
62
|
|
|
47
|
-
|
|
48
|
-
import { PayEngine } from 'react-native-payengine';
|
|
63
|
+
#### Wrap the Config in a Provider
|
|
49
64
|
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
import
|
|
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
|
-
|
|
70
|
-
const
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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
|
|
89
|
-
<
|
|
90
|
-
<
|
|
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
|
-
|
|
123
|
+
```jsx
|
|
124
|
+
import React from 'react';
|
|
125
|
+
import { PEBankAccountView } from 'react-native-payengine';
|
|
126
|
+
import { Button, View } from 'react-native';
|
|
133
127
|
|
|
134
|
-
|
|
128
|
+
const BankAccountForm = () => {
|
|
129
|
+
const formRef = React.createRef();
|
|
135
130
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
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
|
-
|
|
140
|
+
return (
|
|
141
|
+
<View>
|
|
142
|
+
<PEBankAccountView ref={formRef} />
|
|
143
|
+
<Button onPress={createBankAccount} title="Create Bank Account" />
|
|
144
|
+
</View>
|
|
145
|
+
);
|
|
146
|
+
};
|
|
148
147
|
```
|
|
149
|
-
|
|
150
|
-
|
|
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
|
```
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#
|
|
2
|
-
gradle.version=
|
|
1
|
+
#Mon Sep 09 23:15:47 ICT 2024
|
|
2
|
+
gradle.version=6.1.1
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|