ChargeIntentAPI

Provides coroutine-based and callback-based methods for managing charge intents via the Frame API.

Each operation is available in two flavors: a suspend function for use with coroutines and an overload that accepts a completion handler for callback-based callers.

Functions

Link copied to clipboard
fun cancelChargeIntent(intentId: String, completionHandler: (ChargeIntent?, NetworkingError?) -> Unit)

Cancels a charge intent, preventing it from being confirmed or captured.

Link copied to clipboard

Captures a previously authorized charge intent for the specified amount.

Link copied to clipboard
suspend fun confirmChargeIntent(intentId: String, clientSecret: String): Pair<ChargeIntent?, NetworkingError?>
fun confirmChargeIntent(intentId: String, clientSecret: String, completionHandler: (ChargeIntent?, NetworkingError?) -> Unit)

Confirms a server-minted charge intent in-app, moving it to an authorized state.

Link copied to clipboard

Creates a new charge intent, attaching the current Sonar session ID and live fraud signals before sending.

Link copied to clipboard

Retrieves a paginated list of all charge intents for the merchant.

Link copied to clipboard
suspend fun getChargeIntent(intentId: String, clientSecret: String): Pair<ChargeIntent?, NetworkingError?>
fun getChargeIntent(intentId: String, clientSecret: String, completionHandler: (ChargeIntent?, NetworkingError?) -> Unit)

Retrieves a single server-minted charge intent in-app using its client_secret.

Link copied to clipboard

Updates mutable fields on an existing charge intent.

Link copied to clipboard
fun voidRemainingChargeIntent(intentId: String, completionHandler: (ChargeIntent?, NetworkingError?) -> Unit)

Voids the uncaptured remainder of a partially captured charge intent.