Class NoOpPaymentBroker

java.lang.Object
com.tnsai.payment.NoOpPaymentBroker
All Implemented Interfaces:
PaymentBroker

public final class NoOpPaymentBroker extends Object implements 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)
  • Field Details

    • DEFAULT_QUOTE_TTL

      public static final Duration DEFAULT_QUOTE_TTL
      How long a quote stays valid by default.
  • Constructor Details

    • NoOpPaymentBroker

      public NoOpPaymentBroker()
    • NoOpPaymentBroker

      public NoOpPaymentBroker(Duration quoteTtl)
  • Method Details