In today’s fast-paced world, people want to reduce time spent on routine tasks as much as possible. We all expect online purchases to be easy and convenient. And this, basically, means that we want to buy things with just one click without wasting our precious minutes on entering billing, shipping and contact information each time at the checkout.
Apple Pay service was introduced in 2014 and it has more than 252 million users worldwide today. Why did it become so popular in such a short time-span? The main reason is that Apple Pay allowed iPhone, Apple Watch, iPad and Mac owners to get rid of their physical wallets and make secure payments in stores, in iOS apps and on the web with the help of their Apple devices.
According to Statista, as of March 2018, 35 percent of online merchants globally accepted Apple Pay. Want to join them? In this article, we’ll try to explain how to add Apple Pay to your website or app.
Is Apple Pay a good fit for your business?
We already mentioned that users just love Apple Pay because it’s an easy and convenient way to make purchases. So the advantages for buyers are pretty much obvious. But what about the selling side? Let’s look into this.
Apple Pay covers a wide range of transactions and allows online merchants to sell almost anything:
- physical goods (for example, clothes, groceries, books etc.)
- services (for example, club membership)
- bookings (for example, hotel reservations)
However, some reasonable exceptions still exist. For example, it’s not allowed to use Apple Pay for selling such goods as cigarettes, tobacco products, weapons, pornography etc. You may find the full list of prohibited uses here.
If your business activity doesn’t fall within the above exceptions, there should be no doubts: integration of Apple Pay into your website or app is the right decision.
Note: Apple Pay does not replace In-App Purchase. You still need the later to sell virtual goods, for example, premium content and subscriptions within your iOS application.
Do You Need a Apple 'pay in' mode?
This stage does not require any coding, you just need to create the environment for Apple Pay integration.
First of all, you need to find a payment provider that supports Apple Pay in your region. To do this, see this list on the Apple Pay page. This is the optional but highly recommended step because if you don’t have the established system in place, handling card payments can be quite challenging.
Also, make sure that Apple Pay is available in your country (see the full list of countries and regions here).
For Apple Pay on the web, web pages that incorporate Apple Pay must be served over HTTPS and support TLS 1.2 protocol.
Now, you have to set up Apple Pay Requirements.
1. Create a Merchant ID
Merchant ID is needed to identify your business as a merchant that can accept Apple Pay payments on your website or mobile app. That’s easy. Just log in to your developer account here and go to Certificates, Identifiers & Profiles.
After that, choose iOS, tvOS, watchOS (from the pop-up menu).
Then, choose App ID in the Identifiers section.
Click add button “+”
Enter your name in the Name field.
After that, enter Bundle ID as instructed.
Check Apple Pay Payment Processing box in the Apple Services section and click Continue -> Submit.
Then, find Merchant ID in the left column.
Click add button “+” in the upper right corner.
You’ll see this page:
Add a description (it can be just the name of your app or website) and identifier name in the following format: merchant.com.YourAppName. After that, click Continue.
Review the Settings and click Register -> Done.
Now, navigate to App ID (which we’ve just created). Check Apple Pay Payment Processing box and click Edit.
After that, select your merchant ID and check the box.
Now, your App ID should look like this:
2. Create Payment Processing Certificate
Payment Processing Certificate is needed to encrypt and secure outgoing payment data. How to set up it? Follow the steps below.
Navigate to Certificates, Identifiers & Profiles -> Identifiers -> Merchant IDs.
After that, select your merchant ID on the right and click Edit.
You’ll see Payment Processing Certificate section. Click Create Certificate.
Certificate signing request
If you don’t have a certificate signing request (CSR), you need to create it to create. To do this, launch Keychain Access that is Mac OS system utility. It’s located in /Applications/Utilities on your Mac.
Then, choose Certificate Assistant -> Request a Certificate from a Certificate Authority.
Enter necessary information: your email address in the User Email Address field and a name for the key in the Common Name field. The third field, CA Email Address, should be left empty.
Click Save to disk -> Continue.
Check out this Apple help page to make sure that you didn’t miss anything.
To proceed with Payment Processing Certificate creation, click Choose file. Then select CSR file (it has .certSigningRequest extension) and click Choose – > Continue -> Download.
The downloaded certificate file will have .cer extension. Click Done.
Note: you need to recreate your Payment Processing Certificate every 25 months.
3. Create Merchant Identity Certificate (for websites only)
This certificate is needed to authenticate communication with the Apple Pay servers. To create it, follow the steps below.
Navigate to Certificates, Identifiers & Profiles -> Identifiers -> Merchant IDs. Select your merchant ID on the right and click Edit.
Under Merchant Identity Certificate Section, click Create Certificate.
After that, click Choose file and choose your CSR to upload.
Click Choose – > Continue -> Download.
The downloaded certificate file will have .cer extension. Click Done.
Note: you need to recreate your Merchant Identity Certificate every 25 months.
4. Register and verify your domain (for websites only)
To register a domain, navigate to Certificates, Identifiers & Profiles -> Identifiers -> Merchant IDs. Select your merchant ID on the right and click Edit.
Under Merchant Domains Section, click Add domain.
After that, enter your domain name and click Continue -> Download.
Place the file in the specified location and click Verify. After the verification is completed, click Done.
Note: you’ll need to verify a domain every time its SSL certificate expires.
Watch this video to make sure that you didn’t miss anything.
5. Enable Apple Pay in Xcode (for apps only)
Go to XCode and click the file icon in the upper left corner.
Select the target project and you’ll see the project editor on the right. Choose Capabilities.
You’ll see Apple Pay section. Turn it ON.
Refresh the page — you’ll see your Merchant ID in the Merchant IDs field.
Finally, make sure that all Steps are checked.
This is the part where coding starts. If you have some basic programming knowledge, you can do it yourself. Alternatively, if you don’t feel confident about writing a code and want to do things right, reach out to your developer or contact us. We are ready to help!
1. Support Apple Pay on your app or website
First of all, you need APIs that will allow you to determine if a user has the Apple Pay capable device and if Apple Pay is set up on it. To check Apple Pay availability:
- for app, use PassKit framework. You can find detailed instructions on how to do this here.
2. Create an Apple Pay button and mark
All websites and apps that accept Apple Pay must display Apple Pay mark and Apple Pay button whenever payment options are shown.
- download Apple Pay mark and see its usage guidelines here.
- choose your button style here.
- refer to Apple Pay on Web and Apple Pay pages for detailed programming guidelines.
3. Customize a payment sheet
Tapping the Apple Pay button should lead to a payment sheet (see on the right). Such payment sheet must contain information that is required to complete the purchase, for example, payment card details, shipping options, contact information etc. It’s up to you to decide what information to present on a payment sheet, but you cannot request data that is not related to the transaction.
For detailed instruction on customizing Apple Pay payment sheet, see Human Interface Guidelines.
Congratulations! You’ve just implemented Apple Pay in your app/website!
Integration of Apple Pay into the app or website is one of the easiest and cheapest ways for merchants to improve customer experience. We all want to be cared for and we really appreciate if a company not just tries to sell us stuff, but also makes our life easier. Follow the steps in this article to implement Apple Pay yourself.
If you need any assistance, our iOS developers are ready to help.