processRefund

suspend fun Terminal.processRefund(parameters: RefundParameters, collectConfig: CollectRefundConfiguration = CollectRefundConfiguration.Builder().build()): Refund

Return

The processed Refund if successful

Parameters

parameters

The refund parameters

collectConfig

Configuration for the refund collection process

See also

Processes a refund using Terminal in a coroutine-safe manner.

This suspend function wraps Terminal.processRefund and integrates with Kotlin's structured concurrency. If the coroutine calling this function is cancelled (either through job cancellation, scope cancellation, or any other cancellation in the coroutine context), the underlying refund operation will automatically be cancelled as well.

Example usage:

val job = coroutineScope.launch {
try {
val refund = terminal.processRefund(parameters, config)
// Handle successful refund
} catch (e: TerminalException) {
// Handle refund failure
}
}

// Cancelling the job will cancel the refund operation
job.cancel()

Throws

if the refund operation fails