Testing Apple Pay
Apple Pay, developed by Apple Inc., serves as a mobile payment and digital wallet service enabling transactions through various Apple devices, such as iPhones and iPads. Testing with Apply Pay comes with challenges. This document aims to clarify some methods that are available for testing with iOS and Apple Pay.
There are important differences between Apple Pay on Real Devices and iOS Simulators. The iOS Simulator has the following limitations:
- The simulator only targets the front-end integration of Apple Pay and does not test the back-end integration.
- You can not add payment cards to the wallet on iOS simulators. So no Apply Pay sandbox testing cards, or any other real credit card.
- It is not possible to test the Apple Pay in-web flow.
- It is possible to test the Apple Pay in-app flow, but the Apple Pay in-app flow will not work the same way as with a Real iOS Devices. It will not return a payment token and will not properly process a payment.
Apple Pay on Real Private Devices
TestingBot provides private iOS devices, which are able to use Apple Pay. To make Apple Pay work on TestingBot's real private devices, please follow the steps below:
- Follow Apple's documentation to enable Appy Pay
- Set up Apple Pay integration in your iOS app, using the Apple documentation.
- Register your Merchant ID in your Apple developer account.
- Set up an Apple sandbox tester account. See the Apple Sandbox documentation for more information.
- Build your ipa file. Apple Pay will not work with enterprise certificates, which means it will not work by default on TestingBot's private devices. You will need to add the
udid
(iPhone/iPad unique id) of each private device assigned to you, to your Apple provisioning profile.- Log in to Apple's Developer Account
- Click Add Device
- Type in a device name and the UDID that you received from TestingBot.
- Save the device.
- Now add the new device to your Provisioning Profile
Passcode
One of the requirements to use Apple Pay, is that a passcode needs to be set on the device. Make sure that you set a passcode on your private iOS device.
TestingBot cleans every private device after every each test session. You will need to configure your Apple Pay Sandbox Testing account, including a passcode and sandbox cards, every time you want to test Apple Pay on an iOS real device.
If you want to disable this automated cleaning process, please reach out.
Apple Pay on iOS Simulators
iOS Simulators offer a feature where you can authorize Apple Pay by clicking a button in the Simulator's menu bar.
- Navigate to a point in your app where a payment sheet is visible.
- Click Features, then enable Authorize Apple Pay, or use the key combination (Command+SHIFT+A).
Apple Sandbox Test Cards
You can find a list of Test Cards and their details on Apple Pay's Sandbox Testing documentation page.
These test cards include Discover, Master Card, American Express, VISA and others. There are cards available for the USA, Europe, China and even Test Cards for Point of Sale Systems.
To use these, simply open the Wallet application on your iOS device and add the card number and expiration date.