Sep31TransactionInfoNeededException

class Sep31TransactionInfoNeededException(val fields: Map<String, Any?>?, val rawResponseBody: String? = null) : Sep31Exception

Deprecated

SEP-31 v2.5.0 deprecated per-transaction fields. Use SEP-12 PUT /customer instead.

Exception thrown when the Receiving Anchor reports missing per-transaction fields.

Raised exclusively from POST /transactions when the anchor responds with HTTP 400 and error == "transaction_info_needed". The fields map mirrors the deprecated fields shape from GET /info and describes the per-transaction parameters the Sending Anchor must supply on retry.

The leaves of the fields map are always primitive Kotlin types (String, Boolean, Long, Double, or null) — never kotlinx.serialization.json.JsonElement instances. Callers can safely walk the nested Map<String, Any?> and List<Any?> structure without performing JsonElement casts.

Resolution workflow (legacy):

  1. Inspect fields for the missing per-transaction parameters.

  2. Populate the fields map on the next Sep31PostTransactionsRequest and retry.

The per-transaction fields workflow is deprecated. New integrations should register customer KYC via SEP-12 PUT /customer and pass sender_id / receiver_id instead.

Example - Handle transaction-info-needed:

try {
val response = sep31Service.postTransactions(request, jwt)
} catch (e: Sep31TransactionInfoNeededException) {
@Suppress("DEPRECATION")
println("Missing transaction fields: ${e.fields?.keys}")
// Populate the legacy fields map and retry, or migrate to SEP-12.
}

See also:

Constructors

Link copied to clipboard
constructor(fields: Map<String, Any?>?, rawResponseBody: String? = null)

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard

The literal error tag returned by the Receiving Anchor for this condition.

Link copied to clipboard
val fields: Map<String, Any?>?

The per-transaction parameters the Sending Anchor must supply on retry. Leaves are primitive Kotlin types only; null when the anchor did not include a fields object.

Link copied to clipboard
expect open val message: String?
Link copied to clipboard

Anchor response body for local debugging — see the rawResponseBody convention on Sep31Exception. null when no body was captured.

Functions

Link copied to clipboard
open override fun toString(): String