Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.checkout.components.interfaces.model.CardMetadata
import com.checkout.components.interfaces.model.Phone
import com.checkout.components.interfaces.model.TokenizationResult
import com.checkout.components.interfaces.model.UpdateDetails
import com.checkout.components.interfaces.model.WalletAuthorization
import com.checkout.components.wallet.WalletComponent
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.CancellationException
Expand Down Expand Up @@ -275,6 +276,8 @@ class MainViewModel @Inject constructor(

onCardBinChanged = ::onCardBinChanged,

onAuthorized = ::onAuthorized,

onTokenized = ::onTokenize,

handleSubmit = if (advancedSettings.value.submitPayment == SubmitPaymentHandler.HandleSubmit) ::handleSubmit else null,
Expand Down Expand Up @@ -310,6 +313,11 @@ class MainViewModel @Inject constructor(
return CallbackResult.Accepted
}

private fun onAuthorized(walletAuthorization: WalletAuthorization): CallbackResult {
println("onAuthorized: $walletAuthorization")
return CallbackResult.Accepted
}

private suspend fun handleSubmit(sessionData: String): ApiCallResult = flowComponent.handleSubmit(sessionData, settingState.value)

@Suppress("RedundantSuspendModifier") // handleTap callback is a suspend function, even if we are not have any suspended call
Expand Down
2 changes: 1 addition & 1 deletion sample/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ksp = "2.3.4"
coroutinesCore = "1.10.2"
kotlinSerialization = "1.10.0"

checkoutAndroidComponents = "2.9.0"
checkoutAndroidComponents = "2.10.0"
appcompat = "1.7.1"
material = "1.13.0"

Expand Down
Loading