diff --git a/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationActivity.kt b/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationActivity.kt index ea8e40f2b55..d39ddadab8f 100644 --- a/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationActivity.kt +++ b/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/CardImageVerificationActivity.kt @@ -83,7 +83,8 @@ internal sealed class CardVerificationScanState(isFinal: Boolean) : ScanState(is @Keep internal open class CardImageVerificationActivity : - SimpleScanActivity(), SimpleScanStateful { + SimpleScanActivity(), + SimpleScanStateful { override var scanState: CardVerificationScanState? = CardVerificationScanState.NotFound @@ -117,8 +118,12 @@ internal open class CardImageVerificationActivity : protected open val processingTextView by lazy { TextView(this) } private val params: CardImageVerificationSheetParams by lazy { - intent.getParcelableExtra(INTENT_PARAM_REQUEST) - ?: CardImageVerificationSheetParams("", CardImageVerificationSheet.Configuration(), "", "") + intent.getParcelableExtra(INTENT_PARAM_REQUEST) ?: CardImageVerificationSheetParams( + stripePublishableKey = "", + configuration = CardImageVerificationSheet.Configuration(), + cardImageVerificationIntentId = "", + cardImageVerificationIntentSecret = "", + ) } /** @@ -356,7 +361,9 @@ internal open class CardImageVerificationActivity : private fun onScanDetailsAvailable( cardVerificationFlowParameters: CardVerificationFlowParameters?, ) { - if (cardVerificationFlowParameters != null && !cardVerificationFlowParameters.lastFour.isNullOrEmpty()) { + if (cardVerificationFlowParameters != null && + !cardVerificationFlowParameters.lastFour.isNullOrEmpty() + ) { this.requiredCardIssuer = cardVerificationFlowParameters.cardIssuer this.requiredCardLastFour = cardVerificationFlowParameters.lastFour diff --git a/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/result/MainLoopState.kt b/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/result/MainLoopState.kt index 9ef49248253..d3dd7470fd1 100644 --- a/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/result/MainLoopState.kt +++ b/stripecardscan/src/main/java/com/stripe/android/stripecardscan/cardimageverification/result/MainLoopState.kt @@ -114,7 +114,7 @@ internal sealed class MainLoopState( requiredLastFour = requiredLastFour, strictModeFrames = strictModeFrames, ) - else -> this // comparisonResult is CardMatchResult.NoPan or not enough visible cards + else -> this // comparisonResult is NoPan or not enough visible cards } } } diff --git a/stripecardscan/src/test/java/com/stripe/android/stripecardscan/cardimageverification/result/MainLoopStateMachineTest.kt b/stripecardscan/src/test/java/com/stripe/android/stripecardscan/cardimageverification/result/MainLoopStateMachineTest.kt index 60dc801d5a7..f4a53bb5131 100644 --- a/stripecardscan/src/test/java/com/stripe/android/stripecardscan/cardimageverification/result/MainLoopStateMachineTest.kt +++ b/stripecardscan/src/test/java/com/stripe/android/stripecardscan/cardimageverification/result/MainLoopStateMachineTest.kt @@ -100,7 +100,7 @@ class MainLoopStateMachineTest { @Test @ExperimentalCoroutinesApi - fun `initial state does not transition when OCR is not found but a card is visible`() = runTest { + fun `initial state doesn't transition when OCR is not found but a card is visible`() = runTest { val state = MainLoopState.Initial( requiredCardIssuer = CardIssuer.Visa, requiredLastFour = "8770", diff --git a/stripecardscan/src/test/java/com/stripe/android/stripecardscan/framework/util/RetryTest.kt b/stripecardscan/src/test/java/com/stripe/android/stripecardscan/framework/util/RetryTest.kt index 41f0f6625ca..d7b79a6112a 100644 --- a/stripecardscan/src/test/java/com/stripe/android/stripecardscan/framework/util/RetryTest.kt +++ b/stripecardscan/src/test/java/com/stripe/android/stripecardscan/framework/util/RetryTest.kt @@ -18,7 +18,7 @@ class RetryTest { assertEquals( 1, - retry({ _, _-> 1.milliseconds }) { + retry({ _, _ -> 1.milliseconds }) { executions++ 1 } @@ -34,7 +34,7 @@ class RetryTest { assertEquals( 1, - retry({ _, _-> 1.milliseconds }) { + retry({ _, _ -> 1.milliseconds }) { executions++ if (executions == 2) { 1 @@ -53,7 +53,7 @@ class RetryTest { var executions = 0 assertFailsWith { - retry({ _, _-> 1.milliseconds }) { + retry({ _, _ -> 1.milliseconds }) { executions++ throw RuntimeException() } @@ -68,7 +68,10 @@ class RetryTest { var executions = 0 assertFailsWith { - retry({ _, _-> 1.milliseconds }, excluding = listOf(RuntimeException::class.java)) { + retry( + retryDelayFunction = { _, _ -> 1.milliseconds }, + excluding = listOf(RuntimeException::class.java), + ) { executions++ throw RuntimeException() }