GALANTHUS / ABI FUNCTION REFERENCE
gln_set_tan_mode
Declared in <galanthus/c_api/gln_capi.h>.
GLN_API gln_status_t GLN_CALL gln_set_tan_mode(
gln_backend_t* in_backend,
const gln_set_tan_mode_request_t* in_request,
gln_backend_result_t** out_result);
Purpose
gln_set_tan_mode stores the caller's selected FinTS TAN security function in backend state and returns the selected row as a gln_backend_result_t envelope.
The security_function should come from a TAN mode row returned by gln_retrieve_tan_modes through gln_get_tan_mode_security_function. The implementation validates the requested value against freshly discovered FinTS mechanisms, falling back to cached mechanisms only when discovery yields none.
Backend support is operation-specific. Use gln_check_backend_operation_support to check whether a backend supports this operation before calling it. Unsupported operations return an envelope whose status is GLN_ERR_NOT_SUPPORTED.
When To Use
Use this operation after the caller chooses one of the TAN modes advertised by gln_retrieve_tan_modes.
Use the security_function string as the selector. The display name is a bank-supplied label, and the success result returns the selected security function plus the display name that matched it.
Call Contract
GLN_OK from the function means an envelope was produced in *out_result; it does not mean the backend operation succeeded. Inspect the envelope with gln_get_backend_result_outcome, gln_get_backend_result_status, and gln_get_backend_result_kind.
out_result == NULL is the no-envelope invalid-argument case. In that case the function returns GLN_ERR_INVALID_ARG directly.
Set security_function to a non-empty string. Missing, empty, or structurally mismatched requests are represented in an error envelope when out_result is valid.
The parameter table is binding for required handles and output slots.
Return
Returns GLN_OK when the call produced a gln_backend_result_t envelope in out_result. Operation success, caller action, provider rejection, and operation errors are reported inside that envelope.
| Type | Nullability | Ownership |
|---|---|---|
gln_status_t | value | value |
Parameters
| Name | Direction | Type | Nullability | Ownership |
|---|---|---|---|---|
in_backend | input | gln_backend_t* | nonnull | borrowed |
in_request | input | const gln_set_tan_mode_request_t* | nonnull | borrowed |
out_result | output | gln_backend_result_t** | nonnull | transferred_out |
Success Result
Successful operation envelopes have outcome GLN_BACKEND_OUTCOME_SUCCESS, status GLN_OK, and kind GLN_BACKEND_RESULT_KIND_TAN_MODE_SELECTION.
Borrow the typed success view with gln_get_backend_result_tan_mode_selection.
Use gln_get_backend_result_tan_mode_selection only when the envelope outcome is GLN_BACKEND_OUTCOME_SUCCESS and the kind is GLN_BACKEND_RESULT_KIND_TAN_MODE_SELECTION.
A success envelope means the requested security function was available according to the current discovery result or cached mechanism list and was stored as the selected TAN mechanism in backend state.
Outcomes
GLN_BACKEND_OUTCOME_SUCCESS: read theGLN_BACKEND_RESULT_KIND_TAN_MODE_SELECTIONtyped view.GLN_BACKEND_OUTCOME_ERROR: inspectgln_get_backend_result_statusandgln_get_backend_result_error. Validation failures use this outcome; other backends use this outcome with statusGLN_ERR_NOT_SUPPORTED.
This operation reports success or failure through its result envelope; it does not define an action-required continuation path.
Ownership And Lifetime
The envelope returned through out_result is caller-owned and must be released with gln_destroy_backend_result.
Typed views, result rows or fields, borrowed strings, and the JSON string are borrowed from the envelope. They become invalid when the envelope is destroyed. Copy strings or row data before destroying the envelope when the caller needs to keep them.
Example
gln_set_tan_mode_request_t request = {0};
gln_default_set_tan_mode_request(&request);
request.security_function = selected_security_function;
gln_backend_result_t* result = NULL;
gln_status_t rc = gln_set_tan_mode(backend, &request, &result);
if (rc != GLN_OK) {
return rc;
}
if (gln_get_backend_result_outcome(result) == GLN_BACKEND_OUTCOME_SUCCESS &&
gln_get_backend_result_kind(result) == GLN_BACKEND_RESULT_KIND_TAN_MODE_SELECTION) {
const gln_tan_mode_selection_t* selection =
gln_get_backend_result_tan_mode_selection(result);
const char* security_function =
gln_get_tan_mode_selection_security_function(selection);
const char* name = gln_get_tan_mode_selection_name(selection);
remember_selected_tan_mode(security_function, name);
}
else {
handle_tan_mode_selection_failure(
gln_get_backend_result_status(result),
gln_get_backend_result_error(result));
}
gln_destroy_backend_result(result);
See Also
gln_retrieve_tan_modesgln_get_tan_mode_security_functiongln_get_backend_result_outcomegln_get_backend_result_statusgln_get_backend_result_kindgln_get_backend_result_tan_mode_selectiongln_get_backend_result_opaque_jsongln_get_backend_result_errorgln_destroy_backend_resultgln_get_tan_mode_selection_security_functiongln_get_tan_mode_selection_namegln_check_backend_operation_support- ABI function index