Package-level declarations
Types
Bridges HostedWebViewGateway.pay (a suspending call with no UI of its own) to the Compose WebView screen that actually renders the checkout and detects the return-URL. One relay instance is shared (Koin single) across every hosted-webview config, keyed by GatewayId rather than single-slot like a per-gateway relay — many configs share this one module.
One hosted gateway asking to be shown as a checkout WebView.
One hosted-checkout gateway's shape. provider:hosted-webview is a single archetype-C module that takes N of these instead of a module per gateway (dozens of hosted gateways would otherwise blow up the build graph).
The terminal outcome detected from a return-URL redirect inside the hosted checkout WebView.
The archetype-C PaymentGateway: renders a hosted checkout page in a Compose WebView and resolves on return-URL redirect, per HostedGatewayConfig. One instance is created per configured gateway (see di/HostedWebViewModule.kt), all sharing the one HostedCheckoutRelay.
Common return-URL shapes seen across hosted gateways: a success/failure path or query marker, optionally carrying a payment id. Most configs can be expressed with this alone; gateways with a stranger return contract supply a custom matchReturn.
SECURITY: SSL/certificate errors on a hosted checkout page fail closed. compose-webview-multiplatform's AccompanistWebViewClient does not override onReceivedSslError at all, so without this subclass the platform default (handler.cancel()) silently cancels the load with no signal to the payment flow — the WebView would just sit blank. This override makes the failure explicit and reports it through onSslError so the orchestrator can settle the payment as com.siddharth.kmp.paymentsapi.PaymentResult.Failure.
Functions
Subscribes to HostedCheckoutRelay.requests and renders HostedCheckoutScreen for whichever hosted gateway is currently mid-checkout; reports the outcome back through the same relay so HostedWebViewGateway.pay resumes. configs is the app's assembled list of HostedGatewayConfig.
Renders one hosted gateway's checkout page and watches every navigation for the return-URL pattern. docs: https://github.com/KevinnZou/compose-webview-multiplatform — state.lastLoadedUrl is the interception point; the moment matchReturn recognizes a redirect as terminal, onResult fires exactly once (the reported guard survives re-navigation inside the same page load).
Builds the platform SSL-fail-closed hook for HostedCheckoutScreen's WebView, or null on platforms where PlatformWebViewParams has nothing to attach a client to.
Builds the platform SSL-fail-closed hook for HostedCheckoutScreen's WebView, or null on platforms where PlatformWebViewParams has nothing to attach a client to.
Builds the platform SSL-fail-closed hook for HostedCheckoutScreen's WebView, or null on platforms where PlatformWebViewParams has nothing to attach a client to.