@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
|
@@ -6,7 +6,7 @@ import com.stripe.android.model.*
|
|
|
6
6
|
class PaymentMethodCreateParamsFactory(
|
|
7
7
|
private val clientSecret: String,
|
|
8
8
|
private val params: ReadableMap,
|
|
9
|
-
private val cardFieldView:
|
|
9
|
+
private val cardFieldView: CardFieldView?,
|
|
10
10
|
private val cardFormView: CardFormView?,
|
|
11
11
|
) {
|
|
12
12
|
private val billingDetailsParams = mapToBillingDetails(getMapOrNull(params, "billingDetails"), cardFieldView?.cardAddress ?: cardFormView?.cardAddress)
|
|
@@ -77,17 +77,17 @@ class PaymentMethodCreateParamsFactory(
|
|
|
77
77
|
|
|
78
78
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
79
79
|
private fun createP24PaymentConfirmParams(): ConfirmPaymentIntentParams {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
80
|
+
billingDetailsParams?.let {
|
|
81
|
+
val params = PaymentMethodCreateParams.createP24(it)
|
|
83
82
|
|
|
84
|
-
|
|
83
|
+
return ConfirmPaymentIntentParams
|
|
84
|
+
.createWithPaymentMethodCreateParams(
|
|
85
|
+
paymentMethodCreateParams = params,
|
|
86
|
+
clientSecret = clientSecret,
|
|
87
|
+
)
|
|
88
|
+
}
|
|
85
89
|
|
|
86
|
-
|
|
87
|
-
.createWithPaymentMethodCreateParams(
|
|
88
|
-
paymentMethodCreateParams = params,
|
|
89
|
-
clientSecret = clientSecret,
|
|
90
|
-
)
|
|
90
|
+
throw PaymentMethodCreateParamsException("You must provide billing details")
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
@@ -146,21 +146,25 @@ class PaymentMethodCreateParamsFactory(
|
|
|
146
146
|
|
|
147
147
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
148
148
|
private fun createSepaPaymentSetupParams(): ConfirmSetupIntentParams {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
throw PaymentMethodCreateParamsException("You must provide IBAN")
|
|
154
|
-
}
|
|
149
|
+
billingDetailsParams?.let {
|
|
150
|
+
val iban = getValOr(params, "iban", null) ?: run {
|
|
151
|
+
throw PaymentMethodCreateParamsException("You must provide IBAN")
|
|
152
|
+
}
|
|
155
153
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
154
|
+
val sepaParams = PaymentMethodCreateParams.SepaDebit(iban)
|
|
155
|
+
val createParams =
|
|
156
|
+
PaymentMethodCreateParams.create(
|
|
157
|
+
sepaDebit = sepaParams,
|
|
158
|
+
billingDetails = it
|
|
159
|
+
)
|
|
159
160
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
161
|
+
return ConfirmSetupIntentParams.create(
|
|
162
|
+
paymentMethodCreateParams = createParams,
|
|
163
|
+
clientSecret = clientSecret
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
throw PaymentMethodCreateParamsException("You must provide billing details")
|
|
164
168
|
}
|
|
165
169
|
|
|
166
170
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
@@ -182,7 +186,7 @@ class PaymentMethodCreateParamsFactory(
|
|
|
182
186
|
|
|
183
187
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
184
188
|
private fun createSofortPaymentConfirmParams(): ConfirmPaymentIntentParams {
|
|
185
|
-
val country = getValOr(params, "country", null)
|
|
189
|
+
val country = getValOr(params, "country", null) ?: run {
|
|
186
190
|
throw PaymentMethodCreateParamsException("You must provide bank account country")
|
|
187
191
|
}
|
|
188
192
|
val setupFutureUsage = mapToPaymentIntentFutureUsage(getValOr(params, "setupFutureUsage"))
|
|
@@ -230,100 +234,101 @@ class PaymentMethodCreateParamsFactory(
|
|
|
230
234
|
|
|
231
235
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
232
236
|
private fun createBancontactPaymentConfirmParams(): ConfirmPaymentIntentParams {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
237
|
+
billingDetailsParams?.let {
|
|
238
|
+
val setupFutureUsage = mapToPaymentIntentFutureUsage(getValOr(params, "setupFutureUsage", null))
|
|
239
|
+
val params = PaymentMethodCreateParams.createBancontact(it)
|
|
236
240
|
|
|
237
|
-
|
|
238
|
-
|
|
241
|
+
return ConfirmPaymentIntentParams
|
|
242
|
+
.createWithPaymentMethodCreateParams(
|
|
243
|
+
paymentMethodCreateParams = params,
|
|
244
|
+
clientSecret = clientSecret,
|
|
245
|
+
setupFutureUsage = setupFutureUsage,
|
|
246
|
+
)
|
|
247
|
+
}
|
|
239
248
|
|
|
240
|
-
|
|
241
|
-
.createWithPaymentMethodCreateParams(
|
|
242
|
-
paymentMethodCreateParams = params,
|
|
243
|
-
clientSecret = clientSecret,
|
|
244
|
-
setupFutureUsage = setupFutureUsage,
|
|
245
|
-
)
|
|
249
|
+
throw PaymentMethodCreateParamsException("You must provide billing details")
|
|
246
250
|
}
|
|
247
251
|
|
|
248
252
|
private fun createBancontactPaymentSetupParams(): ConfirmSetupIntentParams {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
253
|
+
billingDetailsParams?.let {
|
|
254
|
+
val params = PaymentMethodCreateParams.createBancontact(it)
|
|
252
255
|
|
|
253
|
-
|
|
256
|
+
return ConfirmSetupIntentParams
|
|
257
|
+
.create(
|
|
258
|
+
paymentMethodCreateParams = params,
|
|
259
|
+
clientSecret = clientSecret,
|
|
260
|
+
)
|
|
261
|
+
}
|
|
254
262
|
|
|
255
|
-
|
|
256
|
-
.create(
|
|
257
|
-
paymentMethodCreateParams = params,
|
|
258
|
-
clientSecret = clientSecret,
|
|
259
|
-
)
|
|
263
|
+
throw PaymentMethodCreateParamsException("You must provide billing details")
|
|
260
264
|
}
|
|
261
265
|
|
|
262
266
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
263
267
|
private fun createOXXOPaymentConfirmParams(): ConfirmPaymentIntentParams {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
268
|
+
billingDetailsParams?.let {
|
|
269
|
+
val params = PaymentMethodCreateParams.createOxxo(it)
|
|
267
270
|
|
|
268
|
-
|
|
271
|
+
return ConfirmPaymentIntentParams
|
|
272
|
+
.createWithPaymentMethodCreateParams(
|
|
273
|
+
paymentMethodCreateParams = params,
|
|
274
|
+
clientSecret = clientSecret,
|
|
275
|
+
)
|
|
276
|
+
}
|
|
269
277
|
|
|
270
|
-
|
|
271
|
-
.createWithPaymentMethodCreateParams(
|
|
272
|
-
paymentMethodCreateParams = params,
|
|
273
|
-
clientSecret = clientSecret,
|
|
274
|
-
)
|
|
278
|
+
throw PaymentMethodCreateParamsException("You must provide billing details")
|
|
275
279
|
}
|
|
276
280
|
|
|
277
281
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
278
282
|
private fun createEPSPaymentConfirmParams(): ConfirmPaymentIntentParams {
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
283
|
+
billingDetailsParams?.let {
|
|
284
|
+
val params = PaymentMethodCreateParams.createEps(it)
|
|
282
285
|
|
|
283
|
-
|
|
286
|
+
return ConfirmPaymentIntentParams
|
|
287
|
+
.createWithPaymentMethodCreateParams(
|
|
288
|
+
paymentMethodCreateParams = params,
|
|
289
|
+
clientSecret = clientSecret,
|
|
290
|
+
)
|
|
291
|
+
}
|
|
284
292
|
|
|
285
|
-
|
|
286
|
-
.createWithPaymentMethodCreateParams(
|
|
287
|
-
paymentMethodCreateParams = params,
|
|
288
|
-
clientSecret = clientSecret,
|
|
289
|
-
)
|
|
293
|
+
throw PaymentMethodCreateParamsException("You must provide billing details")
|
|
290
294
|
}
|
|
291
295
|
|
|
292
296
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
293
297
|
private fun createGiropayPaymentConfirmParams(): ConfirmPaymentIntentParams {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
298
|
+
billingDetailsParams?.let {
|
|
299
|
+
val params = PaymentMethodCreateParams.createGiropay(it)
|
|
297
300
|
|
|
298
|
-
|
|
301
|
+
return ConfirmPaymentIntentParams
|
|
302
|
+
.createWithPaymentMethodCreateParams(
|
|
303
|
+
paymentMethodCreateParams = params,
|
|
304
|
+
clientSecret = clientSecret,
|
|
305
|
+
)
|
|
306
|
+
}
|
|
299
307
|
|
|
300
|
-
|
|
301
|
-
.createWithPaymentMethodCreateParams(
|
|
302
|
-
paymentMethodCreateParams = params,
|
|
303
|
-
clientSecret = clientSecret,
|
|
304
|
-
)
|
|
308
|
+
throw PaymentMethodCreateParamsException("You must provide billing details")
|
|
305
309
|
}
|
|
306
310
|
|
|
307
311
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
308
312
|
private fun createSepaPaymentConfirmParams(): ConfirmPaymentIntentParams {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
313
|
+
billingDetailsParams?.let {
|
|
314
|
+
val iban = getValOr(params, "iban", null) ?: run {
|
|
315
|
+
throw PaymentMethodCreateParamsException("You must provide IBAN")
|
|
316
|
+
}
|
|
317
|
+
val setupFutureUsage = mapToPaymentIntentFutureUsage(getValOr(params, "setupFutureUsage"))
|
|
318
|
+
val params = PaymentMethodCreateParams.create(
|
|
319
|
+
sepaDebit = PaymentMethodCreateParams.SepaDebit(iban),
|
|
320
|
+
billingDetails = it
|
|
321
|
+
)
|
|
322
|
+
|
|
323
|
+
return ConfirmPaymentIntentParams
|
|
324
|
+
.createWithPaymentMethodCreateParams(
|
|
325
|
+
paymentMethodCreateParams = params,
|
|
326
|
+
clientSecret = clientSecret,
|
|
327
|
+
setupFutureUsage = setupFutureUsage
|
|
328
|
+
)
|
|
314
329
|
}
|
|
315
|
-
val setupFutureUsage = mapToPaymentIntentFutureUsage(getValOr(params, "setupFutureUsage"))
|
|
316
|
-
val params = PaymentMethodCreateParams.create(
|
|
317
|
-
sepaDebit = PaymentMethodCreateParams.SepaDebit(iban),
|
|
318
|
-
billingDetails = billingDetails
|
|
319
|
-
)
|
|
320
330
|
|
|
321
|
-
|
|
322
|
-
.createWithPaymentMethodCreateParams(
|
|
323
|
-
paymentMethodCreateParams = params,
|
|
324
|
-
clientSecret = clientSecret,
|
|
325
|
-
setupFutureUsage = setupFutureUsage
|
|
326
|
-
)
|
|
331
|
+
throw PaymentMethodCreateParamsException("You must provide billing details")
|
|
327
332
|
}
|
|
328
333
|
|
|
329
334
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
@@ -342,22 +347,22 @@ class PaymentMethodCreateParamsFactory(
|
|
|
342
347
|
|
|
343
348
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
344
349
|
private fun createAfterpayClearpayPaymentConfirmParams(): ConfirmPaymentIntentParams {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
350
|
+
billingDetailsParams?.let {
|
|
351
|
+
val params = PaymentMethodCreateParams.createAfterpayClearpay(it)
|
|
348
352
|
|
|
349
|
-
|
|
353
|
+
return ConfirmPaymentIntentParams
|
|
354
|
+
.createWithPaymentMethodCreateParams(
|
|
355
|
+
paymentMethodCreateParams = params,
|
|
356
|
+
clientSecret = clientSecret,
|
|
357
|
+
)
|
|
358
|
+
}
|
|
350
359
|
|
|
351
|
-
|
|
352
|
-
.createWithPaymentMethodCreateParams(
|
|
353
|
-
paymentMethodCreateParams = params,
|
|
354
|
-
clientSecret = clientSecret,
|
|
355
|
-
)
|
|
360
|
+
throw PaymentMethodCreateParamsException("You must provide billing details")
|
|
356
361
|
}
|
|
357
362
|
|
|
358
363
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
359
364
|
private fun createAuBecsDebitPaymentConfirmParams(): ConfirmPaymentIntentParams {
|
|
360
|
-
val formDetails = getMapOrNull(params, "formDetails")
|
|
365
|
+
val formDetails = getMapOrNull(params, "formDetails") ?: run {
|
|
361
366
|
throw PaymentMethodCreateParamsException("You must provide form details")
|
|
362
367
|
}
|
|
363
368
|
|
|
@@ -388,7 +393,7 @@ class PaymentMethodCreateParamsFactory(
|
|
|
388
393
|
|
|
389
394
|
@Throws(PaymentMethodCreateParamsException::class)
|
|
390
395
|
private fun createAuBecsDebitPaymentSetupParams(): ConfirmSetupIntentParams {
|
|
391
|
-
val formDetails = getMapOrNull(params, "formDetails")
|
|
396
|
+
val formDetails = getMapOrNull(params, "formDetails") ?: run {
|
|
392
397
|
throw PaymentMethodCreateParamsException("You must provide form details")
|
|
393
398
|
}
|
|
394
399
|
|
|
@@ -6,7 +6,6 @@ import android.content.res.ColorStateList
|
|
|
6
6
|
import android.graphics.Bitmap
|
|
7
7
|
import android.graphics.Canvas
|
|
8
8
|
import android.graphics.Color
|
|
9
|
-
import android.graphics.drawable.Drawable
|
|
10
9
|
import android.os.Bundle
|
|
11
10
|
import android.util.Base64
|
|
12
11
|
import android.view.LayoutInflater
|
|
@@ -17,8 +16,9 @@ import androidx.appcompat.content.res.AppCompatResources
|
|
|
17
16
|
import androidx.core.graphics.drawable.DrawableCompat
|
|
18
17
|
import androidx.fragment.app.Fragment
|
|
19
18
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
|
20
|
-
import com.stripe.android.paymentsheet
|
|
21
|
-
import com.stripe.android.paymentsheet.
|
|
19
|
+
import com.stripe.android.paymentsheet.PaymentOptionCallback
|
|
20
|
+
import com.stripe.android.paymentsheet.PaymentSheet
|
|
21
|
+
import com.stripe.android.paymentsheet.PaymentSheetResultCallback
|
|
22
22
|
import java.io.ByteArrayOutputStream
|
|
23
23
|
|
|
24
24
|
class PaymentSheetFragment : Fragment() {
|
|
@@ -55,48 +55,46 @@ class PaymentSheetFragment : Fragment() {
|
|
|
55
55
|
paymentIntentClientSecret = arguments?.getString("paymentIntentClientSecret").orEmpty()
|
|
56
56
|
setupIntentClientSecret = arguments?.getString("setupIntentClientSecret").orEmpty()
|
|
57
57
|
|
|
58
|
-
val paymentOptionCallback =
|
|
59
|
-
|
|
60
|
-
val intent = Intent(ON_PAYMENT_OPTION_ACTION)
|
|
58
|
+
val paymentOptionCallback = PaymentOptionCallback { paymentOption ->
|
|
59
|
+
val intent = Intent(ON_PAYMENT_OPTION_ACTION)
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
if (paymentOption != null) {
|
|
62
|
+
val bitmap = getBitmapFromVectorDrawable(context, paymentOption.drawableResourceId)
|
|
63
|
+
val imageString = getBase64FromBitmap(bitmap)
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
localBroadcastManager.sendBroadcast(intent)
|
|
65
|
+
intent.putExtra("label", paymentOption.label)
|
|
66
|
+
intent.putExtra("image", imageString)
|
|
70
67
|
}
|
|
68
|
+
localBroadcastManager.sendBroadcast(intent)
|
|
71
69
|
}
|
|
72
70
|
|
|
73
|
-
val paymentResultCallback =
|
|
74
|
-
|
|
75
|
-
val intent = Intent(ON_PAYMENT_RESULT_ACTION)
|
|
71
|
+
val paymentResultCallback = PaymentSheetResultCallback { paymentResult ->
|
|
72
|
+
val intent = Intent(ON_PAYMENT_RESULT_ACTION)
|
|
76
73
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
74
|
+
intent.putExtra("paymentResult", paymentResult)
|
|
75
|
+
localBroadcastManager.sendBroadcast(intent)
|
|
80
76
|
}
|
|
81
77
|
|
|
82
78
|
var primaryButtonColor: ColorStateList? = null
|
|
83
|
-
if (primaryButtonColorHexStr
|
|
79
|
+
if (primaryButtonColorHexStr.isNotEmpty()) {
|
|
84
80
|
primaryButtonColor = ColorStateList.valueOf(Color.parseColor(primaryButtonColorHexStr))
|
|
85
81
|
}
|
|
86
82
|
|
|
87
83
|
var defaultBillingDetails: PaymentSheet.BillingDetails? = null
|
|
88
84
|
if (billingDetailsBundle != null) {
|
|
89
85
|
val addressBundle = billingDetailsBundle.getBundle("address")
|
|
90
|
-
val address = PaymentSheet.Address(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
86
|
+
val address = PaymentSheet.Address(
|
|
87
|
+
addressBundle?.getString("city"),
|
|
88
|
+
addressBundle?.getString("country"),
|
|
89
|
+
addressBundle?.getString("line1"),
|
|
90
|
+
addressBundle?.getString("line2"),
|
|
91
|
+
addressBundle?.getString("postalCode"),
|
|
92
|
+
addressBundle?.getString("state"))
|
|
93
|
+
defaultBillingDetails = PaymentSheet.BillingDetails(
|
|
94
|
+
address,
|
|
95
|
+
billingDetailsBundle.getString("email"),
|
|
96
|
+
billingDetailsBundle.getString("name"),
|
|
97
|
+
billingDetailsBundle.getString("phone"))
|
|
100
98
|
}
|
|
101
99
|
|
|
102
100
|
paymentSheetConfiguration = PaymentSheet.Configuration(
|
|
@@ -142,20 +140,18 @@ class PaymentSheetFragment : Fragment() {
|
|
|
142
140
|
}
|
|
143
141
|
|
|
144
142
|
private fun configureFlowController() {
|
|
145
|
-
val onFlowControllerConfigure =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
intent.putExtra("image", imageString)
|
|
156
|
-
}
|
|
157
|
-
localBroadcastManager.sendBroadcast(intent)
|
|
143
|
+
val onFlowControllerConfigure = PaymentSheet.FlowController.ConfigCallback { _, _ ->
|
|
144
|
+
val paymentOption = flowController?.getPaymentOption()
|
|
145
|
+
val intent = Intent(ON_CONFIGURE_FLOW_CONTROLLER)
|
|
146
|
+
|
|
147
|
+
paymentOption?.let {
|
|
148
|
+
val bitmap = getBitmapFromVectorDrawable(context, it.drawableResourceId)
|
|
149
|
+
val imageString = getBase64FromBitmap(bitmap)
|
|
150
|
+
|
|
151
|
+
intent.putExtra("label", it.label)
|
|
152
|
+
intent.putExtra("image", imageString)
|
|
158
153
|
}
|
|
154
|
+
localBroadcastManager.sendBroadcast(intent)
|
|
159
155
|
}
|
|
160
156
|
|
|
161
157
|
if (!paymentIntentClientSecret.isNullOrEmpty()) {
|
|
@@ -175,26 +171,23 @@ class PaymentSheetFragment : Fragment() {
|
|
|
175
171
|
}
|
|
176
172
|
|
|
177
173
|
fun getBitmapFromVectorDrawable(context: Context?, drawableId: Int): Bitmap? {
|
|
178
|
-
var drawable
|
|
179
|
-
|
|
180
|
-
if (drawable == null) {
|
|
181
|
-
return null
|
|
182
|
-
}
|
|
174
|
+
var drawable = AppCompatResources.getDrawable(context!!, drawableId) ?: return null
|
|
183
175
|
|
|
184
176
|
drawable = DrawableCompat.wrap(drawable).mutate()
|
|
185
177
|
val bitmap = Bitmap.createBitmap(drawable.intrinsicWidth, drawable.intrinsicHeight, Bitmap.Config.ARGB_8888)
|
|
186
|
-
bitmap.eraseColor(Color.WHITE)
|
|
178
|
+
bitmap.eraseColor(Color.WHITE)
|
|
187
179
|
val canvas = Canvas(bitmap)
|
|
188
180
|
drawable.setBounds(0, 0, canvas.width, canvas.height)
|
|
189
181
|
drawable.draw(canvas)
|
|
190
182
|
return bitmap
|
|
191
183
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
184
|
+
|
|
185
|
+
fun getBase64FromBitmap(bitmap: Bitmap?): String? {
|
|
186
|
+
if (bitmap == null) {
|
|
187
|
+
return null
|
|
188
|
+
}
|
|
189
|
+
val stream = ByteArrayOutputStream()
|
|
190
|
+
bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream)
|
|
191
|
+
val imageBytes: ByteArray = stream.toByteArray()
|
|
192
|
+
return Base64.encodeToString(imageBytes, Base64.DEFAULT)
|
|
193
|
+
}
|
|
@@ -8,8 +8,9 @@ class StripeContainerManager : ViewGroupManager<StripeContainerView>() {
|
|
|
8
8
|
override fun getName() = "StripeContainer"
|
|
9
9
|
|
|
10
10
|
@ReactProp(name = "keyboardShouldPersistTaps")
|
|
11
|
+
@SuppressWarnings("unused")
|
|
11
12
|
fun setKeyboardShouldPersistTaps(view: StripeContainerView, keyboardShouldPersistTaps: Boolean) {
|
|
12
|
-
view.setKeyboardShouldPersistTaps(keyboardShouldPersistTaps)
|
|
13
|
+
view.setKeyboardShouldPersistTaps(keyboardShouldPersistTaps)
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
override fun createViewInstance(reactContext: ThemedReactContext): StripeContainerView {
|