Blog / Development / ios app development

7-8 minutes

How to Integrate Apple Pay into Your App and Website

apple pay logo

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.

  1. Is Apple Pay a good fit for your business?
  2. Preparation stage
  3. Implementation stage

Is Apple Pay a good fit for your business?

iPhone, IPad, MacBook with Apple Pay

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)
  • tickets

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.

Preparation stage

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.

Apple Pay integration screenshot

 

After that, choose iOS, tvOS, watchOS (from the pop-up menu).

Then, choose App ID in the Identifiers section.

Apple Pay integration screenshot

Click add button “+

Apple Pay integration screenshot

Enter your name in the Name field.

Apple Pay integration screenshot

After that, enter Bundle ID as instructed.

Apple Pay integration screenshot

Check Apple Pay Payment Processing box in the Apple Services section and click Continue -> Submit.

Apple Pay integration screenshot

Then, find Merchant ID in the left column.

Apple Pay integration screenshot

Click add button “+ in the upper right corner.

Apple Pay integration screenshot

You’ll see this page:

Apple Pay integration screenshot

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.

Apple Pay integration screenshot

After that, select your merchant ID and check the box.

Apple Pay integration screenshot

Now, your App ID should look like this:

Apple Pay integration screenshot

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.

Apple Pay integration screenshot

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.

Apple Pay integration screenshot

After that, click Choose file and choose your CSR to upload.

Click Choose – > Continue -> Download.

Apple Pay integration screenshot

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.

Apple Pay integration screenshot

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.

Apple Pay integration screenshot

Refresh the page — you’ll see your Merchant ID in the Merchant IDs field.

Finally, make sure that all Steps are checked.

Implementation stage

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.
  • for website (on Safari only), use JavaScript-based APIs. You can find detailed instructions on how to do this here.

2. Create an Apple Pay button and mark

ApplePay payment sheet

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!

Final thoughts

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.

 

Ivanna is a Content Marketing Manager of GBKSOFT passionate about tech advancements, marketing, and startups. Her dream is to make the virtual world a better place with the help of a written word.


Leave a comment
Close

Leave a Reply


Similar Blog Articles

Illustration_web_development

Business

How Much Money Do You Need to Build a Business Website?

In today’s digitized world, having a website is no longer optional — especially for large and rapidly growing businesses. And it doesn’t matter if you work in a B2C or B2B segment because we all judge companies by their online presence. For this reason, making a business website not just visually appealing but also high-functioning...

Rating — 5 (4 voices)

Development

Swift VS Objective-C: What language to Choose in 2018?

Created by Apple and for Apple, Swift is the most rapidly growing programming language nowadays. As an alternative to the well-known Objective-C, Swift has the significant pool of advantages putting it to the leading positions in iOS development. Here are the most crucial of them:

Rating — 4.9 (10 voices)
Top 3 360 Camera Apps for iPhone and Android

Development

Best 360 Camera Apps for iPhone and Android: Secrets of Development.

Nowadays we are surrounded by content. We scroll newsfeed, we browse websites, we see ads on the streets, we listen to the radio and watch TV. Our brain gets used to processing the enormous amount of information and it “smoothes” the majority of things we see otherwise our heads would become overloaded. It’s hard to...

Rating — 5 (6 voices)

Categories

All articles Business Company News Development Marketing StartUp App Ideas UI and Design

Tell us

About your project

We’ll estimate your project and give first advice within 24 hours!

We use cookies to improve your experience with our site, including analytics and personalization. By continuing to use the service, you agree to our use of cookies as described in the Privacy Policy.

Testimonials

Garrett
They proved to be very good and they’re very reliable as well. They are quite conscientious. They will go the extra yard to make sure we're happy. Reliable
Devan
They write clean code, adhere to deadlines, and communicate extremely well. I strongly recommend anyone from the GBKSOFT agency and hope to work with them again myself. Clean Code
Aaron
I’ve been using GBK Soft for the past 3 years and they have been great. Communication is unparalleled to other app development companies. I’ve continued to return to them to improve my iOS app countless times and I will continue to do so in the future. I highly recommend this company! Improve
13
App Futura ExtractGood FirmsClutchAwwwards