Wallets

How to accept Apple Pay: web, every browser, and in your app

Apple Pay is a card payment wearing a nicer coat: same processor, same price, same refunds. The work is all in the setup, and it splits three ways: through your payment provider on the web, directly with Apple on the web, or in an iOS app, where the App Store decides whether you're allowed to use it at all. With the wallet material from chapters 30 and 22.

Apple's setup and App Review rules, and Stripe's integration options, checked on 14 November 2026. Apple revises the App Review Guidelines several times a year.

To accept Apple Pay you need a payment provider that supports it, a domain Apple has verified (for the web) or a merchant ID in your app (for iOS), and an Apple Pay button that only shows up where the customer can use it. What you get is a tokenized card payment: authorization, refunds and disputes run through your normal card flow, and on Stripe you pay "only the Stripe processing fees" (Stripe), the same card rate as a typed card. Apple Pay isn't even a separate payment method type in Stripe's API; there's no apple_pay type, and the payment arrives as a card (Stripe API).

Three ways in

Web, through your PSPWeb, directly with AppleIn your iOS app
Apple Developer ProgramStripe's web flow doesn't ask for itNeeded ($99 a year)Needed
Merchant IDThe PSP'sYoursYours
CertificatesHandled by the PSPPayment processing and merchant identity, both renewed every 25 monthsPayment processing (on Stripe, from a Stripe CSR)
Domain verificationRegister the domain with the PSP.well-known file, re-verified when your SSL certificate lapsesNot applicable
Merchant validationThe PSP'sYour server, with mutual TLS, every sessionNot applicable
Allowed for digital goodsYesYesNo, with exceptions (below)

Sources: Apple configuration, Apple maintenance, Apple Developer Program, Stripe domain registration, Stripe Apple Pay.

On the web, through your PSP (start here)

On Stripe, Apple Pay works on Payment Links and hosted Checkout with no extra configuration. On Elements or embedded Checkout, register every domain and subdomain that shows the button, in the Dashboard's Payment method domains page or through the API, in both sandbox and live mode (Stripe). Stripe handles Apple's merchant validation behind the scenes, and says you don't need to create an Apple Merchant ID or CSR (Stripe).

For a custom page, use the Express Checkout Element, which shows Apple Pay, Google Pay, Link and other one-click buttons where each is available. The older Payment Request Button is marked deprecated and superseded by it (Stripe). If you see a tutorial building on paymentRequest(), it's from the old API.

Testing has one catch: you can't add Stripe's or Apple's test cards to a Wallet. Stripe has you use a real card with your test API keys; it recognises test mode and returns a test token, so nothing is charged (Stripe).

On the web, directly with Apple

If your processor decrypts Apple Pay tokens but doesn't run the web flow for you, the setup is yours (Apple):

  1. Join the Apple Developer Program and register a merchant ID. It never expires, and you can use it across websites and apps.
  2. Create two certificates. The payment processing certificate encrypts payment data, and you or your processor hold the private key that decrypts it. The merchant identity certificate is a TLS client certificate your server uses to start sessions with Apple; it's only needed on the web. Both expire every 25 months (Apple).
  3. Register and verify every domain that shows the button, subdomains included, by hosting Apple's file at /.well-known/apple-developer-merchantid-domain-association. The URL can't sit behind a proxy or redirect. Verification expires the day your SSL certificate does; Apple checks for a renewed certificate 30, 15 and 7 days before, and if you renew in time, nothing else is needed (Apple).
  4. Serve the page over HTTPS with TLS 1.2 or later, and let your server reach Apple's gateway domains (Apple).
  5. Validate the merchant on every payment sheet. When the sheet opens, the browser fires onvalidatemerchant; your server requests a payment session from Apple over mutual TLS with the merchant identity certificate, and hands the opaque result back. Apple says to send this from your server, never the client, and the session expires after five minutes (Apple).

Step 5 in Flask:

import os

import requests
from flask import Flask, abort, jsonify

# Apple's documented Payment Session endpoint. Using it means you never post
# your certificate to a URL the browser chose. Sandbox testing uses
# apple-pay-gateway-cert.apple.com instead.
PAYMENT_SESSION_URL = os.environ.get(
    "APPLE_PAY_SESSION_URL",
    "https://apple-pay-gateway.apple.com/paymentservices/paymentSession",
)
# The merchant identity certificate and its key, as PEM files.
MERCHANT_IDENTITY = (os.environ["APPLE_PAY_CERT"], os.environ["APPLE_PAY_KEY"])

app = Flask(__name__)


@app.post("/apple-pay/session")
def apple_pay_session():
    """Called from the page's onvalidatemerchant handler, once per sheet."""
    try:
        resp = requests.post(
            PAYMENT_SESSION_URL,
            cert=MERCHANT_IDENTITY,  # mutual TLS
            json={
                "merchantIdentifier": os.environ["APPLE_MERCHANT_ID"],
                "displayName": "Example Store",   # 64 characters or fewer
                "initiative": "web",
                "initiativeContext": "shop.example.com",  # the verified domain
            },
            timeout=10,
        )
        resp.raise_for_status()
    except requests.RequestException:
        abort(502)  # log it: an expired certificate looks exactly like this
    # Opaque to you. Pass it to completeMerchantValidation within 5 minutes.
    return jsonify(resp.json())

Apple's docs also let you post to the validation URL the browser hands you. If you do, check its host against Apple's list before your certificate goes anywhere near it; Apple tells you to fail for any other URL (Apple). Older examples send a domainName field to a startSession URL; Apple says Start Session is being phased out in favour of Payment Session.

The two certificates and the domain verification are the classic outage: nothing fails at checkout, the sheet just never opens. Apple emails the account holder and admins before each expiry (Apple). Make sure someone reads that inbox, and put the dates in your monitoring as well.

Outside Safari, since iOS 18

Apple Pay on the web used to mean Safari. With iOS 18, a customer in any non-Safari browser, on any device, can click Apple Pay, scan a code with their iPhone, and pay there. Apple's conditions: load the Apple Pay JS SDK version 1.2.0 or later, and use the SDK's Apple Pay button, not the CSS one, which "will not support non-Safari browsers". Code already written for Safari needs no changes (Apple, WWDC24). On Stripe's Express Checkout Element, Apple Pay on non-Safari desktop browsers shows only when paymentMethods.applePay is set to always (Stripe).

Whether to set it is a product call. The QR hand-off is one more step than a typed card for someone who's already at a keyboard; measure it before you put it first.

In your iOS app

In an app, Apple Pay runs through PassKit (Apple): enable the Apple Pay capability in Xcode with your merchant ID and present the payment sheet. On Stripe that means registering an Apple Merchant ID, creating the payment processing certificate from a CSR Stripe gives you, and using its iOS SDK (Stripe).

The App Store rule decides whether you can use it at all. Physical goods and services consumed outside the app must use something other than in-app purchase, "such as Apple Pay or traditional credit card entry" (Guideline 3.1.3(e)). Unlocking features or content inside the app, subscriptions included, must use in-app purchase (3.1.1) (App Review Guidelines). So Apple Pay is for the hotel booking, the meal and the T-shirt, not the premium tier. The exception is the US storefront, where apps can link out to a web checkout (3.1.1(a)); Stripe's docs describe redirecting to an external payment page for digital goods sold in the US or the EEA (Stripe). App store fees covers what that saves.

If you use Apple Pay for recurring payments in an app, Guideline 4.9 requires you to disclose the renewal term and that it continues until cancelled, what's provided each period, the actual charges, and how to cancel.

3D Secure and liability

Wallet payments don't support 3D Secure on Stripe. The wallet supplies its own cryptogram instead, and in some cases that carries the same liability shift a 3DS payment gets (Stripe). 3DS2 liability shift covers when it applies.

The setup overhead, the certificate renewal that takes Apple Pay down, and the validation call in Node. From chapter 30.

Server-Side Merchant Validation (Node.js)

Apple Pay carries setup overhead that catches teams off guard. You need an Apple Developer Program membership ($99/year), domain ownership proof, a merchant identity certificate (valid 25 months), and a server-side validation endpoint that handles Apple's callback URLs.

The certificate is the part that bites. Forget a renewal and every Apple Pay payment fails, and you'll usually hear about it from customers before you hear about it from your alerts. Domain verification expires with your site's SSL certificate, so a lapsed SSL cert takes Apple Pay down too (Apple). Certificate misinstallation ("merchant validation failed" on every attempt) and a live domain that was never verified against the merchant ID are the other common breakages. Set up 60-day expiry monitoring, automate renewal, and test the full flow in staging before any cert update reaches production.

Apple Pay still misses most Android traffic, which is why Google Pay is the natural pair.

const axios = require('axios');
const fs = require('fs');

async function validateMerchant(validationURL) {
  const merchantId = 'merchant.com.yourcompany';
  const displayName = 'Your Store';
  const initiative = 'web';
  const initiativeContext = 'yourstore.com';

  const payload = {
    merchantIdentifier: merchantId,
    displayName: displayName,
    initiative: initiative,
    initiativeContext: initiativeContext
  };

  try {
    const response = await axios.post(validationURL, payload, {
      cert: fs.readFileSync('path/to/merchant_id.pem'),
      key: fs.readFileSync('path/to/merchant_id.key'),
      headers: {
        'Content-Type': 'application/json'
      }
    });

    return response.data;
  } catch (error) {
    console.error('Merchant validation failed:', error);
    throw error;
  }
}

Questions

How do I accept Apple Pay payments on my website?

Use a payment provider that supports it. On Stripe, Apple Pay works on hosted Checkout and Payment Links with no setup; on Elements or embedded Checkout, register your domains in the Dashboard and use the Express Checkout Element. Stripe handles Apple's merchant validation, so you don't need your own Apple merchant ID.

Does Apple charge merchants a fee for Apple Pay?

Apple Pay is processed as a card payment. On Stripe you pay only Stripe's normal processing fees, the same rate as a typed card. Integrating directly with Apple on the web, or in an app, needs an Apple Developer Program membership at $99 a year.

Does Apple Pay work in Chrome or on Windows?

Since iOS 18, yes. A customer in a non-Safari browser clicks Apple Pay, scans a code with their iPhone and pays there. The site needs Apple Pay JS SDK 1.2.0 or later and the SDK's button; on Stripe's Express Checkout Element, set paymentMethods.applePay to always for non-Safari desktop browsers.

How do I verify my domain for Apple Pay?

Through your provider's dashboard if it runs Apple Pay for you, as Stripe does. Directly with Apple, host Apple's file at /.well-known/apple-developer-merchantid-domain-association, with no proxy or redirect. Verification expires when your SSL certificate does, unless you renew it in time.

Can I use Apple Pay for in-app purchases?

Only for physical goods and services used outside the app, where App Review Guideline 3.1.3(e) requires a method other than in-app purchase, such as Apple Pay. Digital content and features unlocked in the app must use in-app purchase, though US storefront apps can link out to a web checkout.

What the book adds

What chapters 30 and 22 add

  • The Apple Pay JS payment sheet, shipping updates included
  • Google Pay on the web, and why it's the cheaper second wallet
  • Wallet tokenization and the Secure Element
  • Fixing merchant validation failures
  • Where wallets fit in your payment method mix

30-day money-back · Instant PDF and EPUB

All 42 chapters