Closeout

United States

Close out all captured (AUTH payments) transactions.

📘

NOTE

Capture all pre-auths before before sending closeout request.

Prerequisites

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

  • Claim your Clover account and log in with your Clover credentials so that you can use the Clover standard OAuth flow for authentication.
  • Create and set up a developer account (including your test merchant settings) and an app in Clover sandbox Developer Dashboard.
  • Create at least one employee user to use within the OAuth flow.
  • Order a Clover Go Card Reader Developer Kit (Dev Kit) and set it up.

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)")
}