diff --git a/stripe/build.gradle b/stripe/build.gradle index c9539906b88..e900c54e760 100644 --- a/stripe/build.gradle +++ b/stripe/build.gradle @@ -33,7 +33,7 @@ dependencies { // Api for this import because we use reflection to alter TextInputLayout api 'com.google.android.material:material:1.1.0' - implementation "com.stripe:stripe-3ds2-android:4.0.4" + implementation "com.stripe:stripe-3ds2-android:4.0.5" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion" diff --git a/stripe/src/main/java/com/stripe/android/StripePaymentController.kt b/stripe/src/main/java/com/stripe/android/StripePaymentController.kt index 80d44ee465d..32ba4712037 100644 --- a/stripe/src/main/java/com/stripe/android/StripePaymentController.kt +++ b/stripe/src/main/java/com/stripe/android/StripePaymentController.kt @@ -657,9 +657,7 @@ internal class StripePaymentController internal constructor( ) workScope.launch { - // call `authenticationRequestParameters` on background thread to avoid StrictMode - // DiskReadViolation - val areqParams = transaction.authenticationRequestParameters + val areqParams = transaction.createAuthenticationRequestParameters() val timeout = config.stripe3ds2Config.timeout val authParams = Stripe3ds2AuthParams( diff --git a/stripe/src/test/java/com/stripe/android/StripePaymentControllerTest.kt b/stripe/src/test/java/com/stripe/android/StripePaymentControllerTest.kt index 2c6800b1700..bf074ccef3c 100644 --- a/stripe/src/test/java/com/stripe/android/StripePaymentControllerTest.kt +++ b/stripe/src/test/java/com/stripe/android/StripePaymentControllerTest.kt @@ -45,6 +45,7 @@ import com.stripe.android.view.PaymentRelayActivity import kotlin.test.BeforeTest import kotlin.test.Test import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.runBlocking import kotlinx.coroutines.test.TestCoroutineDispatcher import kotlinx.coroutines.test.TestCoroutineScope import org.junit.runner.RunWith @@ -83,8 +84,10 @@ class StripePaymentControllerTest { @BeforeTest fun setup() { - whenever(transaction.authenticationRequestParameters) - .thenReturn(Stripe3ds2Fixtures.AREQ_PARAMS) + runBlocking { + whenever(transaction.createAuthenticationRequestParameters()) + .thenReturn(Stripe3ds2Fixtures.AREQ_PARAMS) + } whenever(activity.applicationContext) .thenReturn(context) }