Interface: BalanceLedgerPort
Defined in: server/checkout/manual-provider.ts:45
Consumer-implemented stored-balance ledger (account balance, consumer-managed
gift cards). The debit cannot be deferred — a stored balance is double-spendable
the instant the success txn lands without it — so capture awaits debit
BEFORE returning the txn (proposal §Stored balances debit synchronously).
Transaction discipline: the ambient capture/refund transaction is the
SERVICE's concern. The implementation resolves the ambient tx itself via the
persistence TransactionManager.startOrUseTransaction, so the balance fact
and the payment ledger event commit or roll back together. ManualProvider
never starts or manages transactions.
Methods
credit()
credit(ctx: BalanceCreditContext): Promise<void>;Defined in: server/checkout/manual-provider.ts:48
Parameters
| Parameter | Type |
|---|---|
ctx | BalanceCreditContext |
Returns
Promise<void>
debit()
debit(ctx: BalanceDebitContext): Promise<void>;Defined in: server/checkout/manual-provider.ts:47
Throw InsufficientBalanceError (shared checkout errors) to fail the capture.
Parameters
| Parameter | Type |
|---|---|
ctx | BalanceDebitContext |
Returns
Promise<void>