Check Mobile App
Read now

Implement Apple pay in swift 5


During the presentation on the 9th of September 2014, Apple introduced Apple Pay — its own system of mobile payments.

Apple pay allows iPhone 6 and iPhone 6+ users, as well as those who have new versions of Apple Watch easily shop online now, and benefit from apple pay app integration as well as make payments with the help of NFC (Near Field Communication) Technology. Touch ID or Face ID technologies are used for payment authorization.

How to Set Up Apple Pay in The App

To set up your environment to implement Apple Pay in your apps, you must complete these steps:

  1. Create a Merchant ID
  2. Configure Apple Pay capabilities in Xcode for your project
  3. Create a sandbox user in iTunes Connect
  4. Add a test card
  5. Create a payment request in your project
  6. Handle the result

Step 1: Create a Merchant ID from your Apple Developer Account.

Steps 2: Configure Apple Pay capabilities in Xcode for your project

Steps 3: Create a sandbox user in iTunes Connect

Login this sandbox account in the device or simulator.

Steps 4: Add a test card in the account

Please click here for demo card details.

Steps 5:  Create a payment request for the project.
First, create UI For apple pay.

Import the PassKit Library in ViewController

Create a Payment Request in the ViewController

Handle the Apple Pay button action and make payment request

Steps 6: Handle the result

Confirm the PKPaymentAuthorizationViewControllerDelegate in the View Controller

Now run your app.

In this way, you can integrate Apple pay in your app. I hope you understand the whole process. If you have any queries or suggestions please comment below.

Thank you


. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


  • Anand
    Hello Sir/ma’am

    i am ios developer and integrate apple pay in my application and i have follw this step.but how i can test app in india? is it possible to test app in an indian appstore account?

  • aksa
    sir can you plx tell me how can i put the condition in this, if the payment is done go to home view controller else do something?
    • Debabrata Roy (Moderator)
      After payment is done paymentAuthorizationViewControllerDidFinish method will be called, so you can put your condition inside this method.
  • Ankit Kumar Gupta
    how would I know that the payment is successful or failed?Please do let me know?
  • Ankit
    If we send -> completion(PKPaymentAuthorizationResult(status: .success, errors: nil)) , then the payment gets charged
  • HM
    This is wonderful tutorial on google.
    i want to know
    1. how to test apple pay using live stripe key, in india.
    2. how to test apple pay using live app india.
  • Rafat
    Just I am confused how to integrate this Ui pay view controller with my main app
    If the customer pay the app will automatically installed and show him my main app storyboard view controller
    Please send me your details
  • css.php

    Big thanks to Webkul and his team for helping get Opencart release ready!

    Deniel Kerr

    Owner and Founder. Opencart

    Talk to Sales
    Start a Project

      Message Sent!

      If you have more details or questions, you can reply to the received confirmation email.

      Back to Home