react-native-payengine 1.0.5 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -111
- package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/{5.6.4 → 6.1.1}/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.idea/caches/deviceStreaming.xml +318 -0
- package/android/.idea/compiler.xml +1 -1
- package/android/.idea/gradle.xml +2 -2
- package/android/.idea/kotlinc.xml +6 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +1 -1
- package/android/build.gradle +42 -6
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/paymentsdk-debug.aar +0 -0
- package/android/paymentsdk-release.aar +0 -0
- package/android/src/legacy/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativepayengine/GooglePayModule.java +196 -0
- package/android/src/main/java/com/reactnativepayengine/PayengineModule.java +1 -5
- package/android/src/main/java/com/reactnativepayengine/PayenginePackage.java +8 -33
- package/android/src/main/java/com/reactnativepayengine/util/MetricsUtil.kt +44 -0
- package/android/src/main/java/com/reactnativepayengine/util/PaymentsUtil.java +113 -0
- package/android/src/main/java/com/reactnativepayengine/v2/RNPEFraudAnalyticsApplication.java +55 -0
- package/android/src/main/java/com/reactnativepayengine/v2/RNPayEngineNative.kt +71 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEEvents.kt +8 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEField.kt +17 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNBankAccountViewManager.kt +103 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNPEBankAccountView.kt +77 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardView.kt +77 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardViewManager.kt +103 -0
- package/ios/PayEngineSDK.xcframework/Info.plist +44 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +622 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/module.modulemap +11 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/browserInfo.html +136 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/perform3ds.html +467 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +1240 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/module.modulemap +11 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/browserInfo.html +136 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/perform3ds.html +467 -0
- package/ios/Payengine.xcodeproj/project.pbxproj +30 -9
- package/ios/Payengine.xcodeproj/project.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Payengine.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +4 -4
- package/ios/Payengine.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Payengine.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Sources/Classes/ApplePay/RNPEApplePayButton.swift +111 -0
- package/ios/Sources/Classes/ApplePay/RNPEApplePayPaymentRequest.swift +43 -0
- package/ios/Sources/Classes/RNPEError.swift +12 -0
- package/ios/Sources/Classes/RNPEEventEmitter.swift +29 -0
- package/ios/Sources/Classes/RNPEUtils.swift +30 -0
- package/ios/Sources/Classes/RNPayEngineNative.swift +87 -0
- package/ios/Sources/Classes/SecureFields/RNPEBankAccountView.swift +130 -0
- package/ios/Sources/Classes/SecureFields/RNPECreditCardView.swift +129 -0
- package/ios/Sources/Classes/SecureFields/RNPEEvents.swift +15 -0
- package/ios/Sources/Classes/SecureFields/RNPEField.swift +26 -0
- package/ios/Sources/Payengine.m +73 -0
- package/ios/Sources/Payengine.swift +13 -0
- package/lib/commonjs/components/PayEngine.js +2 -123
- package/lib/commonjs/components/PayEngine.js.map +1 -1
- package/lib/commonjs/components/{SecureFields/VGS/CardHolderNameField.js → v2/ApplePay/PEApplePayButton.js} +38 -13
- package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js +29 -0
- package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
- package/lib/commonjs/components/v2/PayEngineNative.js +34 -0
- package/lib/commonjs/components/v2/PayEngineNative.js.map +1 -0
- package/lib/commonjs/components/{SecureFields/VGS/TextField.js → v2/PayEngineProvider.js} +28 -12
- package/lib/commonjs/components/v2/PayEngineProvider.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js +89 -0
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js +90 -0
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/IPEField.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/IPEField.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PECard.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/PECard.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js +18 -0
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
- package/lib/commonjs/index.js +73 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/index.js +2 -0
- package/lib/commonjs/interfaces/index.js.map +1 -0
- package/lib/commonjs/utils/index.js +29 -45
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/components/PayEngine.js +3 -118
- package/lib/module/components/PayEngine.js.map +1 -1
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js +37 -0
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/module/components/v2/ApplePay/PEPaymentRequest.js +20 -0
- package/lib/module/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
- package/lib/module/components/v2/PayEngineNative.js +23 -0
- package/lib/module/components/v2/PayEngineNative.js.map +1 -0
- package/lib/module/components/v2/PayEngineProvider.js +30 -0
- package/lib/module/components/v2/PayEngineProvider.js.map +1 -0
- package/lib/module/components/v2/SecureFields/BankAccountView.js +75 -0
- package/lib/module/components/v2/SecureFields/BankAccountView.js.map +1 -0
- package/lib/module/components/v2/SecureFields/CreditCardView.js +76 -0
- package/lib/module/components/v2/SecureFields/CreditCardView.js.map +1 -0
- package/lib/module/components/v2/SecureFields/IPEField.js +2 -0
- package/lib/module/components/v2/SecureFields/IPEField.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PEBankAccount.js +2 -0
- package/lib/module/components/v2/SecureFields/PEBankAccount.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PECard.js +2 -0
- package/lib/module/components/v2/SecureFields/PECard.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js +11 -0
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
- package/lib/module/index.js +15 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/index.js +2 -0
- package/lib/module/interfaces/index.js.map +1 -0
- package/lib/module/utils/index.js +20 -45
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/components/PayEngine.d.ts +1 -14
- package/lib/typescript/components/v2/ApplePay/PEApplePayButton.d.ts +12 -0
- package/lib/typescript/components/v2/ApplePay/PEPaymentRequest.d.ts +12 -0
- package/lib/typescript/components/v2/PayEngineNative.d.ts +5 -0
- package/lib/typescript/components/v2/PayEngineProvider.d.ts +8 -0
- package/lib/typescript/components/v2/SecureFields/BankAccountView.d.ts +14 -0
- package/lib/typescript/components/v2/SecureFields/CreditCardView.d.ts +14 -0
- package/lib/typescript/components/v2/SecureFields/IPEField.d.ts +10 -0
- package/lib/typescript/components/v2/SecureFields/PEBankAccount.d.ts +11 -0
- package/lib/typescript/components/v2/SecureFields/PECard.d.ts +13 -0
- package/lib/typescript/components/v2/SecureFields/PEKeyboardType.d.ts +7 -0
- package/lib/typescript/index.d.ts +13 -3
- package/lib/typescript/interfaces/index.d.ts +6 -0
- package/lib/typescript/utils/index.d.ts +7 -41
- package/package.json +17 -11
- package/react-native-payengine.podspec +3 -3
- package/src/components/LoadingIndicator.tsx +28 -0
- package/src/components/PayEngine.tsx +8 -0
- package/src/components/v2/ApplePay/PEApplePayButton.tsx +70 -0
- package/src/components/v2/ApplePay/PEPaymentRequest.ts +18 -0
- package/src/components/v2/PayEngineNative.tsx +20 -0
- package/src/components/v2/PayEngineProvider.tsx +30 -0
- package/src/components/v2/SecureFields/BankAccountView.tsx +95 -0
- package/src/components/v2/SecureFields/CreditCardView.tsx +96 -0
- package/src/components/v2/SecureFields/IPEField.ts +12 -0
- package/src/components/v2/SecureFields/PEBankAccount.ts +12 -0
- package/src/components/v2/SecureFields/PECard.ts +14 -0
- package/src/components/v2/SecureFields/PEKeyboardType.ts +8 -0
- package/src/index.tsx +62 -0
- package/src/interfaces/index.ts +6 -0
- package/src/utils/index.ts +79 -0
- package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
- package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectModule.java +0 -148
- package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectOnCreateViewInstanceListener.java +0 -6
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCVCField.java +0 -67
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardHolderNameField.java +0 -53
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardNumberField.java +0 -57
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSExpDateField.java +0 -54
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSTextField.java +0 -57
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSZipCodeField.java +0 -62
- package/android/src/main/java/com/reactnativepayengine/util/ResourceUtil.java +0 -14
- package/ios/Payengine.m +0 -55
- package/ios/Payengine.swift +0 -637
- package/lib/commonjs/components/SecureFields/VGS/CVCField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/CVCField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/CollectManager.js +0 -65
- package/lib/commonjs/components/SecureFields/VGS/CollectManager.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/TextField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/index.js +0 -34
- package/lib/commonjs/components/SecureFields/index.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CVCField.js +0 -14
- package/lib/module/components/SecureFields/VGS/CVCField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CardHolderNameField.js +0 -14
- package/lib/module/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CardNumberField.js +0 -14
- package/lib/module/components/SecureFields/VGS/CardNumberField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CollectManager.js +0 -50
- package/lib/module/components/SecureFields/VGS/CollectManager.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/ExpDateField.js +0 -14
- package/lib/module/components/SecureFields/VGS/ExpDateField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/TextField.js +0 -17
- package/lib/module/components/SecureFields/VGS/TextField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/ZipCodeField.js +0 -14
- package/lib/module/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
- package/lib/module/components/SecureFields/index.js +0 -17
- package/lib/module/components/SecureFields/index.js.map +0 -1
- package/lib/typescript/components/SecureFields/VGS/CVCField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/CardHolderNameField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/CardNumberField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/CollectManager.d.ts +0 -12
- package/lib/typescript/components/SecureFields/VGS/ExpDateField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/TextField.d.ts +0 -14
- package/lib/typescript/components/SecureFields/VGS/ZipCodeField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/index.d.ts +0 -16
- /package/android/.gradle/{5.6.4 → 6.1.1}/fileChanges/last-build.bin +0 -0
- /package/android/.gradle/{5.6.4 → 6.1.1}/gc.properties +0 -0
- /package/android/{vgscollect-1.7.2-debug.aar → securefields-1.7.2-debug.aar} +0 -0
- /package/ios/{Payengine-Bridging-Header.h → Sources/Payengine-Bridging-Header.h} +0 -0
|
@@ -1,124 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { WebView } from 'react-native-webview';
|
|
4
|
-
import { getScriptURL, debuggingScript } from '../utils';
|
|
5
|
-
import LoadingIndicator from './LoadingIndicator';
|
|
2
|
+
import { Text } from 'react-native';
|
|
6
3
|
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
return `<pay-engine id="component"
|
|
10
|
-
style="z-index: 100"
|
|
11
|
-
${allowedProps.map(propName => `${propName}="${props[propName]}"`).join(' ')}
|
|
12
|
-
></pay-engine>`;
|
|
4
|
+
const PayEngine = () => {
|
|
5
|
+
return /*#__PURE__*/React.createElement(Text, null, "Obsolete. Please check out the package readme");
|
|
13
6
|
};
|
|
14
7
|
|
|
15
|
-
const generateHTML = (scriptURL, props) => {
|
|
16
|
-
return `<!DOCTYPE html>
|
|
17
|
-
<html>
|
|
18
|
-
<head>
|
|
19
|
-
<title>PayEngine Elements</title>
|
|
20
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
21
|
-
<script src="${scriptURL}" async defer type="text/javascript"></script>
|
|
22
|
-
</head>
|
|
23
|
-
<body>
|
|
24
|
-
${getHtmlTag(props)}
|
|
25
|
-
<script>
|
|
26
|
-
setInterval(function() {
|
|
27
|
-
window.ReactNativeWebView.postMessage(JSON.stringify({
|
|
28
|
-
type: 'PayEngine-height',
|
|
29
|
-
height: document.body.scrollHeight
|
|
30
|
-
}))
|
|
31
|
-
}, 500);
|
|
32
|
-
</script>
|
|
33
|
-
</body>
|
|
34
|
-
</html>`;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const PayEngine = props => {
|
|
38
|
-
const [scriptURL] = React.useState(getScriptURL(props.config));
|
|
39
|
-
const [height, setHeight] = React.useState(30);
|
|
40
|
-
const html = generateHTML(scriptURL, props);
|
|
41
|
-
|
|
42
|
-
const onMessage = payload => {
|
|
43
|
-
var _props$events;
|
|
44
|
-
|
|
45
|
-
const isDebug = props.config.logLevel > 0;
|
|
46
|
-
let dataPayload;
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
dataPayload = JSON.parse(payload.nativeEvent.data);
|
|
50
|
-
} catch (e) {}
|
|
51
|
-
|
|
52
|
-
if (dataPayload) {
|
|
53
|
-
switch (dataPayload.type) {
|
|
54
|
-
case 'Console':
|
|
55
|
-
if (isDebug) {
|
|
56
|
-
console.info(`[Console] ${JSON.stringify(dataPayload.data)}`);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
break;
|
|
60
|
-
|
|
61
|
-
case 'PayEngine':
|
|
62
|
-
const {
|
|
63
|
-
type,
|
|
64
|
-
detail
|
|
65
|
-
} = dataPayload.event;
|
|
66
|
-
|
|
67
|
-
if ((_props$events = props.events) !== null && _props$events !== void 0 && _props$events[type]) {
|
|
68
|
-
var _props$events2, _props$events2$type;
|
|
69
|
-
|
|
70
|
-
(_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);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
break;
|
|
74
|
-
|
|
75
|
-
case 'PayEngine-height':
|
|
76
|
-
setHeight(dataPayload.height);
|
|
77
|
-
break;
|
|
78
|
-
|
|
79
|
-
default:
|
|
80
|
-
if (isDebug) {
|
|
81
|
-
console.log(dataPayload);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return /*#__PURE__*/React.createElement(View, {
|
|
90
|
-
style: [{
|
|
91
|
-
flex: 1,
|
|
92
|
-
height: height
|
|
93
|
-
}, props.style]
|
|
94
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
95
|
-
style: styles.yellowBox
|
|
96
|
-
}, /*#__PURE__*/React.createElement(Text, null, "Script URL: ", scriptURL)), /*#__PURE__*/React.createElement(View, {
|
|
97
|
-
style: styles.yellowBox
|
|
98
|
-
}, /*#__PURE__*/React.createElement(Text, null, getHtmlTag(props))), /*#__PURE__*/React.createElement(WebView, {
|
|
99
|
-
originWhitelist: ['*'],
|
|
100
|
-
source: {
|
|
101
|
-
html: html,
|
|
102
|
-
baseUrl: ''
|
|
103
|
-
} // source={{ uri: 'https://google.com' }}
|
|
104
|
-
,
|
|
105
|
-
applicationNameForUserAgent: `PayEngine-RN/${Platform.OS}`,
|
|
106
|
-
injectedJavaScript: debuggingScript,
|
|
107
|
-
renderLoading: LoadingIndicator,
|
|
108
|
-
startInLoadingState: true,
|
|
109
|
-
onMessage: onMessage
|
|
110
|
-
}));
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const styles = StyleSheet.create({
|
|
114
|
-
yellowBox: {
|
|
115
|
-
marginVertical: 5,
|
|
116
|
-
marginHorizontal: 10,
|
|
117
|
-
padding: 10,
|
|
118
|
-
backgroundColor: 'yellow',
|
|
119
|
-
borderWidth: 1,
|
|
120
|
-
borderColor: 'yellow'
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
8
|
export default PayEngine;
|
|
124
9
|
//# sourceMappingURL=PayEngine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","Text","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,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;;AAEA,MAAMC,SAAS,GAAG,MAAM;EACtB,oBAAO,oBAAC,IAAD,wDAAP;AACD,CAFD;;AAIA,eAAeA,SAAf"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { requireNativeComponent } from 'react-native';
|
|
3
|
+
const RNPEApplePayButton = requireNativeComponent('RNPEApplePayButton');
|
|
4
|
+
export const PEApplePayButton = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
5
|
+
React.useImperativeHandle(ref, () => ({}));
|
|
6
|
+
|
|
7
|
+
const pmError = event => {
|
|
8
|
+
if (props.onPaymentFailed) {
|
|
9
|
+
props.onPaymentFailed(new Error(event.nativeEvent.error));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const pmTokenDidReturn = event => {
|
|
14
|
+
if (props.onTokenDidReturn) {
|
|
15
|
+
props.onTokenDidReturn(event.nativeEvent.token);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const pmSheetDidDismiss = () => {
|
|
20
|
+
if (props.onPaymentSheetDismissed) {
|
|
21
|
+
props.onPaymentSheetDismissed();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return /*#__PURE__*/React.createElement(RNPEApplePayButton, {
|
|
26
|
+
style: {
|
|
27
|
+
height: 32,
|
|
28
|
+
width: '100%',
|
|
29
|
+
...props.style
|
|
30
|
+
},
|
|
31
|
+
paymentRequest: JSON.stringify(props.paymentRequest),
|
|
32
|
+
onPmError: pmError,
|
|
33
|
+
onPmTokenDidReturn: pmTokenDidReturn,
|
|
34
|
+
onPmSheetDidDismiss: pmSheetDidDismiss
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=PEApplePayButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","requireNativeComponent","RNPEApplePayButton","PEApplePayButton","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,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,sBAAT,QAAkD,cAAlD;AAIA,MAAMC,kBAAkB,GAAGD,sBAAsB,CAA8B,oBAA9B,CAAjD;AA4BA,OAAO,MAAME,gBAAgB,gBAAGH,KAAK,CAACI,UAAN,CAG9B,CAACC,KAAD,EAAQC,GAAR,KAAgB;EAEhBN,KAAK,CAACO,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,20 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
|
|
3
|
+
export class PEPaymentRequest {
|
|
4
|
+
constructor(paymentAmount) {
|
|
5
|
+
let currencyCode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'USD';
|
|
6
|
+
let paymentItems = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
|
|
7
|
+
|
|
8
|
+
_defineProperty(this, "paymentAmount", void 0);
|
|
9
|
+
|
|
10
|
+
_defineProperty(this, "currencyCode", void 0);
|
|
11
|
+
|
|
12
|
+
_defineProperty(this, "paymentItems", void 0);
|
|
13
|
+
|
|
14
|
+
this.paymentAmount = paymentAmount;
|
|
15
|
+
this.currencyCode = currencyCode;
|
|
16
|
+
this.paymentItems = paymentItems;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
}
|
|
20
|
+
//# 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":";;AACA,OAAO,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,23 @@
|
|
|
1
|
+
import { NativeModules, Platform } from "react-native";
|
|
2
|
+
const {
|
|
3
|
+
RNPayEngineNative
|
|
4
|
+
} = NativeModules;
|
|
5
|
+
export default class PayEngineNative {
|
|
6
|
+
static async createFraudMonitorSession(merchantId) {
|
|
7
|
+
return RNPayEngineNative.createFraudMonitorSession(merchantId);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
static async getBrowserInfo() {
|
|
11
|
+
return RNPayEngineNative.getBrowserInfo();
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static async isPlatformPaySupported(merchantId) {
|
|
15
|
+
if (Platform.OS === 'ios') {
|
|
16
|
+
return await RNPayEngineNative.isApplePaySupported(merchantId);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=PayEngineNative.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","RNPayEngineNative","PayEngineNative","createFraudMonitorSession","merchantId","getBrowserInfo","isPlatformPaySupported","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,SAASA,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,MAAM;EAAEC;AAAF,IAAwBF,aAA9B;AAEA,eAAe,MAAMG,eAAN,CAAsB;EACG,aAAzBC,yBAAyB,CAACC,UAAD,EAAqB;IACzD,OAAOH,iBAAiB,CAACE,yBAAlB,CAA4CC,UAA5C,CAAP;EACD;;EAE0B,aAAdC,cAAc,GAAG;IAC5B,OAAOJ,iBAAiB,CAACI,cAAlB,EAAP;EACD;;EAEkC,aAAtBC,sBAAsB,CAACF,UAAD,EAAqB;IACtD,IAAIJ,QAAQ,CAACO,EAAT,KAAgB,KAApB,EAA2B;MACzB,OAAO,MAAMN,iBAAiB,CAACO,mBAAlB,CAAsCJ,UAAtC,CAAb;IACD;;IACD,OAAO,KAAP;EACD;;AAdkC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, { createContext } from "react";
|
|
2
|
+
import { ActivityIndicator, NativeModules } from "react-native";
|
|
3
|
+
const {
|
|
4
|
+
RNPayEngineNative
|
|
5
|
+
} = NativeModules;
|
|
6
|
+
const PayEngineContext = /*#__PURE__*/createContext(undefined);
|
|
7
|
+
|
|
8
|
+
const PayEngineProvider = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
config,
|
|
11
|
+
children
|
|
12
|
+
} = _ref;
|
|
13
|
+
const [loading, setLoading] = React.useState(true);
|
|
14
|
+
React.useEffect(() => {
|
|
15
|
+
setLoading(true);
|
|
16
|
+
RNPayEngineNative.setConfig(config.publicKey, config.scriptURL);
|
|
17
|
+
setLoading(false);
|
|
18
|
+
}, [config]);
|
|
19
|
+
|
|
20
|
+
if (!config) {
|
|
21
|
+
throw new Error('PayEngineProvider: config is required');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return /*#__PURE__*/React.createElement(PayEngineContext.Provider, {
|
|
25
|
+
value: config
|
|
26
|
+
}, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, null) : children);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { PayEngineContext, PayEngineProvider };
|
|
30
|
+
//# sourceMappingURL=PayEngineProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","ActivityIndicator","NativeModules","RNPayEngineNative","PayEngineContext","undefined","PayEngineProvider","config","children","loading","setLoading","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,OAAOA,KAAP,IAAgBC,aAAhB,QAAqC,OAArC;AAEA,SAASC,iBAAT,EAA4BC,aAA5B,QAAiD,cAAjD;AAEA,MAAM;EAAEC;AAAF,IAAwBD,aAA9B;AAEA,MAAME,gBAAgB,gBAAGJ,aAAa,CAA+BK,SAA/B,CAAtC;;AAEA,MAAMC,iBAAiB,GAAG,QAAmF;EAAA,IAAlF;IAAEC,MAAF;IAAUC;EAAV,CAAkF;EAC3G,MAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBX,KAAK,CAACY,QAAN,CAAe,IAAf,CAA9B;EAEAZ,KAAK,CAACa,SAAN,CAAgB,MAAM;IACpBF,UAAU,CAAC,IAAD,CAAV;IACAP,iBAAiB,CAACU,SAAlB,CAA4BN,MAAM,CAACO,SAAnC,EAA8CP,MAAM,CAACQ,SAArD;IACAL,UAAU,CAAC,KAAD,CAAV;EACD,CAJD,EAIG,CAACH,MAAD,CAJH;;EAMA,IAAI,CAACA,MAAL,EAAa;IACX,MAAM,IAAIS,KAAJ,CAAU,uCAAV,CAAN;EACD;;EAED,oBAAO,oBAAC,gBAAD,CAAkB,QAAlB;IAA2B,KAAK,EAAET;EAAlC,GACJE,OAAO,gBAAG,oBAAC,iBAAD,OAAH,GAA2BD,QAD9B,CAAP;AAGD,CAhBD;;AAkBA,SACEJ,gBADF,EAEEE,iBAFF"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { requireNativeComponent, NativeModules, NativeEventEmitter, findNodeHandle, UIManager, ActivityIndicator, Platform } from 'react-native';
|
|
3
|
+
const {
|
|
4
|
+
RNPEEventEmitter
|
|
5
|
+
} = NativeModules;
|
|
6
|
+
const COMPONENT_NAME = 'RNPEBankAccountView';
|
|
7
|
+
const RNPEBankAccountView = requireNativeComponent(COMPONENT_NAME); // @ts-ignore
|
|
8
|
+
|
|
9
|
+
const RNPEBankAccountViewManager = UIManager[COMPONENT_NAME];
|
|
10
|
+
const peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);
|
|
11
|
+
export const PEBankAccountView = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
|
+
const formRef = React.useRef();
|
|
13
|
+
const [height, setHeight] = React.useState(0);
|
|
14
|
+
React.useImperativeHandle(ref, () => ({
|
|
15
|
+
submit: async function (merchantId) {
|
|
16
|
+
let additionalData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
if (height === 0) {
|
|
19
|
+
return reject(new Error('Form is not ready'));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const listener = peEventEmitter.addListener('onBankAccountRespond', args => {
|
|
23
|
+
listener.remove();
|
|
24
|
+
const {
|
|
25
|
+
error,
|
|
26
|
+
bankAccount: json
|
|
27
|
+
} = args;
|
|
28
|
+
|
|
29
|
+
if (error) {
|
|
30
|
+
reject(new Error(error));
|
|
31
|
+
} else {
|
|
32
|
+
const bankAccount = JSON.parse(json);
|
|
33
|
+
resolve(bankAccount);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
callNativeMethod("submit", [merchantId, additionalData]);
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
showKeyboard: () => {
|
|
40
|
+
callNativeMethod("showKeyboard");
|
|
41
|
+
},
|
|
42
|
+
hideKeyboard: () => {
|
|
43
|
+
callNativeMethod("hideKeyboard");
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
const callNativeMethod = React.useCallback(function (methodName) {
|
|
47
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
48
|
+
const viewId = findNodeHandle(formRef.current);
|
|
49
|
+
let commandId = RNPEBankAccountViewManager.Commands[methodName].toString();
|
|
50
|
+
|
|
51
|
+
if (Platform.OS === 'ios') {
|
|
52
|
+
commandId = Number(commandId);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
UIManager.dispatchViewManagerCommand(viewId, commandId, params);
|
|
56
|
+
}, [formRef.current]);
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
const eventListener = peEventEmitter.addListener('onSizeChanges', args => {
|
|
59
|
+
const {
|
|
60
|
+
width: _,
|
|
61
|
+
height: frameHeight
|
|
62
|
+
} = args;
|
|
63
|
+
setHeight(frameHeight);
|
|
64
|
+
});
|
|
65
|
+
return () => eventListener.remove();
|
|
66
|
+
}, []);
|
|
67
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, height === 0 && /*#__PURE__*/React.createElement(ActivityIndicator, null), /*#__PURE__*/React.createElement(RNPEBankAccountView, {
|
|
68
|
+
ref: formRef,
|
|
69
|
+
additionalFields: JSON.stringify(props.additionalFields ?? []),
|
|
70
|
+
style: {
|
|
71
|
+
height: height
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=BankAccountView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","requireNativeComponent","NativeModules","NativeEventEmitter","findNodeHandle","UIManager","ActivityIndicator","Platform","RNPEEventEmitter","COMPONENT_NAME","RNPEBankAccountView","RNPEBankAccountViewManager","peEventEmitter","PEBankAccountView","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","current","commandId","Commands","toString","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,76 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { requireNativeComponent, NativeModules, NativeEventEmitter, Platform, findNodeHandle, UIManager, ActivityIndicator } from 'react-native';
|
|
3
|
+
const {
|
|
4
|
+
RNPEEventEmitter
|
|
5
|
+
} = NativeModules;
|
|
6
|
+
const COMPONENT_NAME = 'RNPECreditCardView';
|
|
7
|
+
const RNPECreditCardView = requireNativeComponent(COMPONENT_NAME); // @ts-ignore
|
|
8
|
+
|
|
9
|
+
const RNPECreditCardViewManager = UIManager[COMPONENT_NAME];
|
|
10
|
+
const peEventEmitter = new NativeEventEmitter(RNPEEventEmitter);
|
|
11
|
+
export const PECreditCardView = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
12
|
+
const formRef = React.useRef();
|
|
13
|
+
const [height, setHeight] = React.useState(0);
|
|
14
|
+
React.useImperativeHandle(ref, () => ({
|
|
15
|
+
submit: async function (merchantId) {
|
|
16
|
+
let additionalData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17
|
+
return new Promise((resolve, reject) => {
|
|
18
|
+
if (height === 0) {
|
|
19
|
+
return reject(new Error('Form is not ready'));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const listener = peEventEmitter.addListener('onCardRespond', args => {
|
|
23
|
+
listener.remove();
|
|
24
|
+
const {
|
|
25
|
+
error,
|
|
26
|
+
card: json
|
|
27
|
+
} = args;
|
|
28
|
+
|
|
29
|
+
if (error) {
|
|
30
|
+
reject(new Error(error));
|
|
31
|
+
} else {
|
|
32
|
+
const card = JSON.parse(json);
|
|
33
|
+
resolve(card);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
callNativeMethod("submit", [merchantId, additionalData]);
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
showKeyboard: () => {
|
|
40
|
+
callNativeMethod("showKeyboard");
|
|
41
|
+
},
|
|
42
|
+
hideKeyboard: () => {
|
|
43
|
+
callNativeMethod("hideKeyboard");
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
const callNativeMethod = React.useCallback(function (methodName) {
|
|
47
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
48
|
+
console.log("callNativeMethod", methodName, params);
|
|
49
|
+
const viewId = findNodeHandle(formRef.current);
|
|
50
|
+
let commandId = RNPECreditCardViewManager.Commands[methodName].toString();
|
|
51
|
+
|
|
52
|
+
if (Platform.OS === 'ios') {
|
|
53
|
+
commandId = Number(commandId);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
UIManager.dispatchViewManagerCommand(viewId, commandId, params);
|
|
57
|
+
}, [formRef.current]);
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
const eventListener = peEventEmitter.addListener('onSizeChanges', args => {
|
|
60
|
+
const {
|
|
61
|
+
width: _,
|
|
62
|
+
height: frameHeight
|
|
63
|
+
} = args;
|
|
64
|
+
setHeight(frameHeight);
|
|
65
|
+
});
|
|
66
|
+
return () => eventListener.remove();
|
|
67
|
+
}, []);
|
|
68
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, height === 0 && /*#__PURE__*/React.createElement(ActivityIndicator, null), /*#__PURE__*/React.createElement(RNPECreditCardView, {
|
|
69
|
+
ref: formRef,
|
|
70
|
+
additionalFields: JSON.stringify(props.additionalFields ?? []),
|
|
71
|
+
style: {
|
|
72
|
+
height: height
|
|
73
|
+
}
|
|
74
|
+
}));
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=CreditCardView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","requireNativeComponent","NativeModules","NativeEventEmitter","Platform","findNodeHandle","UIManager","ActivityIndicator","RNPEEventEmitter","COMPONENT_NAME","RNPECreditCardView","RNPECreditCardViewManager","peEventEmitter","PECreditCardView","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","current","commandId","Commands","toString","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":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var PEKeyboardType;
|
|
2
|
+
|
|
3
|
+
(function (PEKeyboardType) {
|
|
4
|
+
PEKeyboardType["alphabet"] = "alphabet";
|
|
5
|
+
PEKeyboardType["number"] = "number";
|
|
6
|
+
PEKeyboardType["phone"] = "phone";
|
|
7
|
+
PEKeyboardType["normal"] = "normal";
|
|
8
|
+
})(PEKeyboardType || (PEKeyboardType = {}));
|
|
9
|
+
|
|
10
|
+
export default PEKeyboardType;
|
|
11
|
+
//# sourceMappingURL=PEKeyboardType.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PEKeyboardType"],"sources":["PEKeyboardType.ts"],"sourcesContent":["enum PEKeyboardType {\n alphabet = 'alphabet',\n number = 'number',\n phone = 'phone',\n normal = 'normal',\n}\n\nexport default PEKeyboardType;\n"],"mappings":"IAAKA,c;;WAAAA,c;EAAAA,c;EAAAA,c;EAAAA,c;EAAAA,c;GAAAA,c,KAAAA,c;;AAOL,eAAeA,cAAf"}
|
package/lib/module/index.js
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import PayEngine from './components/PayEngine';
|
|
2
2
|
import { NativeModules, Platform } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { PECreditCardView, PECreditCardViewMethods } from './components/v2/SecureFields/CreditCardView';
|
|
4
|
+
import { PEBankAccountView, PEBankAccountViewMethods } from './components/v2/SecureFields/BankAccountView';
|
|
5
|
+
import { PayEngineProvider } from './components/v2/PayEngineProvider';
|
|
6
|
+
import PayEngineNative from './components/v2/PayEngineNative';
|
|
7
|
+
import { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';
|
|
8
|
+
import { PEPaymentRequest } from './components/v2/ApplePay/PEPaymentRequest';
|
|
9
|
+
import * as PayEngineUtils from './utils/index';
|
|
10
|
+
import PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';
|
|
4
11
|
const LINKING_ERROR = `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \n\n` + Platform.select({
|
|
5
12
|
ios: "- You have run 'pod install'\n",
|
|
6
13
|
default: ''
|
|
@@ -10,9 +17,11 @@ const PayEngineStatic = NativeModules.Payengine ? NativeModules.Payengine : new
|
|
|
10
17
|
throw new Error(LINKING_ERROR);
|
|
11
18
|
}
|
|
12
19
|
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
});
|
|
21
|
+
export { PayEngineStatic, PayEngine, // v2 starting here
|
|
22
|
+
PayEngineUtils, PayEngineProvider, PayEngineNative, // securefields
|
|
23
|
+
PEKeyboardType, // credit card
|
|
24
|
+
PECreditCardView, PECreditCardViewMethods, // bank account
|
|
25
|
+
PEBankAccountView, PEBankAccountViewMethods, // Apple Pay
|
|
26
|
+
PEApplePayButton, PEPaymentRequest };
|
|
18
27
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PayEngine","NativeModules","Platform","
|
|
1
|
+
{"version":3,"names":["PayEngine","NativeModules","Platform","PECreditCardView","PECreditCardViewMethods","PEBankAccountView","PEBankAccountViewMethods","PayEngineProvider","PayEngineNative","PEApplePayButton","PEPaymentRequest","PayEngineUtils","PEKeyboardType","LINKING_ERROR","select","ios","default","PayEngineStatic","Payengine","Proxy","get","Error"],"sources":["index.tsx"],"sourcesContent":["import PayEngine from './components/PayEngine';\nimport { NativeModules, Platform } from 'react-native';\nimport type { IPayEngineConfig } from './interfaces/index';\nimport {\n PECreditCardView,\n PECreditCardViewMethods,\n} from './components/v2/SecureFields/CreditCardView';\nimport {\n PEBankAccountView,\n PEBankAccountViewMethods,\n} from './components/v2/SecureFields/BankAccountView';\nimport type IPEField from './components/v2/SecureFields/IPEField';\nimport type PECard from './components/v2/SecureFields/PECard';\nimport type PEBankAccount from './components/v2/SecureFields/PEBankAccount';\nimport { PayEngineProvider } from './components/v2/PayEngineProvider';\nimport PayEngineNative from './components/v2/PayEngineNative';\nimport { PEApplePayButton } from './components/v2/ApplePay/PEApplePayButton';\nimport { PEPaymentRequest } from './components/v2/ApplePay/PEPaymentRequest';\nimport * as PayEngineUtils from './utils/index';\nimport PEKeyboardType from './components/v2/SecureFields/PEKeyboardType';\n\nconst LINKING_ERROR =\n `The package 'react-native-payengine' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo managed workflow\\n';\n\nconst PayEngineStatic = NativeModules.Payengine\n ? NativeModules.Payengine\n : new Proxy(\n {},\n {\n get() {\n throw new Error(LINKING_ERROR);\n },\n }\n );\n\nexport {\n PayEngineStatic,\n PayEngine,\n IPayEngineConfig,\n\n // v2 starting here\n PayEngineUtils,\n PayEngineProvider,\n PayEngineNative,\n // securefields\n PEKeyboardType,\n IPEField,\n // credit card\n PECreditCardView,\n PECreditCardViewMethods,\n PECard,\n // bank account\n PEBankAccountView,\n PEBankAccountViewMethods,\n PEBankAccount,\n // Apple Pay\n PEApplePayButton,\n PEPaymentRequest,\n};\n"],"mappings":"AAAA,OAAOA,SAAP,MAAsB,wBAAtB;AACA,SAASC,aAAT,EAAwBC,QAAxB,QAAwC,cAAxC;AAEA,SACEC,gBADF,EAEEC,uBAFF,QAGO,6CAHP;AAIA,SACEC,iBADF,EAEEC,wBAFF,QAGO,8CAHP;AAOA,SAASC,iBAAT,QAAkC,mCAAlC;AACA,OAAOC,eAAP,MAA4B,iCAA5B;AACA,SAASC,gBAAT,QAAiC,2CAAjC;AACA,SAASC,gBAAT,QAAiC,2CAAjC;AACA,OAAO,KAAKC,cAAZ,MAAgC,eAAhC;AACA,OAAOC,cAAP,MAA2B,6CAA3B;AAEA,MAAMC,aAAa,GAChB,iFAAD,GACAX,QAAQ,CAACY,MAAT,CAAgB;EAAEC,GAAG,EAAE,gCAAP;EAAyCC,OAAO,EAAE;AAAlD,CAAhB,CADA,GAEA,sDAFA,GAGA,6CAJF;AAMA,MAAMC,eAAe,GAAGhB,aAAa,CAACiB,SAAd,GACpBjB,aAAa,CAACiB,SADM,GAEpB,IAAIC,KAAJ,CACE,EADF,EAEE;EACEC,GAAG,GAAG;IACJ,MAAM,IAAIC,KAAJ,CAAUR,aAAV,CAAN;EACD;;AAHH,CAFF,CAFJ;AAWA,SACEI,eADF,EAEEjB,SAFF,EAKE;AACAW,cANF,EAOEJ,iBAPF,EAQEC,eARF,EASE;AACAI,cAVF,EAYE;AACAT,gBAbF,EAcEC,uBAdF,EAgBE;AACAC,iBAjBF,EAkBEC,wBAlBF,EAoBE;AACAG,gBArBF,EAsBEC,gBAtBF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export interface IPayEngineConfig {\n publicKey: string;\n version?: string;\n scriptURL?: string;\n logLevel?: number;\n}\n"],"mappings":""}
|