react-native-payengine 1.0.6 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -111
- 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 +318 -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 +24 -3
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/paymentsdk-debug.aar +0 -0
- package/android/paymentsdk-release.aar +0 -0
- package/android/src/main/java/com/reactnativepayengine/PayengineModule.java +1 -5
- package/android/src/main/java/com/reactnativepayengine/PayenginePackage.java +7 -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 +71 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEEvents.kt +8 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEField.kt +17 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNBankAccountViewManager.kt +103 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNPEBankAccountView.kt +77 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardView.kt +77 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardViewManager.kt +103 -0
- package/ios/PayEngineSDK.xcframework/Info.plist +44 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +622 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/module.modulemap +11 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/browserInfo.html +136 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/perform3ds.html +467 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +1240 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/module.modulemap +11 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/browserInfo.html +136 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/perform3ds.html +467 -0
- package/ios/Payengine.xcodeproj/project.pbxproj +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/{SecureFields/VGS/ExpDateField.js → v2/ApplePay/PEApplePayButton.js} +38 -13
- package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js +29 -0
- package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
- package/lib/commonjs/components/v2/PayEngineNative.js +34 -0
- package/lib/commonjs/components/v2/PayEngineNative.js.map +1 -0
- package/lib/commonjs/components/{SecureFields/VGS/TextField.js → v2/PayEngineProvider.js} +28 -12
- package/lib/commonjs/components/v2/PayEngineProvider.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js +89 -0
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js +90 -0
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/IPEField.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/IPEField.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PECard.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/PECard.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js +18 -0
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
- package/lib/commonjs/index.js +54 -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 +37 -0
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/module/components/v2/ApplePay/PEPaymentRequest.js +20 -0
- package/lib/module/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
- package/lib/module/components/v2/PayEngineNative.js +23 -0
- package/lib/module/components/v2/PayEngineNative.js.map +1 -0
- package/lib/module/components/v2/PayEngineProvider.js +30 -0
- package/lib/module/components/v2/PayEngineProvider.js.map +1 -0
- package/lib/module/components/v2/SecureFields/BankAccountView.js +75 -0
- package/lib/module/components/v2/SecureFields/BankAccountView.js.map +1 -0
- package/lib/module/components/v2/SecureFields/CreditCardView.js +76 -0
- package/lib/module/components/v2/SecureFields/CreditCardView.js.map +1 -0
- package/lib/module/components/v2/SecureFields/IPEField.js +2 -0
- package/lib/module/components/v2/SecureFields/IPEField.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PEBankAccount.js +2 -0
- package/lib/module/components/v2/SecureFields/PEBankAccount.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PECard.js +2 -0
- package/lib/module/components/v2/SecureFields/PECard.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js +11 -0
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
- package/lib/module/index.js +14 -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/ApplePay/PEPaymentRequest.d.ts +12 -0
- package/lib/typescript/components/v2/PayEngineNative.d.ts +5 -0
- package/lib/typescript/components/v2/PayEngineProvider.d.ts +8 -0
- package/lib/typescript/components/v2/SecureFields/BankAccountView.d.ts +14 -0
- package/lib/typescript/components/v2/SecureFields/CreditCardView.d.ts +14 -0
- package/lib/typescript/components/v2/SecureFields/IPEField.d.ts +10 -0
- package/lib/typescript/components/v2/SecureFields/PEBankAccount.d.ts +11 -0
- package/lib/typescript/components/v2/SecureFields/PECard.d.ts +13 -0
- package/lib/typescript/components/v2/SecureFields/PEKeyboardType.d.ts +7 -0
- package/lib/typescript/index.d.ts +12 -6
- package/lib/typescript/interfaces/index.d.ts +0 -27
- package/lib/typescript/utils/index.d.ts +3 -36
- package/package.json +12 -7
- package/react-native-payengine.podspec +2 -2
- package/src/components/PayEngine.tsx +5 -118
- package/src/components/v2/ApplePay/PEApplePayButton.tsx +70 -0
- package/src/components/v2/ApplePay/PEPaymentRequest.ts +18 -0
- package/src/components/v2/PayEngineNative.tsx +20 -0
- package/src/components/v2/PayEngineProvider.tsx +30 -0
- package/src/components/v2/SecureFields/BankAccountView.tsx +95 -0
- package/src/components/v2/SecureFields/CreditCardView.tsx +96 -0
- package/src/components/v2/SecureFields/IPEField.ts +12 -0
- package/src/components/v2/SecureFields/PEBankAccount.ts +12 -0
- package/src/components/v2/SecureFields/PECard.ts +14 -0
- package/src/components/v2/SecureFields/PEKeyboardType.ts +8 -0
- package/src/index.tsx +47 -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.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,13 @@
|
|
|
1
|
+
import UIKit
|
|
2
|
+
import PassKit
|
|
3
|
+
|
|
4
|
+
let borderColor = UIColor.gray
|
|
5
|
+
let errorBorderColor = UIColor.red
|
|
6
|
+
|
|
7
|
+
@objc(Payengine)
|
|
8
|
+
class Payengine: NSObject {
|
|
9
|
+
@objc(multiply:withB:withResolver:withRejecter:)
|
|
10
|
+
func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void {
|
|
11
|
+
resolve(a*b)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -9,133 +9,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
12
|
-
var _reactNativeWebview = require("react-native-webview");
|
|
13
|
-
|
|
14
|
-
var _utils = require("../utils");
|
|
15
|
-
|
|
16
|
-
var _LoadingIndicator = _interopRequireDefault(require("./LoadingIndicator"));
|
|
17
|
-
|
|
18
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
13
|
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
return `<pay-engine id="component"
|
|
23
|
-
style="z-index: 100"
|
|
24
|
-
${allowedProps.map(propName => `${propName}="${props[propName]}"`).join(' ')}
|
|
25
|
-
></pay-engine>`;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const generateHTML = (scriptURL, props) => {
|
|
29
|
-
return `<!DOCTYPE html>
|
|
30
|
-
<html>
|
|
31
|
-
<head>
|
|
32
|
-
<title>PayEngine Elements</title>
|
|
33
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
34
|
-
<script src="${scriptURL}" async defer type="text/javascript"></script>
|
|
35
|
-
</head>
|
|
36
|
-
<body>
|
|
37
|
-
${getHtmlTag(props)}
|
|
38
|
-
<script>
|
|
39
|
-
setInterval(function() {
|
|
40
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
41
|
-
type: 'PayEngine-height',
|
|
42
|
-
height: document.body.scrollHeight
|
|
43
|
-
}))
|
|
44
|
-
}, 500);
|
|
45
|
-
</script>
|
|
46
|
-
</body>
|
|
47
|
-
</html>`;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const PayEngine = props => {
|
|
51
|
-
const [scriptURL] = _react.default.useState((0, _utils.getScriptURL)(props.config));
|
|
52
|
-
|
|
53
|
-
const [height, setHeight] = _react.default.useState(30);
|
|
54
|
-
|
|
55
|
-
const html = generateHTML(scriptURL, props);
|
|
56
|
-
|
|
57
|
-
const onMessage = payload => {
|
|
58
|
-
var _props$events;
|
|
59
|
-
|
|
60
|
-
const isDebug = props.config.logLevel > 0;
|
|
61
|
-
let dataPayload;
|
|
62
|
-
|
|
63
|
-
try {
|
|
64
|
-
dataPayload = JSON.parse(payload.nativeEvent.data);
|
|
65
|
-
} catch (e) {}
|
|
66
|
-
|
|
67
|
-
if (dataPayload) {
|
|
68
|
-
switch (dataPayload.type) {
|
|
69
|
-
case 'Console':
|
|
70
|
-
if (isDebug) {
|
|
71
|
-
console.info(`[Console] ${JSON.stringify(dataPayload.data)}`);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
break;
|
|
75
|
-
|
|
76
|
-
case 'PayEngine':
|
|
77
|
-
const {
|
|
78
|
-
type,
|
|
79
|
-
detail
|
|
80
|
-
} = dataPayload.event;
|
|
81
|
-
|
|
82
|
-
if ((_props$events = props.events) !== null && _props$events !== void 0 && _props$events[type]) {
|
|
83
|
-
var _props$events2, _props$events2$type;
|
|
84
|
-
|
|
85
|
-
(_props$events2 = props.events) === null || _props$events2 === void 0 ? void 0 : (_props$events2$type = _props$events2[type]) === null || _props$events2$type === void 0 ? void 0 : _props$events2$type.call(_props$events2, detail);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
break;
|
|
89
|
-
|
|
90
|
-
case 'PayEngine-height':
|
|
91
|
-
setHeight(dataPayload.height);
|
|
92
|
-
break;
|
|
93
|
-
|
|
94
|
-
default:
|
|
95
|
-
if (isDebug) {
|
|
96
|
-
console.log(dataPayload);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
105
|
-
style: [{
|
|
106
|
-
flex: 1,
|
|
107
|
-
height: height
|
|
108
|
-
}, props.style]
|
|
109
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
110
|
-
style: styles.yellowBox
|
|
111
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "Script URL: ", scriptURL)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
112
|
-
style: styles.yellowBox
|
|
113
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, getHtmlTag(props))), /*#__PURE__*/_react.default.createElement(_reactNativeWebview.WebView, {
|
|
114
|
-
originWhitelist: ['*'],
|
|
115
|
-
source: {
|
|
116
|
-
html: html,
|
|
117
|
-
baseUrl: ''
|
|
118
|
-
} // source={{ uri: 'https://google.com' }}
|
|
119
|
-
,
|
|
120
|
-
applicationNameForUserAgent: `PayEngine-RN/${_reactNative.Platform.OS}`,
|
|
121
|
-
injectedJavaScript: _utils.debuggingScript,
|
|
122
|
-
renderLoading: _LoadingIndicator.default,
|
|
123
|
-
startInLoadingState: true,
|
|
124
|
-
onMessage: onMessage
|
|
125
|
-
}));
|
|
14
|
+
const PayEngine = () => {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "Obsolete. Please check out the package readme");
|
|
126
16
|
};
|
|
127
17
|
|
|
128
|
-
const styles = _reactNative.StyleSheet.create({
|
|
129
|
-
yellowBox: {
|
|
130
|
-
marginVertical: 5,
|
|
131
|
-
marginHorizontal: 10,
|
|
132
|
-
padding: 10,
|
|
133
|
-
backgroundColor: 'yellow',
|
|
134
|
-
borderWidth: 1,
|
|
135
|
-
borderColor: 'yellow'
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
|
|
139
18
|
var _default = PayEngine;
|
|
140
19
|
exports.default = _default;
|
|
141
20
|
//# sourceMappingURL=PayEngine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["PayEngine"],"sources":["PayEngine.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from 'react-native';\n\nconst PayEngine = () => {\n return <Text>Obsolete. Please check out the package readme</Text>;\n};\n\nexport default PayEngine;\n"],"mappings":";;;;;;;AAAA;;AACA;;;;AAEA,MAAMA,SAAS,GAAG,MAAM;EACtB,oBAAO,6BAAC,iBAAD,wDAAP;AACD,CAFD;;eAIeA,S"}
|
package/lib/commonjs/components/{SecureFields/VGS/ExpDateField.js → v2/ApplePay/PEApplePayButton.js}
RENAMED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PEApplePayButton = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _reactNative = require("react-native");
|
|
11
11
|
|
|
@@ -13,14 +13,39 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
const RNPEApplePayButton = (0, _reactNative.requireNativeComponent)('RNPEApplePayButton');
|
|
17
|
+
const PEApplePayButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
18
|
+
React.useImperativeHandle(ref, () => ({}));
|
|
19
|
+
|
|
20
|
+
const pmError = event => {
|
|
21
|
+
if (props.onPaymentFailed) {
|
|
22
|
+
props.onPaymentFailed(new Error(event.nativeEvent.error));
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const pmTokenDidReturn = event => {
|
|
27
|
+
if (props.onTokenDidReturn) {
|
|
28
|
+
props.onTokenDidReturn(event.nativeEvent.token);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const pmSheetDidDismiss = () => {
|
|
33
|
+
if (props.onPaymentSheetDismissed) {
|
|
34
|
+
props.onPaymentSheetDismissed();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return /*#__PURE__*/React.createElement(RNPEApplePayButton, {
|
|
39
|
+
style: {
|
|
40
|
+
height: 32,
|
|
41
|
+
width: '100%',
|
|
42
|
+
...props.style
|
|
43
|
+
},
|
|
44
|
+
paymentRequest: JSON.stringify(props.paymentRequest),
|
|
45
|
+
onPmError: pmError,
|
|
46
|
+
onPmTokenDidReturn: pmTokenDidReturn,
|
|
47
|
+
onPmSheetDidDismiss: pmSheetDidDismiss
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
exports.PEApplePayButton = PEApplePayButton;
|
|
51
|
+
//# sourceMappingURL=PEApplePayButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RNPEApplePayButton","requireNativeComponent","PEApplePayButton","React","forwardRef","props","ref","useImperativeHandle","pmError","event","onPaymentFailed","Error","nativeEvent","error","pmTokenDidReturn","onTokenDidReturn","token","pmSheetDidDismiss","onPaymentSheetDismissed","height","width","style","JSON","stringify","paymentRequest"],"sources":["PEApplePayButton.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { requireNativeComponent, ViewProps } from 'react-native';\nimport type { PEPaymentRequest } from './PEPaymentRequest';\n\n\nconst RNPEApplePayButton = requireNativeComponent<NativePECreditCardViewProps>('RNPEApplePayButton');\n\ntype NativePEApplePayEvent = {\n nativeEvent: {\n error?: string;\n token?: string\n };\n};\n\ninterface NativePECreditCardViewProps extends ViewProps {\n paymentRequest: string;\n onPmSheetDidDismiss: (event: NativePEApplePayEvent) => void;\n onPmTokenDidReturn: (event: NativePEApplePayEvent) => void;\n onPmError: (event: NativePEApplePayEvent) => void;\n}\n\nexport interface PEApplePayButtonProps extends ViewProps {\n paymentRequest: PEPaymentRequest;\n onTokenDidReturn?: (token: string) => void;\n onPaymentSheetDismissed?: () => void;\n onPaymentFailed?: (error: Error) => void;\n}\n\nexport interface PEApplePayButtonMethods {\n \n}\n\n\nexport const PEApplePayButton = React.forwardRef<\nPEApplePayButtonMethods,\n PEApplePayButtonProps\n>((props, ref) => {\n\n React.useImperativeHandle(ref, () => ({\n }));\n\n const pmError = (event: NativePEApplePayEvent) => {\n if (props.onPaymentFailed) {\n props.onPaymentFailed(new Error(event.nativeEvent.error));\n }\n };\n\n const pmTokenDidReturn = (event: NativePEApplePayEvent) => {\n if (props.onTokenDidReturn) {\n props.onTokenDidReturn(event.nativeEvent.token!);\n }\n };\n\n const pmSheetDidDismiss = () => {\n if (props.onPaymentSheetDismissed) {\n props.onPaymentSheetDismissed();\n }\n }\n \n return (\n <RNPEApplePayButton \n style={{ height: 32, width: '100%', ...(props.style as object) }} \n paymentRequest={JSON.stringify(props.paymentRequest)} \n onPmError={pmError} \n onPmTokenDidReturn={pmTokenDidReturn} \n onPmSheetDidDismiss={pmSheetDidDismiss} \n />\n );\n});\n"],"mappings":";;;;;;;AACA;;AACA;;;;;;AAIA,MAAMA,kBAAkB,GAAG,IAAAC,mCAAA,EAAoD,oBAApD,CAA3B;AA4BO,MAAMC,gBAAgB,gBAAGC,KAAK,CAACC,UAAN,CAG9B,CAACC,KAAD,EAAQC,GAAR,KAAgB;EAEhBH,KAAK,CAACI,mBAAN,CAA0BD,GAA1B,EAA+B,OAAO,EAAP,CAA/B;;EAGA,MAAME,OAAO,GAAIC,KAAD,IAAkC;IAChD,IAAIJ,KAAK,CAACK,eAAV,EAA2B;MACzBL,KAAK,CAACK,eAAN,CAAsB,IAAIC,KAAJ,CAAUF,KAAK,CAACG,WAAN,CAAkBC,KAA5B,CAAtB;IACD;EACF,CAJD;;EAMA,MAAMC,gBAAgB,GAAIL,KAAD,IAAkC;IACzD,IAAIJ,KAAK,CAACU,gBAAV,EAA4B;MAC1BV,KAAK,CAACU,gBAAN,CAAuBN,KAAK,CAACG,WAAN,CAAkBI,KAAzC;IACD;EACF,CAJD;;EAMA,MAAMC,iBAAiB,GAAG,MAAM;IAC9B,IAAIZ,KAAK,CAACa,uBAAV,EAAmC;MACjCb,KAAK,CAACa,uBAAN;IACD;EACF,CAJD;;EAMA,oBACE,oBAAC,kBAAD;IACE,KAAK,EAAE;MAAEC,MAAM,EAAE,EAAV;MAAcC,KAAK,EAAE,MAArB;MAA6B,GAAIf,KAAK,CAACgB;IAAvC,CADT;IAEE,cAAc,EAAEC,IAAI,CAACC,SAAL,CAAelB,KAAK,CAACmB,cAArB,CAFlB;IAGE,SAAS,EAAEhB,OAHb;IAIE,kBAAkB,EAAEM,gBAJtB;IAKE,mBAAmB,EAAEG;EALvB,EADF;AASD,CAnC+B,CAAzB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PEPaymentRequest = void 0;
|
|
7
|
+
|
|
8
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
|
|
10
|
+
class PEPaymentRequest {
|
|
11
|
+
constructor(paymentAmount) {
|
|
12
|
+
let currencyCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'USD';
|
|
13
|
+
let paymentItems = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
14
|
+
|
|
15
|
+
_defineProperty(this, "paymentAmount", void 0);
|
|
16
|
+
|
|
17
|
+
_defineProperty(this, "currencyCode", void 0);
|
|
18
|
+
|
|
19
|
+
_defineProperty(this, "paymentItems", void 0);
|
|
20
|
+
|
|
21
|
+
this.paymentAmount = paymentAmount;
|
|
22
|
+
this.currencyCode = currencyCode;
|
|
23
|
+
this.paymentItems = paymentItems;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
exports.PEPaymentRequest = PEPaymentRequest;
|
|
29
|
+
//# sourceMappingURL=PEPaymentRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PEPaymentRequest","constructor","paymentAmount","currencyCode","paymentItems"],"sources":["PEPaymentRequest.ts"],"sourcesContent":["\nexport class PEPaymentRequest {\n paymentAmount: number;\n currencyCode: 'USD' | 'CAD';\n paymentItems: {\n amount: number;\n label: string;\n }[]\n\n constructor(paymentAmount: number, currencyCode: 'USD' | 'CAD' = 'USD', paymentItems: {\n amount: number;\n label: string;\n }[] = []) {\n this.paymentAmount = paymentAmount;\n this.currencyCode = currencyCode;\n this.paymentItems = paymentItems;\n }\n}"],"mappings":";;;;;;;;;AACO,MAAMA,gBAAN,CAAuB;EAQ5BC,WAAW,CAACC,aAAD,EAGD;IAAA,IAHyBC,YAGzB,uEAHuD,KAGvD;IAAA,IAH8DC,YAG9D,uEAAJ,EAAI;;IAAA;;IAAA;;IAAA;;IACR,KAAKF,aAAL,GAAqBA,aAArB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,YAAL,GAAoBA,YAApB;EACD;;AAf2B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
const {
|
|
11
|
+
RNPayEngineNative
|
|
12
|
+
} = _reactNative.NativeModules;
|
|
13
|
+
|
|
14
|
+
class PayEngineNative {
|
|
15
|
+
static async createFraudMonitorSession(merchantId) {
|
|
16
|
+
return RNPayEngineNative.createFraudMonitorSession(merchantId);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static async getBrowserInfo() {
|
|
20
|
+
return RNPayEngineNative.getBrowserInfo();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static async isPlatformPaySupported(merchantId) {
|
|
24
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
25
|
+
return await RNPayEngineNative.isApplePaySupported(merchantId);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
exports.default = PayEngineNative;
|
|
34
|
+
//# sourceMappingURL=PayEngineNative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RNPayEngineNative","NativeModules","PayEngineNative","createFraudMonitorSession","merchantId","getBrowserInfo","isPlatformPaySupported","Platform","OS","isApplePaySupported"],"sources":["PayEngineNative.tsx"],"sourcesContent":["import { NativeModules, Platform } from \"react-native\";\n\nconst { RNPayEngineNative } = NativeModules;\n\nexport default class PayEngineNative {\n static async createFraudMonitorSession(merchantId: string) {\n return RNPayEngineNative.createFraudMonitorSession(merchantId);\n }\n\n static async getBrowserInfo() {\n return RNPayEngineNative.getBrowserInfo();\n }\n\n static async isPlatformPaySupported(merchantId: string) {\n if (Platform.OS === 'ios') {\n return await RNPayEngineNative.isApplePaySupported(merchantId);\n }\n return false;\n }\n}"],"mappings":";;;;;;;AAAA;;AAEA,MAAM;EAAEA;AAAF,IAAwBC,0BAA9B;;AAEe,MAAMC,eAAN,CAAsB;EACG,aAAzBC,yBAAyB,CAACC,UAAD,EAAqB;IACzD,OAAOJ,iBAAiB,CAACG,yBAAlB,CAA4CC,UAA5C,CAAP;EACD;;EAE0B,aAAdC,cAAc,GAAG;IAC5B,OAAOL,iBAAiB,CAACK,cAAlB,EAAP;EACD;;EAEkC,aAAtBC,sBAAsB,CAACF,UAAD,EAAqB;IACtD,IAAIG,qBAAA,CAASC,EAAT,KAAgB,KAApB,EAA2B;MACzB,OAAO,MAAMR,iBAAiB,CAACS,mBAAlB,CAAsCL,UAAtC,CAAb;IACD;;IACD,OAAO,KAAP;EACD;;AAdkC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PayEngineProvider = exports.PayEngineContext = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -13,18 +13,34 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
13
13
|
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const {
|
|
17
|
+
RNPayEngineNative
|
|
18
|
+
} = _reactNative.NativeModules;
|
|
19
|
+
const PayEngineContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
20
|
+
exports.PayEngineContext = PayEngineContext;
|
|
21
|
+
|
|
22
|
+
const PayEngineProvider = _ref => {
|
|
23
|
+
let {
|
|
24
|
+
config,
|
|
25
|
+
children
|
|
26
|
+
} = _ref;
|
|
27
|
+
|
|
28
|
+
const [loading, setLoading] = _react.default.useState(true);
|
|
29
|
+
|
|
30
|
+
_react.default.useEffect(() => {
|
|
31
|
+
setLoading(true);
|
|
32
|
+
RNPayEngineNative.setConfig(config.publicKey, config.scriptURL);
|
|
33
|
+
setLoading(false);
|
|
34
|
+
}, [config]);
|
|
20
35
|
|
|
21
|
-
|
|
22
|
-
|
|
36
|
+
if (!config) {
|
|
37
|
+
throw new Error('PayEngineProvider: config is required');
|
|
23
38
|
}
|
|
24
39
|
|
|
25
|
-
|
|
40
|
+
return /*#__PURE__*/_react.default.createElement(PayEngineContext.Provider, {
|
|
41
|
+
value: config
|
|
42
|
+
}, loading ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, null) : children);
|
|
43
|
+
};
|
|
26
44
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
exports.default = _default;
|
|
30
|
-
//# sourceMappingURL=TextField.js.map
|
|
45
|
+
exports.PayEngineProvider = PayEngineProvider;
|
|
46
|
+
//# sourceMappingURL=PayEngineProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RNPayEngineNative","NativeModules","PayEngineContext","createContext","undefined","PayEngineProvider","config","children","loading","setLoading","React","useState","useEffect","setConfig","publicKey","scriptURL","Error"],"sources":["PayEngineProvider.tsx"],"sourcesContent":["import React, { createContext } from \"react\";\nimport type { IPayEngineConfig } from \"../../interfaces\";\nimport { ActivityIndicator, NativeModules } from \"react-native\";\n\nconst { RNPayEngineNative } = NativeModules;\n\nconst PayEngineContext = createContext<IPayEngineConfig | undefined>(undefined);\n\nconst PayEngineProvider = ({ config, children }: { config: IPayEngineConfig, children: React.ReactNode }) => {\n const [loading, setLoading] = React.useState(true);\n\n React.useEffect(() => {\n setLoading(true);\n RNPayEngineNative.setConfig(config.publicKey, config.scriptURL)\n setLoading(false);\n }, [config]);\n\n if (!config) {\n throw new Error('PayEngineProvider: config is required');\n }\n\n return <PayEngineContext.Provider value={config}>\n {loading ? <ActivityIndicator /> : children}\n </PayEngineContext.Provider>\n}\n\nexport {\n PayEngineContext,\n PayEngineProvider\n};"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;AAEA,MAAM;EAAEA;AAAF,IAAwBC,0BAA9B;AAEA,MAAMC,gBAAgB,gBAAG,IAAAC,oBAAA,EAA4CC,SAA5C,CAAzB;;;AAEA,MAAMC,iBAAiB,GAAG,QAAmF;EAAA,IAAlF;IAAEC,MAAF;IAAUC;EAAV,CAAkF;;EAC3G,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBC,cAAA,CAAMC,QAAN,CAAe,IAAf,CAA9B;;EAEAD,cAAA,CAAME,SAAN,CAAgB,MAAM;IACpBH,UAAU,CAAC,IAAD,CAAV;IACAT,iBAAiB,CAACa,SAAlB,CAA4BP,MAAM,CAACQ,SAAnC,EAA8CR,MAAM,CAACS,SAArD;IACAN,UAAU,CAAC,KAAD,CAAV;EACD,CAJD,EAIG,CAACH,MAAD,CAJH;;EAMA,IAAI,CAACA,MAAL,EAAa;IACX,MAAM,IAAIU,KAAJ,CAAU,uCAAV,CAAN;EACD;;EAED,oBAAO,6BAAC,gBAAD,CAAkB,QAAlB;IAA2B,KAAK,EAAEV;EAAlC,GACJE,OAAO,gBAAG,6BAAC,8BAAD,OAAH,GAA2BD,QAD9B,CAAP;AAGD,CAhBD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PEBankAccountView = void 0;
|
|
7
|
+
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
RNPEEventEmitter
|
|
18
|
+
} = _reactNative.NativeModules;
|
|
19
|
+
const COMPONENT_NAME = 'RNPEBankAccountView';
|
|
20
|
+
const RNPEBankAccountView = (0, _reactNative.requireNativeComponent)(COMPONENT_NAME); // @ts-ignore
|
|
21
|
+
|
|
22
|
+
const RNPEBankAccountViewManager = _reactNative.UIManager[COMPONENT_NAME];
|
|
23
|
+
const peEventEmitter = new _reactNative.NativeEventEmitter(RNPEEventEmitter);
|
|
24
|
+
const PEBankAccountView = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
25
|
+
const formRef = React.useRef();
|
|
26
|
+
const [height, setHeight] = React.useState(0);
|
|
27
|
+
React.useImperativeHandle(ref, () => ({
|
|
28
|
+
submit: async function (merchantId) {
|
|
29
|
+
let additionalData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
if (height === 0) {
|
|
32
|
+
return reject(new Error('Form is not ready'));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const listener = peEventEmitter.addListener('onBankAccountRespond', args => {
|
|
36
|
+
listener.remove();
|
|
37
|
+
const {
|
|
38
|
+
error,
|
|
39
|
+
bankAccount: json
|
|
40
|
+
} = args;
|
|
41
|
+
|
|
42
|
+
if (error) {
|
|
43
|
+
reject(new Error(error));
|
|
44
|
+
} else {
|
|
45
|
+
const bankAccount = JSON.parse(json);
|
|
46
|
+
resolve(bankAccount);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
callNativeMethod("submit", [merchantId, additionalData]);
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
showKeyboard: () => {
|
|
53
|
+
callNativeMethod("showKeyboard");
|
|
54
|
+
},
|
|
55
|
+
hideKeyboard: () => {
|
|
56
|
+
callNativeMethod("hideKeyboard");
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
const callNativeMethod = React.useCallback(function (methodName) {
|
|
60
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
61
|
+
const viewId = (0, _reactNative.findNodeHandle)(formRef.current);
|
|
62
|
+
let commandId = RNPEBankAccountViewManager.Commands[methodName].toString();
|
|
63
|
+
|
|
64
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
65
|
+
commandId = Number(commandId);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
_reactNative.UIManager.dispatchViewManagerCommand(viewId, commandId, params);
|
|
69
|
+
}, [formRef.current]);
|
|
70
|
+
React.useEffect(() => {
|
|
71
|
+
const eventListener = peEventEmitter.addListener('onSizeChanges', args => {
|
|
72
|
+
const {
|
|
73
|
+
width: _,
|
|
74
|
+
height: frameHeight
|
|
75
|
+
} = args;
|
|
76
|
+
setHeight(frameHeight);
|
|
77
|
+
});
|
|
78
|
+
return () => eventListener.remove();
|
|
79
|
+
}, []);
|
|
80
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, height === 0 && /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, null), /*#__PURE__*/React.createElement(RNPEBankAccountView, {
|
|
81
|
+
ref: formRef,
|
|
82
|
+
additionalFields: JSON.stringify(props.additionalFields ?? []),
|
|
83
|
+
style: {
|
|
84
|
+
height: height
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
});
|
|
88
|
+
exports.PEBankAccountView = PEBankAccountView;
|
|
89
|
+
//# sourceMappingURL=BankAccountView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RNPEEventEmitter","NativeModules","COMPONENT_NAME","RNPEBankAccountView","requireNativeComponent","RNPEBankAccountViewManager","UIManager","peEventEmitter","NativeEventEmitter","PEBankAccountView","React","forwardRef","props","ref","formRef","useRef","height","setHeight","useState","useImperativeHandle","submit","merchantId","additionalData","Promise","resolve","reject","Error","listener","addListener","args","remove","error","bankAccount","json","JSON","parse","callNativeMethod","showKeyboard","hideKeyboard","useCallback","methodName","params","viewId","findNodeHandle","current","commandId","Commands","toString","Platform","OS","Number","dispatchViewManagerCommand","useEffect","eventListener","width","_","frameHeight","stringify","additionalFields"],"sources":["BankAccountView.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { requireNativeComponent, NativeModules, NativeEventEmitter, ViewProps, findNodeHandle, UIManager, ActivityIndicator, Platform } from 'react-native';\nimport type IPEField from './IPEField';\nimport type PEBankAccount from './PEBankAccount';\n\nconst { RNPEEventEmitter } = NativeModules;\n\ninterface NativePEBankAccountViewProps extends ViewProps {\n additionalFields: string;\n}\n\nconst COMPONENT_NAME = 'RNPEBankAccountView'\nconst RNPEBankAccountView = requireNativeComponent<NativePEBankAccountViewProps>(COMPONENT_NAME);\n// @ts-ignore\nconst RNPEBankAccountViewManager = UIManager[COMPONENT_NAME]\n\nconst peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);\n\nexport interface PEBankAccountViewProps {\n additionalFields?: IPEField[];\n}\n\nexport interface PEBankAccountViewMethods {\n submit: (merchantId: string, additionalData: { [key: string]: string }) => Promise<PEBankAccount>;\n showKeyboard: () => void;\n hideKeyboard: () => void;\n}\n\nexport const PEBankAccountView = React.forwardRef<\n PEBankAccountViewMethods,\n PEBankAccountViewProps\n>((props, ref) => {\n const formRef = React.useRef<any>();\n const [height, setHeight] = React.useState(0);\n\n React.useImperativeHandle(ref, () => ({\n submit: async (merchantId: string, additionalData: any = {}) => {\n return new Promise((resolve, reject) => {\n if (height === 0) {\n return reject(new Error('Form is not ready'))\n }\n \n const listener = peEventEmitter.addListener('onBankAccountRespond', args => {\n listener.remove()\n\n const { error, bankAccount: json } = args;\n if (error) {\n reject(new Error(error))\n } else {\n const bankAccount = JSON.parse(json) as PEBankAccount;\n resolve(bankAccount)\n }\n });\n\n callNativeMethod(\"submit\", [merchantId, additionalData],)\n });\n },\n showKeyboard: () => {\n callNativeMethod(\"showKeyboard\")\n },\n hideKeyboard: () => {\n callNativeMethod(\"hideKeyboard\")\n }\n }));\n\n const callNativeMethod = React.useCallback((methodName: string, params: any[] = []) => {\n const viewId = findNodeHandle(formRef.current);\n let commandId = RNPEBankAccountViewManager.Commands[methodName].toString()\n if (Platform.OS === 'ios') {\n commandId = Number(commandId)\n }\n UIManager.dispatchViewManagerCommand(\n viewId,\n commandId,\n params,\n );\n }, [formRef.current])\n\n\n React.useEffect(() => {\n const eventListener = peEventEmitter.addListener('onSizeChanges', args => {\n const { width: _, height: frameHeight } = args;\n setHeight(frameHeight);\n });\n return () => eventListener.remove();\n }, []);\n\n return (\n <>\n {height === 0 && <ActivityIndicator />}\n <RNPEBankAccountView ref={formRef} additionalFields={JSON.stringify(props.additionalFields ?? [])} style={{ height: height }} />\n </>\n );\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PECreditCardView = void 0;
|
|
7
|
+
|
|
8
|
+
var React = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
RNPEEventEmitter
|
|
18
|
+
} = _reactNative.NativeModules;
|
|
19
|
+
const COMPONENT_NAME = 'RNPECreditCardView';
|
|
20
|
+
const RNPECreditCardView = (0, _reactNative.requireNativeComponent)(COMPONENT_NAME); // @ts-ignore
|
|
21
|
+
|
|
22
|
+
const RNPECreditCardViewManager = _reactNative.UIManager[COMPONENT_NAME];
|
|
23
|
+
const peEventEmitter = new _reactNative.NativeEventEmitter(RNPEEventEmitter);
|
|
24
|
+
const PECreditCardView = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
25
|
+
const formRef = React.useRef();
|
|
26
|
+
const [height, setHeight] = React.useState(0);
|
|
27
|
+
React.useImperativeHandle(ref, () => ({
|
|
28
|
+
submit: async function (merchantId) {
|
|
29
|
+
let additionalData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
if (height === 0) {
|
|
32
|
+
return reject(new Error('Form is not ready'));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const listener = peEventEmitter.addListener('onCardRespond', args => {
|
|
36
|
+
listener.remove();
|
|
37
|
+
const {
|
|
38
|
+
error,
|
|
39
|
+
card: json
|
|
40
|
+
} = args;
|
|
41
|
+
|
|
42
|
+
if (error) {
|
|
43
|
+
reject(new Error(error));
|
|
44
|
+
} else {
|
|
45
|
+
const card = JSON.parse(json);
|
|
46
|
+
resolve(card);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
callNativeMethod("submit", [merchantId, additionalData]);
|
|
50
|
+
});
|
|
51
|
+
},
|
|
52
|
+
showKeyboard: () => {
|
|
53
|
+
callNativeMethod("showKeyboard");
|
|
54
|
+
},
|
|
55
|
+
hideKeyboard: () => {
|
|
56
|
+
callNativeMethod("hideKeyboard");
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
const callNativeMethod = React.useCallback(function (methodName) {
|
|
60
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
61
|
+
console.log("callNativeMethod", methodName, params);
|
|
62
|
+
const viewId = (0, _reactNative.findNodeHandle)(formRef.current);
|
|
63
|
+
let commandId = RNPECreditCardViewManager.Commands[methodName].toString();
|
|
64
|
+
|
|
65
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
66
|
+
commandId = Number(commandId);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
_reactNative.UIManager.dispatchViewManagerCommand(viewId, commandId, params);
|
|
70
|
+
}, [formRef.current]);
|
|
71
|
+
React.useEffect(() => {
|
|
72
|
+
const eventListener = peEventEmitter.addListener('onSizeChanges', args => {
|
|
73
|
+
const {
|
|
74
|
+
width: _,
|
|
75
|
+
height: frameHeight
|
|
76
|
+
} = args;
|
|
77
|
+
setHeight(frameHeight);
|
|
78
|
+
});
|
|
79
|
+
return () => eventListener.remove();
|
|
80
|
+
}, []);
|
|
81
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, height === 0 && /*#__PURE__*/React.createElement(_reactNative.ActivityIndicator, null), /*#__PURE__*/React.createElement(RNPECreditCardView, {
|
|
82
|
+
ref: formRef,
|
|
83
|
+
additionalFields: JSON.stringify(props.additionalFields ?? []),
|
|
84
|
+
style: {
|
|
85
|
+
height: height
|
|
86
|
+
}
|
|
87
|
+
}));
|
|
88
|
+
});
|
|
89
|
+
exports.PECreditCardView = PECreditCardView;
|
|
90
|
+
//# sourceMappingURL=CreditCardView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["RNPEEventEmitter","NativeModules","COMPONENT_NAME","RNPECreditCardView","requireNativeComponent","RNPECreditCardViewManager","UIManager","peEventEmitter","NativeEventEmitter","PECreditCardView","React","forwardRef","props","ref","formRef","useRef","height","setHeight","useState","useImperativeHandle","submit","merchantId","additionalData","Promise","resolve","reject","Error","listener","addListener","args","remove","error","card","json","JSON","parse","callNativeMethod","showKeyboard","hideKeyboard","useCallback","methodName","params","console","log","viewId","findNodeHandle","current","commandId","Commands","toString","Platform","OS","Number","dispatchViewManagerCommand","useEffect","eventListener","width","_","frameHeight","stringify","additionalFields"],"sources":["CreditCardView.tsx"],"sourcesContent":["\nimport * as React from 'react';\nimport { requireNativeComponent, NativeModules, NativeEventEmitter, ViewProps, Platform, findNodeHandle, UIManager, ActivityIndicator } from 'react-native';\nimport type IPEField from './IPEField';\nimport type PECard from './PECard';\n\nconst { RNPEEventEmitter } = NativeModules;\n\ninterface NativePECreditCardViewProps extends ViewProps {\n additionalFields: string;\n}\n\nconst COMPONENT_NAME = 'RNPECreditCardView'\nconst RNPECreditCardView = requireNativeComponent<NativePECreditCardViewProps>(COMPONENT_NAME);\n// @ts-ignore\nconst RNPECreditCardViewManager = UIManager[COMPONENT_NAME]\nconst peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);\n\nexport interface PECreditCardViewProps {\n additionalFields?: IPEField[];\n}\n\nexport interface PECreditCardViewMethods {\n submit: (merchantId: string, additionalData: { [key: string]: string }) => Promise<PECard>;\n showKeyboard: () => void;\n hideKeyboard: () => void;\n}\n\nexport const PECreditCardView = React.forwardRef<\n PECreditCardViewMethods,\n PECreditCardViewProps\n>((props, ref) => {\n const formRef = React.useRef<any>();\n const [height, setHeight] = React.useState(0);\n\n React.useImperativeHandle(ref, () => ({\n submit: async (merchantId: string, additionalData: any = {}) => {\n return new Promise((resolve, reject) => {\n if (height === 0) {\n return reject(new Error('Form is not ready'))\n }\n\n const listener = peEventEmitter.addListener('onCardRespond', args => {\n listener.remove()\n\n const { error, card: json } = args;\n if (error) {\n reject(new Error(error))\n } else {\n const card = JSON.parse(json) as PECard;\n resolve(card)\n }\n });\n\n callNativeMethod(\"submit\", [merchantId, additionalData])\n });\n },\n showKeyboard: () => {\n callNativeMethod(\"showKeyboard\")\n },\n hideKeyboard: () => {\n callNativeMethod(\"hideKeyboard\")\n }\n }));\n\n const callNativeMethod = React.useCallback((methodName: string, params: any[] = []) => {\n console.log(\"callNativeMethod\", methodName, params)\n const viewId = findNodeHandle(formRef.current);\n let commandId = RNPECreditCardViewManager.Commands[methodName].toString()\n if (Platform.OS === 'ios') {\n commandId = Number(commandId)\n }\n UIManager.dispatchViewManagerCommand(\n viewId,\n commandId,\n params,\n );\n }, [formRef.current])\n\n React.useEffect(() => {\n const eventListener = peEventEmitter.addListener('onSizeChanges', args => {\n const { width: _, height: frameHeight } = args;\n setHeight(frameHeight);\n });\n\n return () => eventListener.remove();\n }, []);\n\n\n return (\n <>\n {height === 0 && <ActivityIndicator />}\n <RNPECreditCardView ref={formRef} additionalFields={JSON.stringify(props.additionalFields ?? [])} style={{ height: height }} />\n </>\n );\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["IPEField.ts"],"sourcesContent":["import type PEKeyboardType from \"./PEKeyboardType\";\n\ninterface IPEField {\n name: string;\n type: string;\n placeholder: string;\n keyboardType: PEKeyboardType;\n isRequired: boolean;\n pattern?: string;\n}\n\nexport default IPEField;\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["PEBankAccount.ts"],"sourcesContent":["interface PEBankAccount {\n id: string;\n token: string;\n account_data: {\n first_name: string;\n last_name: string;\n routing_number: string;\n last_4: string;\n };\n}\n\nexport default PEBankAccount;"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["PECard.ts"],"sourcesContent":["interface PECard {\n token: string;\n card_data: {\n id: string;\n brand: string;\n last_4: string;\n exp_year: string;\n exp_month: string;\n name: string;\n address_zip?: string;\n };\n}\n\nexport default PECard;"],"mappings":""}
|