Expected behavior
If there is anything go wrong in Authorizing Payment page, it should show error and guide user what to do next
Actual behavior
- Using a failed authorize_uri that has query param
acs=true makes the app crash on AuthorizingPaymentActivity
- If there is no
acs=true in query param, AuthorizingPaymentActivity still can render error page without problem
Steps to reproduce the issue
- Setup intent to call to
AuthorizingPaymentActivity with a failed authorize uri including acs=true in query param
val intent = Intent(fragment.requireActivity(), AuthorizingPaymentActivity::class.java)
intent.putExtra(AuthorizingPaymentURLVerifier.EXTRA_AUTHORIZED_URLSTRING, "https://api.omise.co/payments/paym_test_no1t4tnemucod0e51mo/authorize?acs=true")
intent.putExtra(
AuthorizingPaymentActivity.EXTRA_THREE_DS_REQUESTOR_APP_URL,
"deeplink://sample"
)
intent.putExtra(
AuthorizingPaymentURLVerifier.EXTRA_EXPECTED_RETURN_URLSTRING_PATTERNS,
"https://www.example.com"
)
- Crash happens right after landing to
AuthorizingPaymentActivity
Logs
java.lang.RuntimeException: Exception while trying to handle coroutine exception
at
kotlinx.coroutines.CoroutineExceptionHandlerKt.handlerException(CoroutineExceptionHandler.kt:37)
at
kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:28)
at
kotlinx.coroutines.StandaloneCoroutine.handleJobException(Builders.common.kt:194)
at
kotlinx.coroutines.JobSupport.finalizeFinishingState(JobSupport.kt:231)
at
kotlinx.coroutines.JobSupport.tryMakeCompletingSlowPath(JobSupport.kt:910)
at kotlinx.coroutines.JobSupport.tryMakeCompleting(JobSupport.kt:867) at kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core(JobSupport.kt:832)
at kotlinx.coroutines.AbstractCoroutine.resumeWith(AbstractCoroutine.kt:100)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:46)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Suppressed: APIError(location=https://www.omise.co/api-errors#not-found, code=not_found, message=Resource was not found)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:119)
at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createUsingDefault(StdValueInstantiator.java:261)
at com.fasterxml.jackson.databind.deser.std.ThrowableDeserializer.deserializeFromObject(ThrowableDeserializer.java:145)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159)
at com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1608)
at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1185)
at co.omise.android.models.Serializer.deserialize(SourceFile:2)
at co.omise.android.api.Invocation.processCall(SourceFile:11)
at co.omise.android.api.Invocation.invoke(SourceFile:17)
at co.omise.android.api.Client.send$lambda-0(SourceFile:1)
at co.omise.android.api.Client.$r8$lambda$x9l_k9O6Ac4psrYtKDz-ULIf5VU(Unknown Source:0)
at co.omise.android.api.Client$$ExternalSyntheticLambda1.run(Unknown Source:6)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
at java.lang.Thread.run(Thread.java:1012)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [co.omise.android.ui.AuthorizingPaymentViewModel$special$$inlined$CoroutineExceptionHandler$1@800ebe7, StandaloneCoroutine{Cancelling}@bef0394, Dispatchers.IO]
Caused by: kotlin.UninitializedPropertyAccessException: lateinit property transaction has not been initialized
at co.omise.android.ThreeDS2ServiceWrapper.getTransaction(SourceFile:1)
at co.omise.android.ui.AuthorizingPaymentViewModel$special$$inlined$CoroutineExceptionHandler$1.handleException(SourceFile:2)
at kotlinx.coroutines.CoroutineExceptionHandlerKt.handleCoroutineException(CoroutineExceptionHandler.kt:24)
... 14 more
Screenshots
No response
Name and version information
Omise SDK 5.3.0
Expected behavior
If there is anything go wrong in Authorizing Payment page, it should show error and guide user what to do next
Actual behavior
acs=truemakes the app crash onAuthorizingPaymentActivityacs=truein query param,AuthorizingPaymentActivitystill can render error page without problemSteps to reproduce the issue
AuthorizingPaymentActivitywith a failed authorize uri including acs=true in query paramAuthorizingPaymentActivityLogs
Screenshots
No response
Name and version information
Omise SDK 5.3.0