Setup & Configuration
1. Confido Settings (Custom Setting)
Settings__c — Hierarchy Custom Setting. Configure at Setup → Custom Settings → Confido Settings → Manage.
| Field | API Name | Description |
|---|---|---|
| Confido API Token | ApiToken__c | Your Confido API key. Required for all API calls. |
| Confido Webhook Secret | WebhookSecret__c | HMAC secret for verifying incoming webhooks. |
| Production Environment | ProductionEnvironment__c | Checkbox. Checked = api.gravity-legal.com; unchecked = api.sandbox.gravity-legal.com. |
2. Remote Site Settings
Pre-configured; both active by default:- production →
https://api.gravity-legal.com - sandbox →
https://api.sandbox.gravity-legal.com
3. Webhook Configuration
Point your Confido webhook to:X-SIGNATURE header using HMAC-SHA512 with your WebhookSecret__c. Must be exposed via a Salesforce Site or Community (public REST resource).
4. Sync Bank Accounts
Bank accounts are managed in Confido, not Salesforce. Sync them before creating payment links using the LWC button or the invocable action.Client__c
| Field | Description |
|---|---|
Name | Client name (synced to Confido) |
ConfidoId__c | Text(36), unique external ID, auto-populated |
SyncErrorMessage__c | Long Text, populated if last sync failed |
Matter__c
| Field | Description |
|---|---|
Name | Matter name |
Client__c | Lookup → Client__c |
ConfidoId__c | Text(36), unique |
SyncErrorMessage__c | Long Text |
PaymentLink__c
| Field | Description |
|---|---|
Name | Descriptive name |
BankAccount__c | Lookup → BankAccount__c (destination) |
Client__c | Lookup → Client__c |
Matter__c | Lookup → Matter__c (optional) |
ConfidoId__c | Text(36), unique |
OutstandingAmount__c | Currency, amount still owed |
PaidAmount__c | Currency, amount paid so far |
Status__c | Picklist: unpaid, partially_paid, paid, sealed |
Url__c | URL, the shareable payment link |
SyncErrorMessage__c | Long Text |
Transaction__c (auto-created via webhooks)
| Field | Description |
|---|---|
Amount__c | Currency |
AmountRefunded__c | Currency |
BankAccount__c | Lookup → BankAccount__c |
Client__c | Lookup → Client__c |
Matter__c | Lookup → Matter__c |
PaymentLink__c | Lookup → PaymentLink__c |
ConfidoId__c | Text(36), unique |
CreatedOn__c | DateTime |
ErrorMessage__c | Text(255) |
LastFour__c | Text(255), last 4 of payment method |
Method__c | Picklist: ACH, CARD, CREDIT, DEBIT, MANUAL, PUSH_TO_CARD |
PayerEmail__c | |
PayerName__c | Text(255) |
Status__c | Picklist: PENDING, SUCCESSFUL, DEPOSITED, FUNDS_IN_TRANSIT, REFUNDED, PARTIALLY_REFUNDED, RETURNED, VOIDED, ERROR, CHARGED_BACK, HELD |
Type__c | Text(255), e.g. payment, refund, return |
BankAccount__c (read-only from Confido)
| Field | Description |
|---|---|
Name | Nickname |
Category__c | operating or trust |
ConfidoId__c | Text(36), unique |
IsDefault__c | Checkbox |
LastFour__c | Text(255) |
AggregateLink__c
| Field | Description |
|---|---|
Name | Descriptive name |
ConfidoId__c | Text(36), unique |
PaymentLinkIds__c | Long Text, comma-separated SF IDs |
Url__c | URL |
SyncErrorMessage__c | Long Text |
AggregateLinkPaymentLink__c
Junction object (Master-Detail on both sides), managed automatically.Platform Events
WebhookPayload__e and TransactionPayload__e — used internally for async webhook processing.
Invocable Flow Actions
All available in Flow Builder under Action elements. They create/update both the Salesforce record and the corresponding Confido record.Create Client (ClientCreate)
- Input:
name(String, required) - Returns:
List<Client__c>
Update Client (ClientUpdate)
- Input:
clientId(String, required),name(String, optional) - Returns:
List<Client__c>
Create Matter (MatterCreate)
- Input:
clientId(String, required),name(String, required) - Returns:
List<Matter__c>
Update Matter (MatterUpdate)
- Input:
matterId(String, required),name(String, required) - Returns:
List<Matter__c>
Create Payment Link (PaymentLinkCreate)
- Input:
amount(Decimal, required),bankAccountId(String, required),clientId(String, required),matterId(String, optional),paymentLinkName(String, optional) - Returns:
List<PaymentLink__c>
Update Payment Link (PaymentLinkUpdate)
- Input:
paymentLinkId(String, required),amount(Decimal),bankAccountId(String),clientId(String),matterId(String) — all optional except ID - Returns:
List<PaymentLink__c>
Create Aggregate Link (AggregateLinkCreate)
- Input:
paymentLinkIds(List<String>, required),aggregateLinkName(String, optional) - Returns:
List<AggregateLink__c>
Update Aggregate Link (AggregateLinkUpdate)
- Input:
aggregateLinkId(String, required),paymentLinkIds(List<String>, required — pass empty to delete) - Returns:
List<AggregateLink__c>
Sync Bank Accounts (BankAccountsSync)
- Input: None
- Fetches all bank accounts from Confido and upserts/deletes
BankAccount__crecords to match.
Lightning Web Components
All exposed to App Pages, Home Pages, and Flow Screens.| Component | Description |
|---|---|
confidoSettings | Settings card |
confidoClientCreate | Client creation form (Client Name) |
confidoMatterCreate | Matter creation form (Client picker + Matter Name) |
confidoPaymentLinkCreate | Full payment link form (Name, Bank Account, Client, Matter, Amount). Displays resulting URL. |
confidoAggregateLinkCreate | Aggregate link from multiple payment links (multi-select with pill container) |
confidoAggregateLinkUpdate | Update an aggregate link’s payment links |
confidoBankAccountsSync | ”Sync Bank Accounts” button, shows count of synced accounts |
confidoTransactionsList | Read-only table of 10 most recent transactions |
Webhooks & Automatic Transaction Sync
Flow
Supported Events
| Event | Behavior |
|---|---|
transaction.created | Creates/updates the transaction |
transaction.deposited | Updates status |
transaction.funds_in_transit | Updates status |
transaction.ach_returned | Updates original + creates return txn |
transaction.refunded | Updates original + creates refund txn |
transaction.partially_refunded | Updates original + creates refund txn |
transaction.voided | Updates status |
Note: Payout-type transactions and zero-amount transactions (e.g., trust surcharging) are auto-skipped.
Trigger Sync Behavior
| Object | Behavior |
|---|---|
Client__c | After Insert/Update: auto-syncs to Confido if no ConfidoId or Name changed |
Matter__c | After Insert/Update: same pattern |
PaymentLink__c | After Insert/Update: syncs if no ConfidoId or amount/bank/client/matter changed. Before/After Delete: removes from aggregate links then from Confido |
AggregateLink__c | After Insert/Update: syncs + re-creates junction records |
SyncErrorMessage__c and cleared on the next successful sync.
Quick Start Checklist
- ☐ Install
confido_corepackage - ☐ Set API Token in Custom Settings
- ☐ Set Webhook Secret in Custom Settings
- ☐ Check/uncheck Production Environment
- ☐ Verify Remote Site Settings are active
- ☐ Configure webhook URL in Confido
- ☐ Expose
/webhookendpoint via SF Site or Experience Cloud - ☐ Run Sync Bank Accounts
- ☐ Create first Client, Matter, and Payment Link
- ☐ Verify transactions flow in via webhooks
Dependencies
- Nebula Logger — Package uses
Nebula.Loggerfor logging. Install from: https://github.com/jongpie/NebulaLogger