API Documentation
Table of Contents
Classes
- ActionsTalerBarr
- Hook actions for the TalerBarr module.
- TalerCategoryMap
- Class TalerCategoryMap
- TalerConfig
- Class for TalerConfig.
- TalerConfigLine
- Class TalerConfigLine. You can also remove this and generate a CRUD class for lines objects.
- TalerErrorLog
- Class TalerErrorLog
- TalerMerchantClient
- TalerMerchantClient
- TalerMerchantResponseParser
- TalerMerchantResponseParser
- TalerOrderLink
- Class TalerOrderLink
- TalerProductLink
- Class TalerProductLink
- TalerTaxMap
- Class TalerTaxMap
- modTalerBarr
- Description and activation class for module TalerBarr
- InterfaceTalerBarrTriggers
- Class of triggers for TalerBarr module
- TalerSyncUtil
- \file lib/talersync.lib.php \ingroup talerbarr \brief Lightweight launcher for the background synchroniser.
Constants
- NOCSRFCHECK = 1
- NOCSRFCHECK = '1'
- NOCSRFCHECK = 1
- NOLOGIN = 1
- \file talerbarr/webhook/webhook.php \ingroup talerbarr \brief Lightweight webhook listener for the Taler synchronisation.
- NOREQUIREAJAX = 1
- NOREQUIREAJAX = '1'
- NOREQUIREAJAX = 1
- NOREQUIREHTML = 1
- NOREQUIREHTML = '1'
- NOREQUIREHTML = 1
- NOREQUIREMENU = 1
- NOREQUIREMENU = '1'
- NOREQUIREMENU = 1
- NOREQUIRESOC = 1
- NOREQUIRESOC = '1'
- NOSCANGETFORINJECTION = 1
- NOSCANPOSTFORINJECTION = 1
- NOSESSION = 1
- Background synchroniser for the Taler-Barr module.
- NOSESSION = 1
- NOTOKENRENEWAL = 1
- NOTOKENRENEWAL = 1
Functions
- writeStatus() : void
- Persist a human-readable sync status JSON file.
- cleanOrphanProductLinks() : array{checked: int, deleted: int, errors: int}
- Remove stale product_link rows: - links pointing to a deleted Dolibarr product - links that no longer exist on Taler
- talerbarrAdminPrepareHead() : array<string|int, array{string, string, string}>
- Prepare admin pages header
- talerconfigPrepareHead() : array<string|int, array{string, string, string}>
- Prepare array of tabs for TalerConfig
- talerbarr_build_chart_buckets() : array<string|int, mixed>
- Build bucket definitions for a given range key.
- talerbarr_force_orderlink_list_columns() : void
- Ensure relation/link columns are present and visible in the order-link list.
- talerbarr_orderlink_extra_link_columns() : array<string, string>
- Custom relation/external link columns rendered explicitly in the list.
- talerbarr_find_credit_note_for_invoice() : int
- Resolve the latest credit note linked to a source invoice.
- talerbarrWebhookRespond() : void
- Emit a JSON error/success response and exit.
- talerbarrEscapeNestedJsonStrings() : string
- Escape unescaped quotes inside stringified JSON blobs embedded in a JSON payload.
- talerbarrDecodeWebhookJson() : array<string|int, mixed>|null
- Decode a JSON payload with a couple of sanitation fallbacks.
- talerbarrPersistInvalidJsonPayload() : void
- Persist the raw body of a JSON payload that could not be decoded for debugging.
Constants
NOCSRFCHECK
public
mixed
NOCSRFCHECK
= 1
NOCSRFCHECK
public
mixed
NOCSRFCHECK
= '1'
NOCSRFCHECK
public
mixed
NOCSRFCHECK
= 1
NOLOGIN
\file talerbarr/webhook/webhook.php \ingroup talerbarr \brief Lightweight webhook listener for the Taler synchronisation.
public
mixed
NOLOGIN
= 1
NOREQUIREAJAX
public
mixed
NOREQUIREAJAX
= 1
NOREQUIREAJAX
public
mixed
NOREQUIREAJAX
= '1'
NOREQUIREAJAX
public
mixed
NOREQUIREAJAX
= 1
NOREQUIREHTML
public
mixed
NOREQUIREHTML
= 1
NOREQUIREHTML
public
mixed
NOREQUIREHTML
= '1'
NOREQUIREHTML
public
mixed
NOREQUIREHTML
= 1
NOREQUIREMENU
public
mixed
NOREQUIREMENU
= 1
NOREQUIREMENU
public
mixed
NOREQUIREMENU
= '1'
NOREQUIREMENU
public
mixed
NOREQUIREMENU
= 1
NOREQUIRESOC
public
mixed
NOREQUIRESOC
= 1
NOREQUIRESOC
public
mixed
NOREQUIRESOC
= '1'
NOSCANGETFORINJECTION
public
mixed
NOSCANGETFORINJECTION
= 1
NOSCANPOSTFORINJECTION
public
mixed
NOSCANPOSTFORINJECTION
= 1
NOSESSION
Background synchroniser for the Taler-Barr module.
public
mixed
NOSESSION
= 1
Runs from CLI or by an async exec() call.
Refuses to start when another run is in progress (flock lock).
Writes human-readable progress into DOL_DATA_ROOT.'/talerbarr/sync.status.json'.
Normally you are not supposed to call it directly, only through the lib TalerSyncUtil class.
Usage examples php talerbarrsync.php – normal run, auto-detect direction php talerbarrsync.php --force – ignore stale lock file
NOSESSION
public
mixed
NOSESSION
= 1
NOTOKENRENEWAL
public
mixed
NOTOKENRENEWAL
= 1
NOTOKENRENEWAL
public
mixed
NOTOKENRENEWAL
= 1
Functions
writeStatus()
Persist a human-readable sync status JSON file.
writeStatus(array<string|int, mixed> $s) : void
Parameters
- $s : array<string|int, mixed>
-
Arbitrary status payload to serialize; function adds an RFC date in "ts".
cleanOrphanProductLinks()
Remove stale product_link rows: - links pointing to a deleted Dolibarr product - links that no longer exist on Taler
cleanOrphanProductLinks(DoliDB $db, string $instance, array<string|int, mixed> $remoteIds, User $user) : array{checked: int, deleted: int, errors: int}
Parameters
- $db : DoliDB
-
DB handler
- $instance : string
-
Taler instance id
- $remoteIds : array<string|int, mixed>
-
Product ids seen on Taler during this run
- $user : User
-
Current user
Return values
array{checked: int, deleted: int, errors: int}talerbarrAdminPrepareHead()
Prepare admin pages header
talerbarrAdminPrepareHead() : array<string|int, array{string, string, string}>
Return values
array<string|int, array{string, string, string}>talerconfigPrepareHead()
Prepare array of tabs for TalerConfig
talerconfigPrepareHead(TalerConfig $object) : array<string|int, array{string, string, string}>
Parameters
- $object : TalerConfig
-
TalerConfig
Return values
array<string|int, array{string, string, string}> —Array of tabs
talerbarr_build_chart_buckets()
Build bucket definitions for a given range key.
talerbarr_build_chart_buckets(string $rangeKey, int $nowTs) : array<string|int, mixed>
Parameters
- $rangeKey : string
-
Chart range key: day|week|month|year.
- $nowTs : int
-
Current timestamp used as reference to anchor buckets.
Return values
array<string|int, mixed>talerbarr_force_orderlink_list_columns()
Ensure relation/link columns are present and visible in the order-link list.
talerbarr_force_orderlink_list_columns(array<string|int, mixed> &$arrayfields, TalerOrderLink $object, Translate $langs) : void
Parameters
- $arrayfields : array<string|int, mixed>
-
Column configuration array (modified in-place)
- $object : TalerOrderLink
-
Current list object definition
- $langs : Translate
-
Translator
talerbarr_orderlink_extra_link_columns()
Custom relation/external link columns rendered explicitly in the list.
talerbarr_orderlink_extra_link_columns(Translate $langs) : array<string, string>
Parameters
- $langs : Translate
-
Translator
Return values
array<string, string>talerbarr_find_credit_note_for_invoice()
Resolve the latest credit note linked to a source invoice.
talerbarr_find_credit_note_for_invoice(DoliDB $db, int $sourceInvoiceId) : int
Parameters
- $db : DoliDB
-
Database handle
- $sourceInvoiceId : int
-
Source invoice rowid
Return values
int —Credit note rowid (0 if none found)
talerbarrWebhookRespond()
Emit a JSON error/success response and exit.
talerbarrWebhookRespond(int $status, string $message[, array<string|int, mixed> $extra = [] ]) : void
Parameters
- $status : int
-
HTTP status code
- $message : string
-
Human readable message
- $extra : array<string|int, mixed> = []
-
Optional extra payload
talerbarrEscapeNestedJsonStrings()
Escape unescaped quotes inside stringified JSON blobs embedded in a JSON payload.
talerbarrEscapeNestedJsonStrings(string $raw) : string
This is a defensive fix for Taler payloads that wrap arrays/objects in strings without escaping inner quotes (e.g., "taxes":"[{"tax":"..."}]").
Parameters
- $raw : string
-
Raw body
Return values
string —Sanitised body
talerbarrDecodeWebhookJson()
Decode a JSON payload with a couple of sanitation fallbacks.
talerbarrDecodeWebhookJson(string $raw[, string|null &$error = null ][, string|null &$lastAttempt = null ]) : array<string|int, mixed>|null
Parameters
- $raw : string
-
Raw HTTP body.
- $error : string|null = null
-
Receives the last json_last_error_msg() if decoding fails.
- $lastAttempt : string|null = null
-
Receives the sanitised payload used for the final attempt.
Return values
array<string|int, mixed>|null —Decoded associative array on success, null on failure.
talerbarrPersistInvalidJsonPayload()
Persist the raw body of a JSON payload that could not be decoded for debugging.
talerbarrPersistInvalidJsonPayload(string $raw, string $error) : void
Parameters
- $raw : string
-
Raw body string.
- $error : string
-
Last json_last_error_msg().