TransferV2Confirmation

class TransferV2Confirmation(checkoutClientSecret: String? = null, challengePresenter: FrameThreeDSecureChallengePresenting?, polling: TransferV2Confirmation.PollingConfiguration = PollingConfiguration(), confirmTransfer: suspend (transferId: String) -> TransferV2? = { id -> val token = checkoutClientSecret if (!token.isNullOrEmpty()) TransfersV2API.confirmTransfer(id, token).first else TransfersV2API.confirmTransfer(id).first }, loadTransfer: suspend (transferId: String) -> TransferV2? = { id -> val token = checkoutClientSecret if (!token.isNullOrEmpty()) TransfersV2API.getTransferWith(id, token).first else TransfersV2API.getTransferWith(id).first }, sleep: suspend (Long) -> Unit = { delay(it) })

Confirms a V2 transfer from the app, driving a 3D Secure challenge when the API asks for one.

Polling timings are part of the contract — see PollingConfiguration.

Constructors

Link copied to clipboard
constructor(checkoutClientSecret: String? = null, challengePresenter: FrameThreeDSecureChallengePresenting?, polling: TransferV2Confirmation.PollingConfiguration = PollingConfiguration(), confirmTransfer: suspend (transferId: String) -> TransferV2? = { id -> val token = checkoutClientSecret if (!token.isNullOrEmpty()) TransfersV2API.confirmTransfer(id, token).first else TransfersV2API.confirmTransfer(id).first }, loadTransfer: suspend (transferId: String) -> TransferV2? = { id -> val token = checkoutClientSecret if (!token.isNullOrEmpty()) TransfersV2API.getTransferWith(id, token).first else TransfersV2API.getTransferWith(id).first }, sleep: suspend (Long) -> Unit = { delay(it) })

Types

Link copied to clipboard
data class PollingConfiguration(val maxAttempts: Int = 10, val intervalMillis: Long = 1000)

How the confirmation polls for a terminal payment status. Defaults match the browser SDK.

Functions

Link copied to clipboard
suspend fun confirm(transferId: String): FrameTransferV2Outcome

Confirms transferId, completing a 3D Secure challenge if the API requires one.