From 90eea1840a3cb295200e630c9f2ba14fc9371e0f Mon Sep 17 00:00:00 2001 From: Jose Ugia Date: Wed, 7 Feb 2024 16:17:22 +0100 Subject: [PATCH 01/14] Use the 19.3.0 beta version of the Google Pay API --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 01fc467db96..2a49f95c32c 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -57,7 +57,7 @@ ext.versions = [ places : '3.3.0', playServicesCoroutines : '1.7.3', playServicesTfLite : '16.0.1', - playServicesWallet : '19.2.1', + playServicesWallet : '19.3.0-beta01', retrofit : '2.9.0', robolectric : '4.11.1', shot : '5.14.1', From bd672e7cce7fb14d2518273d629b7c9257a7840e Mon Sep 17 00:00:00 2001 From: Jose Ugia Date: Wed, 7 Feb 2024 16:23:59 +0100 Subject: [PATCH 02/14] Replace deprecated onActivity result with the new Google Pay contract --- .../GooglePayLauncherActivity.kt | 107 ++++++++---------- .../GooglePayPaymentMethodLauncherActivity.kt | 101 +++++++---------- 2 files changed, 84 insertions(+), 124 deletions(-) diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt index a7dea3ce8a7..0c3efed6604 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt @@ -6,9 +6,11 @@ import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity import androidx.core.os.bundleOf import androidx.lifecycle.lifecycleScope -import com.google.android.gms.tasks.Task +import com.google.android.gms.common.api.CommonStatusCodes import com.google.android.gms.wallet.AutoResolveHelper import com.google.android.gms.wallet.PaymentData +import com.google.android.gms.wallet.contract.ApiTaskResult +import com.google.android.gms.wallet.contract.TaskResultContracts.GetPaymentDataResult import com.stripe.android.model.PaymentMethodCreateParams import com.stripe.android.model.StripeIntent import com.stripe.android.utils.fadeOut @@ -58,11 +60,15 @@ internal class GooglePayLauncherActivity : AppCompatActivity() { } } + val googlePayLauncher = registerForActivityResult(GetPaymentDataResult()) { + onGooglePayResult(it) + } + if (!viewModel.hasLaunched) { lifecycleScope.launch { viewModel.createLoadPaymentDataTask().fold( onSuccess = { - payWithGoogle(it) + googlePayLauncher.launch(it) viewModel.hasLaunched = true }, onFailure = { @@ -80,73 +86,57 @@ internal class GooglePayLauncherActivity : AppCompatActivity() { fadeOut() } - private fun payWithGoogle(task: Task) { - AutoResolveHelper.resolveTask( - task, - this, - LOAD_PAYMENT_DATA_REQUEST_CODE - ) - } + private fun onGooglePayResult(taskResult: ApiTaskResult) { + when (taskResult.status.statusCode) { + CommonStatusCodes.SUCCESS -> { + onGooglePayResult(taskResult.result!!) + } - @Deprecated("Deprecated in Java") - public override fun onActivityResult( - requestCode: Int, - resultCode: Int, - data: Intent? - ) { - super.onActivityResult(requestCode, resultCode, data) - if (requestCode == LOAD_PAYMENT_DATA_REQUEST_CODE) { - when (resultCode) { - RESULT_OK -> { - onGooglePayResult(data) - } - RESULT_CANCELED -> { - viewModel.updateResult( - GooglePayLauncher.Result.Canceled - ) - } - AutoResolveHelper.RESULT_ERROR -> { - val status = AutoResolveHelper.getStatusFromIntent(data) - val statusMessage = status?.statusMessage.orEmpty() - viewModel.updateResult( - GooglePayLauncher.Result.Failed( - RuntimeException( - "Google Pay failed with error: $statusMessage" - ) + CommonStatusCodes.CANCELED -> { + viewModel.updateResult( + GooglePayLauncher.Result.Canceled + ) + } + + AutoResolveHelper.RESULT_ERROR -> { + val statusMessage = taskResult.status.statusMessage.orEmpty() + viewModel.updateResult( + GooglePayLauncher.Result.Failed( + RuntimeException( + "Google Pay failed with error: $statusMessage" ) ) - } - else -> { - viewModel.updateResult( - GooglePayLauncher.Result.Failed( - RuntimeException( - "Google Pay returned an expected result code." - ) + ) + } + + else -> { + viewModel.updateResult( + GooglePayLauncher.Result.Failed( + RuntimeException( + "Google Pay returned an expected result code." ) ) - } - } - } else { - lifecycleScope.launch { - viewModel.onConfirmResult( - requestCode, - data ?: Intent() ) } } } - private fun onGooglePayResult(data: Intent?) { - val paymentData = data?.let { PaymentData.getFromIntent(it) } - if (paymentData == null) { - viewModel.updateResult( - GooglePayLauncher.Result.Failed( - IllegalArgumentException("Google Pay data was not available") - ) + @Deprecated("Deprecated in Java") + public override fun onActivityResult( + requestCode: Int, + resultCode: Int, + data: Intent? + ) { + super.onActivityResult(requestCode, resultCode, data) + lifecycleScope.launch { + viewModel.onConfirmResult( + requestCode, + data ?: Intent() ) - return } + } + private fun onGooglePayResult(paymentData: PaymentData) { val paymentDataJson = JSONObject(paymentData.toJson()) val params = PaymentMethodCreateParams.createFromGooglePay(paymentDataJson) @@ -166,9 +156,4 @@ internal class GooglePayLauncherActivity : AppCompatActivity() { ) finish() } - - private companion object { - // the value isn't meaningful / is arbitrary - private const val LOAD_PAYMENT_DATA_REQUEST_CODE = 4444 - } } diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt index 789c9b30d1c..3742d71be44 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt @@ -7,9 +7,10 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.os.bundleOf import androidx.lifecycle.lifecycleScope import com.google.android.gms.common.api.CommonStatusCodes -import com.google.android.gms.tasks.Task import com.google.android.gms.wallet.AutoResolveHelper import com.google.android.gms.wallet.PaymentData +import com.google.android.gms.wallet.contract.ApiTaskResult +import com.google.android.gms.wallet.contract.TaskResultContracts.GetPaymentDataResult import com.stripe.android.model.PaymentMethod import com.stripe.android.utils.fadeOut import kotlinx.coroutines.launch @@ -60,13 +61,17 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { } } + val googlePayLauncher = registerForActivityResult(GetPaymentDataResult()) { + onGooglePayResult(it) + } + if (!viewModel.hasLaunched) { lifecycleScope.launch { runCatching { viewModel.createLoadPaymentDataTask() }.fold( onSuccess = { - launchGooglePay(it) + googlePayLauncher.launch(it) viewModel.hasLaunched = true }, onFailure = { @@ -87,70 +92,44 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { setFadeAnimations() } - private fun launchGooglePay(task: Task) { - AutoResolveHelper.resolveTask( - task, - this, - LOAD_PAYMENT_DATA_REQUEST_CODE - ) - } - - @Deprecated("Deprecated in Java") - public override fun onActivityResult( - requestCode: Int, - resultCode: Int, - data: Intent? - ) { - super.onActivityResult(requestCode, resultCode, data) - if (requestCode == LOAD_PAYMENT_DATA_REQUEST_CODE) { - when (resultCode) { - RESULT_OK -> { - onGooglePayResult(data) - } - RESULT_CANCELED -> { - updateResult( - GooglePayPaymentMethodLauncher.Result.Canceled - ) - } - AutoResolveHelper.RESULT_ERROR -> { - val status = AutoResolveHelper.getStatusFromIntent(data) - val statusMessage = status?.statusMessage.orEmpty() - updateResult( - GooglePayPaymentMethodLauncher.Result.Failed( - RuntimeException( - "Google Pay failed with error ${status?.statusCode}: $statusMessage" - ), - status?.statusCode?.let { - googlePayStatusCodeToErrorCode(it) - } ?: GooglePayPaymentMethodLauncher.INTERNAL_ERROR - ) + private fun onGooglePayResult(taskResult: ApiTaskResult) { + when (taskResult.status.statusCode) { + CommonStatusCodes.SUCCESS -> { + onGooglePayResult(taskResult.result!!) + } + CommonStatusCodes.CANCELED -> { + updateResult( + GooglePayPaymentMethodLauncher.Result.Canceled + ) + } + AutoResolveHelper.RESULT_ERROR -> { + val status = taskResult.status + updateResult( + GooglePayPaymentMethodLauncher.Result.Failed( + RuntimeException( + "Google Pay failed with error ${status.statusCode}: ${status.statusMessage}" + ), + googlePayStatusCodeToErrorCode(status.statusCode) ) - } - else -> { - updateResult( - GooglePayPaymentMethodLauncher.Result.Failed( - RuntimeException("Google Pay returned an expected result code."), - GooglePayPaymentMethodLauncher.INTERNAL_ERROR - ) + ) + } + else -> { + updateResult( + GooglePayPaymentMethodLauncher.Result.Failed( + RuntimeException("Google Pay returned an expected result code."), + GooglePayPaymentMethodLauncher.INTERNAL_ERROR ) - } + ) } } } - private fun onGooglePayResult(data: Intent?) { - data?.let { PaymentData.getFromIntent(it) }?.let { paymentData -> - lifecycleScope.launch { - finishWithResult( - viewModel.createPaymentMethod(paymentData) - ) - } - } ?: updateResult( - GooglePayPaymentMethodLauncher.Result.Failed( - IllegalArgumentException("Google Pay data was not available"), - GooglePayPaymentMethodLauncher.INTERNAL_ERROR + private fun onGooglePayResult(paymentData: PaymentData) { + lifecycleScope.launch { + finishWithResult( + viewModel.createPaymentMethod(paymentData) ) - ) + } } private fun updateResult(result: GooglePayPaymentMethodLauncher.Result) { @@ -180,8 +159,4 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { else -> GooglePayPaymentMethodLauncher.INTERNAL_ERROR } } - - private companion object { - private const val LOAD_PAYMENT_DATA_REQUEST_CODE = 4444 - } } From 3d3712d58a880bb218d202d036be095cb6a85749 Mon Sep 17 00:00:00 2001 From: Jose Ugia Date: Wed, 6 Mar 2024 11:31:00 +0100 Subject: [PATCH 03/14] Upgrade to general availability --- dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dependencies.gradle b/dependencies.gradle index 2a49f95c32c..decef1add6e 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -57,7 +57,7 @@ ext.versions = [ places : '3.3.0', playServicesCoroutines : '1.7.3', playServicesTfLite : '16.0.1', - playServicesWallet : '19.3.0-beta01', + playServicesWallet : '19.3.0', retrofit : '2.9.0', robolectric : '4.11.1', shot : '5.14.1', From acc70a174c29955c74f2fb603beba2d46f8c8465 Mon Sep 17 00:00:00 2001 From: Jose Ugia Date: Mon, 11 Mar 2024 11:25:11 +0100 Subject: [PATCH 04/14] Import VisibleForTesting from AndroidX --- .../paymentdatacollection/bacs/BacsMandateConfirmationForm.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/paymentdatacollection/bacs/BacsMandateConfirmationForm.kt b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/paymentdatacollection/bacs/BacsMandateConfirmationForm.kt index aa2081fcb59..561180a6787 100644 --- a/paymentsheet/src/main/java/com/stripe/android/paymentsheet/paymentdatacollection/bacs/BacsMandateConfirmationForm.kt +++ b/paymentsheet/src/main/java/com/stripe/android/paymentsheet/paymentdatacollection/bacs/BacsMandateConfirmationForm.kt @@ -1,6 +1,7 @@ package com.stripe.android.paymentsheet.paymentdatacollection.bacs import android.content.res.Configuration.UI_MODE_NIGHT_YES +import androidx.annotation.VisibleForTesting import androidx.compose.foundation.BorderStroke import androidx.compose.foundation.background import androidx.compose.foundation.border @@ -28,7 +29,6 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.lifecycle.viewmodel.compose.viewModel -import com.google.android.gms.common.util.VisibleForTesting import com.stripe.android.core.strings.resolvableString import com.stripe.android.paymentsheet.R import com.stripe.android.paymentsheet.utils.PaymentSheetContentPadding From 656c9a7ae5484df4e7818d3f51468261c730dad8 Mon Sep 17 00:00:00 2001 From: Jose Ugia Date: Wed, 10 Apr 2024 13:41:27 +0200 Subject: [PATCH 05/14] Revert changed files during merge process --- bitrise.yml | 3 +++ build.gradle | 2 ++ 2 files changed, 5 insertions(+) diff --git a/bitrise.yml b/bitrise.yml index 173da9b5bf6..e9f9efcb845 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -334,12 +334,15 @@ workflows: - conclude_all steps: - script@1: + timeout: 1200 inputs: - content: ./gradlew :paymentsheet-example:assembleDebugAndroidTest :paymentsheet-example:assembleDebug - script@1: + timeout: 120 inputs: - content: pip3 install requests_toolbelt requests - script@1: + timeout: 2400 inputs: - content: python3 scripts/browserstack.py --test --apk paymentsheet-example/build/outputs/apk/debug/paymentsheet-example-debug.apk --espresso paymentsheet-example/build/outputs/apk/androidTest/debug/paymentsheet-example-debug-androidTest.apk check-dependencies: diff --git a/build.gradle b/build.gradle index 5f1e8a051fd..0b2355e9ff8 100644 --- a/build.gradle +++ b/build.gradle @@ -29,6 +29,7 @@ plugins { id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' id 'io.codearte.nexus-staging' version '0.30.0' id 'com.google.devtools.ksp' version '1.9.22-1.0.17' apply false + id 'dev.drewhamilton.poko' version '0.15.2' apply false } apply plugin: "io.gitlab.arturbosch.detekt" @@ -95,6 +96,7 @@ apiValidation { "payments-core-testing", "paymentsheet-example", "stripecardscan-example", + "screenshot-testing", ] nonPublicMarkers.add("androidx.annotation.RestrictTo") nonPublicMarkers.add("dagger.internal.DaggerGenerated") From 57f8aa9a971180a3af0ea04a24a6b8e905cbfaaf Mon Sep 17 00:00:00 2001 From: Jose Ugia Date: Tue, 16 Apr 2024 15:07:39 +0200 Subject: [PATCH 06/14] The task needs to be completed before it can be handled by the activity result launcher --- .../GooglePayPaymentMethodLauncherActivity.kt | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt index 3742d71be44..9d24bbff8f8 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt @@ -7,6 +7,8 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.os.bundleOf import androidx.lifecycle.lifecycleScope import com.google.android.gms.common.api.CommonStatusCodes +import com.google.android.gms.tasks.CancellationTokenSource +import com.google.android.gms.tasks.Task import com.google.android.gms.wallet.AutoResolveHelper import com.google.android.gms.wallet.PaymentData import com.google.android.gms.wallet.contract.ApiTaskResult @@ -14,6 +16,9 @@ import com.google.android.gms.wallet.contract.TaskResultContracts.GetPaymentData import com.stripe.android.model.PaymentMethod import com.stripe.android.utils.fadeOut import kotlinx.coroutines.launch +import kotlinx.coroutines.suspendCancellableCoroutine +import java.util.concurrent.Executor +import kotlin.coroutines.resume /** * [GooglePayPaymentMethodLauncherActivity] is used to return the result of a Google Pay operation. @@ -68,7 +73,7 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { if (!viewModel.hasLaunched) { lifecycleScope.launch { runCatching { - viewModel.createLoadPaymentDataTask() + viewModel.createLoadPaymentDataTask().awaitTask() }.fold( onSuccess = { googlePayLauncher.launch(it) @@ -160,3 +165,23 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { } } } + +suspend fun Task.awaitTask(cancellationTokenSource: CancellationTokenSource? = null): Task { + return if (isComplete) this else suspendCancellableCoroutine { cont -> + // Run the callback directly to avoid unnecessarily scheduling on the main thread. + addOnCompleteListener(DirectExecutor, cont::resume) + + cancellationTokenSource?.let { cancellationSource -> + cont.invokeOnCancellation { cancellationSource.cancel() } + } + } +} + +/** + * An [Executor] that just directly executes the [Runnable]. + */ +private object DirectExecutor : Executor { + override fun execute(r: Runnable) { + r.run() + } +} From a2a39fe49cde5e287f4f0f2316b4c854f317ed5d Mon Sep 17 00:00:00 2001 From: Jose Ugia Date: Tue, 16 Apr 2024 15:34:51 +0200 Subject: [PATCH 07/14] Move Task extension to a separate file --- .../GooglePayLauncherActivity.kt | 3 +-- .../GooglePayLauncherViewModel.kt | 4 +-- .../GooglePayPaymentMethodLauncherActivity.kt | 25 +---------------- ...GooglePayPaymentMethodLauncherViewModel.kt | 4 +-- .../stripe/android/googlepaylauncher/Tasks.kt | 27 +++++++++++++++++++ 5 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 payments-core/src/main/java/com/stripe/android/googlepaylauncher/Tasks.kt diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt index 4235dc61451..907a015004a 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt @@ -13,7 +13,6 @@ import com.google.android.gms.wallet.contract.ApiTaskResult import com.google.android.gms.wallet.contract.TaskResultContracts.GetPaymentDataResult import com.stripe.android.model.PaymentMethodCreateParams import com.stripe.android.model.StripeIntent -import com.stripe.android.payments.core.analytics.ErrorReporter import com.stripe.android.utils.fadeOut import com.stripe.android.view.AuthActivityStarterHost import kotlinx.coroutines.launch @@ -67,7 +66,7 @@ internal class GooglePayLauncherActivity : AppCompatActivity() { if (!viewModel.hasLaunched) { lifecycleScope.launch { - viewModel.createLoadPaymentDataTask().fold( + viewModel.loadPaymentData().fold( onSuccess = { googlePayLauncher.launch(it) viewModel.hasLaunched = true diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherViewModel.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherViewModel.kt index 5e451839842..4a9d0aa654c 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherViewModel.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherViewModel.kt @@ -160,7 +160,7 @@ internal class GooglePayLauncherViewModel( } } - suspend fun createLoadPaymentDataTask(): Result> { + suspend fun loadPaymentData(): Result> { return runCatching { check(isReadyToPay()) { "Google Pay is unavailable." } }.mapResult { @@ -168,7 +168,7 @@ internal class GooglePayLauncherViewModel( }.mapCatching { json -> PaymentDataRequest.fromJson(json) }.map { request -> - paymentsClient.loadPaymentData(request) + paymentsClient.loadPaymentData(request).awaitTask() } } diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt index 9d24bbff8f8..0a83762ff8c 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt @@ -7,8 +7,6 @@ import androidx.appcompat.app.AppCompatActivity import androidx.core.os.bundleOf import androidx.lifecycle.lifecycleScope import com.google.android.gms.common.api.CommonStatusCodes -import com.google.android.gms.tasks.CancellationTokenSource -import com.google.android.gms.tasks.Task import com.google.android.gms.wallet.AutoResolveHelper import com.google.android.gms.wallet.PaymentData import com.google.android.gms.wallet.contract.ApiTaskResult @@ -16,9 +14,6 @@ import com.google.android.gms.wallet.contract.TaskResultContracts.GetPaymentData import com.stripe.android.model.PaymentMethod import com.stripe.android.utils.fadeOut import kotlinx.coroutines.launch -import kotlinx.coroutines.suspendCancellableCoroutine -import java.util.concurrent.Executor -import kotlin.coroutines.resume /** * [GooglePayPaymentMethodLauncherActivity] is used to return the result of a Google Pay operation. @@ -73,7 +68,7 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { if (!viewModel.hasLaunched) { lifecycleScope.launch { runCatching { - viewModel.createLoadPaymentDataTask().awaitTask() + viewModel.loadPaymentData() }.fold( onSuccess = { googlePayLauncher.launch(it) @@ -166,22 +161,4 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { } } -suspend fun Task.awaitTask(cancellationTokenSource: CancellationTokenSource? = null): Task { - return if (isComplete) this else suspendCancellableCoroutine { cont -> - // Run the callback directly to avoid unnecessarily scheduling on the main thread. - addOnCompleteListener(DirectExecutor, cont::resume) - cancellationTokenSource?.let { cancellationSource -> - cont.invokeOnCancellation { cancellationSource.cancel() } - } - } -} - -/** - * An [Executor] that just directly executes the [Runnable]. - */ -private object DirectExecutor : Executor { - override fun execute(r: Runnable) { - r.run() - } -} diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherViewModel.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherViewModel.kt index d81335bbebf..077a74c5f3e 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherViewModel.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherViewModel.kt @@ -84,13 +84,13 @@ internal class GooglePayPaymentMethodLauncherViewModel @Inject constructor( ) } - suspend fun createLoadPaymentDataTask(): Task { + suspend fun loadPaymentData(): Task { check(isReadyToPay()) { "Google Pay is unavailable." } return paymentsClient.loadPaymentData( PaymentDataRequest.fromJson(createPaymentDataRequest().toString()) - ) + ).awaitTask() } suspend fun createPaymentMethod( diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/Tasks.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/Tasks.kt new file mode 100644 index 00000000000..005eb5fb01d --- /dev/null +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/Tasks.kt @@ -0,0 +1,27 @@ +package com.stripe.android.googlepaylauncher + +import com.google.android.gms.tasks.CancellationTokenSource +import com.google.android.gms.tasks.Task +import kotlinx.coroutines.suspendCancellableCoroutine +import java.util.concurrent.Executor +import kotlin.coroutines.resume + +internal suspend fun Task.awaitTask(cancellationTokenSource: CancellationTokenSource? = null): Task { + return if (isComplete) this else suspendCancellableCoroutine { cont -> + // Run the callback directly to avoid unnecessarily scheduling on the main thread. + addOnCompleteListener(DirectExecutor, cont::resume) + + cancellationTokenSource?.let { cancellationSource -> + cont.invokeOnCancellation { cancellationSource.cancel() } + } + } +} + +/** + * An [Executor] that just directly executes the [Runnable]. + */ +private object DirectExecutor : Executor { + override fun execute(r: Runnable) { + r.run() + } +} From f04b29ca150756da88a3ab8f113e84d298a5b489 Mon Sep 17 00:00:00 2001 From: Jay Newstrom Date: Tue, 30 Apr 2024 12:35:38 -0600 Subject: [PATCH 08/14] Fix lint stuff. --- example/dependencies/dependencies.txt | 32 +++++++------- .../dependencies/dependencies.txt | 26 ++++++------ link/dependencies/dependencies.txt | 26 ++++++------ network-testing/dependencies/dependencies.txt | 26 ++++++------ .../dependencies/dependencies.txt | 26 ++++++------ .../dependencies/dependencies.txt | 26 ++++++------ payments-core/dependencies/dependencies.txt | 26 ++++++------ .../GooglePayPaymentMethodLauncherActivity.kt | 2 - .../dependencies/dependencies.txt | 26 ++++++------ payments/dependencies/dependencies.txt | 30 ++++++------- .../dependencies/dependencies.txt | 42 +++++++++---------- paymentsheet/dependencies/dependencies.txt | 30 ++++++------- stripe-test-e2e/dependencies/dependencies.txt | 30 ++++++------- wechatpay/dependencies/dependencies.txt | 26 ++++++------ 14 files changed, 186 insertions(+), 188 deletions(-) diff --git a/example/dependencies/dependencies.txt b/example/dependencies/dependencies.txt index 2e3a8252c83..6ae79a35777 100644 --- a/example/dependencies/dependencies.txt +++ b/example/dependencies/dependencies.txt @@ -705,30 +705,30 @@ | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | | +--- com.google.android.material:material:1.11.0 (*) -| | +--- com.google.android.gms:play-services-wallet:19.2.1 +| | +--- com.google.android.gms:play-services-wallet:19.3.0 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 +| | | +--- com.google.android.gms:play-services-base:18.3.0 | | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | | +--- com.google.android.instantapps:instantapps:1.1.0 | | +--- com.stripe:stripe-3ds2-android:6.1.8 | | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) @@ -943,9 +943,9 @@ | | | +--- androidx.compose.ui:ui:1.5.0 -> 1.5.4 (*) | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*) | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0 -> 1.9.10 (*) -| | +--- com.google.android.gms:play-services-wallet:19.2.1 (*) +| | +--- com.google.android.gms:play-services-wallet:19.3.0 (*) | | +--- com.google.pay.button:compose-pay-button:0.1.3 -| | | +--- com.google.android.gms:play-services-wallet:19.2.1 (*) +| | | +--- com.google.android.gms:play-services-wallet:19.2.1 -> 19.3.0 (*) | | | +--- androidx.compose.ui:ui:1.5.4 (*) | | | +--- androidx.compose.material:material:1.5.4 (*) | | | +--- androidx.core:core-ktx:1.12.0 (*) @@ -1027,7 +1027,7 @@ | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*) +--- com.google.android.material:material:1.11.0 (*) -+--- com.google.android.gms:play-services-wallet:19.2.1 (*) ++--- com.google.android.gms:play-services-wallet:19.3.0 (*) +--- com.squareup.okio:okio:3.7.0 (*) +--- com.squareup.retrofit2:retrofit:2.9.0 | \--- com.squareup.okhttp3:okhttp:3.14.9 -> 4.12.0 (*) diff --git a/financial-connections-example/dependencies/dependencies.txt b/financial-connections-example/dependencies/dependencies.txt index baab36db41c..f90c27a1cf2 100644 --- a/financial-connections-example/dependencies/dependencies.txt +++ b/financial-connections-example/dependencies/dependencies.txt @@ -815,30 +815,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 +| +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 +| | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) diff --git a/link/dependencies/dependencies.txt b/link/dependencies/dependencies.txt index 134b16e92fe..50a777b6a52 100644 --- a/link/dependencies/dependencies.txt +++ b/link/dependencies/dependencies.txt @@ -696,30 +696,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 +| +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 +| | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) diff --git a/network-testing/dependencies/dependencies.txt b/network-testing/dependencies/dependencies.txt index 1e7495d894b..feb5a86bc19 100644 --- a/network-testing/dependencies/dependencies.txt +++ b/network-testing/dependencies/dependencies.txt @@ -683,30 +683,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 +| +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 +| | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) diff --git a/payment-method-messaging/dependencies/dependencies.txt b/payment-method-messaging/dependencies/dependencies.txt index 9a1a9e89305..b7a99f0ed8c 100644 --- a/payment-method-messaging/dependencies/dependencies.txt +++ b/payment-method-messaging/dependencies/dependencies.txt @@ -695,30 +695,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 +| +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 +| | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) diff --git a/payments-core-testing/dependencies/dependencies.txt b/payments-core-testing/dependencies/dependencies.txt index e2846b4132b..39431200c41 100644 --- a/payments-core-testing/dependencies/dependencies.txt +++ b/payments-core-testing/dependencies/dependencies.txt @@ -675,30 +675,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 +| +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 +| | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) diff --git a/payments-core/dependencies/dependencies.txt b/payments-core/dependencies/dependencies.txt index 27358e2d024..ff9a2aa44da 100644 --- a/payments-core/dependencies/dependencies.txt +++ b/payments-core/dependencies/dependencies.txt @@ -671,30 +671,30 @@ +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | \--- com.google.android.gms:play-services-basement:18.0.0 +| +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | \--- com.google.android.gms:play-services-basement:18.3.0 | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) +--- com.google.android.material:material:1.11.0 (*) -+--- com.google.android.gms:play-services-wallet:19.2.1 ++--- com.google.android.gms:play-services-wallet:19.3.0 | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| +--- com.google.android.gms:play-services-base:18.0.1 +| +--- com.google.android.gms:play-services-base:18.3.0 | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| +--- com.google.android.gms:play-services-basement:18.3.0 (*) | +--- com.google.android.gms:play-services-identity:18.0.1 -| | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | +--- com.google.android.gms:play-services-maps:18.0.2 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +--- com.google.android.instantapps:instantapps:1.1.0 +--- com.stripe:stripe-3ds2-android:6.1.8 | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt index 0a83762ff8c..769a665a9da 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt @@ -160,5 +160,3 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { } } } - - diff --git a/payments-ui-core/dependencies/dependencies.txt b/payments-ui-core/dependencies/dependencies.txt index a10b1e82b6c..67b37ef129c 100644 --- a/payments-ui-core/dependencies/dependencies.txt +++ b/payments-ui-core/dependencies/dependencies.txt @@ -675,30 +675,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 +| +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 +| | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) diff --git a/payments/dependencies/dependencies.txt b/payments/dependencies/dependencies.txt index 8c2619ccab6..1595004043b 100644 --- a/payments/dependencies/dependencies.txt +++ b/payments/dependencies/dependencies.txt @@ -702,30 +702,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 +| +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 +| | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) @@ -940,9 +940,9 @@ | | +--- androidx.compose.ui:ui:1.5.0 -> 1.5.4 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0 -> 1.9.10 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 (*) +| +--- com.google.android.gms:play-services-wallet:19.3.0 (*) | +--- com.google.pay.button:compose-pay-button:0.1.3 -| | +--- com.google.android.gms:play-services-wallet:19.2.1 (*) +| | +--- com.google.android.gms:play-services-wallet:19.2.1 -> 19.3.0 (*) | | +--- androidx.compose.ui:ui:1.5.4 (*) | | +--- androidx.compose.material:material:1.5.4 (*) | | +--- androidx.core:core-ktx:1.12.0 (*) diff --git a/paymentsheet-example/dependencies/dependencies.txt b/paymentsheet-example/dependencies/dependencies.txt index 3ffd05a3f4c..3096df07ebf 100644 --- a/paymentsheet-example/dependencies/dependencies.txt +++ b/paymentsheet-example/dependencies/dependencies.txt @@ -722,30 +722,30 @@ | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | | +--- com.google.android.material:material:1.11.0 (*) -| | +--- com.google.android.gms:play-services-wallet:19.2.1 +| | +--- com.google.android.gms:play-services-wallet:19.3.0 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 +| | | +--- com.google.android.gms:play-services-base:18.3.0 | | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | | +--- com.google.android.instantapps:instantapps:1.1.0 | | +--- com.stripe:stripe-3ds2-android:6.1.8 | | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) @@ -982,9 +982,9 @@ | | | +--- androidx.compose.ui:ui:1.5.0 -> 1.5.4 (*) | | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*) | | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0 -> 1.9.10 (*) -| | +--- com.google.android.gms:play-services-wallet:19.2.1 (*) +| | +--- com.google.android.gms:play-services-wallet:19.3.0 (*) | | +--- com.google.pay.button:compose-pay-button:0.1.3 -| | | +--- com.google.android.gms:play-services-wallet:19.2.1 (*) +| | | +--- com.google.android.gms:play-services-wallet:19.2.1 -> 19.3.0 (*) | | | +--- androidx.compose.ui:ui:1.5.4 (*) | | | +--- androidx.compose.material:material:1.5.4 (*) | | | +--- androidx.core:core-ktx:1.12.0 (*) @@ -1281,14 +1281,14 @@ | | \--- com.google.firebase:firebase-encoders-json:16.1.0 | | \--- androidx.annotation:annotation:1.1.0 -> 1.7.1 (*) | +--- com.google.android.datatransport:transport-runtime:2.2.3 (*) -| +--- com.google.android.gms:play-services-base:18.0.1 (*) -| +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| +--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | +--- com.google.android.gms:play-services-location:20.0.0 -| | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.0.1 -> 18.1.0 (*) | +--- com.google.android.gms:play-services-maps:17.0.0 -> 18.0.2 (*) -| +--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| +--- com.google.android.gms:play-services-tasks:18.0.1 -> 18.1.0 (*) | +--- com.google.auto.value:auto-value-annotations:1.6.2 -> 1.6.3 | +--- com.google.code.gson:gson:2.8.5 | +--- com.squareup.okhttp:okhttp:2.7.2 diff --git a/paymentsheet/dependencies/dependencies.txt b/paymentsheet/dependencies/dependencies.txt index 3baceef2b70..4d2c6b43229 100644 --- a/paymentsheet/dependencies/dependencies.txt +++ b/paymentsheet/dependencies/dependencies.txt @@ -702,30 +702,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 +| +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 +| | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) @@ -938,9 +938,9 @@ | +--- androidx.compose.ui:ui:1.5.0 -> 1.5.4 (*) | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*) | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0 -> 1.9.10 (*) -+--- com.google.android.gms:play-services-wallet:19.2.1 (*) ++--- com.google.android.gms:play-services-wallet:19.3.0 (*) +--- com.google.pay.button:compose-pay-button:0.1.3 -| +--- com.google.android.gms:play-services-wallet:19.2.1 (*) +| +--- com.google.android.gms:play-services-wallet:19.2.1 -> 19.3.0 (*) | +--- androidx.compose.ui:ui:1.5.4 (*) | +--- androidx.compose.material:material:1.5.4 (*) | +--- androidx.core:core-ktx:1.12.0 (*) diff --git a/stripe-test-e2e/dependencies/dependencies.txt b/stripe-test-e2e/dependencies/dependencies.txt index 4539fd3365b..2805b9827cc 100644 --- a/stripe-test-e2e/dependencies/dependencies.txt +++ b/stripe-test-e2e/dependencies/dependencies.txt @@ -704,30 +704,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) - | | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 - | | | \--- com.google.android.gms:play-services-basement:18.0.0 + | | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 + | | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) - | | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) + | | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) - | +--- com.google.android.gms:play-services-wallet:19.2.1 + | +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) - | | +--- com.google.android.gms:play-services-base:18.0.1 + | | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) - | | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) - | | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) - | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) + | | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) + | | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) + | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 - | | | +--- com.google.android.gms:play-services-base:18.0.1 (*) - | | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) + | | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) + | | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) - | | | +--- com.google.android.gms:play-services-base:18.0.1 (*) - | | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) - | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) + | | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) + | | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) + | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) @@ -942,9 +942,9 @@ | | +--- androidx.compose.ui:ui:1.5.0 -> 1.5.4 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 -> 1.7.3 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.0 -> 1.9.10 (*) - | +--- com.google.android.gms:play-services-wallet:19.2.1 (*) + | +--- com.google.android.gms:play-services-wallet:19.3.0 (*) | +--- com.google.pay.button:compose-pay-button:0.1.3 - | | +--- com.google.android.gms:play-services-wallet:19.2.1 (*) + | | +--- com.google.android.gms:play-services-wallet:19.2.1 -> 19.3.0 (*) | | +--- androidx.compose.ui:ui:1.5.4 (*) | | +--- androidx.compose.material:material:1.5.4 (*) | | +--- androidx.core:core-ktx:1.12.0 (*) diff --git a/wechatpay/dependencies/dependencies.txt b/wechatpay/dependencies/dependencies.txt index e8cf550dc7e..22cecf31c5c 100644 --- a/wechatpay/dependencies/dependencies.txt +++ b/wechatpay/dependencies/dependencies.txt @@ -673,30 +673,30 @@ | +--- org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.7.3 | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3 (*) | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.7.3 (*) -| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.0.1 -| | | \--- com.google.android.gms:play-services-basement:18.0.0 +| | +--- com.google.android.gms:play-services-tasks:16.0.1 -> 18.1.0 +| | | \--- com.google.android.gms:play-services-basement:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) -| | | \--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) +| | | \--- androidx.fragment:fragment:1.1.0 -> 1.6.2 (*) | | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.9.10 (*) | +--- com.google.android.material:material:1.11.0 (*) -| +--- com.google.android.gms:play-services-wallet:19.2.1 +| +--- com.google.android.gms:play-services-wallet:19.3.0 | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | +--- com.google.android.gms:play-services-base:18.0.1 +| | +--- com.google.android.gms:play-services-base:18.3.0 | | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*) | | | +--- androidx.core:core:1.2.0 -> 1.12.0 (*) | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) -| | +--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-basement:18.3.0 (*) +| | | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) +| | +--- com.google.android.gms:play-services-basement:18.3.0 (*) | | +--- com.google.android.gms:play-services-identity:18.0.1 -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) | | +--- com.google.android.gms:play-services-maps:18.0.2 | | | +--- androidx.fragment:fragment:1.0.0 -> 1.6.2 (*) -| | | +--- com.google.android.gms:play-services-base:18.0.1 (*) -| | | \--- com.google.android.gms:play-services-basement:18.0.0 (*) -| | \--- com.google.android.gms:play-services-tasks:18.0.1 (*) +| | | +--- com.google.android.gms:play-services-base:18.0.1 -> 18.3.0 (*) +| | | \--- com.google.android.gms:play-services-basement:18.0.0 -> 18.3.0 (*) +| | \--- com.google.android.gms:play-services-tasks:18.1.0 (*) | +--- com.google.android.instantapps:instantapps:1.1.0 | +--- com.stripe:stripe-3ds2-android:6.1.8 | | +--- org.jetbrains.kotlin:kotlin-parcelize-runtime:1.9.10 -> 1.9.22 (*) From 499affc5f8a8cde6ccab359e9df32c74c1b9d5ed Mon Sep 17 00:00:00 2001 From: Jay Newstrom Date: Tue, 30 Apr 2024 13:12:03 -0600 Subject: [PATCH 09/14] Add back some error handling, and fix lint. --- .../GooglePayPaymentMethodLauncherActivity.kt | 34 +++++++++++++++++-- .../stripe/android/googlepaylauncher/Tasks.kt | 14 +++++--- 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt index 769a665a9da..fcec775fb4c 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt @@ -12,8 +12,11 @@ import com.google.android.gms.wallet.PaymentData import com.google.android.gms.wallet.contract.ApiTaskResult import com.google.android.gms.wallet.contract.TaskResultContracts.GetPaymentDataResult import com.stripe.android.model.PaymentMethod +import com.stripe.android.payments.core.analytics.ErrorReporter import com.stripe.android.utils.fadeOut +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext /** * [GooglePayPaymentMethodLauncherActivity] is used to return the result of a Google Pay operation. @@ -34,6 +37,10 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { GooglePayPaymentMethodLauncherViewModel.Factory(args) } + private val errorReporter: ErrorReporter by lazy { + ErrorReporter.createFallbackInstance(context = this) + } + private lateinit var args: GooglePayPaymentMethodLauncherContractV2.Args override fun onCreate(savedInstanceState: Bundle?) { @@ -68,7 +75,9 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { if (!viewModel.hasLaunched) { lifecycleScope.launch { runCatching { - viewModel.loadPaymentData() + withContext(Dispatchers.IO) { + viewModel.loadPaymentData() + } }.fold( onSuccess = { googlePayLauncher.launch(it) @@ -95,7 +104,20 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { private fun onGooglePayResult(taskResult: ApiTaskResult) { when (taskResult.status.statusCode) { CommonStatusCodes.SUCCESS -> { - onGooglePayResult(taskResult.result!!) + val result = taskResult.result + if (result != null) { + onGooglePayResult(result) + } else { + errorReporter.report(ErrorReporter.UnexpectedErrorEvent.GOOGLE_PAY_MISSING_INTENT_DATA) + updateResult( + GooglePayPaymentMethodLauncher.Result.Failed( + RuntimeException( + "Google Pay failed with missing data." + ), + GooglePayPaymentMethodLauncher.INTERNAL_ERROR + ) + ) + } } CommonStatusCodes.CANCELED -> { updateResult( @@ -104,16 +126,22 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { } AutoResolveHelper.RESULT_ERROR -> { val status = taskResult.status + val statusMessage = status.statusMessage.orEmpty() + errorReporter.report( + ErrorReporter.ExpectedErrorEvent.GOOGLE_PAY_FAILED, + additionalNonPiiParams = mapOf("status_message" to statusMessage) + ) updateResult( GooglePayPaymentMethodLauncher.Result.Failed( RuntimeException( - "Google Pay failed with error ${status.statusCode}: ${status.statusMessage}" + "Google Pay failed with error ${status.statusCode}: $statusMessage" ), googlePayStatusCodeToErrorCode(status.statusCode) ) ) } else -> { + errorReporter.report(ErrorReporter.UnexpectedErrorEvent.GOOGLE_PAY_UNEXPECTED_RESULT_CODE) updateResult( GooglePayPaymentMethodLauncher.Result.Failed( RuntimeException("Google Pay returned an expected result code."), diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/Tasks.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/Tasks.kt index 005eb5fb01d..36fa081ad33 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/Tasks.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/Tasks.kt @@ -7,12 +7,16 @@ import java.util.concurrent.Executor import kotlin.coroutines.resume internal suspend fun Task.awaitTask(cancellationTokenSource: CancellationTokenSource? = null): Task { - return if (isComplete) this else suspendCancellableCoroutine { cont -> - // Run the callback directly to avoid unnecessarily scheduling on the main thread. - addOnCompleteListener(DirectExecutor, cont::resume) + return if (isComplete) { + this + } else { + suspendCancellableCoroutine { cont -> + // Run the callback directly to avoid unnecessarily scheduling on the main thread. + addOnCompleteListener(DirectExecutor, cont::resume) - cancellationTokenSource?.let { cancellationSource -> - cont.invokeOnCancellation { cancellationSource.cancel() } + cancellationTokenSource?.let { cancellationSource -> + cont.invokeOnCancellation { cancellationSource.cancel() } + } } } } From 2f8ef437d5963ca899ccf5d1a05517ca4b489a3b Mon Sep 17 00:00:00 2001 From: Jay Newstrom Date: Tue, 30 Apr 2024 13:29:15 -0600 Subject: [PATCH 10/14] Fix tests. --- .../googlepaylauncher/GooglePayLauncherViewModelTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/payments-core/src/test/java/com/stripe/android/googlepaylauncher/GooglePayLauncherViewModelTest.kt b/payments-core/src/test/java/com/stripe/android/googlepaylauncher/GooglePayLauncherViewModelTest.kt index a1c76a59dab..583dccd22bf 100644 --- a/payments-core/src/test/java/com/stripe/android/googlepaylauncher/GooglePayLauncherViewModelTest.kt +++ b/payments-core/src/test/java/com/stripe/android/googlepaylauncher/GooglePayLauncherViewModelTest.kt @@ -54,7 +54,9 @@ class GooglePayLauncherViewModelTest { private val googlePayRepository = FakeGooglePayRepository(true) private val testDispatcher = StandardTestDispatcher() - private val task = mock>() + private val task = mock>().also { + whenever(it.isComplete).thenReturn(true) + } private val paymentsClient = mock().also { whenever(it.loadPaymentData(any())) .thenReturn(task) From 3c2d3c8d4f12a171858926f1cf35055178929d1b Mon Sep 17 00:00:00 2001 From: Jay Newstrom Date: Wed, 1 May 2024 07:09:05 -0600 Subject: [PATCH 11/14] Address code review feedback. --- CHANGELOG.md | 3 ++ .../GooglePayLauncherActivity.kt | 32 +++++++++++++++---- .../GooglePayPaymentMethodLauncherActivity.kt | 10 ++++-- 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee312797e49..82809ebd42f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## XX.XX.XX - 2023-XX-XX +Dependencies updated in [8381](https://github.com/stripe/stripe-android/pull/8381): +* Bumped Play Services Wallet from 19.2.1 to 19.3.0. + ## 20.41.1 - 2024-04-22 ### PaymentSheet diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt index 12faf5eedfe..e6d0679eed1 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt @@ -15,6 +15,7 @@ import com.google.android.gms.wallet.contract.ApiTaskResult import com.google.android.gms.wallet.contract.TaskResultContracts.GetPaymentDataResult import com.stripe.android.model.PaymentMethodCreateParams import com.stripe.android.model.StripeIntent +import com.stripe.android.payments.core.analytics.ErrorReporter import com.stripe.android.utils.fadeOut import com.stripe.android.view.AuthActivityStarterHost import kotlinx.coroutines.launch @@ -40,6 +41,10 @@ internal class GooglePayLauncherActivity : AppCompatActivity() { GooglePayLauncherViewModel.Factory(args) } + private val errorReporter: ErrorReporter by lazy { + ErrorReporter.createFallbackInstance(context = this) + } + private lateinit var args: GooglePayLauncherContract.Args override fun onCreate(savedInstanceState: Bundle?) { @@ -86,10 +91,15 @@ internal class GooglePayLauncherActivity : AppCompatActivity() { private fun onGooglePayResult(taskResult: ApiTaskResult) { when (taskResult.status.statusCode) { CommonStatusCodes.SUCCESS -> { - val paymentDataJson = JSONObject(taskResult.result!!.toJson()) - val params = PaymentMethodCreateParams.createFromGooglePay(paymentDataJson) - val host = AuthActivityStarterHost.create(this) - viewModel.confirmStripeIntent(host, params) + val result = taskResult.result + if (result != null) { + val paymentDataJson = JSONObject(result.toJson()) + val params = PaymentMethodCreateParams.createFromGooglePay(paymentDataJson) + val host = AuthActivityStarterHost.create(this) + viewModel.confirmStripeIntent(host, params) + } else { + errorReporter.report(ErrorReporter.UnexpectedErrorEvent.GOOGLE_PAY_MISSING_INTENT_DATA) + } } CommonStatusCodes.CANCELED -> { @@ -99,17 +109,27 @@ internal class GooglePayLauncherActivity : AppCompatActivity() { } AutoResolveHelper.RESULT_ERROR -> { - val statusMessage = taskResult.status.statusMessage.orEmpty() + val status = taskResult.status + val statusMessage = status.statusMessage.orEmpty() + val statusCode = status.statusCode.toString() + errorReporter.report( + ErrorReporter.ExpectedErrorEvent.GOOGLE_PAY_FAILED, + additionalNonPiiParams = mapOf( + "status_message" to statusMessage, + "status_code" to statusCode, + ) + ) viewModel.updateResult( GooglePayLauncher.Result.Failed( RuntimeException( - "Google Pay failed with error: $statusMessage" + "Google Pay failed with error $statusCode: $statusMessage" ) ) ) } else -> { + errorReporter.report(ErrorReporter.UnexpectedErrorEvent.GOOGLE_PAY_UNEXPECTED_RESULT_CODE) viewModel.updateResult( GooglePayLauncher.Result.Failed( RuntimeException( diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt index fcec775fb4c..d20bf01e5af 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt @@ -127,16 +127,20 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { AutoResolveHelper.RESULT_ERROR -> { val status = taskResult.status val statusMessage = status.statusMessage.orEmpty() + val statusCode = status.statusCode errorReporter.report( ErrorReporter.ExpectedErrorEvent.GOOGLE_PAY_FAILED, - additionalNonPiiParams = mapOf("status_message" to statusMessage) + additionalNonPiiParams = mapOf( + "status_message" to statusMessage, + "status_code" to statusCode.toString(), + ) ) updateResult( GooglePayPaymentMethodLauncher.Result.Failed( RuntimeException( - "Google Pay failed with error ${status.statusCode}: $statusMessage" + "Google Pay failed with error $statusCode: $statusMessage" ), - googlePayStatusCodeToErrorCode(status.statusCode) + googlePayStatusCodeToErrorCode(statusCode) ) ) } From 57ada232a243ca04b8e3823f5c777216cbc94e14 Mon Sep 17 00:00:00 2001 From: Jay Newstrom Date: Wed, 1 May 2024 07:20:36 -0600 Subject: [PATCH 12/14] Send result. --- .../android/googlepaylauncher/GooglePayLauncherActivity.kt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt index e6d0679eed1..dc0f73c0495 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt @@ -99,6 +99,13 @@ internal class GooglePayLauncherActivity : AppCompatActivity() { viewModel.confirmStripeIntent(host, params) } else { errorReporter.report(ErrorReporter.UnexpectedErrorEvent.GOOGLE_PAY_MISSING_INTENT_DATA) + viewModel.updateResult( + GooglePayLauncher.Result.Failed( + RuntimeException( + "Google Pay missing result data." + ) + ) + ) } } From 76095318e1d63c8c52a5261b9b7fa983c0290ce2 Mon Sep 17 00:00:00 2001 From: Jay Newstrom Date: Wed, 1 May 2024 07:45:39 -0600 Subject: [PATCH 13/14] Fix an error message --- .../googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt index d20bf01e5af..96e0ecbdf35 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayPaymentMethodLauncherActivity.kt @@ -148,7 +148,7 @@ internal class GooglePayPaymentMethodLauncherActivity : AppCompatActivity() { errorReporter.report(ErrorReporter.UnexpectedErrorEvent.GOOGLE_PAY_UNEXPECTED_RESULT_CODE) updateResult( GooglePayPaymentMethodLauncher.Result.Failed( - RuntimeException("Google Pay returned an expected result code."), + RuntimeException("Google Pay returned an unexpected result code."), GooglePayPaymentMethodLauncher.INTERNAL_ERROR ) ) From cbb0e5fc0f9f5284af4c9eb415edca6bf25603d5 Mon Sep 17 00:00:00 2001 From: Jay Newstrom Date: Wed, 1 May 2024 08:29:14 -0600 Subject: [PATCH 14/14] Add checks to activity result. --- .../googlepaylauncher/GooglePayLauncherActivity.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt index dc0f73c0495..099e3fc5171 100644 --- a/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt +++ b/payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherActivity.kt @@ -13,6 +13,8 @@ import com.google.android.gms.wallet.AutoResolveHelper import com.google.android.gms.wallet.PaymentData import com.google.android.gms.wallet.contract.ApiTaskResult import com.google.android.gms.wallet.contract.TaskResultContracts.GetPaymentDataResult +import com.stripe.android.StripePaymentController.Companion.PAYMENT_REQUEST_CODE +import com.stripe.android.StripePaymentController.Companion.SETUP_REQUEST_CODE import com.stripe.android.model.PaymentMethodCreateParams import com.stripe.android.model.StripeIntent import com.stripe.android.payments.core.analytics.ErrorReporter @@ -155,10 +157,12 @@ internal class GooglePayLauncherActivity : AppCompatActivity() { data: Intent? ) { super.onActivityResult(requestCode, resultCode, data) - viewModel.onConfirmResult( - requestCode, - data ?: Intent() - ) + if (requestCode == PAYMENT_REQUEST_CODE || requestCode == SETUP_REQUEST_CODE) { + viewModel.onConfirmResult( + requestCode, + data ?: Intent() + ) + } } private fun finishWithResult(result: GooglePayLauncher.Result) {