Start a Project

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

 

Exit mobile version