@stripe/stripe-react-native 0.4.0 → 0.6.1
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/CHANGELOG.md +38 -0
- package/README.md +6 -1
- package/android/build/.transforms/{c731e6bf5b480f659bf1c341f3f0657c → 253af79d247c9f91c901f2038cdc6938}/results.bin +0 -0
- package/android/build/.transforms/253af79d247c9f91c901f2038cdc6938/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/{e9391f6bbf8da46ff748ca7feadbce73 → 3cbaee99352386a9df7b22dbbb69831e}/results.bin +0 -0
- package/android/build/.transforms/3cbaee99352386a9df7b22dbbb69831e/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/{f0b2868ed2d4a4bb73b1ace98fe4ccfa → 8d3571dbfd2a31ee669f64a85b02f3fc}/results.bin +0 -0
- package/android/build/.transforms/8d3571dbfd2a31ee669f64a85b02f3fc/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/bcac5194839639e17669a07fd0143335/results.bin +1 -0
- package/android/build/.transforms/bcac5194839639e17669a07fd0143335/transformed/classes/classes.dex +0 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +4 -2
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +553 -29
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +1 -1
- package/android/build/intermediates/javac/debug/classes/com/reactnativestripesdk/databinding/GooglepayButtonBinding.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativestripesdk/databinding/GooglepayButtonNoShadowBinding.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativestripesdk/databinding/PayWithGooglepayButtonBinding.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativestripesdk/databinding/PayWithGooglepayButtonNoShadowBinding.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +4 -2
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +523 -29
- package/android/build/kotlin/compileDebugKotlin/build-history.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/package-parts.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab.values.s +1 -1
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/counters.tab +2 -2
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab.values.s +1 -1
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/last-build.bin +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/reactnativestripesdk_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/AuBECSDebitFormView$setListeners$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/AuBECSDebitFormView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/AuBECSDebitFormViewManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardChangedEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardChangedEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$10.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$6.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$7.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$8.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView$setListeners$9.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFieldViewManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFocusEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFocusEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFormCompleteEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFormCompleteEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFormView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CardFormViewManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CollectBankAccountLauncherFragment$createBankAccountLauncher$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CollectBankAccountLauncherFragment.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ConfirmPaymentErrorType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ConfirmSetupIntentErrorType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/CreateTokenErrorType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/DefaultPushProvisioningProxy.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ErrorType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ErrorsKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ExtensionsKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/FormCompleteEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/FormCompleteEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayButtonManager$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayButtonManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayButtonView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayErrorType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment$onViewCreated$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment$onViewCreated$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment$onViewCreated$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment$onViewCreated$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayFragment.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/MappersKt$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/MappersKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$retrievePaymentIntent$1$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$retrievePaymentIntent$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$retrieveSetupIntent$1$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment$retrieveSetupIntent$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentLauncherFragment.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentMethodCreateParamsException.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentMethodCreateParamsFactory$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetErrorType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragment.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragmentKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PushProvisioningProxy$createActivityEventListener$listener$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PushProvisioningProxy.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/RetrievePaymentIntentErrorType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/RetrieveSetupIntentErrorType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeContainerManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeContainerView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$createPaymentMethod$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$createTokenForCVCUpdate$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$createTokenFromBankAccount$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$createTokenFromCard$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$retrievePaymentIntent$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$retrieveSetupIntent$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$verifyMicrodeposits$paymentCallback$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$verifyMicrodeposits$setupCallback$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView$onAfterUpdateTransaction$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletCompleteEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/AddToWalletCompleteEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/EphemeralKeyProvider$CREATOR.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/EphemeralKeyProvider.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.class +0 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +1 -10
- package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt +4 -2
- package/android/src/main/java/com/reactnativestripesdk/CardChangedEvent.kt +0 -4
- package/android/src/main/java/com/reactnativestripesdk/{StripeSdkCardView.kt → CardFieldView.kt} +6 -9
- package/android/src/main/java/com/reactnativestripesdk/{StripeSdkCardViewManager.kt → CardFieldViewManager.kt} +20 -16
- package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +23 -23
- package/android/src/main/java/com/reactnativestripesdk/CardFormViewManager.kt +9 -6
- package/android/src/main/java/com/reactnativestripesdk/Errors.kt +3 -3
- package/android/src/main/java/com/reactnativestripesdk/FormCompleteEvent.kt +0 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +1 -0
- package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +1 -1
- package/android/src/main/java/com/reactnativestripesdk/Mappers.kt +51 -12
- package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +122 -0
- package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +103 -98
- package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +51 -58
- package/android/src/main/java/com/reactnativestripesdk/StripeContainerManager.kt +2 -1
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +84 -124
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +1 -1
- package/ios/.DS_Store +0 -0
- package/ios/AuBECSDebitFormView.swift +15 -0
- package/ios/Errors.swift +9 -35
- package/ios/Mappers.swift +110 -5
- package/ios/PaymentMethodFactory.swift +46 -1
- package/ios/StripeSdk.m +15 -1
- package/ios/StripeSdk.swift +287 -105
- package/jest/mock.js +1 -1
- package/lib/commonjs/NativeStripeSdk.js.map +1 -1
- package/lib/commonjs/components/StripeProvider.js +1 -1
- package/lib/commonjs/components/StripeProvider.js.map +1 -1
- package/lib/commonjs/functions.js +1 -1
- package/lib/commonjs/functions.js.map +1 -1
- package/lib/commonjs/hooks/useStripe.js +1 -1
- package/lib/commonjs/hooks/useStripe.js.map +1 -1
- package/lib/commonjs/types/Card.js.map +1 -1
- package/lib/commonjs/types/NextAction.js +2 -0
- package/lib/commonjs/types/NextAction.js.map +1 -0
- package/lib/commonjs/types/PaymentIntents.js.map +1 -1
- package/lib/commonjs/types/PaymentMethods.js.map +1 -1
- package/lib/commonjs/types/SetupIntent.js.map +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/module/NativeStripeSdk.js.map +1 -1
- package/lib/module/components/StripeProvider.js +1 -1
- package/lib/module/components/StripeProvider.js.map +1 -1
- package/lib/module/functions.js +1 -1
- package/lib/module/functions.js.map +1 -1
- package/lib/module/hooks/useStripe.js +1 -1
- package/lib/module/hooks/useStripe.js.map +1 -1
- package/lib/module/types/Card.js.map +1 -1
- package/lib/module/types/NextAction.js +2 -0
- package/lib/module/types/NextAction.js.map +1 -0
- package/lib/module/types/PaymentIntents.js.map +1 -1
- package/lib/module/types/PaymentMethods.js.map +1 -1
- package/lib/module/types/SetupIntent.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/typescript/e2e/helpers.d.ts +1 -0
- package/lib/typescript/e2e/screenObject/BasicPaymentScreen.d.ts +1 -0
- package/lib/typescript/e2e/screenObject/HomeScreen.d.ts +1 -1
- package/lib/typescript/example/src/App.d.ts +2 -0
- package/lib/typescript/example/src/screens/ACHPaymentScreen.d.ts +1 -0
- package/lib/typescript/example/src/screens/ACHSetupScreen.d.ts +1 -0
- package/lib/typescript/src/NativeStripeSdk.d.ts +4 -2
- package/lib/typescript/src/components/StripeProvider.d.ts +4 -10
- package/lib/typescript/src/functions.d.ts +10 -2
- package/lib/typescript/src/hooks/useStripe.d.ts +7 -2
- package/lib/typescript/src/types/Card.d.ts +1 -0
- package/lib/typescript/src/types/NextAction.d.ts +32 -0
- package/lib/typescript/src/types/PaymentIntents.d.ts +2 -0
- package/lib/typescript/src/types/PaymentMethods.d.ts +28 -2
- package/lib/typescript/src/types/SetupIntent.d.ts +4 -2
- package/lib/typescript/src/types/index.d.ts +23 -4
- package/package.json +4 -4
- package/src/NativeStripeSdk.tsx +15 -3
- package/src/components/StripeProvider.tsx +7 -15
- package/src/functions.ts +174 -3
- package/src/hooks/useStripe.tsx +57 -6
- package/src/types/Card.ts +1 -0
- package/src/types/NextAction.ts +44 -0
- package/src/types/PaymentIntents.ts +2 -0
- package/src/types/PaymentMethods.ts +31 -2
- package/src/types/SetupIntent.ts +9 -2
- package/src/types/index.ts +32 -4
- package/stripe-react-native.podspec +3 -2
- package/android/build/.transforms/c731e6bf5b480f659bf1c341f3f0657c/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/e9391f6bbf8da46ff748ca7feadbce73/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/f0b2868ed2d4a4bb73b1ace98fe4ccfa/transformed/classes/classes.dex +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values +0 -0
- package/android/build/kotlin/compileDebugKotlin/caches-jvm/inputs/source-to-output.tab.values.s +0 -1
- package/android/build/tmp/compileDebugJavaWithJavac/source-classes-mapping.txt +0 -10
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/ConstantsKt.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/NextPaymentActionErrorType.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragment$configureFlowController$onFlowControllerConfigure$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragment$onViewCreated$paymentOptionCallback$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/PaymentSheetFragment$onViewCreated$paymentResultCallback$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$4.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$5.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView$setListeners$6.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardView.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkCardViewManager.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$googlePayReceiver$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1$onActivityResult$2$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1$onActivityResult$2.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1$onActivityResult$3$WhenMappings.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mActivityEventListener$1$onActivityResult$3.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$mPaymentSheetReceiver$1.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativestripesdk/StripeSdkModule$payWithWeChatPay$1.class +0 -0
|
@@ -5,10 +5,9 @@ import com.facebook.react.bridge.ReadableMap
|
|
|
5
5
|
import com.facebook.react.common.MapBuilder
|
|
6
6
|
import com.facebook.react.uimanager.SimpleViewManager
|
|
7
7
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
8
|
-
import com.facebook.react.uimanager.UIManagerModule
|
|
9
8
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
10
9
|
|
|
11
|
-
class
|
|
10
|
+
class CardFieldViewManager : SimpleViewManager<CardFieldView>() {
|
|
12
11
|
override fun getName() = "CardField"
|
|
13
12
|
|
|
14
13
|
private var reactContextRef: ThemedReactContext? = null
|
|
@@ -19,7 +18,7 @@ class StripeSdkCardViewManager : SimpleViewManager<StripeSdkCardView>() {
|
|
|
19
18
|
CardChangedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onCardChange"))
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
override fun receiveCommand(root:
|
|
21
|
+
override fun receiveCommand(root: CardFieldView, commandId: String?, args: ReadableArray?) {
|
|
23
22
|
when (commandId) {
|
|
24
23
|
"focus" -> root.requestFocusFromJS()
|
|
25
24
|
"blur" -> root.requestBlurFromJS()
|
|
@@ -28,33 +27,38 @@ class StripeSdkCardViewManager : SimpleViewManager<StripeSdkCardView>() {
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
@ReactProp(name = "dangerouslyGetFullCardDetails")
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
@SuppressWarnings("unused")
|
|
31
|
+
fun setDangerouslyGetFullCardDetails(view: CardFieldView, dangerouslyGetFullCardDetails: Boolean = false) {
|
|
32
|
+
view.setDangerouslyGetFullCardDetails(dangerouslyGetFullCardDetails)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@ReactProp(name = "postalCodeEnabled")
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
@SuppressWarnings("unused")
|
|
37
|
+
fun setPostalCodeEnabled(view: CardFieldView, postalCodeEnabled: Boolean = true) {
|
|
38
|
+
view.setPostalCodeEnabled(postalCodeEnabled)
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
@ReactProp(name = "autofocus")
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
@SuppressWarnings("unused")
|
|
43
|
+
fun setAutofocus(view: CardFieldView, autofocus: Boolean = false) {
|
|
44
|
+
view.setAutofocus(autofocus)
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
@ReactProp(name = "cardStyle")
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
@SuppressWarnings("unused")
|
|
49
|
+
fun setCardStyle(view: CardFieldView, cardStyle: ReadableMap) {
|
|
50
|
+
view.setCardStyle(cardStyle)
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
@ReactProp(name = "placeholder")
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
@SuppressWarnings("unused")
|
|
55
|
+
fun setPlaceHolders(view: CardFieldView, placeholder: ReadableMap) {
|
|
56
|
+
view.setPlaceHolders(placeholder)
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
override fun createViewInstance(reactContext: ThemedReactContext):
|
|
59
|
+
override fun createViewInstance(reactContext: ThemedReactContext): CardFieldView {
|
|
56
60
|
val stripeSdkModule: StripeSdkModule? = reactContext.getNativeModule(StripeSdkModule::class.java)
|
|
57
|
-
val view =
|
|
61
|
+
val view = CardFieldView(reactContext)
|
|
58
62
|
|
|
59
63
|
reactContextRef = reactContext
|
|
60
64
|
|
|
@@ -62,7 +66,7 @@ class StripeSdkCardViewManager : SimpleViewManager<StripeSdkCardView>() {
|
|
|
62
66
|
return view
|
|
63
67
|
}
|
|
64
68
|
|
|
65
|
-
override fun onDropViewInstance(view:
|
|
69
|
+
override fun onDropViewInstance(view: CardFieldView) {
|
|
66
70
|
super.onDropViewInstance(view)
|
|
67
71
|
|
|
68
72
|
val stripeSdkModule: StripeSdkModule? = reactContextRef?.getNativeModule(StripeSdkModule::class.java)
|
|
@@ -17,7 +17,7 @@ import com.stripe.android.model.PaymentMethodCreateParams
|
|
|
17
17
|
import com.stripe.android.view.CardFormView
|
|
18
18
|
import com.stripe.android.view.CardInputListener
|
|
19
19
|
|
|
20
|
-
class CardFormView(
|
|
20
|
+
class CardFormView(context: ThemedReactContext) : FrameLayout(context) {
|
|
21
21
|
private var cardForm: CardFormView = CardFormView(context, null, R.style.StripeCardFormView_Borderless)
|
|
22
22
|
private var mEventDispatcher: EventDispatcher? = context.getNativeModule(UIManagerModule::class.java)?.eventDispatcher
|
|
23
23
|
private var dangerouslyGetFullCardDetails: Boolean = false
|
|
@@ -30,7 +30,6 @@ class CardFormView(private val context: ThemedReactContext) : FrameLayout(contex
|
|
|
30
30
|
init {
|
|
31
31
|
cardFormViewBinding.cardMultilineWidgetContainer.isFocusable = true
|
|
32
32
|
cardFormViewBinding.cardMultilineWidgetContainer.isFocusableInTouchMode = true
|
|
33
|
-
cardFormViewBinding.cardMultilineWidgetContainer.requestFocus()
|
|
34
33
|
|
|
35
34
|
addView(cardForm)
|
|
36
35
|
setListeners()
|
|
@@ -46,27 +45,28 @@ class CardFormView(private val context: ThemedReactContext) : FrameLayout(contex
|
|
|
46
45
|
cardFormView.postalCodeContainer.visibility = visibility
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
val
|
|
54
|
-
val
|
|
55
|
-
val
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
//
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
48
|
+
// TODO: uncomment when ios-sdk allows for this
|
|
49
|
+
// fun setPlaceHolders(value: ReadableMap) {
|
|
50
|
+
// val cardFormView = StripeCardFormViewBinding.bind(cardForm)
|
|
51
|
+
//
|
|
52
|
+
// val numberPlaceholder = getValOr(value, "number", null)
|
|
53
|
+
// val expirationPlaceholder = getValOr(value, "expiration", null)
|
|
54
|
+
// val cvcPlaceholder = getValOr(value, "cvc", null)
|
|
55
|
+
// val postalCodePlaceholder = getValOr(value, "postalCode", null)
|
|
56
|
+
//
|
|
57
|
+
// numberPlaceholder?.let {
|
|
58
|
+
//// multilineWidgetBinding.tlCardNumber.hint = it
|
|
59
|
+
// }
|
|
60
|
+
// expirationPlaceholder?.let {
|
|
61
|
+
// multilineWidgetBinding.tlExpiry.hint = it
|
|
62
|
+
// }
|
|
63
|
+
// cvcPlaceholder?.let {
|
|
64
|
+
// multilineWidgetBinding.tlCvc.hint = it
|
|
65
|
+
// }
|
|
66
|
+
// postalCodePlaceholder?.let {
|
|
67
|
+
// cardFormView.postalCodeContainer.hint = it
|
|
68
|
+
// }
|
|
69
|
+
// }
|
|
70
70
|
|
|
71
71
|
fun setAutofocus(value: Boolean) {
|
|
72
72
|
if (value) {
|
|
@@ -3,7 +3,6 @@ package com.reactnativestripesdk
|
|
|
3
3
|
import com.facebook.react.bridge.ReadableArray
|
|
4
4
|
import com.facebook.react.bridge.ReadableMap
|
|
5
5
|
import com.facebook.react.common.MapBuilder
|
|
6
|
-
import com.facebook.react.uimanager.ReactStylesDiffMap
|
|
7
6
|
import com.facebook.react.uimanager.SimpleViewManager
|
|
8
7
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
9
8
|
import com.facebook.react.uimanager.annotations.ReactProp
|
|
@@ -28,28 +27,32 @@ class CardFormViewManager : SimpleViewManager<CardFormView>() {
|
|
|
28
27
|
}
|
|
29
28
|
|
|
30
29
|
@ReactProp(name = "dangerouslyGetFullCardDetails")
|
|
30
|
+
@SuppressWarnings("unused")
|
|
31
31
|
fun setDangerouslyGetFullCardDetails(view: CardFormView, dangerouslyGetFullCardDetails: Boolean = false) {
|
|
32
|
-
view.setDangerouslyGetFullCardDetails(dangerouslyGetFullCardDetails)
|
|
32
|
+
view.setDangerouslyGetFullCardDetails(dangerouslyGetFullCardDetails)
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
@ReactProp(name = "postalCodeEnabled")
|
|
36
|
+
@SuppressWarnings("unused")
|
|
36
37
|
fun setPostalCodeEnabled(view: CardFormView, postalCodeEnabled: Boolean = false) {
|
|
37
|
-
view.setPostalCodeEnabled(postalCodeEnabled)
|
|
38
|
+
view.setPostalCodeEnabled(postalCodeEnabled)
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
// @ReactProp(name = "placeholder")
|
|
41
42
|
// fun setPlaceHolders(view: CardFormView, placeholder: ReadableMap) {
|
|
42
|
-
// view.setPlaceHolders(placeholder)
|
|
43
|
+
// view.setPlaceHolders(placeholder)
|
|
43
44
|
// }
|
|
44
45
|
|
|
45
46
|
@ReactProp(name = "autofocus")
|
|
47
|
+
@SuppressWarnings("unused")
|
|
46
48
|
fun setAutofocus(view: CardFormView, autofocus: Boolean = false) {
|
|
47
|
-
view.setAutofocus(autofocus)
|
|
49
|
+
view.setAutofocus(autofocus)
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
@ReactProp(name = "cardStyle")
|
|
53
|
+
@SuppressWarnings("unused")
|
|
51
54
|
fun setCardStyle(view: CardFormView, cardStyle: ReadableMap) {
|
|
52
|
-
view.setCardStyle(cardStyle)
|
|
55
|
+
view.setCardStyle(cardStyle)
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
override fun createViewInstance(reactContext: ThemedReactContext): CardFormView {
|
|
@@ -3,9 +3,9 @@ package com.reactnativestripesdk
|
|
|
3
3
|
import com.facebook.react.bridge.WritableMap
|
|
4
4
|
import com.facebook.react.bridge.WritableNativeMap
|
|
5
5
|
import com.stripe.android.core.exception.APIException
|
|
6
|
+
import com.stripe.android.core.exception.InvalidRequestException
|
|
6
7
|
import com.stripe.android.exception.AuthenticationException
|
|
7
8
|
import com.stripe.android.exception.CardException
|
|
8
|
-
import com.stripe.android.core.exception.InvalidRequestException
|
|
9
9
|
import com.stripe.android.model.PaymentIntent
|
|
10
10
|
import com.stripe.android.model.SetupIntent
|
|
11
11
|
|
|
@@ -22,7 +22,7 @@ enum class NextPaymentActionErrorType {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
enum class ConfirmSetupIntentErrorType {
|
|
25
|
-
Failed, Canceled
|
|
25
|
+
Failed, Canceled
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
enum class RetrievePaymentIntentErrorType {
|
|
@@ -38,7 +38,7 @@ enum class PaymentSheetErrorType {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
enum class GooglePayErrorType {
|
|
41
|
-
Failed, Canceled
|
|
41
|
+
Failed, Canceled
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
internal fun mapError(code: String, message: String?, localizedMessage: String?, declineCode: String?, type: String?, stripeErrorCode: String?): WritableMap {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
package com.reactnativestripesdk
|
|
2
2
|
import com.facebook.react.bridge.Arguments
|
|
3
|
-
import com.facebook.react.bridge.ReadableMap
|
|
4
3
|
import com.facebook.react.bridge.WritableMap
|
|
5
4
|
import com.facebook.react.uimanager.events.Event
|
|
6
5
|
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
@@ -5,7 +5,7 @@ import android.widget.FrameLayout
|
|
|
5
5
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
6
|
|
|
7
7
|
class GooglePayButtonView(private val context: ThemedReactContext) : FrameLayout(context) {
|
|
8
|
-
var buttonType: String? = null
|
|
8
|
+
private var buttonType: String? = null
|
|
9
9
|
|
|
10
10
|
fun initialize() {
|
|
11
11
|
val type = when (buttonType) {
|
package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt
CHANGED
|
@@ -18,7 +18,7 @@ class GooglePayPaymentMethodLauncherFragment(
|
|
|
18
18
|
private val promise: Promise
|
|
19
19
|
) : Fragment() {
|
|
20
20
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
|
21
|
-
savedInstanceState: Bundle?): View
|
|
21
|
+
savedInstanceState: Bundle?): View {
|
|
22
22
|
return FrameLayout(requireActivity()).also {
|
|
23
23
|
it.visibility = View.GONE
|
|
24
24
|
}
|
|
@@ -5,6 +5,8 @@ import android.util.Log
|
|
|
5
5
|
import com.facebook.react.bridge.*
|
|
6
6
|
import com.stripe.android.PaymentAuthConfig
|
|
7
7
|
import com.stripe.android.model.*
|
|
8
|
+
import com.stripe.android.model.StripeIntent.NextActionType
|
|
9
|
+
import com.stripe.android.model.StripeIntent.NextActionData
|
|
8
10
|
|
|
9
11
|
internal fun createResult(key: String, value: WritableMap): WritableMap {
|
|
10
12
|
val map = WritableNativeMap()
|
|
@@ -199,6 +201,7 @@ internal fun mapFromBankAccount(bankAccount: BankAccount?): WritableMap? {
|
|
|
199
201
|
return null
|
|
200
202
|
}
|
|
201
203
|
|
|
204
|
+
bankAccountMap.putString("id", bankAccount.id)
|
|
202
205
|
bankAccountMap.putString("bankName", bankAccount.bankName)
|
|
203
206
|
bankAccountMap.putString("accountHolderName", bankAccount.accountHolderName)
|
|
204
207
|
bankAccountMap.putString("accountHolderType", mapFromBankAccountType(bankAccount.accountHolderType))
|
|
@@ -235,6 +238,7 @@ internal fun mapFromCard(card: Card?): WritableMap? {
|
|
|
235
238
|
cardMap.putNull("expYear")
|
|
236
239
|
}
|
|
237
240
|
|
|
241
|
+
cardMap.putString("id", card.id)
|
|
238
242
|
cardMap.putString("last4", card.last4)
|
|
239
243
|
cardMap.putString("funding", card.funding?.name)
|
|
240
244
|
cardMap.putString("name", card.name)
|
|
@@ -342,6 +346,7 @@ internal fun mapFromPaymentIntentResult(paymentIntent: PaymentIntent): WritableM
|
|
|
342
346
|
map.putString("created", convertToUnixTimestamp(paymentIntent.created))
|
|
343
347
|
map.putString("captureMethod", mapCaptureMethod(paymentIntent.captureMethod))
|
|
344
348
|
map.putString("confirmationMethod", mapConfirmationMethod(paymentIntent.confirmationMethod))
|
|
349
|
+
map.putMap("nextAction", mapNextAction(paymentIntent.nextActionType, paymentIntent.nextActionData))
|
|
345
350
|
map.putNull("lastPaymentError")
|
|
346
351
|
map.putNull("shipping")
|
|
347
352
|
map.putNull("amount")
|
|
@@ -368,12 +373,52 @@ internal fun mapFromPaymentIntentResult(paymentIntent: PaymentIntent): WritableM
|
|
|
368
373
|
paymentIntent.amount?.let {
|
|
369
374
|
map.putDouble("amount", it.toDouble())
|
|
370
375
|
}
|
|
371
|
-
paymentIntent.canceledAt
|
|
372
|
-
map.putString("canceledAt", convertToUnixTimestamp(it))
|
|
373
|
-
}
|
|
376
|
+
map.putString("canceledAt", convertToUnixTimestamp(paymentIntent.canceledAt))
|
|
374
377
|
return map
|
|
375
378
|
}
|
|
376
379
|
|
|
380
|
+
internal fun mapNextAction(type: NextActionType?, data: NextActionData?): WritableNativeMap? {
|
|
381
|
+
val nextActionMap = WritableNativeMap()
|
|
382
|
+
when (type) {
|
|
383
|
+
NextActionType.RedirectToUrl -> {
|
|
384
|
+
(data as? NextActionData.RedirectToUrl)?.let {
|
|
385
|
+
nextActionMap.putString("type", "urlRedirect")
|
|
386
|
+
nextActionMap.putString("redirectUrl", it.url.toString())
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
// TODO: This is currently private. Uncomment when ACHv2 is available on Android.
|
|
390
|
+
// NextActionType.VerifyWithMicrodeposits -> {
|
|
391
|
+
// (data as? NextActionData.VerifyWithMicrodeposits)?.let {
|
|
392
|
+
// nextActionMap.putString("type", "verifyWithMicrodeposits")
|
|
393
|
+
// nextActionMap.putString("arrivalDate", it.arrivalDate.toString())
|
|
394
|
+
// nextActionMap.putString("redirectUrl", it.hostedVerificationUrl)
|
|
395
|
+
// nextActionMap.putString("microdepositType", it.microdepositType.toString())
|
|
396
|
+
// }
|
|
397
|
+
// }
|
|
398
|
+
NextActionType.DisplayOxxoDetails -> {
|
|
399
|
+
(data as? NextActionData.DisplayOxxoDetails)?.let {
|
|
400
|
+
nextActionMap.putString("type", "oxxoVoucher")
|
|
401
|
+
nextActionMap.putInt("expiration", it.expiresAfter)
|
|
402
|
+
nextActionMap.putString("voucherURL", it.hostedVoucherUrl)
|
|
403
|
+
nextActionMap.putString("voucherNumber", it.number)
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
NextActionType.WeChatPayRedirect -> {
|
|
407
|
+
(data as? NextActionData.WeChatPayRedirect)?.let {
|
|
408
|
+
nextActionMap.putString("type", "weChatRedirect")
|
|
409
|
+
nextActionMap.putString("redirectUrl", it.weChat.qrCodeUrl)
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
NextActionType.AlipayRedirect -> { // TODO: Can't access, private
|
|
413
|
+
return null
|
|
414
|
+
}
|
|
415
|
+
NextActionType.BlikAuthorize, NextActionType.UseStripeSdk, null -> {
|
|
416
|
+
return null
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
return nextActionMap
|
|
420
|
+
}
|
|
421
|
+
|
|
377
422
|
internal fun mapFromPaymentIntentLastErrorType(errorType: PaymentIntent.Error.Type?): String? {
|
|
378
423
|
return when (errorType) {
|
|
379
424
|
PaymentIntent.Error.Type.ApiConnectionError -> "api_connection_error"
|
|
@@ -486,10 +531,6 @@ fun getIntOrNull(map: ReadableMap?, key: String): Int? {
|
|
|
486
531
|
return if (map?.hasKey(key) == true) map.getInt(key) else null
|
|
487
532
|
}
|
|
488
533
|
|
|
489
|
-
public fun getBooleanOrNull(map: ReadableMap?, key: String): Boolean? {
|
|
490
|
-
return if (map?.hasKey(key) == true) map.getBoolean(key) else null
|
|
491
|
-
}
|
|
492
|
-
|
|
493
534
|
fun getMapOrNull(map: ReadableMap?, key: String): ReadableMap? {
|
|
494
535
|
return if (map?.hasKey(key) == true) map.getMap(key) else null
|
|
495
536
|
}
|
|
@@ -687,10 +728,8 @@ internal fun mapFromSetupIntentResult(setupIntent: SetupIntent): WritableMap {
|
|
|
687
728
|
map.putString("clientSecret", setupIntent.clientSecret)
|
|
688
729
|
map.putString("paymentMethodId", setupIntent.paymentMethodId)
|
|
689
730
|
map.putString("usage", mapSetupIntentUsage(setupIntent.usage))
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
map.putString("created", convertToUnixTimestamp(setupIntent.created))
|
|
693
|
-
}
|
|
731
|
+
map.putString("created", convertToUnixTimestamp(setupIntent.created))
|
|
732
|
+
map.putMap("nextAction", mapNextAction(setupIntent.nextActionType, setupIntent.nextActionData))
|
|
694
733
|
|
|
695
734
|
setupIntent.lastSetupError?.let {
|
|
696
735
|
val setupError: WritableMap = WritableNativeMap()
|
|
@@ -736,7 +775,7 @@ fun mapToPaymentIntentFutureUsage(type: String?): ConfirmPaymentIntentParams.Set
|
|
|
736
775
|
}
|
|
737
776
|
}
|
|
738
777
|
|
|
739
|
-
fun toBundleObject(readableMap: ReadableMap?): Bundle
|
|
778
|
+
fun toBundleObject(readableMap: ReadableMap?): Bundle {
|
|
740
779
|
val result = Bundle()
|
|
741
780
|
if (readableMap == null) {
|
|
742
781
|
return result
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
package com.reactnativestripesdk
|
|
2
|
+
|
|
3
|
+
import android.os.Bundle
|
|
4
|
+
import android.view.LayoutInflater
|
|
5
|
+
import android.view.View
|
|
6
|
+
import android.view.ViewGroup
|
|
7
|
+
import android.widget.FrameLayout
|
|
8
|
+
import androidx.fragment.app.Fragment
|
|
9
|
+
import com.facebook.react.bridge.Promise
|
|
10
|
+
import com.stripe.android.ApiResultCallback
|
|
11
|
+
import com.stripe.android.Stripe
|
|
12
|
+
import com.stripe.android.model.PaymentIntent
|
|
13
|
+
import com.stripe.android.model.StripeIntent
|
|
14
|
+
import com.stripe.android.payments.paymentlauncher.PaymentLauncher
|
|
15
|
+
import com.stripe.android.payments.paymentlauncher.PaymentResult
|
|
16
|
+
|
|
17
|
+
class PaymentLauncherFragment(
|
|
18
|
+
private val stripe: Stripe,
|
|
19
|
+
private val publishableKey: String,
|
|
20
|
+
private val stripeAccountId: String?,
|
|
21
|
+
) : Fragment() {
|
|
22
|
+
lateinit var paymentLauncher: PaymentLauncher
|
|
23
|
+
|
|
24
|
+
var clientSecret: String? = null
|
|
25
|
+
var promise: Promise? = null
|
|
26
|
+
|
|
27
|
+
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
|
28
|
+
savedInstanceState: Bundle?): View {
|
|
29
|
+
paymentLauncher = createPaymentLauncher()
|
|
30
|
+
return FrameLayout(requireActivity()).also {
|
|
31
|
+
it.visibility = View.GONE
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private fun createPaymentLauncher(): PaymentLauncher {
|
|
36
|
+
return PaymentLauncher.create(this, publishableKey, stripeAccountId) { paymentResult ->
|
|
37
|
+
when (paymentResult) {
|
|
38
|
+
is PaymentResult.Completed -> {
|
|
39
|
+
clientSecret?.let {
|
|
40
|
+
retrievePaymentIntent(it, stripeAccountId)
|
|
41
|
+
} ?: run {
|
|
42
|
+
throw Exception("Client secret must be set before responding to payment results.")
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
is PaymentResult.Canceled -> {
|
|
46
|
+
promise?.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), message = null))
|
|
47
|
+
?: throw Exception("No promise is set to handle payment results.")
|
|
48
|
+
}
|
|
49
|
+
is PaymentResult.Failed -> {
|
|
50
|
+
promise?.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), paymentResult.throwable.localizedMessage))
|
|
51
|
+
?: throw Exception("No promise is set to handle payment results.")
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
private fun retrievePaymentIntent(clientSecret: String, stripeAccountId: String?) {
|
|
58
|
+
val promise = promise ?: throw Exception("No promise is set to handle payment results.")
|
|
59
|
+
stripe.retrievePaymentIntent(clientSecret, stripeAccountId, object : ApiResultCallback<PaymentIntent> {
|
|
60
|
+
override fun onError(e: Exception) {
|
|
61
|
+
promise.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), e))
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
override fun onSuccess(result: PaymentIntent) {
|
|
65
|
+
when (result.status) {
|
|
66
|
+
StripeIntent.Status.Succeeded,
|
|
67
|
+
StripeIntent.Status.Processing,
|
|
68
|
+
StripeIntent.Status.RequiresCapture -> {
|
|
69
|
+
val paymentIntent = createResult("paymentIntent", mapFromPaymentIntentResult(result))
|
|
70
|
+
promise.resolve(paymentIntent)
|
|
71
|
+
}
|
|
72
|
+
StripeIntent.Status.RequiresAction -> {
|
|
73
|
+
if (isNextActionSuccessState(result.nextActionType)) {
|
|
74
|
+
val paymentIntent = createResult("paymentIntent", mapFromPaymentIntentResult(result))
|
|
75
|
+
promise.resolve(paymentIntent)
|
|
76
|
+
} else {
|
|
77
|
+
(result.lastPaymentError)?.let {
|
|
78
|
+
promise.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), it))
|
|
79
|
+
} ?: run {
|
|
80
|
+
promise.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), "The payment has been canceled"))
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
StripeIntent.Status.RequiresPaymentMethod -> {
|
|
85
|
+
val error = result.lastPaymentError
|
|
86
|
+
promise.resolve(createError(ConfirmPaymentErrorType.Failed.toString(), error))
|
|
87
|
+
}
|
|
88
|
+
StripeIntent.Status.RequiresConfirmation -> {
|
|
89
|
+
val paymentIntent = createResult("paymentIntent", mapFromPaymentIntentResult(result))
|
|
90
|
+
promise.resolve(paymentIntent)
|
|
91
|
+
}
|
|
92
|
+
StripeIntent.Status.Canceled -> {
|
|
93
|
+
val error = result.lastPaymentError
|
|
94
|
+
promise.resolve(createError(ConfirmPaymentErrorType.Canceled.toString(), error))
|
|
95
|
+
}
|
|
96
|
+
else -> {
|
|
97
|
+
val errorMessage = "unhandled error: ${result.status}"
|
|
98
|
+
promise.resolve(createError(ConfirmPaymentErrorType.Unknown.toString(), errorMessage))
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Check if paymentIntent.nextAction is out-of-band, such as voucher-based or waiting
|
|
107
|
+
* on customer verification. If it is, then being in this state is considered "successful".
|
|
108
|
+
*/
|
|
109
|
+
private fun isNextActionSuccessState(nextAction: StripeIntent.NextActionType?): Boolean {
|
|
110
|
+
return when (nextAction) {
|
|
111
|
+
StripeIntent.NextActionType.DisplayOxxoDetails,
|
|
112
|
+
StripeIntent.NextActionType.VerifyWithMicrodeposits -> true
|
|
113
|
+
StripeIntent.NextActionType.RedirectToUrl,
|
|
114
|
+
StripeIntent.NextActionType.UseStripeSdk,
|
|
115
|
+
StripeIntent.NextActionType.AlipayRedirect,
|
|
116
|
+
StripeIntent.NextActionType.BlikAuthorize,
|
|
117
|
+
StripeIntent.NextActionType.WeChatPayRedirect,
|
|
118
|
+
null -> false
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|