Book Image

Apple Pay Essentials

By : Ernest Bruce
Book Image

Apple Pay Essentials

By: Ernest Bruce

Overview of this book

Apple Pay, one of the most talked about offerings of the latest iOS 9 release, is a digital wallet and electronic payment system developed by Apple Inc. Paying in stores or within apps has never been easier or safer. Gone are the days of searching for your wallet, and the wasted moments finding the right card! Now you can use your credit cards and rewards cards with just a touch. It allows payment to merchants, using Near field Communication (NFC), and within iOS apps. Implementing Apple Pay within apps for payment is a bit tricky, but our book solves this problem for you. Whether you are a brand new iOS app developer or a seasoned expert, this book arms you with necessary skills to successfully implement Apple Pay in your online-payment workflow. Whether you are a brand new iOS app developer or a seasoned expert, this book arms you with the necessary skills to successfully implement Apple Pay. We start off by teaching you how to obtain the certificates necessary to encrypt customers’ payment information. We will use Xcode and Objective C for the interface and Node.js for server side code. You will then learn how to determine whether the customer can use Apple Pay, and how to create payment requests. You will come to grips with designing a payment-processor program to interact with the payment gateway. Finally, we take a look at a business-focused view of Apple Pay protocols and classes. By the end of this book, you will be able to build a fully functional Apple Pay-integrated iOS app
Table of Contents (13 chapters)

Chapter 4. Payment Processing Workflow

After the user authorizes the payment request, the user app, the payment gateway, and the order processing web app team up to securely deliver payment information to the issuing bank to transfer the funds from the user's account to the acquiring bank and to inform the user of the transaction status (that is, whether it is approved or declined).

The payment processing workflow is made up of three phases:

  1. Preprocess phase: In this phase, the app gets a charge token from the payment gateway and sends the order information (including the charge token) to the order processing server

  2. Process phase: In this phase, the order processing web app (running on your server) charges the user's card through the payment gateway, updates the order and inventory data if the charge is successful, and sends the transaction status to the user app

  3. Postprocess phase: In this, the user app informs the user about the status of the transaction and dismisses the payment sheet

This...