Sep08Post Transaction Response
Represents the response from a SEP-8 approval server when a transaction is submitted for regulatory approval via the postTransaction endpoint.
The approval server evaluates the submitted transaction and returns one of five possible outcomes, each modeled as a subclass of this sealed class. The response type is determined by the status field in the JSON response.
Response Types
Success: The transaction was approved and is ready for submission to the network.
Revised: The transaction was modified by the approval server (e.g., additional operations added) and the revised version should be submitted instead.
Pending: The approval server needs more time to evaluate the transaction. The client should resubmit after the specified timeout.
ActionRequired: The user must complete an additional action (e.g., KYC verification) before the transaction can be approved.
Rejected: The transaction was rejected and cannot be approved.
Usage
val json = Json.parseToJsonElement(responseBody).jsonObject
val response = Sep08PostTransactionResponse.fromJson(json)
when (response) {
is Sep08PostTransactionResponse.Success -> {
// Submit response.tx to the Stellar network
}
is Sep08PostTransactionResponse.Revised -> {
// Review response.tx and response.message, then submit
}
is Sep08PostTransactionResponse.Pending -> {
// Wait response.timeout milliseconds, then resubmit
}
is Sep08PostTransactionResponse.ActionRequired -> {
// Direct user to response.actionUrl
}
is Sep08PostTransactionResponse.Rejected -> {
// Display response.error to the user
}
}See also
Inheritors
Types
The user must complete an action before the transaction can be approved.
The approval server needs more time to process the transaction.
The transaction was rejected by the approval server.
The transaction was revised by the approval server.
The transaction was approved by the approval server without modifications.