Apple Pay enables customers to pay using payment methods saved to their Apple Wallet. The SDK provides configuration options for button styling and contact information capture.Documentation Index
Fetch the complete documentation index at: https://primer.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
Client session requirements
Apple Pay requirescurrencyCode and order.countryCode in the client session.
order.countryCode is the merchant’s country (ISO 3166-1 alpha-2) — where the transaction is processed, not the buyer’s country. This maps to Apple Pay’s PKPaymentRequest.countryCode: “the two-letter ISO 3166 code for the country or region of the merchant’s principle place of business.”Quick reference
| Option | Type | Default | Description |
|---|---|---|---|
buttonOptions.type | string | 'plain' | Button label |
buttonOptions.buttonStyle | string | — | Button color |
billingOptions.requiredBillingContactFields | string[] | [] | Billing fields to capture |
shippingOptions.requiredShippingContactFields | string[] | [] | Shipping fields to capture |
shippingOptions.requireShippingMethod | boolean | false | Enable shipping method selection |
Button options
Customize the appearance of the Apple Pay button through thebuttonOptions configuration.
| Option | Type | Default | Description |
|---|---|---|---|
buttonOptions.type | string | 'plain' | Button label text (see values below). Automatically localized. |
buttonOptions.buttonStyle | string | — | 'black' for black with white text, 'white' for white with black text, 'white-outline' for white with black outline. If not set, Apple Pay uses its default styling. |
Button type
SetbuttonOptions.type to control the label displayed on the Apple Pay button. Text is automatically localized.
| Type | Description |
|---|---|
'plain' | Apple Pay logo only (default) |
'buy' | ”Buy with Apple Pay” |
'book' | ”Book with Apple Pay” |
'check-out' | ”Check Out with Apple Pay” |
'donate' | ”Donate with Apple Pay” |
'order' | ”Order with Apple Pay” |
'pay' | ”Pay with Apple Pay” |
'set-up' | ”Set Up with Apple Pay” |
'subscribe' | ”Subscribe with Apple Pay” |
'add-money' | ”Add Money with Apple Pay” |
'continue' | ”Continue with Apple Pay” |
'contribute' | ”Contribute with Apple Pay” |
'reload' | ”Reload with Apple Pay” |
'rent' | ”Rent with Apple Pay” |
'support' | ”Support with Apple Pay” |
'tip' | ”Tip with Apple Pay” |
'top-up' | ”Top Up with Apple Pay” |
Examples
Billing options
Capture billing information from the customer’s Apple Wallet.Required billing contact fields
SetrequiredBillingContactFields to specify which billing details to capture from the customer’s Apple Wallet.
| Field | Description |
|---|---|
'postalAddress' | Billing address (street, city, state, postal code, country) |
Shipping options
Capture shipping information from the customer’s Apple Wallet and enable shipping method selection.Required shipping contact fields
SetrequiredShippingContactFields to specify which shipping details to capture from the customer’s Apple Wallet.
| Field | Description |
|---|---|
'postalAddress' | Shipping address |
'name' | Recipient’s name |
'phoneticName' | Phonetic representation of name |
'phone' | Phone number |
'email' | Email address |
Shipping method selection
SetrequireShippingMethod to true to display available shipping methods in the Apple Pay sheet. This requires a shipping module to be configured in your Primer dashboard.
Domain configuration
If your checkout is hosted on a different domain than your registered Apple Pay domain, setmerchantDomain:
Complete example
Supported card networks
| Network | Description |
|---|---|
| VISA | Visa cards |
| MASTERCARD | Mastercard cards |
| AMEX | American Express cards |
| DISCOVER | Discover cards |
| JCB | JCB cards |
| MAESTRO | Maestro cards |
| CARTES_BANCAIRES | Cartes Bancaires (France) |
| DANKORT | Dankort (Denmark) |
| ELO | Elo (Brazil) |
| EFTPOS | eftpos (Australia) |
| INTERAC | Interac (Canada) |
| MIR | Mir (Russia) |
| UNIONPAY | China UnionPay |
orderedAllowedCardNetworks is set in your client session, only those networks are available.
Display items
The Apple Pay sheet displays line items from your order:- Line items — Products from
order.lineItems - Fees — All fees from
order.fees - Shipping — Shipping cost when shipping options are enabled
merchantAmount if set, otherwise from totalOrderAmount.
Testing
Development
- Use Safari on macOS or iOS
- Add a test card to your Apple Wallet
- Use Primer’s TEST environment
Production
- Register your domain in the Apple Developer Portal
- Configure your merchant identifier
- Verify your domain
Apple Pay only works on supported devices with Safari or WebKit-based browsers. The button appears only when the device supports Apple Pay and the user has payment methods configured.
See also
SDK options reference
All configuration options
Apple Pay on the web
Official Apple documentation
Apple Pay button types
Complete button type reference