Skip to content

ffl_integrations.payments.saved_cards

Source: apps/ffl_integrations/ffl_integrations/payments/saved_cards.py · 5 endpoint(s)

Generated by make api-docs — do not edit by hand.

card_on_file_offer

POST /api/method/ffl_integrations.payments.saved_cards.card_on_file_offer

Auth (derived from code): Roles: Sales User / Sales Manager / Accounts Manager / System Manager

Whether the counter may offer "Save this card" for this customer, and where the

customer stands with the authorization (the dialog polls it while the customer signs).

arg type required default description
customer string | null no None Customer name (document id).

Returns: {offer: bool, reason: text when not offered, template, state: signed / expiring / expired / pending / missing, agreement: the copy the state comes from}.

apps/ffl_integrations/ffl_integrations/payments/saved_cards.py:157

charge_saved_card

POST /api/method/ffl_integrations.payments.saved_cards.charge_saved_card

Auth (derived from code): Roles: Sales Manager / System Manager

Charge a customer's saved card against a submitted Sales Invoice (merchant-initiated).

Refused before the gateway when the card was removed or is another customer's, the invoice is not submitted or owes nothing, or the amount exceeds the balance. The approval books a Payment Entry exactly like a terminal payment; a decline books nothing. An answer that never came back locks the invoice against another saved-card charge until a later call looks the charge up at the gateway and records it.

arg type required default description
sales_invoice string yes — Submitted Sales Invoice with an outstanding balance.
saved_card string yes — Saved Card name (must be Active and the invoice customer's).
amount — no None Amount to charge, at most the outstanding balance (blank = the whole balance).

Returns: {ok, status, unique_reference, approval_code, amount, payment_entry, outstanding, paid} on approval; {ok: False, status, error} on a decline; resolved=True when an earlier charge was settled instead of a new one.

apps/ffl_integrations/ffl_integrations/payments/saved_cards.py:506

list_saved_cards

POST /api/method/ffl_integrations.payments.saved_cards.list_saved_cards

Auth (derived from code): Roles: Sales User / Sales Manager / Accounts Manager / System Manager

A customer's active saved cards — summary, expiry, default — for the Customer form and the

Charge saved card picker. Never the token.

arg type required default description
customer string yes — Customer name (document id).

Returns: {cards: [{name, card_summary, card_expiry, is_default, usage, saved_on}], can_manage: whether the caller may charge or remove them}.

apps/ffl_integrations/ffl_integrations/payments/saved_cards.py:287

release_saved_card_charge

POST /api/method/ffl_integrations.payments.saved_cards.release_saved_card_charge

Auth (derived from code): Roles: Sales Manager / System Manager

Close an unconfirmed saved-card charge as not charged, after a manager checked the

processor's portal. Looks it up once more first and records it if the gateway now has it; refused while the charge is younger than the lookup grace period.

arg type required default description
terminal_payment string yes — Card Terminal Payment of the saved-card charge (IN_PROGRESS).
reason string yes — What the manager checked (kept on the record).

Returns: {ok: False, status: "CANCELED"} when released; the settle answer when the gateway had it.

apps/ffl_integrations/ffl_integrations/payments/saved_cards.py:457

remove_saved_card

POST /api/method/ffl_integrations.payments.saved_cards.remove_saved_card

Auth (derived from code): Roles: Sales Manager / System Manager

Remove a saved card: the card processor forgets it, then the record turns Removed.

A gateway failure leaves the card Active and says so. A Removed card can never be charged. When the default card goes, the newest remaining card becomes the default.

arg type required default description
saved_card string yes — Saved Card name.
reason string yes — Why it is removed (kept on the record).

Returns: {ok: True, status: "Removed"}.

apps/ffl_integrations/ffl_integrations/payments/saved_cards.py:533