GALANTHUS / ABI FUNCTION REFERENCE
gln_revolut_create_payment_draft
Declared in <galanthus/c_api/gln_capi.h>.
GLN_API gln_status_t GLN_CALL gln_revolut_create_payment_draft(
gln_backend_t* in_backend,
const gln_revolut_create_payment_draft_request_t* in_request,
gln_backend_result_t** out_result);
Purpose
Runs the revolut create payment draft backend operation on in_backend and returns a gln_backend_result_t envelope through out_result.
Successful operation envelopes use GLN_BACKEND_RESULT_KIND_REVOLUT_CREATED_PAYMENT_DRAFT and expose the typed view through gln_get_backend_result_revolut_created_payment_draft.
purpose and end_to_end_reference_or_null are individually optional in the request, but at least one must be non-empty. NULL or empty end_to_end_reference_or_null means no end-to-end reference was supplied. Supplying both non-empty purpose and end_to_end_reference_or_null is rejected as unsupported_field_combination because Revolut exposes only one provider reference field. When purpose is empty and end_to_end_reference_or_null is non-empty, the Revolut plugin maps that value to the provider reference field and returns a REST provider-status row documenting the mapping.
The returned envelope is caller-owned and must be released with gln_destroy_backend_result after all borrowed typed views have been read.
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_revolut_create_payment_draft_request_t* | nonnull | borrowed |
out_result | output | gln_backend_result_t** | nonnull | transferred_out |
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.
Initialize in_request by calling gln_default_revolut_create_payment_draft_request and keep struct_size == sizeof(gln_revolut_create_payment_draft_request_t). Missing required fields and struct-size mismatches are reported in an error envelope when out_result is valid.
The parameter table is binding for required handles and output slots.
Success Result
Successful operation envelopes have outcome GLN_BACKEND_OUTCOME_SUCCESS, status GLN_OK, and kind GLN_BACKEND_RESULT_KIND_REVOLUT_CREATED_PAYMENT_DRAFT.
Borrow the typed success view with gln_get_backend_result_revolut_created_payment_draft.
Use gln_get_backend_result_revolut_created_payment_draft only when the envelope outcome is GLN_BACKEND_OUTCOME_SUCCESS and the kind is GLN_BACKEND_RESULT_KIND_REVOLUT_CREATED_PAYMENT_DRAFT.
Outcomes
GLN_BACKEND_OUTCOME_SUCCESS: read theGLN_BACKEND_RESULT_KIND_REVOLUT_CREATED_PAYMENT_DRAFTtyped view.GLN_BACKEND_OUTCOME_REJECTED: inspectgln_get_backend_result_statusandgln_get_backend_result_errorfor Revolut provider rejection details.GLN_BACKEND_OUTCOME_ERROR: inspectgln_get_backend_result_statusandgln_get_backend_result_error. Non-Revolut backends use statusGLN_ERR_NOT_SUPPORTED. Missing or malformed requests use statusGLN_ERR_INVALID_ARG; Revolut backends without stored OAuth token material use statusGLN_ERR_NOT_FOUND.
This Revolut provider workflow does not produce action-required continuations.
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.