> ## Documentation Index
> Fetch the complete documentation index at: https://crossmint-wallets-docs-2-5.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Apple Pay Integration Guide

> Learn how to enable Apple Pay on your site for Checkout

To enable Apple Pay on your site, follow these steps:

## Prerequisites

1. **HTTPS Hosting**: Your site must be hosted on HTTPS to ensure secure transactions.
2. **Domain Validation**: Provide your domain to our support team for validation.

## Download the Apple Validation File

Before proceeding, download the Apple Developer Merchant ID Domain Association File:

[Download the Apple Developer Merchant ID Domain Association File](https://stripe.com/files/apple-pay/apple-developer-merchantid-domain-association)

## Setup Instructions

### Step 1: Host the Apple Developer Merchant ID Domain Association File

You need to host the following endpoint on your server and return the Apple `.txt` validation file as plain text:

```
https://[your-domain]/.well-known/apple-developer-merchantid-domain-association
```

### Example Setup Using Next.js App Router

**Option 1: Using the Public Folder**

1. **Create a Public Folder**: In your Next.js project, create the `.well-known` folder inside your public directory.

2. **Add the Validation File**: Paste the Apple verification txt with no extension in `public/.well-known/`.

   Filename: `apple-developer-merchantid-domain-association`

**Option 2: Using a Route**

1. **Create the Route Structure**: In your Next.js project, create a folder at:

   Path: `app/.well-known/apple-developer-merchantid-domain-association/`

2. **Add a `route.ts` File**: Inside the folder, create a `route.ts` file with the following content:

   ```typescript route.ts theme={null}
   import { NextResponse } from "next/server";

   export async function GET() {
       return new NextResponse("TXT-CONTENT", {
           headers: {
               "Content-Type": "text/plain",
           },
       });
   }
   ```

   Replace `'TXT-CONTENT'` with the actual content of your Apple validation file.

### Example Setup Using Next.js Page Router

1. **Create a Public Folder**: In your Next.js project, create the `.well-known` folder inside your public directory.

2. **Add the Validation File**: Paste the Apple verification txt with no extension in `public/.well-known/`.

   Filename: `apple-developer-merchantid-domain-association`

### Example Setup Using Vite

1. **Create a Public Folder**: In your Vite project, create the `.well-known` folder inside your public directory.

2. **Add the Validation File**: Paste the Apple verification txt with no extension in `public/.well-known/`.

   Filename: `apple-developer-merchantid-domain-association`

### Step 2: Test Apple Pay

Test Apple Pay on Safari (macOS) or any iOS device once setup is complete.

## Local Testing

We recommend using [ngrok](https://ngrok.com/) to test your setup locally. Ngrok allows you to expose your local server to the internet securely. If possible, use a fixed domain with ngrok for consistent testing.

***

For further assistance, please contact our support team.
