Apple Pay and Google Pay Button Placement

PaymentsUXWallets
Share on LinkedIn Share on X Share on Reddit Share on HN Share on Bluesky

Wallet buttons convert when they are visible, verified, and faster than typing a card. I have seen checkout teams spend weeks on form validation while Apple Pay sat below the fold — wallet-ready users typed 16 digits instead. Placement, domain verification, and express-checkout semantics matter more than button styling.

This post covers where wallet buttons belong, how domain verification gates Apple Pay on the web, and how to wire Payment Request API so express checkout actually skips fields.

Wallet button placement rules

Before changing implementation details, draw the boundary diagram. Apple Pay and Google Pay Button Placement touches routing, caching, client state, and often edge middleware. If you cannot name which layer owns the behavior, you will fix symptoms in React components when the problem lives in cache headers or a third-party script.

Browser ──▶ CDN / Edge ──▶ App Server ──▶ Data / CMS
   │            │              │
   └── Client UI └── Middleware └── Server Components / API
Layer Owns Watch for
Edge / CDN Cache, geo routing, security headers Stale content, cookie scope
Server Data fetching, auth, personalization TTFB regressions, cache misses
Client Interactivity, optimistic UI, a11y Bundle size, hydration, INP
Third party Analytics, payments, chat widgets Long tasks, CSP violations

Document which metrics you expect to move. If apple pay and google pay button placement is a performance change, baseline LCP, INP, and CLS in CrUX or your RUM tool for affected routes before merging. If it is an accessibility change, run axe and manual screen reader checks on the critical path — not just the component story.

Apple Pay and Google Pay flows

Start with the smallest change that proves the approach. For apple pay and google pay button placement, that usually means one route, one component tree, or one middleware rule — not a platform-wide migration.

// Example: progressive adoption pattern
// Step 1 — isolate behind a feature flag or route segment
export async function Page() {
  const enabled = await flags.isEnabled("payments_ux_wallet_buttons_apple_google");
  if (!enabled) return <LegacyExperience />;
  return <NewExperience />;
}
// Example: measurable wrapper for RUM
export function reportMetric(name: string, value: number, tags: Record<string, string>) {
  if (typeof window === "undefined") return;
  // Send to your analytics / RUM endpoint
  navigator.sendBeacon?.("/api/rum", JSON.stringify({ name, value, tags, path: location.pathname }));
}

Validate in staging with production-like data volumes. Empty caches and synthetic tests lie. Warm the CDN, test logged-in and logged-out states, and exercise the failure paths — slow network, ad blockers, and screen reader navigation.

For TypeScript-heavy codebases, type the boundaries explicitly. Loose any at integration points hides regressions until runtime. Prefer satisfies, discriminated unions, and schema validation (Zod) at server/client boundaries so malformed CMS or API payloads fail in development, not in a user's checkout flow.

Wallet button accessibility

Performance optimizations that break keyboard navigation or screen reader announcements are net negative. Every change should preserve or improve WCAG 2.2 conformance:

Run automated checks (axe-core) on affected routes in CI, then manually test with VoiceOver or NVDA on the primary user journey. Automated tools catch roughly 30–40% of issues; manual testing catches the rest.

Domain verification and session safety

Frontend changes intersect security even when the task is "just UI." Any new script source, inline handler, or third-party embed affects your Content Security Policy attack surface. Any new form field may collect PII subject to GDPR retention limits.

Review changes with the same rigor as backend PRs. A "small" analytics snippet can exfiltrate form data if misconfigured.

Testing strategy

Layer tests to match risk:

Layer Tooling Catches
Unit Vitest / Jest Logic, utilities, hooks
Component Testing Library + Storybook Rendering, a11y roles, interactions
E2E Playwright Critical paths, real network, visual regressions
Performance Lighthouse CI, WebPageTest Budget regressions, LCP/CLS lab signals
Accessibility axe-core, pa11y WCAG violations on static DOM

Flaky E2E tests erode trust — quarantine and fix, do not mute. Performance budgets should fail PRs on regression, not merely warn.

Common production mistakes

Teams get apple pay and google pay button placement wrong in predictable ways:

Document trade-offs in the PR description. If you chose speed over strict correctness (or vice versa), the next engineer needs that context during incident response.

Debugging and triage workflow

When apple pay and google pay button placement misbehaves in production, work top-down:

  1. Confirm scope — one route, region, browser, or experiment bucket? Narrow blast radius before deep diving.
  2. Check recent changes — deploys, flag flips, CMS publishes, and CDN config in the last 24 hours.
  3. Compare golden signals — LCP, INP, CLS, error rate, and conversion for affected surface vs. baseline.
  4. Reproduce minimally — smallest input that triggers failure; capture HAR, trace, and screenshots with timestamps.
  5. Fix forward or rollback — if rollback is faster during an incident, rollback first, postmortem second.
  6. Add a guard — alert, E2E test, or CI check so the same failure class is caught earlier next time.

Document the timeline during triage. Future on-call needs timestamps and hypothesis notes, not just the final root cause.

Button hierarchy on checkout

Wallet row first, divider with "or", then manual card entry. On mobile, wallet buttons at full width (min 44px height). Do not duplicate — one Apple Pay button per page per Apple's HIG.

Apple Pay domain verification

Host /.well-known/apple-developer-merchantid-domain-association on every checkout domain. Stripe handles this when you add domains in Dashboard; self-integrated merchants upload the file to CDN origin. Verification fails silently — button simply does not render.

Google Pay isReadyToPay gating

const ready = await googlePayClient.isReadyToPay({ apiVersion: 2, allowedPaymentMethods: [baseCardPaymentMethod] });
if (ready.result) mountGooglePayButton();

Render nothing when false — a disabled gray button suggests broken checkout.

Express checkout data contract

Wallet flows should populate shipping, billing, and email from the wallet token. Re-asking for email after Apple Pay authenticated the user wastes the speed advantage.

CSP and third-party scripts

Payment Request and Stripe.js need explicit CSP entries for js.stripe.com and applepay.cdn-apple.com. Test headers on the payment route in CI.

Conversion metrics worth tracking

Segment completion rate: wallet vs manual card. Median time-to-submit. Compare iOS Safari separately — Apple Pay adoption skews mobile revenue.

Resources

Frequently asked questions

Where should Apple Pay and Google Pay buttons sit?

Above manual card entry on checkout and subscription screens. Wallet users expect one-tap pay at the top; burying buttons below a 12-field form trains them to type card numbers instead.

What breaks wallet button display?

Missing domain verification (Apple Pay), incorrect merchant ID configuration, serving checkout over HTTP, and CSP blocking payment scripts. Fix verification files and script-src before A/B testing button color.

Should wallet buttons appear on mobile only?

No — desktop Safari supports Apple Pay; Chrome supports Google Pay on desktop with saved cards. Hide buttons only when canMakePayments returns false, not based on viewport width alone.

Hiring a senior Android / Flutter engineer?

I architect and ship production mobile software — Kotlin, Jetpack Compose, Flutter — for robotics, EV infrastructure, fintech, and real-time systems. Open to remote roles in Europe and the US.

Get in touch →