PaymentMethodFactory (lnvps_api/src/payment_factory.rs) can build payment handlers from database payment_method_config rows (create_lightning_node, create_fiat_service, create_onchain_provider, get_*_for_company), and the startup data migration seeds those rows from YAML — but nothing at runtime actually uses the factory:
- The Lightning node is built from YAML settings (
Settings::get_node()) and injected into SubscriptionHandler
- The on-chain provider likewise comes from
Settings::get_onchain() (reusing the YAML LND section with hardcoded defaults), so DB fields like min_confirmations, address_type and account on the new OnChainProviderConfig have no runtime effect yet
- Revolut/Stripe payment handlers load DB configs directly in
payments/mod.rs, bypassing the factory
The DB config was presumably intended to be the source of truth (per-company payment providers). Completing the integration means:
Related: #109 / PR #180 introduced create_onchain_provider + get_onchain_provider_for_company and the seeded OnChain DB config.
PaymentMethodFactory(lnvps_api/src/payment_factory.rs) can build payment handlers from databasepayment_method_configrows (create_lightning_node,create_fiat_service,create_onchain_provider,get_*_for_company), and the startup data migration seeds those rows from YAML — but nothing at runtime actually uses the factory:Settings::get_node()) and injected intoSubscriptionHandlerSettings::get_onchain()(reusing the YAML LND section with hardcoded defaults), so DB fields likemin_confirmations,address_typeandaccounton the newOnChainProviderConfighave no runtime effect yetpayments/mod.rs, bypassing the factoryThe DB config was presumably intended to be the source of truth (per-company payment providers). Completing the integration means:
payment_method_configvia the factory at startup (fall back to YAML settings when no DB config exists)min_confirmations,address_type,account) — currently hardcoded to 1 / p2wkh / default account inSettings::get_onchain()SubscriptionHandlercurrently holds a single global node/provider, while the factory is per-companyRelated: #109 / PR #180 introduced
create_onchain_provider+get_onchain_provider_for_companyand the seededOnChainDB config.