react-native-payengine 1.0.5 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +193 -111
- package/android/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/{5.6.4 → 6.1.1}/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/config.properties +2 -0
- package/android/.idea/caches/deviceStreaming.xml +318 -0
- package/android/.idea/compiler.xml +1 -1
- package/android/.idea/gradle.xml +2 -2
- package/android/.idea/kotlinc.xml +6 -0
- package/android/.idea/migrations.xml +10 -0
- package/android/.idea/misc.xml +1 -1
- package/android/build.gradle +42 -6
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/paymentsdk-debug.aar +0 -0
- package/android/paymentsdk-release.aar +0 -0
- package/android/src/legacy/AndroidManifest.xml +4 -0
- package/android/src/main/java/com/reactnativepayengine/GooglePayModule.java +196 -0
- package/android/src/main/java/com/reactnativepayengine/PayengineModule.java +1 -5
- package/android/src/main/java/com/reactnativepayengine/PayenginePackage.java +8 -33
- package/android/src/main/java/com/reactnativepayengine/util/MetricsUtil.kt +44 -0
- package/android/src/main/java/com/reactnativepayengine/util/PaymentsUtil.java +113 -0
- package/android/src/main/java/com/reactnativepayengine/v2/RNPEFraudAnalyticsApplication.java +55 -0
- package/android/src/main/java/com/reactnativepayengine/v2/RNPayEngineNative.kt +71 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEEvents.kt +8 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/RNPEField.kt +17 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNBankAccountViewManager.kt +103 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/bankaccount/RNPEBankAccountView.kt +77 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardView.kt +77 -0
- package/android/src/main/java/com/reactnativepayengine/v2/securefields/creditcard/RNPECreditCardViewManager.kt +103 -0
- package/ios/PayEngineSDK.xcframework/Info.plist +44 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +622 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/Modules/module.modulemap +11 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/browserInfo.html +136 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64/PayEngineSDK.framework/perform3ds.html +467 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Frameworks/libKountDataCollector.a +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/CustomWindow.h +25 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KDataCollector.h +106 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/KountAnalyticsViewController.h +82 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK-Swift.h +1240 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/PayEngineSDK.h +20 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIControl+CustomControl.h +33 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Headers/UIViewController+TouchControl.h +27 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.abi.json +15143 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/PayEngineSDK.swiftmodule/x86_64-apple-ios-simulator.swiftinterface-e +326 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/Modules/module.modulemap +11 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/PayEngineSDK +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Assets.car +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/VGSCollectSDK_VGSCollectSDK.bundle/Info.plist +0 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/browserInfo.html +136 -0
- package/ios/PayEngineSDK.xcframework/ios-arm64_x86_64-simulator/PayEngineSDK.framework/perform3ds.html +467 -0
- package/ios/Payengine.xcodeproj/project.pbxproj +30 -9
- package/ios/Payengine.xcodeproj/project.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Payengine.xcodeproj/xcuserdata/tringuyen.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +4 -4
- package/ios/Payengine.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Payengine.xcworkspace/xcuserdata/tringuyen.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Sources/Classes/ApplePay/RNPEApplePayButton.swift +111 -0
- package/ios/Sources/Classes/ApplePay/RNPEApplePayPaymentRequest.swift +43 -0
- package/ios/Sources/Classes/RNPEError.swift +12 -0
- package/ios/Sources/Classes/RNPEEventEmitter.swift +29 -0
- package/ios/Sources/Classes/RNPEUtils.swift +30 -0
- package/ios/Sources/Classes/RNPayEngineNative.swift +87 -0
- package/ios/Sources/Classes/SecureFields/RNPEBankAccountView.swift +130 -0
- package/ios/Sources/Classes/SecureFields/RNPECreditCardView.swift +129 -0
- package/ios/Sources/Classes/SecureFields/RNPEEvents.swift +15 -0
- package/ios/Sources/Classes/SecureFields/RNPEField.swift +26 -0
- package/ios/Sources/Payengine.m +73 -0
- package/ios/Sources/Payengine.swift +13 -0
- package/lib/commonjs/components/PayEngine.js +2 -123
- package/lib/commonjs/components/PayEngine.js.map +1 -1
- package/lib/commonjs/components/{SecureFields/VGS/CardHolderNameField.js → v2/ApplePay/PEApplePayButton.js} +38 -13
- package/lib/commonjs/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js +29 -0
- package/lib/commonjs/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
- package/lib/commonjs/components/v2/PayEngineNative.js +34 -0
- package/lib/commonjs/components/v2/PayEngineNative.js.map +1 -0
- package/lib/commonjs/components/{SecureFields/VGS/TextField.js → v2/PayEngineProvider.js} +28 -12
- package/lib/commonjs/components/v2/PayEngineProvider.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js +89 -0
- package/lib/commonjs/components/v2/SecureFields/BankAccountView.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js +90 -0
- package/lib/commonjs/components/v2/SecureFields/CreditCardView.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/IPEField.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/IPEField.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/PEBankAccount.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PECard.js +6 -0
- package/lib/commonjs/components/v2/SecureFields/PECard.js.map +1 -0
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js +18 -0
- package/lib/commonjs/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
- package/lib/commonjs/index.js +73 -8
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/index.js +2 -0
- package/lib/commonjs/interfaces/index.js.map +1 -0
- package/lib/commonjs/utils/index.js +29 -45
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/module/components/PayEngine.js +3 -118
- package/lib/module/components/PayEngine.js.map +1 -1
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js +37 -0
- package/lib/module/components/v2/ApplePay/PEApplePayButton.js.map +1 -0
- package/lib/module/components/v2/ApplePay/PEPaymentRequest.js +20 -0
- package/lib/module/components/v2/ApplePay/PEPaymentRequest.js.map +1 -0
- package/lib/module/components/v2/PayEngineNative.js +23 -0
- package/lib/module/components/v2/PayEngineNative.js.map +1 -0
- package/lib/module/components/v2/PayEngineProvider.js +30 -0
- package/lib/module/components/v2/PayEngineProvider.js.map +1 -0
- package/lib/module/components/v2/SecureFields/BankAccountView.js +75 -0
- package/lib/module/components/v2/SecureFields/BankAccountView.js.map +1 -0
- package/lib/module/components/v2/SecureFields/CreditCardView.js +76 -0
- package/lib/module/components/v2/SecureFields/CreditCardView.js.map +1 -0
- package/lib/module/components/v2/SecureFields/IPEField.js +2 -0
- package/lib/module/components/v2/SecureFields/IPEField.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PEBankAccount.js +2 -0
- package/lib/module/components/v2/SecureFields/PEBankAccount.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PECard.js +2 -0
- package/lib/module/components/v2/SecureFields/PECard.js.map +1 -0
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js +11 -0
- package/lib/module/components/v2/SecureFields/PEKeyboardType.js.map +1 -0
- package/lib/module/index.js +15 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/index.js +2 -0
- package/lib/module/interfaces/index.js.map +1 -0
- package/lib/module/utils/index.js +20 -45
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/components/PayEngine.d.ts +1 -14
- package/lib/typescript/components/v2/ApplePay/PEApplePayButton.d.ts +12 -0
- package/lib/typescript/components/v2/ApplePay/PEPaymentRequest.d.ts +12 -0
- package/lib/typescript/components/v2/PayEngineNative.d.ts +5 -0
- package/lib/typescript/components/v2/PayEngineProvider.d.ts +8 -0
- package/lib/typescript/components/v2/SecureFields/BankAccountView.d.ts +14 -0
- package/lib/typescript/components/v2/SecureFields/CreditCardView.d.ts +14 -0
- package/lib/typescript/components/v2/SecureFields/IPEField.d.ts +10 -0
- package/lib/typescript/components/v2/SecureFields/PEBankAccount.d.ts +11 -0
- package/lib/typescript/components/v2/SecureFields/PECard.d.ts +13 -0
- package/lib/typescript/components/v2/SecureFields/PEKeyboardType.d.ts +7 -0
- package/lib/typescript/index.d.ts +13 -3
- package/lib/typescript/interfaces/index.d.ts +6 -0
- package/lib/typescript/utils/index.d.ts +7 -41
- package/package.json +17 -11
- package/react-native-payengine.podspec +3 -3
- package/src/components/LoadingIndicator.tsx +28 -0
- package/src/components/PayEngine.tsx +8 -0
- package/src/components/v2/ApplePay/PEApplePayButton.tsx +70 -0
- package/src/components/v2/ApplePay/PEPaymentRequest.ts +18 -0
- package/src/components/v2/PayEngineNative.tsx +20 -0
- package/src/components/v2/PayEngineProvider.tsx +30 -0
- package/src/components/v2/SecureFields/BankAccountView.tsx +95 -0
- package/src/components/v2/SecureFields/CreditCardView.tsx +96 -0
- package/src/components/v2/SecureFields/IPEField.ts +12 -0
- package/src/components/v2/SecureFields/PEBankAccount.ts +12 -0
- package/src/components/v2/SecureFields/PECard.ts +14 -0
- package/src/components/v2/SecureFields/PEKeyboardType.ts +8 -0
- package/src/index.tsx +62 -0
- package/src/interfaces/index.ts +6 -0
- package/src/utils/index.ts +79 -0
- package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
- package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectModule.java +0 -148
- package/android/src/main/java/com/reactnativepayengine/collect/VGSCollectOnCreateViewInstanceListener.java +0 -6
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCVCField.java +0 -67
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardHolderNameField.java +0 -53
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSCardNumberField.java +0 -57
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSExpDateField.java +0 -54
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSTextField.java +0 -57
- package/android/src/main/java/com/reactnativepayengine/collect/fields/VGSZipCodeField.java +0 -62
- package/android/src/main/java/com/reactnativepayengine/util/ResourceUtil.java +0 -14
- package/ios/Payengine.m +0 -55
- package/ios/Payengine.swift +0 -637
- package/lib/commonjs/components/SecureFields/VGS/CVCField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/CVCField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/CardNumberField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/CollectManager.js +0 -65
- package/lib/commonjs/components/SecureFields/VGS/CollectManager.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/ExpDateField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/TextField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js +0 -26
- package/lib/commonjs/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
- package/lib/commonjs/components/SecureFields/index.js +0 -34
- package/lib/commonjs/components/SecureFields/index.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CVCField.js +0 -14
- package/lib/module/components/SecureFields/VGS/CVCField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CardHolderNameField.js +0 -14
- package/lib/module/components/SecureFields/VGS/CardHolderNameField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CardNumberField.js +0 -14
- package/lib/module/components/SecureFields/VGS/CardNumberField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/CollectManager.js +0 -50
- package/lib/module/components/SecureFields/VGS/CollectManager.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/ExpDateField.js +0 -14
- package/lib/module/components/SecureFields/VGS/ExpDateField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/TextField.js +0 -17
- package/lib/module/components/SecureFields/VGS/TextField.js.map +0 -1
- package/lib/module/components/SecureFields/VGS/ZipCodeField.js +0 -14
- package/lib/module/components/SecureFields/VGS/ZipCodeField.js.map +0 -1
- package/lib/module/components/SecureFields/index.js +0 -17
- package/lib/module/components/SecureFields/index.js.map +0 -1
- package/lib/typescript/components/SecureFields/VGS/CVCField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/CardHolderNameField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/CardNumberField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/CollectManager.d.ts +0 -12
- package/lib/typescript/components/SecureFields/VGS/ExpDateField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/VGS/TextField.d.ts +0 -14
- package/lib/typescript/components/SecureFields/VGS/ZipCodeField.d.ts +0 -10
- package/lib/typescript/components/SecureFields/index.d.ts +0 -16
- /package/android/.gradle/{5.6.4 → 6.1.1}/fileChanges/last-build.bin +0 -0
- /package/android/.gradle/{5.6.4 → 6.1.1}/gc.properties +0 -0
- /package/android/{vgscollect-1.7.2-debug.aar → securefields-1.7.2-debug.aar} +0 -0
- /package/ios/{Payengine-Bridging-Header.h → Sources/Payengine-Bridging-Header.h} +0 -0
package/ios/Payengine.swift
DELETED
|
@@ -1,637 +0,0 @@
|
|
|
1
|
-
import VGSCollectSDK
|
|
2
|
-
import UIKit
|
|
3
|
-
|
|
4
|
-
let borderColor = UIColor.gray
|
|
5
|
-
let errorBorderColor = UIColor.red
|
|
6
|
-
|
|
7
|
-
var vgsCollect = VGSCollect(id: "vauiltId", environment: .sandbox)
|
|
8
|
-
|
|
9
|
-
@objc(Payengine)
|
|
10
|
-
class Payengine: NSObject {
|
|
11
|
-
|
|
12
|
-
@objc(multiply:withB:withResolver:withRejecter:)
|
|
13
|
-
func multiply(a: Float, b: Float, resolve:RCTPromiseResolveBlock,reject:RCTPromiseRejectBlock) -> Void {
|
|
14
|
-
resolve(a*b)
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
@objc(VGSCollectManager)
|
|
20
|
-
class VGSCollectManager: NSObject {
|
|
21
|
-
|
|
22
|
-
override init() {
|
|
23
|
-
super.init()
|
|
24
|
-
|
|
25
|
-
// Enable loggers only for debug!
|
|
26
|
-
VGSCollectLogger.shared.configuration.level = .info
|
|
27
|
-
VGSCollectLogger.shared.configuration.isNetworkDebugEnabled = true
|
|
28
|
-
// *You can stop all VGS Show loggers in app:
|
|
29
|
-
// VGSCollectLogger.shared.disableAllLoggers()
|
|
30
|
-
vgsCollect.textFields.forEach { (textField) in
|
|
31
|
-
textField.delegate = self
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
@objc
|
|
36
|
-
static func requiresMainQueueSetup() -> Bool {
|
|
37
|
-
return true
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
@objc(setConfiguration:environment:hostname:satellitePort:)
|
|
41
|
-
func setConfiguration(_ vaultId: String, environment: String, hostname: String, satellitePort: Int) -> Void {
|
|
42
|
-
vgsCollect = VGSCollect(id: vaultId, environment: environment)
|
|
43
|
-
// , hostname: hostname, satellitePort: satellitePort
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@objc(createCard:resolver:rejecter:)
|
|
47
|
-
func createCard(_ merchantId: String?, resolve: @escaping RCTResponseSenderBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
48
|
-
return submitData(merchantId, path: "/api/cards", resolve: resolve, reject: reject)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
@objc(createBankAccount:resolver:rejecter:)
|
|
52
|
-
func createBankAccount(_ merchantId: String?, resolve: @escaping RCTResponseSenderBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
53
|
-
return submitData(merchantId, path: "/api/bank-accounts", resolve: resolve, reject: reject)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
private func submitData(_ merchantId: String?, path: String, resolve: @escaping RCTResponseSenderBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
57
|
-
// add extra data to submit
|
|
58
|
-
var extraData = [String: Any]()
|
|
59
|
-
if (merchantId != nil) {
|
|
60
|
-
extraData["merchant_id"] = merchantId
|
|
61
|
-
}
|
|
62
|
-
extraData["pci_vault_provider"] = "vgs"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
//All UI changes should be done on main thread.
|
|
66
|
-
DispatchQueue.main.async { [weak self] in
|
|
67
|
-
vgsCollect.textFields.forEach { (textfield) in
|
|
68
|
-
/// Check textField state before submit
|
|
69
|
-
if !textfield.state.isValid {
|
|
70
|
-
/// if state is not valid, set border color as red
|
|
71
|
-
textfield.borderColor = errorBorderColor
|
|
72
|
-
} else {
|
|
73
|
-
textfield.borderColor = borderColor
|
|
74
|
-
}
|
|
75
|
-
/// hide keyboard(if field was active)
|
|
76
|
-
textfield.resignFirstResponder()
|
|
77
|
-
|
|
78
|
-
if let cardState = textfield.state as? CardState {
|
|
79
|
-
extraData["bin"] = cardState.bin
|
|
80
|
-
extraData["last_4"] = cardState.last4
|
|
81
|
-
extraData["brand"] = cardState.cardBrand.stringValue
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Send data to your Vault
|
|
86
|
-
vgsCollect.sendData(path: path, extraData: extraData) { (response) in
|
|
87
|
-
|
|
88
|
-
switch response {
|
|
89
|
-
case .success(_, let data, _):
|
|
90
|
-
var jsonText = ""
|
|
91
|
-
if let data = data, let jsonData = try? JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
|
|
92
|
-
return resolve([jsonData["data"]!])
|
|
93
|
-
}
|
|
94
|
-
case .failure(let code, _, _, let error):
|
|
95
|
-
var errorText = ""
|
|
96
|
-
print("Submit request error: \(code), \(String(describing: error))")
|
|
97
|
-
switch code {
|
|
98
|
-
case 400..<499:
|
|
99
|
-
// Wrong request. This also can happend when your Routs not setup yet or your <vaultId> is wrong
|
|
100
|
-
errorText = "Wrong Request Error: \(code)"
|
|
101
|
-
return reject("http_error", errorText, error)
|
|
102
|
-
case VGSErrorType.inputDataIsNotValid.rawValue:
|
|
103
|
-
if let error = error as? VGSError {
|
|
104
|
-
errorText = "Input data is not valid. Details:\n \(error)"
|
|
105
|
-
}
|
|
106
|
-
return reject("input_error", errorText, error)
|
|
107
|
-
default:
|
|
108
|
-
errorText = "Something went wrong. Code: \(code)"
|
|
109
|
-
return reject("unexpected_error", errorText, error)
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/// VGSTextFieldDelegate -handle VGSTextField changes
|
|
118
|
-
extension VGSCollectManager: VGSTextFieldDelegate {
|
|
119
|
-
func vgsTextFieldDidBeginEditing(_ textField: VGSTextField) {
|
|
120
|
-
/// Reset border color to default if the field was not valid on sendData(_:) request
|
|
121
|
-
textField.borderColor = borderColor
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
func vgsTextFieldDidChange(_ textField: VGSTextField) {
|
|
125
|
-
print(textField.state.description)
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
class CustomCardNumberField: UIView {
|
|
130
|
-
|
|
131
|
-
var field: VGSCardTextField!
|
|
132
|
-
|
|
133
|
-
@objc var placeholder: NSString = "Card number" {
|
|
134
|
-
didSet {
|
|
135
|
-
_placeholder = String(describing: placeholder)
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
var _placeholder: String = "Card number" {
|
|
140
|
-
didSet {
|
|
141
|
-
field.placeholder = String(describing: _placeholder)
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
@objc var name: NSString = "card_number" {
|
|
146
|
-
didSet {
|
|
147
|
-
_name = String(describing: name)
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
var _name: String = "card_number" {
|
|
152
|
-
didSet {
|
|
153
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
154
|
-
config.type = FieldType.cardNumber
|
|
155
|
-
config.isRequiredValidOnly = true
|
|
156
|
-
|
|
157
|
-
field.configuration = config
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
override init(frame: CGRect) {
|
|
162
|
-
super.init(frame: frame)
|
|
163
|
-
setupView()
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
required init?(coder aDecoder: NSCoder) {
|
|
167
|
-
super.init(coder: aDecoder)
|
|
168
|
-
setupView()
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
private func setupView() {
|
|
173
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
174
|
-
config.type = FieldType.cardNumber
|
|
175
|
-
config.isRequiredValidOnly = true
|
|
176
|
-
|
|
177
|
-
field = VGSCardTextField()
|
|
178
|
-
field.translatesAutoresizingMaskIntoConstraints = false
|
|
179
|
-
field.placeholder = String(describing: _placeholder)
|
|
180
|
-
field.padding = .init(top: 8, left: 8, bottom: 8, right: 8)
|
|
181
|
-
field.configuration = config
|
|
182
|
-
self.addSubview(field)
|
|
183
|
-
self.bringSubviewToFront(field)
|
|
184
|
-
field.bounds = self.bounds
|
|
185
|
-
NSLayoutConstraint.activate([
|
|
186
|
-
field.topAnchor.constraint(equalTo: self.topAnchor),
|
|
187
|
-
field.bottomAnchor.constraint(equalTo: self.bottomAnchor),
|
|
188
|
-
field.leadingAnchor.constraint(equalTo: self.leadingAnchor),
|
|
189
|
-
field.trailingAnchor.constraint(equalTo: self.trailingAnchor)
|
|
190
|
-
])
|
|
191
|
-
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
@objc(VGSCardNumberFieldManager)
|
|
198
|
-
class VGSCardNumberFieldManager: RCTViewManager {
|
|
199
|
-
|
|
200
|
-
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
201
|
-
return true
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
override func view() -> UIView! {
|
|
205
|
-
return CustomCardNumberField()
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
class CustomExpDateField: UIView {
|
|
210
|
-
|
|
211
|
-
var field: VGSExpDateTextField!
|
|
212
|
-
|
|
213
|
-
@objc var placeholder: NSString = "Exp date" {
|
|
214
|
-
didSet {
|
|
215
|
-
_placeholder = String(describing: placeholder)
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
var _placeholder: String = "Exp date" {
|
|
220
|
-
didSet {
|
|
221
|
-
field.placeholder = String(describing: _placeholder)
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
@objc var name: NSString = "card_exp" {
|
|
226
|
-
didSet {
|
|
227
|
-
_name = String(describing: name)
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
var _name: String = "card_exp" {
|
|
232
|
-
didSet {
|
|
233
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
234
|
-
config.type = FieldType.expDate
|
|
235
|
-
config.isRequiredValidOnly = true
|
|
236
|
-
|
|
237
|
-
field.configuration = config
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
override init(frame: CGRect) {
|
|
242
|
-
super.init(frame: frame)
|
|
243
|
-
setupView()
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
required init?(coder aDecoder: NSCoder) {
|
|
247
|
-
super.init(coder: aDecoder)
|
|
248
|
-
setupView()
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
private func setupView() {
|
|
254
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
255
|
-
config.type = FieldType.expDate
|
|
256
|
-
config.isRequiredValidOnly = true
|
|
257
|
-
|
|
258
|
-
field = VGSExpDateTextField()
|
|
259
|
-
field.translatesAutoresizingMaskIntoConstraints = false
|
|
260
|
-
field.placeholder = String(describing: _placeholder)
|
|
261
|
-
field.padding = .init(top: 8, left: 8, bottom: 8, right: 8)
|
|
262
|
-
field.configuration = config
|
|
263
|
-
field.monthPickerFormat = .longSymbols
|
|
264
|
-
self.addSubview(field)
|
|
265
|
-
self.bringSubviewToFront(field)
|
|
266
|
-
field.bounds = self.bounds
|
|
267
|
-
NSLayoutConstraint.activate([
|
|
268
|
-
field.topAnchor.constraint(equalTo: self.topAnchor),
|
|
269
|
-
field.bottomAnchor.constraint(equalTo: self.bottomAnchor),
|
|
270
|
-
field.leadingAnchor.constraint(equalTo: self.leadingAnchor),
|
|
271
|
-
field.trailingAnchor.constraint(equalTo: self.trailingAnchor)
|
|
272
|
-
])
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
@objc(VGSExpDateFieldManager)
|
|
279
|
-
class VGSExpDateFieldManager: RCTViewManager {
|
|
280
|
-
|
|
281
|
-
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
282
|
-
return true
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
override func view() -> UIView! {
|
|
286
|
-
return CustomExpDateField()
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
class CustomCVCField: UIView {
|
|
291
|
-
|
|
292
|
-
var field: VGSCVCTextField!
|
|
293
|
-
|
|
294
|
-
@objc var placeholder: NSString = "CVC" {
|
|
295
|
-
didSet {
|
|
296
|
-
_placeholder = String(describing: placeholder)
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
var _placeholder: String = "CVC" {
|
|
301
|
-
didSet {
|
|
302
|
-
field.placeholder = String(describing: _placeholder)
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
@objc var name: NSString = "card_cvc" {
|
|
307
|
-
didSet {
|
|
308
|
-
_name = String(describing: name)
|
|
309
|
-
}
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
var _name: String = "card_cvc" {
|
|
313
|
-
didSet {
|
|
314
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
315
|
-
config.type = FieldType.cvc
|
|
316
|
-
config.isRequiredValidOnly = true
|
|
317
|
-
|
|
318
|
-
field.configuration = config
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
override init(frame: CGRect) {
|
|
323
|
-
super.init(frame: frame)
|
|
324
|
-
setupView()
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
required init?(coder aDecoder: NSCoder) {
|
|
328
|
-
super.init(coder: aDecoder)
|
|
329
|
-
setupView()
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
private func setupView() {
|
|
335
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
336
|
-
config.type = FieldType.cvc
|
|
337
|
-
config.isRequiredValidOnly = true
|
|
338
|
-
|
|
339
|
-
field = VGSCVCTextField()
|
|
340
|
-
field.translatesAutoresizingMaskIntoConstraints = false
|
|
341
|
-
field.placeholder = String(describing: _placeholder)
|
|
342
|
-
field.padding = .init(top: 8, left: 8, bottom: 8, right: 8)
|
|
343
|
-
field.configuration = config
|
|
344
|
-
self.addSubview(field)
|
|
345
|
-
self.bringSubviewToFront(field)
|
|
346
|
-
field.bounds = self.bounds
|
|
347
|
-
NSLayoutConstraint.activate([
|
|
348
|
-
field.topAnchor.constraint(equalTo: self.topAnchor),
|
|
349
|
-
field.bottomAnchor.constraint(equalTo: self.bottomAnchor),
|
|
350
|
-
field.leadingAnchor.constraint(equalTo: self.leadingAnchor),
|
|
351
|
-
field.trailingAnchor.constraint(equalTo: self.trailingAnchor)
|
|
352
|
-
])
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
@objc(VGSCVCFieldManager)
|
|
359
|
-
class VGSCVCFieldManager: RCTViewManager {
|
|
360
|
-
|
|
361
|
-
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
362
|
-
return true
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
override func view() -> UIView! {
|
|
366
|
-
return CustomCVCField()
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
class CustomCardHolderNameField: UIView {
|
|
371
|
-
|
|
372
|
-
var field: VGSTextField!
|
|
373
|
-
|
|
374
|
-
@objc var placeholder: NSString = "Card holder name" {
|
|
375
|
-
didSet {
|
|
376
|
-
_placeholder = String(describing: placeholder)
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
var _placeholder: String = "Card holder name" {
|
|
381
|
-
didSet {
|
|
382
|
-
field.placeholder = String(describing: _placeholder)
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
@objc var name: NSString = "card_holder" {
|
|
387
|
-
didSet {
|
|
388
|
-
_name = String(describing: name)
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
var _name: String = "card_holder" {
|
|
393
|
-
didSet {
|
|
394
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
395
|
-
config.type = FieldType.cardHolderName
|
|
396
|
-
config.isRequiredValidOnly = true
|
|
397
|
-
|
|
398
|
-
field.configuration = config
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
override init(frame: CGRect) {
|
|
403
|
-
super.init(frame: frame)
|
|
404
|
-
setupView()
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
required init?(coder aDecoder: NSCoder) {
|
|
408
|
-
super.init(coder: aDecoder)
|
|
409
|
-
setupView()
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
private func setupView() {
|
|
413
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
414
|
-
config.type = FieldType.cardHolderName
|
|
415
|
-
config.isRequiredValidOnly = true
|
|
416
|
-
|
|
417
|
-
field = VGSTextField()
|
|
418
|
-
field.translatesAutoresizingMaskIntoConstraints = false
|
|
419
|
-
field.autocapitalizationType = UITextAutocapitalizationType.allCharacters
|
|
420
|
-
field.placeholder = String(describing: _placeholder)
|
|
421
|
-
field.padding = .init(top: 8, left: 8, bottom: 8, right: 8)
|
|
422
|
-
field.configuration = config
|
|
423
|
-
self.addSubview(field)
|
|
424
|
-
self.bringSubviewToFront(field)
|
|
425
|
-
field.bounds = self.bounds
|
|
426
|
-
NSLayoutConstraint.activate([
|
|
427
|
-
field.topAnchor.constraint(equalTo: self.topAnchor),
|
|
428
|
-
field.bottomAnchor.constraint(equalTo: self.bottomAnchor),
|
|
429
|
-
field.leadingAnchor.constraint(equalTo: self.leadingAnchor),
|
|
430
|
-
field.trailingAnchor.constraint(equalTo: self.trailingAnchor)
|
|
431
|
-
])
|
|
432
|
-
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
@objc(VGSCardHolderNameFieldManager)
|
|
438
|
-
class VGSCardHolderNameFieldManager: RCTViewManager {
|
|
439
|
-
|
|
440
|
-
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
441
|
-
return true
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
override func view() -> UIView! {
|
|
445
|
-
return CustomCardHolderNameField()
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
class CustomZipCodeField: UIView {
|
|
450
|
-
|
|
451
|
-
var field: VGSTextField!
|
|
452
|
-
|
|
453
|
-
@objc var placeholder: NSString = "Zip code" {
|
|
454
|
-
didSet {
|
|
455
|
-
_placeholder = String(describing: placeholder)
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
var _placeholder: String = "Zip code" {
|
|
460
|
-
didSet {
|
|
461
|
-
field.placeholder = String(describing: _placeholder)
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
@objc var name: NSString = "address_zip" {
|
|
466
|
-
didSet {
|
|
467
|
-
_name = String(describing: name)
|
|
468
|
-
}
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
var _name: String = "address_zip" {
|
|
472
|
-
didSet {
|
|
473
|
-
self.reloadConfig()
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
override init(frame: CGRect) {
|
|
478
|
-
super.init(frame: frame)
|
|
479
|
-
setupView()
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
required init?(coder aDecoder: NSCoder) {
|
|
483
|
-
super.init(coder: aDecoder)
|
|
484
|
-
setupView()
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
private func setupView() {
|
|
488
|
-
field = VGSTextField()
|
|
489
|
-
field.translatesAutoresizingMaskIntoConstraints = false
|
|
490
|
-
field.placeholder = String(describing: _placeholder)
|
|
491
|
-
field.padding = .init(top: 8, left: 8, bottom: 8, right: 8)
|
|
492
|
-
self.reloadConfig()
|
|
493
|
-
|
|
494
|
-
self.addSubview(field)
|
|
495
|
-
self.bringSubviewToFront(field)
|
|
496
|
-
field.bounds = self.bounds
|
|
497
|
-
NSLayoutConstraint.activate([
|
|
498
|
-
field.topAnchor.constraint(equalTo: self.topAnchor),
|
|
499
|
-
field.bottomAnchor.constraint(equalTo: self.bottomAnchor),
|
|
500
|
-
field.leadingAnchor.constraint(equalTo: self.leadingAnchor),
|
|
501
|
-
field.trailingAnchor.constraint(equalTo: self.trailingAnchor)
|
|
502
|
-
])
|
|
503
|
-
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
private func reloadConfig() {
|
|
507
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
508
|
-
config.type = FieldType.cardHolderName
|
|
509
|
-
config.isRequiredValidOnly = true
|
|
510
|
-
config.validationRules = VGSValidationRuleSet(rules: [
|
|
511
|
-
VGSValidationRuleLength(min: 5, max: 7, error: "WRONG_LENGTH"),
|
|
512
|
-
VGSValidationRulePattern.init(pattern: "^(\\d{5}(-\\d{4})?|[a-z]\\d[a-z][- ]*\\d[a-z]\\d)$" , error: "PATTERN FAILED")
|
|
513
|
-
])
|
|
514
|
-
field.configuration = config
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
@objc(VGSZipCodeFieldManager)
|
|
520
|
-
class VGSZipCodeFieldManager: RCTViewManager {
|
|
521
|
-
|
|
522
|
-
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
523
|
-
return true
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
override func view() -> UIView! {
|
|
527
|
-
return CustomZipCodeField()
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
class CustomTextField: UIView {
|
|
532
|
-
|
|
533
|
-
var field: VGSTextField!
|
|
534
|
-
|
|
535
|
-
@objc var placeholder: NSString = "" {
|
|
536
|
-
didSet {
|
|
537
|
-
_placeholder = String(describing: placeholder)
|
|
538
|
-
}
|
|
539
|
-
}
|
|
540
|
-
|
|
541
|
-
var _placeholder: String = "" {
|
|
542
|
-
didSet {
|
|
543
|
-
field.placeholder = String(describing: _placeholder)
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
@objc var name: NSString = "" {
|
|
548
|
-
didSet {
|
|
549
|
-
_name = String(describing: name)
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
var _name: String = "" {
|
|
554
|
-
didSet {
|
|
555
|
-
self.reloadConfig()
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
|
|
559
|
-
@objc var pattern: NSString = "" {
|
|
560
|
-
didSet {
|
|
561
|
-
_pattern = String(describing: pattern)
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
var _pattern: String = "" {
|
|
566
|
-
didSet {
|
|
567
|
-
self.reloadConfig()
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
@objc var maxlength: NSNumber = 0 {
|
|
572
|
-
didSet {
|
|
573
|
-
_maxlength = Int(exactly: maxlength)!
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
var _maxlength: Int = 0 {
|
|
578
|
-
didSet {
|
|
579
|
-
self.reloadConfig()
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
override init(frame: CGRect) {
|
|
584
|
-
super.init(frame: frame)
|
|
585
|
-
setupView()
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
required init?(coder aDecoder: NSCoder) {
|
|
589
|
-
super.init(coder: aDecoder)
|
|
590
|
-
setupView()
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
private func setupView() {
|
|
594
|
-
field = VGSTextField()
|
|
595
|
-
field.translatesAutoresizingMaskIntoConstraints = false
|
|
596
|
-
field.placeholder = String(describing: _placeholder)
|
|
597
|
-
field.padding = .init(top: 8, left: 8, bottom: 8, right: 8)
|
|
598
|
-
|
|
599
|
-
self.reloadConfig()
|
|
600
|
-
|
|
601
|
-
self.addSubview(field)
|
|
602
|
-
self.bringSubviewToFront(field)
|
|
603
|
-
field.bounds = self.bounds
|
|
604
|
-
NSLayoutConstraint.activate([
|
|
605
|
-
field.topAnchor.constraint(equalTo: self.topAnchor),
|
|
606
|
-
field.bottomAnchor.constraint(equalTo: self.bottomAnchor),
|
|
607
|
-
field.leadingAnchor.constraint(equalTo: self.leadingAnchor),
|
|
608
|
-
field.trailingAnchor.constraint(equalTo: self.trailingAnchor)
|
|
609
|
-
])
|
|
610
|
-
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
private func reloadConfig() {
|
|
614
|
-
let config = VGSConfiguration(collector: vgsCollect, fieldName: _name)
|
|
615
|
-
config.type = FieldType.none
|
|
616
|
-
if _pattern.isEmpty == false {
|
|
617
|
-
config.formatPattern = _pattern
|
|
618
|
-
}
|
|
619
|
-
if _maxlength > 0 {
|
|
620
|
-
config.maxInputLength = _maxlength
|
|
621
|
-
}
|
|
622
|
-
field.configuration = config
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
@objc(VGSTextFieldManager)
|
|
628
|
-
class VGSTextFieldManager: RCTViewManager {
|
|
629
|
-
|
|
630
|
-
@objc override static func requiresMainQueueSetup() -> Bool {
|
|
631
|
-
return true
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
override func view() -> UIView! {
|
|
635
|
-
return CustomTextField()
|
|
636
|
-
}
|
|
637
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = 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
|
-
class CVCField extends _react.PureComponent {
|
|
17
|
-
render() {
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement(RTCCVCField, this.props);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const RTCCVCField = (0, _reactNative.requireNativeComponent)('VGSCVCField');
|
|
24
|
-
var _default = CVCField;
|
|
25
|
-
exports.default = _default;
|
|
26
|
-
//# sourceMappingURL=CVCField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CVCField","PureComponent","render","props","RTCCVCField","requireNativeComponent"],"sources":["CVCField.tsx"],"sourcesContent":["import React from 'react'\nimport { PureComponent } from 'react';\nimport { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';\n\n\n\ninterface CVCFieldProps {\n placeholder?: string\n style?: StyleProp<ViewStyle>\n}\n\nclass CVCField extends PureComponent<CVCFieldProps> {\n\n render() {\n return <RTCCVCField {...this.props} />\n }\n}\n\nconst RTCCVCField = requireNativeComponent('VGSCVCField');\n\nexport default CVCField;\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;AASA,MAAMA,QAAN,SAAuBC,oBAAvB,CAAoD;EAElDC,MAAM,GAAG;IACP,oBAAO,6BAAC,WAAD,EAAiB,KAAKC,KAAtB,CAAP;EACD;;AAJiD;;AAOpD,MAAMC,WAAW,GAAG,IAAAC,mCAAA,EAAuB,aAAvB,CAApB;eAEeL,Q"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CardHolderNameField","PureComponent","render","props","RTCCardHolderNameField","requireNativeComponent"],"sources":["CardHolderNameField.tsx"],"sourcesContent":["import React from 'react'\nimport { PureComponent } from 'react';\nimport { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';\n\n\n\ninterface CardHolderNameFieldProps {\n placeholder?: string\n style?: StyleProp<ViewStyle>\n}\n\nclass CardHolderNameField extends PureComponent<CardHolderNameFieldProps> {\n\n render() {\n return <RTCCardHolderNameField {...this.props} />\n }\n}\n\nconst RTCCardHolderNameField = requireNativeComponent('VGSCardHolderNameField');\n\nexport default CardHolderNameField;\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;AASA,MAAMA,mBAAN,SAAkCC,oBAAlC,CAA0E;EAExEC,MAAM,GAAG;IACP,oBAAO,6BAAC,sBAAD,EAA4B,KAAKC,KAAjC,CAAP;EACD;;AAJuE;;AAO1E,MAAMC,sBAAsB,GAAG,IAAAC,mCAAA,EAAuB,wBAAvB,CAA/B;eAEeL,mB"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = 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
|
-
class CardNumberField extends _react.PureComponent {
|
|
17
|
-
render() {
|
|
18
|
-
return /*#__PURE__*/_react.default.createElement(RTCCardNumberField, this.props);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const RTCCardNumberField = (0, _reactNative.requireNativeComponent)('VGSCardNumberField');
|
|
24
|
-
var _default = CardNumberField;
|
|
25
|
-
exports.default = _default;
|
|
26
|
-
//# sourceMappingURL=CardNumberField.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CardNumberField","PureComponent","render","props","RTCCardNumberField","requireNativeComponent"],"sources":["CardNumberField.tsx"],"sourcesContent":["import React from 'react'\nimport { PureComponent } from 'react';\nimport { requireNativeComponent, StyleProp, ViewStyle } from 'react-native';\n\n\n\ninterface CardNumberFieldProps {\n placeholder?: string\n style?: StyleProp<ViewStyle>\n}\n\nclass CardNumberField extends PureComponent<CardNumberFieldProps> {\n\n render() {\n return <RTCCardNumberField {...this.props} />\n }\n}\n\nconst RTCCardNumberField = requireNativeComponent('VGSCardNumberField');\n\nexport default CardNumberField;\n"],"mappings":";;;;;;;AAAA;;AAEA;;;;;;AASA,MAAMA,eAAN,SAA8BC,oBAA9B,CAAkE;EAEhEC,MAAM,GAAG;IACP,oBAAO,6BAAC,kBAAD,EAAwB,KAAKC,KAA7B,CAAP;EACD;;AAJ+D;;AAOlE,MAAMC,kBAAkB,GAAG,IAAAC,mCAAA,EAAuB,oBAAvB,CAA3B;eAEeL,e"}
|