react-native-payengine 1.0.6 → 2.0.4
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 +269 -110
- package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/{5.6.4/fileHashes/resourceHashesCache.bin → 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 +329 -0
- package/android/.idea/gradle.xml +2 -3
- 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 +25 -4
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/payment-sdk-debug-1.0.2.aar +0 -0
- package/android/payment-sdk-release-1.0.2.aar +0 -0
- package/android/src/main/java/com/reactnativepayengine/PayengineModule.java +1 -5
- package/android/src/main/java/com/reactnativepayengine/PayenginePackage.java +9 -33
- package/android/src/main/java/com/reactnativepayengine/util/MetricsUtil.kt +44 -0
- package/android/src/main/java/com/reactnativepayengine/v2/RNPEFraudAnalyticsApplication.java +55 -0
- package/android/src/main/java/com/reactnativepayengine/v2/RNPayEngineNative.kt +73 -0
- package/android/src/main/java/com/reactnativepayengine/v2/features/googlepay/RNPEGooglePayButton.kt +105 -0
- package/android/src/main/java/com/reactnativepayengine/v2/features/googlepay/RNPEGooglePayButtonManager.kt +56 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEEvents.kt +11 -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 +14 -4
- package/ios/Payengine.xcodeproj/project.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- 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/v2/ApplePay/PEApplePayButton.js +55 -0
- package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js +70 -0
- package/lib/commonjs/components/v2/GooglePay/PEGooglePayButton.js.map +1 -0
- package/lib/commonjs/components/v2/PEPaymentRequest.js +32 -0
- package/lib/commonjs/components/v2/PEPaymentRequest.js.map +1 -0
- package/lib/commonjs/components/v2/PayEngineNative.js +36 -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 +62 -18
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/index.js +0 -4
- package/lib/commonjs/interfaces/index.js.map +1 -1
- package/lib/commonjs/utils/index.js +10 -38
- 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 +41 -0
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/module/components/v2/GooglePay/PEGooglePayButton.js +56 -0
- package/lib/module/components/v2/GooglePay/PEGooglePayButton.js.map +1 -0
- package/lib/module/components/v2/PEPaymentRequest.js +23 -0
- package/lib/module/components/v2/PEPaymentRequest.js.map +1 -0
- package/lib/module/components/v2/PayEngineNative.js +25 -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 +1 -1
- package/lib/module/interfaces/index.js.map +1 -1
- package/lib/module/utils/index.js +6 -37
- 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/GooglePay/PEGooglePayButton.d.ts +12 -0
- package/lib/typescript/components/v2/PEPaymentRequest.d.ts +13 -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 -6
- package/lib/typescript/interfaces/index.d.ts +0 -27
- package/lib/typescript/utils/index.d.ts +3 -36
- package/package.json +11 -6
- package/react-native-payengine.podspec +2 -2
- package/src/components/PayEngine.tsx +5 -118
- package/src/components/v2/ApplePay/PEApplePayButton.tsx +74 -0
- package/src/components/v2/GooglePay/PEGooglePayButton.tsx +73 -0
- package/src/components/v2/PEPaymentRequest.ts +20 -0
- package/src/components/v2/PayEngineNative.tsx +22 -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 +49 -22
- package/src/interfaces/index.ts +0 -32
- package/src/utils/index.ts +8 -36
- package/android/.gradle/5.6.4/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/5.6.4/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/5.6.4/fileContent/fileContent.lock +0 -0
- package/android/.gradle/5.6.4/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/5.6.4/javaCompile/classAnalysis.bin +0 -0
- package/android/.gradle/5.6.4/javaCompile/jarAnalysis.bin +0 -0
- package/android/.gradle/5.6.4/javaCompile/javaCompile.lock +0 -0
- package/android/.gradle/5.6.4/javaCompile/taskHistory.bin +0 -0
- package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectModule.java +0 -153
- 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 -72
- package/ios/Payengine.swift +0 -720
- package/lib/commonjs/components/ApplePay/PayEngineApplePay.js +0 -71
- package/lib/commonjs/components/ApplePay/PayEngineApplePay.js.map +0 -1
- package/lib/commonjs/components/ApplePay/index.js +0 -46
- package/lib/commonjs/components/ApplePay/index.js.map +0 -1
- package/lib/commonjs/components/ApplePay/interfaces.js +0 -2
- package/lib/commonjs/components/ApplePay/interfaces.js.map +0 -1
- package/lib/commonjs/components/CreditCardForm/index.js +0 -76
- package/lib/commonjs/components/CreditCardForm/index.js.map +0 -1
- package/lib/commonjs/components/GooglePay/PayEngineGooglePay.js +0 -65
- package/lib/commonjs/components/GooglePay/PayEngineGooglePay.js.map +0 -1
- package/lib/commonjs/components/GooglePay/index.js +0 -40
- package/lib/commonjs/components/GooglePay/index.js.map +0 -1
- package/lib/commonjs/components/GooglePay/interfaces.js +0 -2
- package/lib/commonjs/components/GooglePay/interfaces.js.map +0 -1
- package/lib/commonjs/components/Legacy/CreditCardFormLegacy.js +0 -323
- package/lib/commonjs/components/Legacy/CreditCardFormLegacy.js.map +0 -1
- 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 +0 -26
- 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 -60
- 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/ApplePay/PayEngineApplePay.js +0 -58
- package/lib/module/components/ApplePay/PayEngineApplePay.js.map +0 -1
- package/lib/module/components/ApplePay/index.js +0 -35
- package/lib/module/components/ApplePay/index.js.map +0 -1
- package/lib/module/components/ApplePay/interfaces.js +0 -2
- package/lib/module/components/ApplePay/interfaces.js.map +0 -1
- package/lib/module/components/CreditCardForm/index.js +0 -60
- package/lib/module/components/CreditCardForm/index.js.map +0 -1
- package/lib/module/components/GooglePay/PayEngineGooglePay.js +0 -52
- package/lib/module/components/GooglePay/PayEngineGooglePay.js.map +0 -1
- package/lib/module/components/GooglePay/index.js +0 -29
- package/lib/module/components/GooglePay/index.js.map +0 -1
- package/lib/module/components/GooglePay/interfaces.js +0 -2
- package/lib/module/components/GooglePay/interfaces.js.map +0 -1
- package/lib/module/components/Legacy/CreditCardFormLegacy.js +0 -302
- package/lib/module/components/Legacy/CreditCardFormLegacy.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 -45
- 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/ApplePay/PayEngineApplePay.d.ts +0 -12
- package/lib/typescript/components/ApplePay/index.d.ts +0 -7
- package/lib/typescript/components/ApplePay/interfaces.d.ts +0 -20
- package/lib/typescript/components/CreditCardForm/index.d.ts +0 -3
- package/lib/typescript/components/GooglePay/PayEngineGooglePay.d.ts +0 -10
- package/lib/typescript/components/GooglePay/index.d.ts +0 -7
- package/lib/typescript/components/GooglePay/interfaces.d.ts +0 -38
- package/lib/typescript/components/Legacy/CreditCardFormLegacy.d.ts +0 -4
- 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/src/components/ApplePay/PayEngineApplePay.ts +0 -61
- package/src/components/ApplePay/index.ts +0 -32
- package/src/components/ApplePay/interfaces.ts +0 -25
- package/src/components/CreditCardForm/index.tsx +0 -43
- package/src/components/GooglePay/PayEngineGooglePay.ts +0 -48
- package/src/components/GooglePay/index.ts +0 -39
- package/src/components/GooglePay/interfaces.ts +0 -42
- package/src/components/Legacy/CreditCardFormLegacy.tsx +0 -292
- package/src/components/SecureFields/VGS/CVCField.tsx +0 -21
- package/src/components/SecureFields/VGS/CardHolderNameField.tsx +0 -21
- package/src/components/SecureFields/VGS/CardNumberField.tsx +0 -21
- package/src/components/SecureFields/VGS/CollectManager.tsx +0 -74
- package/src/components/SecureFields/VGS/ExpDateField.tsx +0 -21
- package/src/components/SecureFields/VGS/TextField.tsx +0 -27
- package/src/components/SecureFields/VGS/ZipCodeField.tsx +0 -21
- package/src/components/SecureFields/index.ts +0 -17
- /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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
package com.reactnativepayengine.v2
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.util.Log
|
|
5
|
+
import com.facebook.react.bridge.Promise
|
|
6
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
7
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
8
|
+
import com.facebook.react.bridge.ReactMethod
|
|
9
|
+
import com.facebook.react.bridge.UiThreadUtil.runOnUiThread
|
|
10
|
+
import com.payengine.paymentsdk.PayEngine
|
|
11
|
+
import com.payengine.paymentsdk.features.googlepay.PEGooglePayInterface
|
|
12
|
+
import com.payengine.paymentsdk.models.PEConfig
|
|
13
|
+
import kotlin.concurrent.thread
|
|
14
|
+
|
|
15
|
+
class RNPayEngineNative: ReactContextBaseJavaModule {
|
|
16
|
+
|
|
17
|
+
constructor(context: ReactApplicationContext): super(context) {
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
override fun getName(): String {
|
|
22
|
+
return "RNPayEngineNative"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
@ReactMethod
|
|
26
|
+
fun setConfig(publicKey: String, baseURL: String?) {
|
|
27
|
+
Log.d("PayEngine", "setConfig is called $publicKey $baseURL")
|
|
28
|
+
val config = PEConfig(publicKey, baseURL)
|
|
29
|
+
instance = PayEngine(config)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@ReactMethod
|
|
33
|
+
fun createFraudMonitorSession(merchantId: String, promise: Promise) {
|
|
34
|
+
val currentActivity = reactApplicationContext.currentActivity
|
|
35
|
+
if (currentActivity == null) {
|
|
36
|
+
promise.reject("NO_ACTIVITY", "No activity found")
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
val sessionId = instance?.createFraudMonitorSession(currentActivity, merchantId) { sessionId ->
|
|
42
|
+
if (sessionId != null) {
|
|
43
|
+
promise.resolve(sessionId)
|
|
44
|
+
} else {
|
|
45
|
+
promise.reject("NO_SESSION", "No session found")
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@ReactMethod
|
|
51
|
+
fun getBrowserInfo(promise: Promise) {
|
|
52
|
+
val currentActivity = reactApplicationContext.currentActivity
|
|
53
|
+
if (currentActivity == null) {
|
|
54
|
+
promise.reject("NO_ACTIVITY", "No activity found")
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
runOnUiThread {
|
|
59
|
+
instance?.getBrowserInfo(currentActivity) { browserInfo ->
|
|
60
|
+
if (browserInfo != null) {
|
|
61
|
+
promise.resolve(browserInfo)
|
|
62
|
+
} else {
|
|
63
|
+
promise.reject("NO_BROWSER_INFO", "No browser info found")
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
companion object {
|
|
70
|
+
var instance: PayEngine? = null
|
|
71
|
+
var googlePay: PEGooglePayInterface? = null
|
|
72
|
+
}
|
|
73
|
+
}
|
package/android/src/main/java/com/reactnativepayengine/v2/features/googlepay/RNPEGooglePayButton.kt
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
package com.reactnativepayengine.v2.features.googlepay
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.util.Log
|
|
5
|
+
import android.view.ViewGroup
|
|
6
|
+
import android.widget.LinearLayout
|
|
7
|
+
import com.facebook.react.bridge.Arguments
|
|
8
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
10
|
+
import com.payengine.paymentsdk.features.googlepay.PEGooglePayDelegate
|
|
11
|
+
import com.payengine.paymentsdk.features.googlepay.PEGooglePayStatus
|
|
12
|
+
import com.payengine.paymentsdk.features.googlepay.nmi.GooglePayPaymentRequest
|
|
13
|
+
import com.reactnativepayengine.v2.RNPayEngineNative
|
|
14
|
+
import com.reactnativepayengine.v2.securefields.RNPEEvents
|
|
15
|
+
|
|
16
|
+
class RNPEGooglePayButton(private val context: ThemedReactContext, private val activity: Activity?): LinearLayout(context),
|
|
17
|
+
PEGooglePayDelegate {
|
|
18
|
+
|
|
19
|
+
private var amount: Double? = null
|
|
20
|
+
private var merchantId: String? = null
|
|
21
|
+
|
|
22
|
+
init {
|
|
23
|
+
this.orientation = VERTICAL
|
|
24
|
+
val layoutParams = LayoutParams(
|
|
25
|
+
LayoutParams.WRAP_CONTENT,
|
|
26
|
+
LayoutParams.WRAP_CONTENT
|
|
27
|
+
)
|
|
28
|
+
this.layoutParams = layoutParams
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
fun setAmount(amount: Double) {
|
|
32
|
+
this.amount = amount
|
|
33
|
+
this.setupView()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
fun setMerchantId(merchantId: String) {
|
|
37
|
+
this.merchantId = merchantId
|
|
38
|
+
this.setupView()
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
private fun setupView() {
|
|
42
|
+
if (amount == null || merchantId == null) return
|
|
43
|
+
|
|
44
|
+
this.activity?.let {
|
|
45
|
+
RNPayEngineNative.instance?.createGooglePay(it, this.merchantId!!) {
|
|
46
|
+
if (it is PEGooglePayStatus.Eligible) {
|
|
47
|
+
val googlepay = it.googlePayInstance
|
|
48
|
+
RNPayEngineNative.googlePay = googlepay
|
|
49
|
+
|
|
50
|
+
googlepay.delegate = this
|
|
51
|
+
googlepay.setupGooglePayButton(GooglePayPaymentRequest(amount!!)) {
|
|
52
|
+
if (it != null) {
|
|
53
|
+
this.addView(it)
|
|
54
|
+
} else {
|
|
55
|
+
this.paymentFailure(Error("Google pay is not available"))
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
} else if (it is PEGooglePayStatus.NotEligible) {
|
|
59
|
+
this.paymentFailure(Error("Google pay is not available: ${it.error}"))
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
override fun paymentFailure(error: Error) {
|
|
66
|
+
Log.d("PE", "paymentFailure: $error")
|
|
67
|
+
val params = Arguments.createMap().apply {
|
|
68
|
+
putString("error", error.localizedMessage)
|
|
69
|
+
}
|
|
70
|
+
context
|
|
71
|
+
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
72
|
+
.emit(RNPEEvents.ON_GOOGLE_PAY_ERROR, params)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
override fun paymentSheetDidDismiss() {
|
|
76
|
+
Log.d("PE", "paymentSheetDidDismiss")
|
|
77
|
+
val params = Arguments.createMap().apply {}
|
|
78
|
+
context
|
|
79
|
+
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
80
|
+
.emit(RNPEEvents.ON_GOOGLE_PAY_DISMISS, params)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
override fun paymentTokenDidReturn(token: String) {
|
|
84
|
+
Log.d("PE", "paymentTokenDidReturn: $token")
|
|
85
|
+
val params = Arguments.createMap().apply {
|
|
86
|
+
putString("token", token)
|
|
87
|
+
}
|
|
88
|
+
context
|
|
89
|
+
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
90
|
+
.emit(RNPEEvents.ON_GOOGLE_PAY_RESPOND, params)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
override fun requestLayout() {
|
|
94
|
+
super.requestLayout()
|
|
95
|
+
post(mLayoutRunnable)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private val mLayoutRunnable = Runnable {
|
|
99
|
+
measure(
|
|
100
|
+
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
|
|
101
|
+
MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY)
|
|
102
|
+
)
|
|
103
|
+
layout(left, top, right, bottom)
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
package com.reactnativepayengine.v2.features.googlepay
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Intent
|
|
5
|
+
import com.facebook.react.bridge.ActivityEventListener
|
|
6
|
+
import com.facebook.react.bridge.BaseActivityEventListener
|
|
7
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
8
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
10
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
11
|
+
import com.reactnativepayengine.v2.RNPayEngineNative
|
|
12
|
+
|
|
13
|
+
class RNPEGooglePayButtonManager: SimpleViewManager<RNPEGooglePayButton> {
|
|
14
|
+
private var context: ReactApplicationContext
|
|
15
|
+
|
|
16
|
+
@ReactProp(name = "amount")
|
|
17
|
+
fun setAmount(view: RNPEGooglePayButton, amount: Double) {
|
|
18
|
+
view.setAmount(amount)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@ReactProp(name = "merchantId")
|
|
22
|
+
fun setMerchantId(view: RNPEGooglePayButton, merchantId: String) {
|
|
23
|
+
view.setMerchantId(merchantId)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
constructor(context: ReactApplicationContext) : super() {
|
|
28
|
+
this.context = context
|
|
29
|
+
|
|
30
|
+
context.addActivityEventListener(activityEventListener)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
override fun getName(): String {
|
|
34
|
+
return REACT_CLASS;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun createViewInstance(reactContext: ThemedReactContext): RNPEGooglePayButton {
|
|
38
|
+
return RNPEGooglePayButton(reactContext, context.currentActivity)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
companion object {
|
|
43
|
+
private const val REACT_CLASS = "RNPEGooglePayButton"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
private val activityEventListener: ActivityEventListener = object : BaseActivityEventListener() {
|
|
47
|
+
override fun onActivityResult(
|
|
48
|
+
activity: Activity,
|
|
49
|
+
requestCode: Int,
|
|
50
|
+
resultCode: Int,
|
|
51
|
+
data: Intent
|
|
52
|
+
) {
|
|
53
|
+
RNPayEngineNative.googlePay?.onActivityResult(requestCode, resultCode, data)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
package com.reactnativepayengine.v2.securefields
|
|
2
|
+
|
|
3
|
+
object RNPEEvents {
|
|
4
|
+
val ON_READY = "onReady"
|
|
5
|
+
val ON_SIZE_CHANGES = "onSizeChanges"
|
|
6
|
+
val ON_CARD_RESPOND = "onCardRespond"
|
|
7
|
+
val ON_BANK_ACCOUNT_RESPOND = "onBankAccountRespond"
|
|
8
|
+
val ON_GOOGLE_PAY_RESPOND = "onGooglePayRespond"
|
|
9
|
+
val ON_GOOGLE_PAY_ERROR = "onGooglePayError"
|
|
10
|
+
val ON_GOOGLE_PAY_DISMISS = "onGooglePayDismiss"
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.reactnativepayengine.v2.securefields
|
|
2
|
+
|
|
3
|
+
import com.payengine.paymentsdk.models.PEField
|
|
4
|
+
import com.payengine.paymentsdk.models.PEKeyboardType
|
|
5
|
+
|
|
6
|
+
data class RNPEField(val name: String, val type: String, val placeholder: String, val keyboardType: String, val isRequired: Boolean, val pattern: String?) {
|
|
7
|
+
|
|
8
|
+
fun toNative(): PEField {
|
|
9
|
+
val nativeKeyboardType = when (keyboardType) {
|
|
10
|
+
"number" -> PEKeyboardType.NUMBER
|
|
11
|
+
"alphabet" -> PEKeyboardType.ALPHABET
|
|
12
|
+
"phone" -> PEKeyboardType.PHONE
|
|
13
|
+
else -> PEKeyboardType.NORMAL
|
|
14
|
+
}
|
|
15
|
+
return PEField(name, type, placeholder, isRequired, nativeKeyboardType, pattern)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
package com.reactnativepayengine.v2.securefields.bankaccount
|
|
2
|
+
|
|
3
|
+
import android.util.Log
|
|
4
|
+
import com.facebook.react.bridge.Arguments
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.bridge.ReadableArray
|
|
7
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
|
8
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
10
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
11
|
+
import com.google.gson.Gson
|
|
12
|
+
import com.reactnativepayengine.v2.securefields.RNPEEvents
|
|
13
|
+
import com.reactnativepayengine.v2.securefields.RNPEField
|
|
14
|
+
import org.json.JSONArray
|
|
15
|
+
|
|
16
|
+
class RNPEBankAccountViewManager: SimpleViewManager<RNPEBankAccountView> {
|
|
17
|
+
private var context: ReactApplicationContext
|
|
18
|
+
|
|
19
|
+
@ReactProp(name = "additionalFields")
|
|
20
|
+
fun setPlaceholder(view: RNPEBankAccountView, jsonString: String?) {
|
|
21
|
+
val additionalFields: MutableList<RNPEField> = mutableListOf()
|
|
22
|
+
try {
|
|
23
|
+
val jsonArray = JSONArray(jsonString)
|
|
24
|
+
for (i in 0 until jsonArray.length()) {
|
|
25
|
+
val jsonObject = jsonArray.getJSONObject(i)
|
|
26
|
+
val name = jsonObject.getString("name")
|
|
27
|
+
val type = jsonObject.getString("type")
|
|
28
|
+
val placeholder = jsonObject.getString("placeholder")
|
|
29
|
+
val keyboardType = jsonObject.getString("keyboardType")
|
|
30
|
+
val isRequired = jsonObject.getBoolean("isRequired")
|
|
31
|
+
val pattern = jsonObject.optString("pattern")
|
|
32
|
+
val field = RNPEField(name, type, placeholder, keyboardType, isRequired, pattern)
|
|
33
|
+
additionalFields.add(field)
|
|
34
|
+
}
|
|
35
|
+
} catch (e: Exception) {
|
|
36
|
+
Log.e("PE", "Error parsing additional fields", e)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
view.setAdditionalFields(additionalFields)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
constructor(context: ReactApplicationContext) : super() {
|
|
44
|
+
this.context = context
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
override fun getName(): String {
|
|
48
|
+
return REACT_CLASS;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
override fun createViewInstance(reactContext: ThemedReactContext): RNPEBankAccountView {
|
|
52
|
+
return RNPEBankAccountView(reactContext, context.currentActivity)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override fun getCommandsMap() = mapOf(
|
|
56
|
+
"submit" to COMMAND_SUBMIT,
|
|
57
|
+
"showKeyboard" to COMMAND_SHOW_KEYBOARD,
|
|
58
|
+
"hideKeyboard" to COMMAND_HIDE_KEYBOARD
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
override fun receiveCommand(root: RNPEBankAccountView, commandId: String?, args: ReadableArray?) {
|
|
62
|
+
super.receiveCommand(root, commandId, args)
|
|
63
|
+
when (commandId?.toInt()) {
|
|
64
|
+
COMMAND_SUBMIT -> {
|
|
65
|
+
val merchantId = args!!.getString(0)
|
|
66
|
+
val additionalData = args!!.getMap(1)
|
|
67
|
+
root.submit(merchantId, additionalData) { bankAccount ->
|
|
68
|
+
Log.d("PE", Gson().toJson(bankAccount))
|
|
69
|
+
if (bankAccount.STATUS == "FAILED") {
|
|
70
|
+
val params = Arguments.createMap().apply {
|
|
71
|
+
putString("error", bankAccount.ERROR.toString())
|
|
72
|
+
}
|
|
73
|
+
context
|
|
74
|
+
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
75
|
+
.emit(RNPEEvents.ON_BANK_ACCOUNT_RESPOND, params)
|
|
76
|
+
} else {
|
|
77
|
+
val json = Gson().toJson(bankAccount.DATA)
|
|
78
|
+
val params = Arguments.createMap().apply {
|
|
79
|
+
putString("bankAccount", json)
|
|
80
|
+
}
|
|
81
|
+
context
|
|
82
|
+
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
83
|
+
.emit(RNPEEvents.ON_BANK_ACCOUNT_RESPOND, params)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
COMMAND_SHOW_KEYBOARD -> {
|
|
88
|
+
root.showKeyboard()
|
|
89
|
+
}
|
|
90
|
+
COMMAND_HIDE_KEYBOARD -> {
|
|
91
|
+
root.hideKeyboard()
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
companion object {
|
|
97
|
+
private const val REACT_CLASS = "RNPEBankAccountView"
|
|
98
|
+
private const val COMMAND_SUBMIT = 1
|
|
99
|
+
private const val COMMAND_SHOW_KEYBOARD = 2
|
|
100
|
+
private const val COMMAND_HIDE_KEYBOARD = 3
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
package com.reactnativepayengine.v2.securefields.bankaccount
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Context
|
|
5
|
+
import android.widget.LinearLayout
|
|
6
|
+
import com.facebook.react.bridge.Arguments
|
|
7
|
+
import com.facebook.react.bridge.ReadableMap
|
|
8
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
10
|
+
import com.payengine.paymentsdk.components.PEBankAccountView
|
|
11
|
+
import com.payengine.paymentsdk.components.PESizeChangeListener
|
|
12
|
+
import com.payengine.paymentsdk.models.responses.BankAccountResponse
|
|
13
|
+
import com.reactnativepayengine.util.MetricsUtil
|
|
14
|
+
import com.reactnativepayengine.v2.RNPayEngineNative
|
|
15
|
+
import com.reactnativepayengine.v2.securefields.RNPEEvents
|
|
16
|
+
import com.reactnativepayengine.v2.securefields.RNPEField
|
|
17
|
+
import kotlin.concurrent.thread
|
|
18
|
+
|
|
19
|
+
public class RNPEBankAccountView(private val context: ThemedReactContext, private val activity: Activity?) : LinearLayout(context) {
|
|
20
|
+
|
|
21
|
+
private var view: PEBankAccountView? = null
|
|
22
|
+
private var additionalFields: MutableList<RNPEField> = mutableListOf()
|
|
23
|
+
|
|
24
|
+
init {
|
|
25
|
+
this.orientation = VERTICAL
|
|
26
|
+
val layoutParams = LayoutParams(
|
|
27
|
+
LayoutParams.MATCH_PARENT,
|
|
28
|
+
0
|
|
29
|
+
)
|
|
30
|
+
this.layoutParams = layoutParams
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
fun setAdditionalFields(additionalFields: List<RNPEField>) {
|
|
34
|
+
this.additionalFields = additionalFields.toMutableList()
|
|
35
|
+
this.setupView()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private fun setupView() {
|
|
39
|
+
view = RNPayEngineNative.instance?.createBankAccountView(activity as Context, this.additionalFields.map { it.toNative() })
|
|
40
|
+
if (view != null) {
|
|
41
|
+
this.addView(view)
|
|
42
|
+
view!!.setSizeChangeListener(object: PESizeChangeListener {
|
|
43
|
+
override fun onSizeChanged(width: Int, height: Int) {
|
|
44
|
+
val params = Arguments.createMap().apply {
|
|
45
|
+
putInt("width", MetricsUtil.convertPixelsToDp(width.toFloat(), context).toInt())
|
|
46
|
+
putInt("height", MetricsUtil.convertPixelsToDp(height.toFloat(), context).toInt())
|
|
47
|
+
}
|
|
48
|
+
context
|
|
49
|
+
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
50
|
+
.emit(RNPEEvents.ON_SIZE_CHANGES, params)
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
fun submit(merchantId: String, additionalData: ReadableMap, callback: (BankAccountResponse) -> Unit) {
|
|
58
|
+
if (view == null) {
|
|
59
|
+
callback(BankAccountResponse("FAILED", null, "View is null"))
|
|
60
|
+
return
|
|
61
|
+
}
|
|
62
|
+
thread {
|
|
63
|
+
view!!.tokenize(merchantId, additionalData.toHashMap()) { bankAccount ->
|
|
64
|
+
callback(bankAccount)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
fun showKeyboard() {
|
|
70
|
+
view?.showKeyboard()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
fun hideKeyboard() {
|
|
74
|
+
view?.hideKeyboard()
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
package com.reactnativepayengine.v2.securefields.creditcard
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Context
|
|
5
|
+
import android.widget.LinearLayout
|
|
6
|
+
import com.facebook.react.bridge.Arguments
|
|
7
|
+
import com.facebook.react.bridge.ReadableMap
|
|
8
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
10
|
+
import com.payengine.paymentsdk.components.PEPaymentView
|
|
11
|
+
import com.payengine.paymentsdk.components.PESizeChangeListener
|
|
12
|
+
import com.payengine.paymentsdk.models.responses.CardResponse
|
|
13
|
+
import com.reactnativepayengine.util.MetricsUtil
|
|
14
|
+
import com.reactnativepayengine.v2.RNPayEngineNative
|
|
15
|
+
import com.reactnativepayengine.v2.securefields.RNPEEvents
|
|
16
|
+
import com.reactnativepayengine.v2.securefields.RNPEField
|
|
17
|
+
import kotlin.concurrent.thread
|
|
18
|
+
|
|
19
|
+
public class RNPECreditCardView(private val context: ThemedReactContext, private val activity: Activity?) : LinearLayout(context) {
|
|
20
|
+
|
|
21
|
+
private var view: PEPaymentView? = null
|
|
22
|
+
private var additionalFields: MutableList<RNPEField> = mutableListOf()
|
|
23
|
+
|
|
24
|
+
init {
|
|
25
|
+
this.orientation = VERTICAL
|
|
26
|
+
val layoutParams = LayoutParams(
|
|
27
|
+
LayoutParams.MATCH_PARENT,
|
|
28
|
+
0
|
|
29
|
+
)
|
|
30
|
+
this.layoutParams = layoutParams
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
fun setAdditionalFields(additionalFields: List<RNPEField>) {
|
|
34
|
+
this.additionalFields = additionalFields.toMutableList()
|
|
35
|
+
this.setupView()
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
private fun setupView() {
|
|
39
|
+
view = RNPayEngineNative.instance?.createSecureView(activity as Context, this.additionalFields.map { it.toNative() })
|
|
40
|
+
if (view != null) {
|
|
41
|
+
this.addView(view)
|
|
42
|
+
view!!.setSizeChangeListener(object: PESizeChangeListener {
|
|
43
|
+
override fun onSizeChanged(width: Int, height: Int) {
|
|
44
|
+
val params = Arguments.createMap().apply {
|
|
45
|
+
putInt("width", MetricsUtil.convertPixelsToDp(width.toFloat(), context).toInt())
|
|
46
|
+
putInt("height", MetricsUtil.convertPixelsToDp(height.toFloat(), context).toInt())
|
|
47
|
+
}
|
|
48
|
+
context
|
|
49
|
+
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
50
|
+
.emit(RNPEEvents.ON_SIZE_CHANGES, params)
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
fun submit(merchantId: String, additionalData: ReadableMap, callback: (CardResponse) -> Unit) {
|
|
58
|
+
if (view == null) {
|
|
59
|
+
callback(CardResponse("FAILED", null, "View is null"))
|
|
60
|
+
return
|
|
61
|
+
}
|
|
62
|
+
thread {
|
|
63
|
+
view?.tokenize(merchantId, additionalData.toHashMap()) { card ->
|
|
64
|
+
callback(card)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
fun showKeyboard() {
|
|
70
|
+
view?.showKeyboard()
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
fun hideKeyboard() {
|
|
74
|
+
view?.hideKeyboard()
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
package com.reactnativepayengine.v2.securefields.creditcard
|
|
2
|
+
|
|
3
|
+
import android.util.Log
|
|
4
|
+
import com.facebook.react.bridge.Arguments
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
+
import com.facebook.react.bridge.ReadableArray
|
|
7
|
+
import com.facebook.react.modules.core.DeviceEventManagerModule.RCTDeviceEventEmitter
|
|
8
|
+
import com.facebook.react.uimanager.SimpleViewManager
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
10
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
11
|
+
import com.google.gson.Gson
|
|
12
|
+
import com.reactnativepayengine.v2.securefields.RNPEEvents
|
|
13
|
+
import com.reactnativepayengine.v2.securefields.RNPEField
|
|
14
|
+
import org.json.JSONArray
|
|
15
|
+
|
|
16
|
+
class RNPECreditCardViewManager: SimpleViewManager<RNPECreditCardView> {
|
|
17
|
+
private var context: ReactApplicationContext
|
|
18
|
+
|
|
19
|
+
@ReactProp(name = "additionalFields")
|
|
20
|
+
fun setPlaceholder(view: RNPECreditCardView, jsonString: String?) {
|
|
21
|
+
val additionalFields: MutableList<RNPEField> = mutableListOf()
|
|
22
|
+
try {
|
|
23
|
+
val jsonArray = JSONArray(jsonString)
|
|
24
|
+
for (i in 0 until jsonArray.length()) {
|
|
25
|
+
val jsonObject = jsonArray.getJSONObject(i)
|
|
26
|
+
val name = jsonObject.getString("name")
|
|
27
|
+
val type = jsonObject.getString("type")
|
|
28
|
+
val placeholder = jsonObject.getString("placeholder")
|
|
29
|
+
val keyboardType = jsonObject.getString("keyboardType")
|
|
30
|
+
val isRequired = jsonObject.getBoolean("isRequired")
|
|
31
|
+
val pattern = jsonObject.optString("pattern")
|
|
32
|
+
val field = RNPEField(name, type, placeholder, keyboardType, isRequired, pattern)
|
|
33
|
+
additionalFields.add(field)
|
|
34
|
+
}
|
|
35
|
+
} catch (e: Exception) {
|
|
36
|
+
Log.e("PE", "Error parsing additional fields", e)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
view.setAdditionalFields(additionalFields)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
constructor(context: ReactApplicationContext) : super() {
|
|
44
|
+
this.context = context
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
override fun getName(): String {
|
|
48
|
+
return REACT_CLASS;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
override fun createViewInstance(reactContext: ThemedReactContext): RNPECreditCardView {
|
|
52
|
+
return RNPECreditCardView(reactContext, context.currentActivity)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
override fun getCommandsMap() = mapOf(
|
|
56
|
+
"submit" to COMMAND_SUBMIT,
|
|
57
|
+
"showKeyboard" to COMMAND_SHOW_KEYBOARD,
|
|
58
|
+
"hideKeyboard" to COMMAND_HIDE_KEYBOARD
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
override fun receiveCommand(root: RNPECreditCardView, commandId: String?, args: ReadableArray?) {
|
|
62
|
+
super.receiveCommand(root, commandId, args)
|
|
63
|
+
Log.d("PE", "Received command $commandId")
|
|
64
|
+
when (commandId?.toInt()) {
|
|
65
|
+
COMMAND_SUBMIT -> {
|
|
66
|
+
val merchantId = args!!.getString(0)
|
|
67
|
+
val additionalData = args!!.getMap(1)
|
|
68
|
+
root.submit(merchantId, additionalData) { card ->
|
|
69
|
+
if (card.STATUS == "FAILED") {
|
|
70
|
+
val params = Arguments.createMap().apply {
|
|
71
|
+
putString("error", card.ERROR.toString())
|
|
72
|
+
}
|
|
73
|
+
context
|
|
74
|
+
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
75
|
+
.emit(RNPEEvents.ON_CARD_RESPOND, params)
|
|
76
|
+
} else {
|
|
77
|
+
val json = Gson().toJson(card.DATA)
|
|
78
|
+
val params = Arguments.createMap().apply {
|
|
79
|
+
putString("card", json)
|
|
80
|
+
}
|
|
81
|
+
context
|
|
82
|
+
.getJSModule(RCTDeviceEventEmitter::class.java)
|
|
83
|
+
.emit(RNPEEvents.ON_CARD_RESPOND, params)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
COMMAND_SHOW_KEYBOARD -> {
|
|
88
|
+
root.showKeyboard()
|
|
89
|
+
}
|
|
90
|
+
COMMAND_HIDE_KEYBOARD -> {
|
|
91
|
+
root.hideKeyboard()
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
companion object {
|
|
97
|
+
private const val REACT_CLASS = "RNPECreditCardView"
|
|
98
|
+
private const val COMMAND_SUBMIT = 1
|
|
99
|
+
private const val COMMAND_SHOW_KEYBOARD = 2
|
|
100
|
+
private const val COMMAND_HIDE_KEYBOARD = 3
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>AvailableLibraries</key>
|
|
6
|
+
<array>
|
|
7
|
+
<dict>
|
|
8
|
+
<key>BinaryPath</key>
|
|
9
|
+
<string>PayEngineSDK.framework/PayEngineSDK</string>
|
|
10
|
+
<key>LibraryIdentifier</key>
|
|
11
|
+
<string>ios-arm64_x86_64-simulator</string>
|
|
12
|
+
<key>LibraryPath</key>
|
|
13
|
+
<string>PayEngineSDK.framework</string>
|
|
14
|
+
<key>SupportedArchitectures</key>
|
|
15
|
+
<array>
|
|
16
|
+
<string>arm64</string>
|
|
17
|
+
<string>x86_64</string>
|
|
18
|
+
</array>
|
|
19
|
+
<key>SupportedPlatform</key>
|
|
20
|
+
<string>ios</string>
|
|
21
|
+
<key>SupportedPlatformVariant</key>
|
|
22
|
+
<string>simulator</string>
|
|
23
|
+
</dict>
|
|
24
|
+
<dict>
|
|
25
|
+
<key>BinaryPath</key>
|
|
26
|
+
<string>PayEngineSDK.framework/PayEngineSDK</string>
|
|
27
|
+
<key>LibraryIdentifier</key>
|
|
28
|
+
<string>ios-arm64</string>
|
|
29
|
+
<key>LibraryPath</key>
|
|
30
|
+
<string>PayEngineSDK.framework</string>
|
|
31
|
+
<key>SupportedArchitectures</key>
|
|
32
|
+
<array>
|
|
33
|
+
<string>arm64</string>
|
|
34
|
+
</array>
|
|
35
|
+
<key>SupportedPlatform</key>
|
|
36
|
+
<string>ios</string>
|
|
37
|
+
</dict>
|
|
38
|
+
</array>
|
|
39
|
+
<key>CFBundlePackageType</key>
|
|
40
|
+
<string>XFWK</string>
|
|
41
|
+
<key>XCFrameworkFormatVersion</key>
|
|
42
|
+
<string>1.0</string>
|
|
43
|
+
</dict>
|
|
44
|
+
</plist>
|