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
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { NativeModules, Platform } from 'react-native';
|
|
2
|
-
import type {
|
|
3
|
-
GooglePayAllowedCardAuthMethods,
|
|
4
|
-
GooglePayAllowedCardNetworks,
|
|
5
|
-
GooglePayRequestData,
|
|
6
|
-
IGooglePay,
|
|
7
|
-
} from './interfaces';
|
|
8
|
-
|
|
9
|
-
const { GooglePay: RNGooglePay } = NativeModules;
|
|
10
|
-
|
|
11
|
-
export default class GooglePay implements IGooglePay {
|
|
12
|
-
constructor() {
|
|
13
|
-
if (Platform.OS === 'android') {
|
|
14
|
-
if (!RNGooglePay) {
|
|
15
|
-
throw new Error('GooglePay is not defined');
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
throw new Error('Google Pay is not supported (Android only)');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public async setProduction(isProduction: boolean) {
|
|
23
|
-
return RNGooglePay.setEnvironment(isProduction ? 1 : 3);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public async canMakePayments(
|
|
27
|
-
allowedCardNetworks: GooglePayAllowedCardNetworks,
|
|
28
|
-
allowedCardAuthMethods: GooglePayAllowedCardAuthMethods
|
|
29
|
-
) {
|
|
30
|
-
return await RNGooglePay.isReadyToPay(
|
|
31
|
-
allowedCardNetworks,
|
|
32
|
-
allowedCardAuthMethods
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
public async start(requestData: GooglePayRequestData) {
|
|
37
|
-
return await RNGooglePay.requestPayment(requestData);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export interface IGooglePay {
|
|
2
|
-
canMakePayments: (...args: any) => Promise<boolean>
|
|
3
|
-
start: (...args: any) => Promise<any>
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
type NetworkType = 'AMEX' | 'DISCOVER' | 'JCB' | 'MASTERCARD' | 'VISA';
|
|
7
|
-
type MethodType = 'PAN_ONLY' | 'CRYPTOGRAM_3DS';
|
|
8
|
-
|
|
9
|
-
export type GooglePayAllowedCardNetworks = NetworkType[];
|
|
10
|
-
|
|
11
|
-
export type GooglePayAllowedCardAuthMethods = MethodType[];
|
|
12
|
-
|
|
13
|
-
export type TokenizationSpecificationType = 'PAYMENT_GATEWAY' | 'DIRECT';
|
|
14
|
-
|
|
15
|
-
export interface GooglePayRequestData {
|
|
16
|
-
production?: boolean,
|
|
17
|
-
cardPaymentMethod: {
|
|
18
|
-
tokenizationSpecification: {
|
|
19
|
-
type: TokenizationSpecificationType;
|
|
20
|
-
/** only with type: PAYMENT_GATEWAY */
|
|
21
|
-
gateway?: string;
|
|
22
|
-
/** only with type: PAYMENT_GATEWAY */
|
|
23
|
-
gatewayMerchantId?: string;
|
|
24
|
-
/** only with gateway: stripe */
|
|
25
|
-
stripe?: {
|
|
26
|
-
publishableKey: string;
|
|
27
|
-
version: string;
|
|
28
|
-
};
|
|
29
|
-
/** only with type: DIRECT */
|
|
30
|
-
publicKey?: string;
|
|
31
|
-
};
|
|
32
|
-
allowedCardNetworks: GooglePayAllowedCardNetworks;
|
|
33
|
-
allowedCardAuthMethods: GooglePayAllowedCardAuthMethods;
|
|
34
|
-
};
|
|
35
|
-
transaction: {
|
|
36
|
-
totalPrice: string;
|
|
37
|
-
totalPriceStatus: string;
|
|
38
|
-
currencyCode: string;
|
|
39
|
-
countryCode: string;
|
|
40
|
-
};
|
|
41
|
-
merchantName: string;
|
|
42
|
-
}
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Text, View, StyleSheet, ActivityIndicator } from 'react-native';
|
|
3
|
-
import eventEmitter from 'events';
|
|
4
|
-
import { WebView } from 'react-native-webview';
|
|
5
|
-
import { createHttpClient, getHttpHeaders } from '../../utils/index';
|
|
6
|
-
import type { CreditCardFormMethods, CreditCardFormProps } from '../../interfaces/index';
|
|
7
|
-
import LoadingIndicator from '../LoadingIndicator';
|
|
8
|
-
|
|
9
|
-
const emitter = new eventEmitter();
|
|
10
|
-
|
|
11
|
-
class CardError extends Error {
|
|
12
|
-
public data: any = null;
|
|
13
|
-
|
|
14
|
-
constructor(data: any) {
|
|
15
|
-
super('Failed to create card')
|
|
16
|
-
this.data = data
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const CreditCardFormLegacy = React.forwardRef<CreditCardFormMethods, CreditCardFormProps>((props, ref) => {
|
|
21
|
-
const webviewRef = React.createRef<WebView>()
|
|
22
|
-
|
|
23
|
-
const [loading, setLoading] = React.useState(true)
|
|
24
|
-
const [error, setError] = React.useState("")
|
|
25
|
-
const [html, setHtml] = React.useState("")
|
|
26
|
-
const [webviewResponse, setWebviewResponse] = React.useState<any>()
|
|
27
|
-
|
|
28
|
-
React.useImperativeHandle(ref, () => ({
|
|
29
|
-
createCard: async (merchantId?: string) => {
|
|
30
|
-
setWebviewResponse(null)
|
|
31
|
-
const headers = getHttpHeaders(props.config)
|
|
32
|
-
const script = `
|
|
33
|
-
submit(${merchantId ? '"' + merchantId + '"' : 'null'}, '${headers.Authorization}');
|
|
34
|
-
`
|
|
35
|
-
return new Promise((resolve, reject) => {
|
|
36
|
-
console.log({ emitter })
|
|
37
|
-
emitter.once('pe.card_response', (data, isError) => {
|
|
38
|
-
if (isError) {
|
|
39
|
-
reject(new CardError(data))
|
|
40
|
-
} else {
|
|
41
|
-
resolve(data)
|
|
42
|
-
}
|
|
43
|
-
})
|
|
44
|
-
webviewRef.current?.injectJavaScript(script)
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
},
|
|
48
|
-
}), [props.config, webviewRef, webviewResponse]);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
React.useEffect(() => {
|
|
53
|
-
const configure = async () => {
|
|
54
|
-
setLoading(true)
|
|
55
|
-
try {
|
|
56
|
-
const http = createHttpClient(props.config)
|
|
57
|
-
const resp = await http.get('/api/setting/secure-fields')
|
|
58
|
-
const { vault, environment, cname, vgs_satellite_port } = resp.data.data
|
|
59
|
-
|
|
60
|
-
setHtml(createVGSCollectFormHTML(Boolean(props.showZipCode), vault, environment, cname, vgs_satellite_port))
|
|
61
|
-
} catch (e: any) {
|
|
62
|
-
console.log({ error: e })
|
|
63
|
-
setError(e.message)
|
|
64
|
-
} finally {
|
|
65
|
-
setLoading(false)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
configure()
|
|
70
|
-
}, [])
|
|
71
|
-
|
|
72
|
-
const onMessage = (payload: any) => {
|
|
73
|
-
let dataPayload;
|
|
74
|
-
try {
|
|
75
|
-
dataPayload = JSON.parse(payload.nativeEvent.data);
|
|
76
|
-
} catch (e) { }
|
|
77
|
-
|
|
78
|
-
if (dataPayload) {
|
|
79
|
-
console.log({ dataPayload })
|
|
80
|
-
switch (dataPayload.type) {
|
|
81
|
-
case 'PayEngineCardResponse':
|
|
82
|
-
emitter.emit('pe.card_response', dataPayload.data, dataPayload.isError)
|
|
83
|
-
break
|
|
84
|
-
default:
|
|
85
|
-
break
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
if (loading || !html) {
|
|
91
|
-
return <ActivityIndicator />
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<>
|
|
96
|
-
<View style={[styles.container, { height: props.showZipCode ? 270 : 215 }]}>
|
|
97
|
-
<WebView
|
|
98
|
-
ref={webviewRef}
|
|
99
|
-
originWhitelist={['*']}
|
|
100
|
-
source={{
|
|
101
|
-
html: html,
|
|
102
|
-
}}
|
|
103
|
-
scalesPageToFit={false}
|
|
104
|
-
style={{ backgroundColor: 'transparent' }}
|
|
105
|
-
bounces={false}
|
|
106
|
-
scrollEnabled={false}
|
|
107
|
-
renderLoading={LoadingIndicator}
|
|
108
|
-
startInLoadingState={true}
|
|
109
|
-
onMessage={onMessage}
|
|
110
|
-
/>
|
|
111
|
-
</View>
|
|
112
|
-
{error.length ? <Text>{error}</Text> : <></>}
|
|
113
|
-
</>
|
|
114
|
-
);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
export default CreditCardFormLegacy;
|
|
118
|
-
|
|
119
|
-
const styles = StyleSheet.create({
|
|
120
|
-
container: {
|
|
121
|
-
width: '100%',
|
|
122
|
-
padding: 20,
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
const createVGSCollectFormHTML = (showZipCode: boolean, vault: string, environment: string, cname: string, vgs_satellite_port: string) => `
|
|
127
|
-
<!DOCTYPE html>
|
|
128
|
-
<html lang="en">
|
|
129
|
-
<head>
|
|
130
|
-
<meta charset="UTF-8">
|
|
131
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
132
|
-
<title>Credit Card Form</title>
|
|
133
|
-
<script type="text/javascript" src="https://js.verygoodvault.com/vgs-collect/2.16.0/vgs-collect.js"></script>
|
|
134
|
-
|
|
135
|
-
<style>
|
|
136
|
-
html, body {
|
|
137
|
-
margin: 0;
|
|
138
|
-
padding: 0;
|
|
139
|
-
background: transparent;
|
|
140
|
-
}
|
|
141
|
-
.row {
|
|
142
|
-
display: flex;
|
|
143
|
-
gap: 10px;
|
|
144
|
-
}
|
|
145
|
-
.col {
|
|
146
|
-
flex: 1;
|
|
147
|
-
}
|
|
148
|
-
.form-group {
|
|
149
|
-
margin-bottom: 10px;
|
|
150
|
-
}
|
|
151
|
-
.form-field {
|
|
152
|
-
display: block;
|
|
153
|
-
width: 100%;
|
|
154
|
-
height: 50px;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
.form-field iframe {
|
|
158
|
-
border: 0 none transparent;
|
|
159
|
-
height: 100%;
|
|
160
|
-
vertical-align: middle;
|
|
161
|
-
width: 100%;
|
|
162
|
-
}
|
|
163
|
-
</style>
|
|
164
|
-
</head>
|
|
165
|
-
<body>
|
|
166
|
-
<form id="cc-form">
|
|
167
|
-
<div class="form-group">
|
|
168
|
-
<span id="card_holder" class="form-field">
|
|
169
|
-
</span>
|
|
170
|
-
</div>
|
|
171
|
-
<div class="form-group">
|
|
172
|
-
<span id="card_number" class="form-field"></span>
|
|
173
|
-
</div>
|
|
174
|
-
<div class="row">
|
|
175
|
-
<div class="form-group">
|
|
176
|
-
<span id="card_exp" class="form-field"></span>
|
|
177
|
-
</div>
|
|
178
|
-
<div class="form-group">
|
|
179
|
-
<span id="card_cvc" class="form-field"></span>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
${showZipCode ? `<div class="form-group">
|
|
183
|
-
<span id="address_zip" class="form-field"></span>
|
|
184
|
-
</div>` : ''}
|
|
185
|
-
</form>
|
|
186
|
-
|
|
187
|
-
<script>
|
|
188
|
-
const css = {
|
|
189
|
-
color: '#000',
|
|
190
|
-
border: '#CCC 1px solid',
|
|
191
|
-
'border-radius': '5px',
|
|
192
|
-
'text-transform': 'uppercase',
|
|
193
|
-
padding: '5px 10px',
|
|
194
|
-
'box-sizing': 'border-box',
|
|
195
|
-
'font-size': '1em',
|
|
196
|
-
'caret-color': 'transparent',
|
|
197
|
-
'&:focus': {
|
|
198
|
-
'border-color': '#999',
|
|
199
|
-
},
|
|
200
|
-
'&.invalid.touched': {
|
|
201
|
-
'border-color': 'red',
|
|
202
|
-
},
|
|
203
|
-
'&.valid': {
|
|
204
|
-
'border-color': '#CCC',
|
|
205
|
-
},
|
|
206
|
-
}
|
|
207
|
-
const form = VGSCollect.create('${vault}', '${environment}', function(state) {});
|
|
208
|
-
alert('${cname}')
|
|
209
|
-
form.useCname('${cname}')
|
|
210
|
-
// form.connectSatellite(parseInt(${vgs_satellite_port}) ?? 9098)
|
|
211
|
-
form.field('#card_holder', {
|
|
212
|
-
type: 'text',
|
|
213
|
-
name: 'card_holder',
|
|
214
|
-
placeholder: 'Card holder name',
|
|
215
|
-
validations: ['required'],
|
|
216
|
-
css
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
const cardElement = form.field('#card_number', {
|
|
220
|
-
type: 'card-number',
|
|
221
|
-
name: 'card_number',
|
|
222
|
-
placeholder: 'Card number',
|
|
223
|
-
validations: ['required', 'validCardNumber'],
|
|
224
|
-
showCardIcon: true,
|
|
225
|
-
css
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
const cvcElement = form.field('#card_cvc', {
|
|
229
|
-
type: 'card-security-code',
|
|
230
|
-
name: 'card_cvc',
|
|
231
|
-
placeholder: 'CVC',
|
|
232
|
-
validations: ['required', 'validCardSecurityCode'],
|
|
233
|
-
showCardIcon: true,
|
|
234
|
-
css
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
cardElement.setCVCDependency(cvcElement);
|
|
238
|
-
|
|
239
|
-
form.field('#card_exp', {
|
|
240
|
-
type: 'card-expiration-date',
|
|
241
|
-
name: 'card_exp',
|
|
242
|
-
placeholder: 'Exp date',
|
|
243
|
-
validations: ['required', 'validCardExpirationDate'],
|
|
244
|
-
css
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
${showZipCode ? `
|
|
248
|
-
form.field('#address_zip', {
|
|
249
|
-
type: 'text',
|
|
250
|
-
name: 'address_zip',
|
|
251
|
-
placeholder: 'Zip code',
|
|
252
|
-
maxLength: 7,
|
|
253
|
-
validations: ['required', 'postal_code/us,ca'],
|
|
254
|
-
css
|
|
255
|
-
});
|
|
256
|
-
` : ''}
|
|
257
|
-
|
|
258
|
-
const sendNative = (data, isError) => {
|
|
259
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
260
|
-
type: 'PayEngineCardResponse',
|
|
261
|
-
data: data,
|
|
262
|
-
isError: isError
|
|
263
|
-
}))
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
function submit(merchantId, authHeader) {
|
|
267
|
-
form.submit('/api/cards', {
|
|
268
|
-
method: 'POST',
|
|
269
|
-
data: {
|
|
270
|
-
brand: form.state.card_number.cardType,
|
|
271
|
-
last_4: form.state.card_number.last4,
|
|
272
|
-
bin: form.state.card_number.bin,
|
|
273
|
-
pci_vault_provider: 'vgs',
|
|
274
|
-
merchant_id: merchantId,
|
|
275
|
-
},
|
|
276
|
-
headers: {
|
|
277
|
-
Authorization: authHeader
|
|
278
|
-
}
|
|
279
|
-
}, (status, data) => {
|
|
280
|
-
if (status === 200) {
|
|
281
|
-
sendNative(data, false)
|
|
282
|
-
} else {
|
|
283
|
-
sendNative({ data, status }, true)
|
|
284
|
-
}
|
|
285
|
-
}, error => {
|
|
286
|
-
sendNative(error, true)
|
|
287
|
-
})
|
|
288
|
-
return true
|
|
289
|
-
}
|
|
290
|
-
</script>
|
|
291
|
-
</body>
|
|
292
|
-
</html>`;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
|
-
import { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface CVCFieldProps {
|
|
8
|
-
placeholder?: string
|
|
9
|
-
style?: StyleProp<ViewStyle>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
class CVCField extends PureComponent<CVCFieldProps> {
|
|
13
|
-
|
|
14
|
-
render() {
|
|
15
|
-
return <RTCCVCField {...this.props} />
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const RTCCVCField = requireNativeComponent('VGSCVCField');
|
|
20
|
-
|
|
21
|
-
export default CVCField;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
|
-
import { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface CardHolderNameFieldProps {
|
|
8
|
-
placeholder?: string
|
|
9
|
-
style?: StyleProp<ViewStyle>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
class CardHolderNameField extends PureComponent<CardHolderNameFieldProps> {
|
|
13
|
-
|
|
14
|
-
render() {
|
|
15
|
-
return <RTCCardHolderNameField {...this.props} />
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const RTCCardHolderNameField = requireNativeComponent('VGSCardHolderNameField');
|
|
20
|
-
|
|
21
|
-
export default CardHolderNameField;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
|
-
import { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface CardNumberFieldProps {
|
|
8
|
-
placeholder?: string
|
|
9
|
-
style?: StyleProp<ViewStyle>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
class CardNumberField extends PureComponent<CardNumberFieldProps> {
|
|
13
|
-
|
|
14
|
-
render() {
|
|
15
|
-
return <RTCCardNumberField {...this.props} />
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const RTCCardNumberField = requireNativeComponent('VGSCardNumberField');
|
|
20
|
-
|
|
21
|
-
export default CardNumberField;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Text, NativeModules } from 'react-native';
|
|
3
|
-
import { createHttpClient } from '../../../utils';
|
|
4
|
-
import type { IPayEngineConfig } from '../../../interfaces/index';
|
|
5
|
-
|
|
6
|
-
const NativeVGSCollectManager = NativeModules.VGSCollectManager;
|
|
7
|
-
|
|
8
|
-
export interface CollectManagerProps {
|
|
9
|
-
config: IPayEngineConfig;
|
|
10
|
-
children: JSX.Element | JSX.Element[];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface VGSCollectManagerMethods {
|
|
14
|
-
createCard: (merchantId?: string) => void;
|
|
15
|
-
cardBankAccount: (merchantId?: string) => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const CollectManager = React.forwardRef<
|
|
19
|
-
VGSCollectManagerMethods,
|
|
20
|
-
CollectManagerProps
|
|
21
|
-
>((props, ref) => {
|
|
22
|
-
React.useImperativeHandle(ref, () => ({
|
|
23
|
-
createCard: (merchantId?: string) => {
|
|
24
|
-
return NativeVGSCollectManager.createCard(merchantId);
|
|
25
|
-
},
|
|
26
|
-
cardBankAccount: (merchantId?: string) => {
|
|
27
|
-
return NativeVGSCollectManager.createBankAccount(merchantId);
|
|
28
|
-
},
|
|
29
|
-
}));
|
|
30
|
-
|
|
31
|
-
const [loading, setLoading] = React.useState(true);
|
|
32
|
-
const [error, setError] = React.useState('');
|
|
33
|
-
|
|
34
|
-
React.useEffect(() => {
|
|
35
|
-
const configure = async () => {
|
|
36
|
-
setLoading(true);
|
|
37
|
-
try {
|
|
38
|
-
const http = createHttpClient(props.config);
|
|
39
|
-
const resp = await http.get('/api/setting/secure-fields');
|
|
40
|
-
const { vault, environment, cname, vgs_satellite_port } =
|
|
41
|
-
resp.data.data;
|
|
42
|
-
|
|
43
|
-
NativeVGSCollectManager.setConfiguration(
|
|
44
|
-
props.config.publicKey,
|
|
45
|
-
vault,
|
|
46
|
-
environment,
|
|
47
|
-
cname.replace(/[^a-zA-Z\.]/g, ''),
|
|
48
|
-
Number(vgs_satellite_port)
|
|
49
|
-
);
|
|
50
|
-
} catch (e: any) {
|
|
51
|
-
console.log({ error: e });
|
|
52
|
-
setError(e.message);
|
|
53
|
-
} finally {
|
|
54
|
-
setLoading(false);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
configure();
|
|
59
|
-
}, []);
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<React.Fragment>
|
|
63
|
-
{loading ? (
|
|
64
|
-
<Text>Loading</Text>
|
|
65
|
-
) : error.length ? (
|
|
66
|
-
<Text>{error}</Text>
|
|
67
|
-
) : (
|
|
68
|
-
props.children
|
|
69
|
-
)}
|
|
70
|
-
</React.Fragment>
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
export default CollectManager;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
|
-
import { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface ExpDateFieldProps {
|
|
8
|
-
placeholder?: string
|
|
9
|
-
style?: StyleProp<ViewStyle>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
class ExpDateField extends PureComponent<ExpDateFieldProps> {
|
|
13
|
-
|
|
14
|
-
render() {
|
|
15
|
-
return <RTCExpDateField {...this.props} />
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const RTCExpDateField = requireNativeComponent('VGSExpDateField');
|
|
20
|
-
|
|
21
|
-
export default ExpDateField;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React, { PureComponent } from 'react';
|
|
2
|
-
import { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
interface TextFieldProps {
|
|
7
|
-
name?: string
|
|
8
|
-
placeholder?: string
|
|
9
|
-
maxLength?: number
|
|
10
|
-
pattern?: string
|
|
11
|
-
style?: StyleProp<ViewStyle>
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
class TextField extends PureComponent<TextFieldProps> {
|
|
15
|
-
|
|
16
|
-
constructor(props: TextFieldProps) {
|
|
17
|
-
super(props)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
render() {
|
|
21
|
-
return <RTCTextField {...this.props} />
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const RTCTextField = requireNativeComponent('VGSTextField');
|
|
26
|
-
|
|
27
|
-
export default TextField;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
|
-
import { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
interface ZipCodeFieldProps {
|
|
8
|
-
placeholder?: string
|
|
9
|
-
style?: StyleProp<ViewStyle>
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
class ZipCodeField extends PureComponent<ZipCodeFieldProps> {
|
|
13
|
-
|
|
14
|
-
render() {
|
|
15
|
-
return <RTCZipCodeField {...this.props} />
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const RTCZipCodeField = requireNativeComponent('VGSZipCodeField');
|
|
20
|
-
|
|
21
|
-
export default ZipCodeField;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import CardNumberField from "./VGS/CardNumberField";
|
|
2
|
-
import CVCField from "./VGS/CVCField";
|
|
3
|
-
import ExpDateTextField from "./VGS/ExpDateField";
|
|
4
|
-
import CollectManager from "./VGS/CollectManager";
|
|
5
|
-
import TextField from './VGS/TextField';
|
|
6
|
-
import CardHolderNameField from './VGS/CardHolderNameField';
|
|
7
|
-
import ZipCodeField from './VGS/ZipCodeField';
|
|
8
|
-
|
|
9
|
-
export const SecureFields = {
|
|
10
|
-
CollectManager,
|
|
11
|
-
ExpDateTextField,
|
|
12
|
-
CardNumberField,
|
|
13
|
-
CVCField,
|
|
14
|
-
CardHolderNameField,
|
|
15
|
-
ZipCodeField,
|
|
16
|
-
TextField
|
|
17
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|