diff --git a/licensing-service/src/api/mod.rs b/licensing-service/src/api/mod.rs index 86e5efe..d17c94f 100644 --- a/licensing-service/src/api/mod.rs +++ b/licensing-service/src/api/mod.rs @@ -573,6 +573,41 @@ async fn thank_you( .or(state.config.operator_name.as_deref()) .unwrap_or("Keysat"); let operator = html_escape(operator_str); + + // Provider-aware confirmation copy. BTCPay is Bitcoin-only (Lightning + // + on-chain); Zaprite brokers card payments too (Stripe / etc.) plus + // Bitcoin. The lede and the polling-status copy should reflect which + // payment rails are actually in play so a buyer who paid by card + // doesn't see "your Bitcoin payment was received" while their Stripe + // transaction shows up in the operator's dashboard. + // + // Today this reads `SETTING_ACTIVE_PROVIDER` (the singleton model). + // When the multi-provider work lands, swap this for a lookup of the + // invoice's own `payment_provider_id` so the copy matches the rail + // that actually settled THIS purchase, not whatever's currently + // active on the daemon. + let provider_kind = crate::payment::read_active_provider_preference(&state.db).await; + let (lede_text, provider_kind_str) = match provider_kind { + Some(crate::payment::ProviderKind::Zaprite) => ( + "Your payment was received. We\u{2019}re waiting for it to settle and \ + for the license to be signed. Card payments confirm in seconds; \ + Bitcoin Lightning also settles in seconds; on-chain Bitcoin typically \ + settles in 10\u{2013}20 minutes (one block confirmation).", + "zaprite", + ), + // BTCPay or unconfigured → original Bitcoin-only copy. Unconfigured + // is rare on this page (operator hit /thank-you without a provider + // connected) so we keep it Bitcoin-flavored rather than introducing + // a third "unknown" branch. + _ => ( + "Your Bitcoin payment was received. We\u{2019}re waiting for it to settle \ + and for the license to be signed. Lightning settles in seconds; on-chain \ + typically settles in 10\u{2013}20 minutes (one block confirmation).", + "btcpay", + ), + }; + let provider_kind_json = serde_json::to_string(provider_kind_str) + .unwrap_or_else(|_| "\"btcpay\"".into()); let body = format!( r#" @@ -748,7 +783,7 @@ footer.kfooter a:hover {{ color:var(--navy-900); }}
Your Bitcoin payment was received. We’re waiting for it to settle and for the license to be signed. Lightning settles in seconds; on-chain typically settles in 10–20 minutes (one block confirmation).
+{lede_text}