ffl_integrations.payments.hub¶
Source: apps/ffl_integrations/ffl_integrations/payments/hub.py · 4 endpoint(s)
Generated by
make api-docs— do not edit by hand.
overview¶
POST /api/method/ffl_integrations.payments.hub.overview
Auth (derived from code): Roles: System Manager
Everything the payment-hub page renders, in one round trip.
enabled is each processor's own enabled() (Payroc: single_flag,
raw tabSingles row, docfield default when absent) — the same defence the
integration gate uses, so a site that never saved the settings form reads ON,
not OFF.
Returns: {processors: [{code, label, kind, settings_doctype, mode_of_payment, enabled, ready, can_write, supports_card_on_file, health: [{label, at}]}], can_write, card_on_file: {enabled, template, can_write}}. ready is enabled AND credentials present — the switch can be on while the key is missing, and the card has to show that as its own state, not as "working".
Permissions: System Manager (mirrors Payroc Settings).
apps/ffl_integrations/ffl_integrations/payments/hub.py:47
save_card_on_file¶
POST /api/method/ffl_integrations.payments.hub.save_card_on_file
Auth (derived from code): Roles: System Manager
Switch "Save this card" on or off and pick the authorization customers sign first.
Through the real settings save, so the Single's rules apply: switching on needs an active Per customer agreement template.
| arg | type | required | default | description |
|---|---|---|---|---|
enabled |
— | yes | — | Truthy/falsy. |
template |
string | null | no | None |
Agreement Template name (required to switch on). |
Returns: {enabled: 0|1, template}.
Permissions: System Manager, plus the doc-level write check doc.save() runs.
apps/ffl_integrations/ffl_integrations/payments/hub.py:92
test_connection¶
POST /api/method/ffl_integrations.payments.hub.test_connection
Auth (derived from code): Roles: System Manager
Run the processor's read-only connection probe.
| arg | type | required | default | description |
|---|---|---|---|---|
processor |
string | yes | — | Registry code (e.g. "payroc"). |
Returns: {checks: [{label, ok, detail}]} — the shape the distributor hub renders, so the two pages share one mental model. ok is true, false, or null for "not applicable" (e.g. the switch is off, so nothing was probed — that is a state, not a failure).
Permissions: System Manager.
apps/ffl_integrations/ffl_integrations/payments/hub.py:155
toggle¶
POST /api/method/ffl_integrations.payments.hub.toggle
Auth (derived from code): Roles: System Manager
Flip one processor's enable switch, through the real settings save.
Deliberately doc.save(), not db_set: the settings form makes the
credential fields mandatory while the switch is on (a store cannot arm a
processor it holds no key for), and a hub that wrote the flag straight to
the table would be a side door around exactly that rule. Disabling never
trips it — credentials are only demanded while enabled stays 1. Only one
processor takes cards at a time: switching one on while another is on is
refused (switch the other off first).
| arg | type | required | default | description |
|---|---|---|---|---|
processor |
string | yes | — | Registry code (e.g. "payroc"). |
value |
— | yes | — | Truthy/falsy. |
Returns: {code, enabled: 0|1}.
Permissions: System Manager, plus the doc-level write check doc.save() runs.
apps/ffl_integrations/ffl_integrations/payments/hub.py:117