Package com.tnsai.payment
Class NoOpPaymentBroker
java.lang.Object
com.tnsai.payment.NoOpPaymentBroker
- All Implemented Interfaces:
PaymentBroker
PaymentBroker that prices everything at 0.00 USD and
settles instantly (TNS-298). Default for internal multi-agent
deployments where there's no real money flow — the framework's
accountability machinery threads through unchanged but no settlement
rail is engaged.
Idempotency still works: a second settle(com.tnsai.payment.Quote) call with the
same Quote.idempotencyKey returns
Settlement.AlreadySettled so consumers exercising the
settlement contract see the same shape they'd see against a real
broker.
Quotes expire after DEFAULT_QUOTE_TTL (1 hour) — long
enough that test code rarely hits expiry but short enough to surface
the stale-quote path when it matters.
- Since:
- 0.10.0 (TNS-298)
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tnsai.payment.PaymentBroker
PaymentBroker.QuoteRejectedException -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionquote(AgentPrincipal payer, AgentPrincipal payee, Service service) Compute the price forservicebetweenpayerandpayee, returning aQuotethe caller can later settle (withinQuote.expiresAt).Move funds forquote.
-
Field Details
-
DEFAULT_QUOTE_TTL
How long a quote stays valid by default.
-
-
Constructor Details
-
NoOpPaymentBroker
public NoOpPaymentBroker() -
NoOpPaymentBroker
-
-
Method Details
-
quote
Description copied from interface:PaymentBrokerCompute the price forservicebetweenpayerandpayee, returning aQuotethe caller can later settle (withinQuote.expiresAt).- Specified by:
quotein interfacePaymentBroker
-
settle
Description copied from interface:PaymentBrokerMove funds forquote. Idempotent: a second call with the sameQuote.idempotencyKeyreturnsSettlement.AlreadySettledinstead of double-charging.- Specified by:
settlein interfacePaymentBroker
-