SslFailClosedWebViewClient

class SslFailClosedWebViewClient(onSslError: () -> Unit) : AccompanistWebViewClient

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.

NEVER call handler.proceed() here — that is the exact "flaky regional cert" hack Play policy rejects.

Android-only (android.webkit.* types) — lives in androidMain, never commonMain. Constructed only through sslFailClosedWebViewParams's android actual, which is the fix for the iOS-RED bug this class used to cause when it sat directly in commonMain.

Constructors

Link copied to clipboard
constructor(onSslError: () -> Unit)

Properties

Link copied to clipboard
Link copied to clipboard
open lateinit var navigator: WebViewNavigator
Link copied to clipboard
open lateinit var state: WebViewState

Functions

Link copied to clipboard
open override fun doUpdateVisitedHistory(view: WebView, url: String?, isReload: Boolean)
Link copied to clipboard
open fun onFormResubmission(view: WebView?, dontResend: Message?, resend: Message?)
Link copied to clipboard
open fun onLoadResource(view: WebView?, url: String?)
Link copied to clipboard
open fun onPageCommitVisible(view: WebView?, url: String?)
Link copied to clipboard
open override fun onPageFinished(view: WebView, url: String?)
Link copied to clipboard
open override fun onPageStarted(view: WebView, url: String?, favicon: Bitmap?)
Link copied to clipboard
Link copied to clipboard
open fun onReceivedError(view: WebView?, errorCode: Int, description: String?, failingUrl: String?)
open override fun onReceivedError(view: WebView, request: WebResourceRequest?, error: WebResourceError?)
Link copied to clipboard
open fun onReceivedHttpAuthRequest(view: WebView?, handler: HttpAuthHandler?, host: String?, realm: String?)
Link copied to clipboard
open fun onReceivedHttpError(view: WebView?, request: WebResourceRequest?, errorResponse: WebResourceResponse?)
Link copied to clipboard
open fun onReceivedLoginRequest(view: WebView?, realm: String?, account: String?, args: String?)
Link copied to clipboard
open override fun onReceivedSslError(view: WebView, handler: SslErrorHandler, error: SslError)
Link copied to clipboard
Link copied to clipboard
open fun onSafeBrowsingHit(view: WebView?, request: WebResourceRequest?, threatType: Int, callback: SafeBrowsingResponse?)
Link copied to clipboard
open fun onScaleChanged(view: WebView?, oldScale: Float, newScale: Float)
Link copied to clipboard
open fun onTooManyRedirects(view: WebView?, cancelMsg: Message?, continueMsg: Message?)
Link copied to clipboard
open fun onUnhandledKeyEvent(view: WebView?, event: KeyEvent?)
Link copied to clipboard
Link copied to clipboard
open fun shouldOverrideKeyEvent(view: WebView?, event: KeyEvent?): Boolean
Link copied to clipboard
open override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean