Class: PaymentProviderRegistry
Defined in: server/checkout/provider-registry.ts:46
Maps provider key → adapter instance for the checkout domain.
A payment row's provider column is the lookup key used by PaymentService
to dispatch tender operations to the correct adapter at runtime (stage-5)
and by the webhook router (stage-8).
Registration invariants (enforced at register time, not at call time)
-
Duplicate keys are a wiring bug. Re-registering a key throws a plain
Errorimmediately — fail fast at factory init rather than silently shadowing the previous adapter. -
Poll/postback rails MUST declare a recovery path. Validation covers both the default capability bag and every declared tender method. Absent
fetchPaymentState, registration throwsUnsupportedCapabilityError; postback can explicitly opt out by passing{ acceptUnverifiedPostbacks: true }to acknowledge the risk (proposal §The PaymentProvider port, bullet 1).
The gate is re-run by the checkout factory in case a mutable adapter changes between registration and composition.
Constructors
Constructor
new PaymentProviderRegistry(): PaymentProviderRegistry;Returns
PaymentProviderRegistry
Methods
get()
get(key: string): PaymentProvider;Defined in: server/checkout/provider-registry.ts:95
Retrieve a registered provider by its key.
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
Throws
CheckoutNotFoundError (entity "PaymentProvider") when no
provider with key has been registered.
register()
register(provider: PaymentProvider, opts?: RegisterOptions): void;Defined in: server/checkout/provider-registry.ts:57
Register a payment provider adapter.
Parameters
| Parameter | Type |
|---|---|
provider | PaymentProvider |
opts? | RegisterOptions |
Returns
void
Throws
Error if the provider's key is already registered.
Throws
UnsupportedCapabilityError if a poll or non-opted-out postback
rail lacks fetchPaymentState.
validateRegistrations()
validateRegistrations(): void;Defined in: server/checkout/provider-registry.ts:80
Re-run registration invariants at composition time. This catches mutable adapters and validates every method-specific rail, not only the provider's default capability bag.
Returns
void