mirror of
https://github.com/Such-Software/smirk-backend-core.git
synced 2026-10-17 07:21:32 +02:00
feat(premium): invoice through more than one processor
Premium could invoice through exactly one processor, so an operator running BTCPay for BTC, LTC and Grin could not also take Monero or Wownero: BTCPay has no Wownero support, and this operator runs Monero through its own checkout rather than the BTCPay plugin. xmrcheckout and wowcheckout implement the same two Greenfield invoice routes, accept the same `token` auth and report the same statuses, so the existing adapter serves them unchanged. What was missing was more than one of them. Each is now an optional rail with its own URL, store and key (PAYMENT_XMRCHECKOUT_* and PAYMENT_WOWCHECKOUT_*), all three values or none, and a half-configured rail refuses to start and names itself rather than advertising a coin that cannot be paid. The invoice row already recorded which provider minted it; activation now polls that one, never whichever is primary today. An invoice whose rail was switched off is refused and left unconsumed, so turning the rail back on lets the user redeem what they paid. A client that names a rail the instance does not offer is refused rather than handed an invoice in a different coin; a client that names none gets the primary, which is how every client before this behaved. Registration is untouched and keeps the primary. /capabilities lists the rails and their assets, primary first, from config alone, so it never depends on a processor being reachable. PAYMENT_ASSETS labels the primary. Checkout rails also get an exact confirmationsRequired, which BTCPay Server is not sent since it only has speedPolicy buckets.
This commit is contained in:
@@ -94,6 +94,7 @@ use utoipa::OpenApi;
|
||||
crate::api::capabilities::MessagingCapability,
|
||||
crate::api::capabilities::PremiumCapability,
|
||||
crate::api::capabilities::PremiumPlanInfo,
|
||||
crate::api::capabilities::PremiumRailInfo,
|
||||
crate::api::capabilities::FeedCapability,
|
||||
crate::api::prices::PricesResponse,
|
||||
crate::api::auth::AuthResponse,
|
||||
|
||||
Reference in New Issue
Block a user