From 697ed6fc3953fe57d74a684ca75b92a50ada2e9e Mon Sep 17 00:00:00 2001 From: Oscar Spruit Date: Tue, 20 Jun 2023 16:21:14 +0200 Subject: [PATCH] Always clean up ThreeDS2Service before starting 3DS transaction This solves an issue in the frictionless flow where if the first challenge fails and the second is retried with a different card, it would fail as well. Because the second challenge would be performed with data from the first challenge. COAND-771 --- .../java/com/adyen/checkout/adyen3ds2/Adyen3DS2Component.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/3ds2/src/main/java/com/adyen/checkout/adyen3ds2/Adyen3DS2Component.kt b/3ds2/src/main/java/com/adyen/checkout/adyen3ds2/Adyen3DS2Component.kt index 329ecc810a..98c178ecf6 100644 --- a/3ds2/src/main/java/com/adyen/checkout/adyen3ds2/Adyen3DS2Component.kt +++ b/3ds2/src/main/java/com/adyen/checkout/adyen3ds2/Adyen3DS2Component.kt @@ -210,6 +210,8 @@ class Adyen3DS2Component( notifyException(CheckoutException("Unexpected 3DS2 exception.", throwable)) } viewModelScope.launch(Dispatchers.Default + coroutineExceptionHandler) { + // This makes sure the 3DS2 SDK doesn't re-use any state from previous transactions + closeTransaction(getApplication()) try { Logger.d(TAG, "initialize 3DS2 SDK") ThreeDS2Service.INSTANCE.initialize(activity, configParameters, null, mUiCustomization)