Setting Up Apple Pay
Instructions
Skillz supports Apple Pay but requires some additional steps to get it up and running in your game. In this guide we will show you how to enable Apple Pay in just a few short steps. Since the following steps require using Keychain, they must be performed on a Mac.
Generate the Certificate Signing Request (CSR)
First, you will need to generate a CSR file with specific key pair settings using Keychain Access. Key Size
will be specified as 256 bits
, and Algorithm
will be specified as ECC
.
- On your Mac, open
Keychain Access
- In the menu bar go to
Keychain Access
>Certificate Assistant
>Request a Certificate from a Certificate Authority...
. - Input your preferred email address
- Select
Saved to Disk
- Check
Let me specify key pair information
- Press
Continue
- Choose a location to save the
.certSigningRequest
file, and give it a name. - Select Algorithm
ECC
- Select Key Size
256 Bits
** NOTE: You MUST selectECC
before the256 Bits
option becomes available - Press
Continue
Register a Merchant ID
Register a Merchant ID via the Apple Provisioning Portal. Typically this follows a pattern similar to bundle id (e.g., merchant.com.<publisher>.<game>
).
- Go to the Apple Developer dashboard and log in
- Navigate to "Identifiers"
- Next to the page title "Identifiers" click the blue
+
sign button to be taking to the "Register a New Identifier" page
- Select
Merchant IDs
and clickContinue
- Provide a description and ID. Typically this follows a similar to pattern to bundle id (e.g,
merchant.com.<publisher>.<game>
). - Click
Continue
and if the information looks good, clickregister
After registering a Merchant ID, you will then need to enable Apple Pay for your game’s App ID on the Apple Developer Dashboard.
Certificate Generation
Next you will need to generate your certificate using the CSR you generated via Keychain Access earlier.
- On the Apple Developer dashboard navigate to Certificates
- Next to the page title "Certificates" click the blue
+
sign button to be taking to the "Create a New Certificate" page
- Select
Apple Pay Payment Processing Certificate
and clickContinue
- Select the Merchant ID you created and click
Continue
- Under "Apple Pay Payment Processing Certificate" click
Create Certificate
- You may be taken to a page "Edit or Configure Merchant ID" - which asks "Will payments associated with this Merchant ID be processed exclusively in China?". Skillz does not operate in China. So answer
no
, then clickContinue
. - On the "Create a New Certificate" page upload the
.certSigningRequest
from the first section. ClickContinue
. - You will be taken to a confirmation page titled "Download Your Certificate". Make sure to press the
Download
button and save your certificate file.
Download the resulting certificate file (.cer
), which you will turn into a .p12
file in the next step.
Change Certificate to a .p12
The certificate you have downloaded is a .cer file, which you will need to change to a .p12 file before uploading to Skillz.
- Once you have downloaded the
.cer
, openKeychain Access
on your computer. - Import the certificate you created in the previous step by selecting
File -> Import
Items. - Select the Certificates category.
- Select your game’s APNS certificate:
- Select
File -> Export
Items. - Save as a
Personal Information Exchange (.p12)
file. - You will be prompted to create a password. Make note of this password, as you will need it when you upload to Skillz.
- Save the file in a secure place so that you can retrieve it later.
After you create a .p12 file from the Apple provided .cer, you can upload the .p12 file and provide the password to Skillz on our Apple Pay page under the Configuration section.
Update the Entitlements File in Xcode
You will now need to update your entitlements file in Xcode.
Begin by regenerating and re-downloading the provisioning profiles for your game in the Apple Provisioning Portal. This will ensure they have all updated information regarding Apple Pay. In Xcode, open the capabilities tab for your game’s target, and enable Apple Pay. Select the Merchant ID you created earlier.
Confirm the proper entry has been added to the entitlements file for your game.
Add PassKit to Your Xcode Project
Finally, add PassKit as a weakly linked framework to your project. This can be done one of two ways described below. These options are identical in effect, it’s up to personal preference.
Option 1
Add weak_framework PassKit
to Other Linker Flags
in your project’s Build Settings.
Option 2
Add PassKit to Link Binary With Libraries
section of your project’s Build Phases, and mark as Optional.
You should now be able to complete a deposit via Apple Pay!
Test Apple Pay
When testing Apple Pay, be sure that:
- You are on a device that supports Apple Pay
- You have Apple Pay setup on your device
- The credit card on file is supported by Skillz (Visa, Mastercard)
NOTE
We only show the Apple Pay button to players if they meet the above conditions.
You will then need to test Apple Pay using a real credit card. But don’t worry, as long as the game is running in the Sandbox
environment, your credit card will not be charged!