# Apple Pay

> Enable Apple Pay in Paystack, verify your domain, and add the Apple Pay button to Checkout.

For the Checkout model Apple Pay uses on the web, see [Checkout](/payments/online/checkout).

## Turn on Apple Pay in the dashboard

Open [Developers → Apple Pay](https://dashboard.paystack.com/v2/developers/apple-pay) on your Paystack Dashboard and turn on **Apple Pay**. Accept the Apple Pay Platform Web Merchant Terms and Conditions when prompted.

If you use Commerce Suite or any Paystack-hosted flow that already redirects customers away from your site, Apple Pay becomes available there after enablement.

## Register your domain

In [Developers → Apple Pay](https://dashboard.paystack.com/v2/developers/apple-pay), add the top-level domain or subdomain that will host the payment experience, then download the domain verification file.

Register each domain separately. For example, `paystack.com` and `music.paystack.com` must each be registered on their own.

## Host the verification file

Place the downloaded verification file in a `.well-known` folder at the site root.

Examples:

- `https://paystack.com/.well-known/...`
- `https://music.paystack.com/.well-known/...`

Serve the file with `content-type: application/text`.

## Verify the domain

Return to the dashboard and click **Verify Domain**. Continue only after the domain shows as verified.

## Add the Apple Pay button with InlineJS v2

Apple Pay on Popup requires version 2 of InlineJS.

Create the containers:

```html
<div id="paystack-apple-pay"></div>
<button id="paystack-other-channels">More payment options</button>
```

Mount the Apple Pay button:

```js
const paystackPop = new PaystackPop();

await paystackPop.paymentRequest({
  key: 'pk_domain_xxxxx',
  email: 'CUSTOMER_EMAIL',
  amount: amount * 100,
  currency: 'NGN',
  ref: 'YOUR_REFERENCE',
  container: 'paystack-apple-pay',
  loadPaystackCheckoutButton: 'paystack-other-channels',
  style: {
    theme: 'dark',
    applePay: {
      margin: '10px',
      padding: '10px',
      width: '100%',
      borderRadius: '5px',
      type: 'pay',
      locale: 'en'
    }
  },
  onSuccess(response) {},
  onError() {},
  onCancel() {},
  onElementsMount(elements) {}
})
```

## Or use the pre-checkout modal

If you do not want a dedicated Apple Pay button, trigger the pre-checkout flow instead:

```js
const paystackPop = new PaystackPop();

async function payWithPaystack() {
  await paystackPop.checkout({
    key: 'pk_domain_xxxxx',
    email: 'example@email.com',
    amount: 10000,
    onSuccess: (transaction) => {
      console.log('Transaction: ', transaction)
    },
    onCancel: () => {
      console.log('Pop up closed!')
    }
  })
}
```

If setup fails, confirm HTTPS is enabled, the domain is registered and verified, the verification file is in `.well-known`, and Apple's servers can reach your site.
