Closeout

United States

Close out all captured (AUTH payments) transactions. For more information, see Supported payment methods.

📘

NOTE

Capture all pre-auths before before sending closeout request.

Prerequisites

Before you integrate with the Go SDK, complete the following:

Android

Send a closeout request to obtain the CloseOutState response.

For a successful transaction, OnComplete is displayed.

For a failed transaction, OnError is displayed.

Response details

FieldDescription
OnCompleteCloseout is successful.
OnErrorCloseout failed with an error

API call

fun closeout(): Flow<CloseoutState>

Code example

lifecycleScope.launch {
    goSdk.closeout().collectLatest { closeoutState ->
 
        when (closeoutState) {
            is CloseoutState.OnError -> {
                println("Closeout failed: ${closeoutState.error}")
                updateUI(closeoutState)
            }
            is CloseoutState.OnComplete -> {
                println("Closeout succeeded: ${closeoutState.response}")
                updateUI(closeoutState)
            }
            else -> {
                //Something unexpected happened
            }
        }
    }
}

iOS

To close open transactions, call the closeout function and wait for completion:

do {
   try await CloverPaymentSDK.shared.closeout()
   print("Closeout Completed")
} catch {
   print("Closeout Failed: \(error)")
}