Skip to main content
Primer Checkout iOS SDK is currently in beta (v3.0.0-beta.8). The API is subject to change before the stable release.
Apple Pay is configured through PrimerSettings — there is no separate Apple Pay view or scope to wire up. When Apple Pay is enabled on your Primer Dashboard, it appears automatically. It surfaces as a CheckoutPaymentMethod (with type == "APPLE_PAY") in PrimerPaymentMethods, or as one of the managed screens in PrimerCheckout. The merchant identifier you provide in paymentMethodOptions is required to pay. Without it, selecting Apple Pay fails with a PrimerError.
Apple Pay requires a physical device with a card in the Wallet, the Apple Pay capability enabled in your app, and a configured merchant identifier. The iOS Simulator can list Apple Pay, but you cannot complete a payment there.

Setup overview

There are three steps to accept Apple Pay, in order:

1. Apple Pay capability

Add the Apple Pay capability to your app target in Xcode.

2. Merchant ID

Create a merchant identifier in the Apple Developer portal.

3. PrimerSettings

Pass the merchant identifier to the SDK via PrimerApplePayOptions.

1. Enable the Apple Pay capability

In Xcode, select your app target, open the Signing & Capabilities tab, and add the Apple Pay capability. This generates the com.apple.developer.in-app-payments entitlement and lets you attach merchant identifiers to the app.

2. Create a merchant identifier

In the Apple Developer portal, create a merchant identifier (for example merchant.com.myapp). Then return to Xcode and select that merchant identifier under the Apple Pay capability you added in step 1.
You also need a payment processing certificate associated with the merchant identifier, and Apple Pay must be configured for the processor on your Primer Dashboard. See the Apple Pay payment method documentation for backend configuration.

3. Configure PrimerSettings

Provide the merchant identifier through PrimerApplePayOptions, nested inside paymentMethodOptions on PrimerSettings. The merchantIdentifier must exactly match the identifier you created in step 2.
Set the merchant name through the client session. The SDK uses merchantName only when the client session sets none, so you can pass nil.

PrimerApplePayOptions

Collecting contact details

Use ShippingOptions and BillingOptions to require contact fields on the Apple Pay sheet. Both accept RequiredContactField values. ShippingOptions also takes a required requireShippingMethod argument. Primer Checkout ignores it, so pass false unless you share these settings with Drop-In.
To price shipping from the address the shopper enters, see Express Checkout shipping. When you set the shipping handlers, the SDK turns shipping on and requests the postal address itself. requireShippingMethod has no effect. If you set ShippingOptions to request other contact fields, pass requireShippingMethod: false, because the parameter has no default.

Showing Apple Pay

Once configured, Apple Pay appears wherever payment methods are rendered. You do not present or initiate the Apple Pay sheet yourself — selecting the method starts the SDK-managed flow.

Managed checkout

With PrimerCheckout, pass the settings and the SDK renders Apple Pay among its default screens.

Composable checkout

When you build your own UI, pass the same settings into PrimerCheckoutSession. Apple Pay then appears as a CheckoutPaymentMethod in PrimerPaymentMethods, alongside the other available methods.
The default method slot renders Apple Pay as Apple’s native Apple Pay button. The button follows light and dark mode and has its own VoiceOver label. To single out Apple Pay in a custom layout, override the method slot on PrimerPaymentMethods and branch on paymentMethod.type == "APPLE_PAY". In that branch, call PaymentMethodsDefaults.method so the shopper still sees the native button. Selecting it starts the Apple Pay flow, and the SDK presents the Apple Pay sheet for you.

Troubleshooting

Apple Pay failures are reported through the standard result handling path. See Handle the payment result and PrimerError.

See also

PrimerSettings

Where Apple Pay options live, alongside the other SDK settings.

PrimerPaymentMethods

Render Apple Pay as a method row in a custom layout.

PrimerCheckout

The managed flow that shows Apple Pay automatically.

Express Checkout shipping

Price shipping from the address the shopper enters in the sheet.

Handle the payment result

Consume the checkout outcome after an Apple Pay payment.