Skip to content

[Android] Offsite payment pages ignore the viewport meta tag and render 2–3× too large in the sheet (useWideViewPort is off) #1034

Closed

Description

@sumitchd

What area is the issue related to?

Checkout Kit

What version of Checkout Kit are you using?

@shopify/checkout-sheet-kit 3.9.1 (React Native), which bundles com.shopify:checkout-sheet-kit 3.6.3 on Android. The same WebView settings are in 3.7.0 and in Checkout Kit Android 4.0.0. Seen on a physical Android phone.

Reproducible sample code

None needed. It happens with the default present(checkoutUrl) and no customisation.

Steps to Reproduce

  1. On Android, present checkout in the sheet for a store that offers QFPay Secure Checkout 2.0 (Alipay, AlipayHK, WeChat Pay, PayMe, UnionPay, Octopus).
  2. Choose QFPay and tap Pay.
  3. Inside the sheet, checkout redirects to the Alipay+ cashier page (g.alipayplus.com).

Expected Behavior

The cashier page fits the screen, as it would in a mobile browser, and the buyer can finish paying.

Actual Behavior

The cashier page draws about 2–3× too large. The heading fills the screen width and the rest of the page runs off the right edge, so the buyer can't finish paying. Shopify's own checkout pages look right in the same sheet.

Cause. BaseWebView.configureWebView() (3.6.3) and CheckoutWebView (4.0.0) set only javaScriptEnabled, domStorageEnabled and allowContentAccess. useWideViewPort and loadWithOverviewMode keep Android's default of false, so the WebView lays every page out at the WebView's width in CSS px and ignores the page's <meta name="viewport">. Shopify's checkout declares width=device-width, so it isn't affected. Offsite payment pages built for a fixed design width (750px is common) or that scale by devicePixelRatio come out at the wrong size.

Suggested fix:

settings.apply {
    javaScriptEnabled = true
    domStorageEnabled = true
    allowContentAccess = true
    useWideViewPort = true
    loadWithOverviewMode = true
}

Pages that declare width=device-width, Shopify's checkout among them, lay out exactly as before. Pages with a fixed-width viewport then lay out the way Chrome lays them out. Pages with no viewport tag would also change, to Chrome's zoomed-out 980px layout.

This stops buyers completing checkout, so under the V3 maintenance policy we'd like the fix in 3.x as well as 4.x.

Related: intent:// links do nothing. Android payment pages often switch to the wallet app with intent://…#Intent;scheme=…;package=…;end links, which Chrome supports. Both versions build Intent(ACTION_VIEW, uri) from the raw URI: tryLaunchDeepLink in CheckoutEventProcessor.kt (3.6.3) and ExternalUriLauncher.launchExternalApp (4.0.0). An intent: URI never resolves that way, so the tap does nothing. Parsing it with Intent.parseUri(uri.toString(), Intent.URI_INTENT_SCHEME), with the usual safeguards (add CATEGORY_BROWSABLE, clear the component and selector) and a fallback to S.browser_fallback_url, would match Chrome. We haven't captured which link this Alipay+ page uses to open the wallet apps, so this part comes from reading the code, not from this page. Shopify/checkout-sheet-kit-android#571 asked about the same hand-off for UPI and was closed as stale.

Storefront domain

A Hong Kong merchant's store. We can share the domain privately.

Activity

  1. kiftio commented on Nov 17, 2026

    @kiftio
    Contributor

    Thanks for the detailed report and diagnosis, @sumitchd.

    Viewport: the checkout WebView now enables useWideViewPort and loadWithOverviewMode, so offsite pages respect their <meta name="viewport"> tag as they do in Chrome.

    We reproduced the symptom with test pages that use a fixed-width (width=750) or 1/devicePixelRatio viewport, but didn't reach the Alipay+ cashier ourselves. Could you confirm 3.9.3 fixes it for your store?

    intent:// links: we're not adding built-in handling for now. Parsing intent: URIs from pages in the sheet needs some security consideration, and we haven't confirmed this page uses them. If the wallet hand-off still doesn't work after the viewport fix:

    • If the page uses custom-scheme links (e.g. alipays:// or alipayhk://), Android 11+ only opens them for schemes your app declares in <queries>; otherwise the tap silently does nothing. See Offsite Payments. This applies to React Native apps too, in the app's AndroidManifest.xml.
    • Otherwise, could you capture the link the page navigates to (e.g. via chrome://inspect) so we can see what it uses?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions