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:
- Create a global developer account with a default test merchant account.
- Create additional test merchants, if needed.
- Create an app in the sandbox.
- Create at least one employee role user for the OAuth flow.
- Order a Clover Go 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
Field | Description |
---|---|
OnComplete | Closeout is successful. |
OnError | Closeout 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)")
}
Updated 5 months ago