# Apple Pay onboarding

Set up your merchant ID and certificates, so you can start accepting Apple Pay.

## Step 1: Create a merchant account and merchant ID

1. Log in to your Apple Developer Account.
2. Go to **Certificates, Identifiers & Profiles**.
3. Go to **Identifiers**, then click the **+** button.
4. Choose *Merchant IDs* as the identifier type, then click **Continue**.
5. Enter a description and a merchant ID in the format: `merchant.com.mycompany.mystore`.
6. Click **Continue** then **Register** to confirm.


Your list of identifiers is updated to include your new merchant ID. Copy this to your clipboard.

## Step 2: Generate the certificates

### Download the CSR from the Unity Portal

1. In the Unity Unity Portal, go to **Merchant setup > Merchant groups**.
2. Select a merchant group.
3. In the **Services** tab, click **Edit** next to *Apple Pay service*.
4. Click **Provider authorisation settings**.
5. Enter your Apple merchant ID and click **Register ID**.
6. Click **Download CSR file** and save the `.csr` file locally.


### Create a mechant identity certificate (.PEM)

1. In your Apple Developer Account, go to **Certificates, Identifiers & Profiles**.
2. Go to **Certificates**, then click the **+** button.
3. Choose *Apple Pay Merchant Identity Certificate*, then click **Continue**.
4. Select the merchant ID you created earlier, then click **Continue**.
5. Upload the CSR file you downloaded from the Unity Portal, then click **Continue**. Your certificate is generated
6. Click **Download** and save the `.cer` file locally.
7. Convert it to `.p12` format:
  1. Double-click on the `.cer` file to open it in Keychain Assistant.
  2. Right-click to export.
  3. Save this `.p12` file.
  4. Skip the password.
  5. Enter your system password to authenticate and complete the export processing.
8. Export your `.p12` to `.pem` via openSSL command:

```
% openssl pkcs12 -in <filename>.p12 -out <filename>.pem -nodes
```
9. In the Unity Portal, upload this file under *Merchant identity certificate (.PEM)*.


## Step 3: Create a payment processing certificate (.CER)

1. In your Apple Developer Account, go to **Certificates, Identifiers & Profiles**.
2. Go to **Certificates**, then click the **+** button.
3. Under Apple Pay, choose *Payment Processing Certificate* and click **Continue**.
4. Select your Merchant ID, then click **Continue**.
5. Upload the same CSR file from the Unity Portal, then click **Continue**.
6. Download the generated `.cer` file.
7. In the Unity Portal, upload this file under *Payment processing certificate (.CER)*.


After both certificates are uploaded, your Apple Pay setup with PXP is complete.

Any future merchant ID changes require re-uploading new certificates.