Exodus Salesforce Docs
Technical Reference

Payment Technical Reference

Developer reference for payment services, objects, public checkout, gateway adapters, token coverage, schedulers, sandbox simulation, and reversal behavior

Use this page when changing payment code or diagnosing payment behavior beyond the user-facing Payment Operations screens.

Source Ownership

Payment source lives primarily in features-payments, with Sales Order and Invoice integration in features-orders and quote readiness hooks in features-crm.

AreaSource
Gateway records and runtimefeatures-payments/main/default/classes/payments
Payment objects/tabs/pagesfeatures-payments/main/default/objects, tabs, pages, flexipages
Payment LWCsfeatures-payments/main/default/lwc
Sales Order payment workspacefeatures-orders/main/default/lwc/salesOrderPaymentsWorkspace
Quote payment plan/readinessquote services and QuotePaymentPlanService
Invoice/payment syncInvoicePaymentSyncService, invoice email/PDF services

Core Services

ServiceResponsibility
PaymentGatewayConnectionsControllerAdmin-facing gateway inventory and connection UI.
PaymentGatewayLifecycleServiceActive/deprecated/removed lifecycle and successor handling.
PaymentGatewayManagementServiceGateway management operations.
PaymentGatewayRegistryAdapter/provider resolution.
PaymentTokenCoverageServiceRoute-level readiness and retokenization state.
PaymentTokenizationServiceToken creation and token record management.
PaymentTransactionExecutionServiceAuthorize/capture/sale execution and idempotency.
PaymentTransactionRuntimeServiceRuntime transaction orchestration.
PaymentTransactionReversalServiceVoid/refund/reversal behavior.
PaymentOrderServicePayment order creation and maintenance.
PaymentLinkCheckoutServicePublic payment link checkout execution.
PaymentSettlementSyncServiceSettlement sync and reconciliation fields.
RecurringPaymentPlanServiceRecurring plan creation and lifecycle.
PaymentVaultManagementServiceVault inventory and saved method operations.

Gateway Adapters

Adapters include AuthorizeNetGatewayAdapter, InternalVaultGatewayAdapter, and the base gateway adapter classes. Gateway records identify adapter behavior through fields such as Gateway_Type_Key__c, Adapter_Class__c, Execution_Mode__c, Named_Credential_Name__c, and External_Credential_Name__c.

Adapter changes must preserve:

  1. Idempotency.
  2. Provider reference fields.
  3. Error handling and sanitized user messages.
  4. Sandbox versus production behavior.
  5. Settlement and reversal compatibility.

Public Checkout

The hosted payment link checkout is implemented as PaymentLinkCheckout.page with controller/service support. Payment intents should be reached through generated public tokens, not manually constructed URLs.

Technical expectations:

RequirementReason
Tokenized public linkAvoids exposing internal record ids.
Expiry enforcementPrevents stale links from collecting unexpectedly.
Idempotency keyPrevents duplicate execution on retry/refresh.
Gateway environment guardPrevents sandbox/production mixing.
Post-processingUpdates orders, receipts, allocations, and metrics.

Token Coverage States

PaymentTokenCoverageService is the readiness source for route-aware payment UX.

StateTechnical meaning
ReadySaved method has usable token coverage for route/gateway.
Retokenization requiredMethod exists but successor/gateway coverage is missing.
New payment method requiredCustomer must provide a new method.
Gateway unavailableGateway lifecycle/config prevents execution.

Do not replace this logic with a simpler "has card" check.

Schedulers and Queueables

Scheduler/queueablePurpose
RecurringPaymentSchedulerRuns recurring payment execution.
RecurringPaymentExecutionQueueableExecutes recurring payment work.
PaymentAutomatedCollectionSchedulerRuns automated collections.
PaymentAccountUpdaterSchedulerRuns account updater sync.
PaymentGatewayHealthMonitorSchedulerChecks gateway health.
PaymentSettlementSyncSchedulerRuns settlement sync.
PaymentRuntimePostProcessingQueueablePerforms async post-processing after payment execution.

Settings in Payment_Operations_Settings__c gate runtime behavior. A schedule can exist while a feature toggle remains disabled.

Sandbox Simulation

SandboxPaymentSimulationService supports sandbox-only payment simulation. It checks org sandbox state and prevents simulation behavior in production.

Use sandbox simulation for QA and stress flows only. Do not rely on sandbox tokens or test-card behavior in production gateway testing.

Reversal and Dispute Behavior

Voids/refunds use PaymentTransactionReversalService. Disputes use ManualDisputeService and Payment Order dispute action surfaces.

Technical changes in this area must verify:

  1. Parent transaction lookup.
  2. Gateway adapter reversal support.
  3. Refunded/voided amount math.
  4. Receipt/allocation impact.
  5. Settlement reporting impact.
  6. Dispute record linkage.
  7. Existing sandbox simulation branches.

Validation Guidance

For payment code changes, use focused tests first, then org/runtime validation when ready:

sf apex run test --target-org vesper --class-names PaymentGatewayLifecycleServiceTest,PaymentTokenCoverageServiceTest,PaymentTransactionExecutionServiceTest
sf apex run test --target-org vesper --class-names PaymentLinkCheckoutServiceTest,PaymentOrderServiceTest,PaymentSettlementSyncServiceTest

Use the exact class list that matches your changed files. Do not claim payment operations are production-ready from local tests alone; confirm deployability, settings toggles, and scheduler state in the target org.

Last updated on

On this page