Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon

Payment Processing Workflow

Save for later
  • 4 min read
  • 09 Feb 2016

article-image

In this article by Ernest Bruce, author of the book, Apply Pay Essentials, the author talks about actors and operations in the 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 the payment information to the issuing bank, to transfer the funds form the user's account to the acquiring bank, and to inform the user of the transaction status (approved or declined).

(For more resources related to this topic, see here.)

The payment processing workflow is made up of three phases:

  1. Preprocess phase: This is the phase where the app gets a charge token from the payment gateway, and it sends order information (including the charge token) to the order-processing server
  2. Process phase: This is the phase where the order-processing web app (running on your server) charges the user's card through the payment gateway, updates order and inventory data if the charge is successful, and sends the transaction status to the user app
  3. Postprocess phase: This is the phase where the user app informs the user about the status of the transaction and dismisses the payment sheet

As, in general, the payment-gateway API does not run appropriately in the Simulator app, you must use an actual iOS device to test the payment-processing workflow in your development environment. In addition to this, you need either a separate computer to run the order-processing web app or a proxy server that intercepts network traffic from the device and redirects the appropriate requests to your development computer. For details, see the documentation for the example project.

Actors and Operations in the Processing Workflow

The payment processing workflow is the process by which the payment information that is generated by Apple Pay from the payment request and the information that the user entered in the payment sheet is transmitted to your payment gateway and the card's issuing bank to charge the card and make the payment's funds available in your acquiring bank.

The workflow starts when the payment sheet calls the paymentAuthorizationViewController:didAuthorizePayment:completion: delegate method, providing the user app general order information (such as shipping and billing information) and a payment token containing encrypted-payment data.

This diagram depicts the actors, operations, and data that are part of the payment processing workflow:

Unlock access to the largest independent learning library in Tech for FREE!
Get unlimited access to 7500+ expert-authored eBooks and video courses covering every tech area you can think of.
Renews at $19.99/month. Cancel anytime

payment-processing-workflow-img-0

Payment_processing_workflow

These are the operations and data that are part of the workflow:

  • payment authorized: This is when the payment sheet tells the app that the user authorized the payment
  • payment token: This is when the app provides the payment token to the payment gateway, which returns a charge token
  • order info and charge token: This is when the app sends information about the order and the charge token to the order processing web app
  • charge card: This is when the web app charges the card through the payment gateway
  • approved or declined: This is when the payment gateway tells the web app whether the payment is approved or declined
  • transaction result and order metadata: This is when the web app provides the user app the result of the transaction and order information, such as the order number
  • transaction result: This is when the app tells the payment sheet the result of the payment transaction: approved, or declined
  • payment sheet done: This is when the payment sheet tells the app that the transaction is complete
  • dismiss: This is when the app dismisses the payment sheet

Summary

You can also check out the following books on Apple:

  • Mastering Apple Aperture, Thomas Fitzgerald by Packt Publishing
  • Apple Motion 5 Cookbook, Nick Harauz, by Packt Publishing

Resources for Article:


Further resources on this subject: