Skip to content

Declared in <galanthus/c_api/gln_capi.h>.

GLN_API gln_status_t GLN_CALL gln_retrieve_tan_media(
    gln_backend_t*         in_backend,
    gln_backend_result_t** out_result);
  • Family: Backend operations
  • Return type: gln_status_t

Purpose

gln_retrieve_tan_media asks a FinTS backend for the TAN media assigned to the authenticated user and returns a gln_backend_result_t envelope.

The result rows expose the bank-supplied media name, media type, active flag, and optional phone or card details when the bank response carries them.

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 when a caller needs to present or inspect TAN media such as pushTAN devices, phone entries, or card-based media.

A TAN media listing is separate from TAN mode selection. Use gln_retrieve_tan_modes and gln_set_tan_mode for security-function selection.

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.

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.

TypeNullabilityOwnership
gln_status_tvaluevalue

Parameters

NameDirectionTypeNullabilityOwnership
in_backendinputgln_backend_t*nonnullborrowed
out_resultoutputgln_backend_result_t**nonnulltransferred_out

Success Result

Successful operation envelopes have outcome GLN_BACKEND_OUTCOME_SUCCESS, status GLN_OK, and kind GLN_BACKEND_RESULT_KIND_TAN_MEDIA.

Borrow the typed success view with gln_get_backend_result_tan_media.

Use gln_get_backend_result_tan_media only when the envelope outcome is GLN_BACKEND_OUTCOME_SUCCESS and the kind is GLN_BACKEND_RESULT_KIND_TAN_MEDIA.

Action-required envelopes carry interrupt details and a continuation instead of this typed success view. Resume the operation and read the accessor only after a success envelope is produced.

Enumerate the media with gln_get_tan_media_count and gln_get_tan_medium_at. Each row exposes media_name, media_type, optional phone_number, optional card_number, and active through the gln_tan_medium_* accessors.

gln_get_tan_medium_phone_number and gln_get_tan_medium_card_number return NULL when the bank response did not include that optional field for the row. gln_get_tan_medium_active returns non-zero for active media.

Outcomes

  • GLN_BACKEND_OUTCOME_SUCCESS: read the GLN_BACKEND_RESULT_KIND_TAN_MEDIA typed view.
  • GLN_BACKEND_OUTCOME_ACTION_REQUIRED: FinTS read flows can require caller action, usually a TAN or decoupled step. Inspect gln_get_backend_result_interrupt_info, take the continuation with gln_take_backend_result_continuation, and resume with gln_resume_continuation.
  • GLN_BACKEND_OUTCOME_REJECTED: inspect gln_get_backend_result_status and gln_get_backend_result_error for bank rejection details.
  • GLN_BACKEND_OUTCOME_ERROR: inspect gln_get_backend_result_status and gln_get_backend_result_error. Other backends use this outcome with status GLN_ERR_NOT_SUPPORTED.

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.

For action-required envelopes, gln_get_backend_result_interrupt_info returns borrowed interrupt details. gln_take_backend_result_continuation transfers continuation ownership to the caller; destroy that continuation with gln_destroy_continuation after it has been saved or resumed.

Example

gln_backend_result_t* result = NULL;
gln_status_t rc = gln_retrieve_tan_media(backend, &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_MEDIA) {
    const gln_tan_media_t* media = gln_get_backend_result_tan_media(result);
    size_t count = gln_get_tan_media_count(media);

    for (size_t i = 0; i < count; ++i) {
        const gln_tan_medium_t* medium = gln_get_tan_medium_at(media, i);
        use_tan_medium(
            gln_get_tan_medium_media_name(medium),
            gln_get_tan_medium_media_type(medium),
            gln_get_tan_medium_phone_number(medium),
            gln_get_tan_medium_card_number(medium),
            gln_get_tan_medium_active(medium));
    }
}
else if (gln_get_backend_result_outcome(result) == GLN_BACKEND_OUTCOME_ACTION_REQUIRED) {
    const gln_interrupt_info_t* interrupt = gln_get_backend_result_interrupt_info(result);
    gln_continuation_t* continuation = gln_take_backend_result_continuation(result);
    handle_tan_media_interrupt(interrupt, continuation);
    gln_destroy_continuation(continuation);
}
else {
    handle_tan_media_failure(
        gln_get_backend_result_status(result),
        gln_get_backend_result_error(result));
}

gln_destroy_backend_result(result);

See Also