Last updated

Test an Apple Pay integration

This topic describes how to test your Apple Pay integration, and also how to diagnose issues related to the display of the Apple Pay button. This topic applies for FramePay, Rebilly Instruments, and Hosted Payment Forms.

For a guide on how to add Apple Pay to your FramePay integration, see Set up Apple Pay.

Prerequisites

The Apple Pay button only displays under certain circumstances, and when all of the following requirements are met:

  1. The domain you are trying to test on:
  2. The device you are testing on:
    • Is logged in with the Apple ID that you want to use for testing.
    • Is an Apple Pay supported device. Broadly, this means any device which supports Touch ID and is updated to the latest operating system version.
  3. You are viewing your page in the Safari web browser.
  4. The environment you are testing is set up to handle Apple Pay purchases. For example, the Ready To Pay API should return Apple Pay in the list of available purchase methods.

Test an Apple Pay integration with a live account

Use this process to test your Apple Pay integration with a real Apple ID. This process is used before going live and verifies that your integration is ready for customers to make Apple Pay purchases.

  1. Follow the steps to register your domain with Apple. When signed in with a live Apple ID, your domain must be registered to show the Apple Pay button.
  2. Sign in to your Apple Pay supported device with a live Apple ID.
  3. Open your page in Safari.
  4. Click the Apple Pay button and complete the purchase.

Test an Apple Pay integration with a sandbox tester account

Use this process to test your Apple Pay integration with an Apple sandbox tester account. Merchants and developers use this process to test their implementation of Apple Pay with test credit and debit cards. For example, when testing during development.

Your Apple ID needs to be part of the Apple Developer Program to be able to create Apple sandbox tester accounts.

Create an Apple sandbox tester account

To test Apple Pay, you need an Apple sandbox tester account which you use to make the payment. You log into your test device with this new Apple sandbox tester account, and make test purchases.

To create a sandbox tester account:

  1. Ensure you have a real Apple ID, and that it is part of the Apple Developer Program.
  2. In the App Store Connect, log in with your Apple ID and visit the Users and access page.
  3. In the sidebar, under Sandbox, click Testers.
  4. Click + and register a new account.
    • You must use a new unique email address for the account. You can not use any email account that has been previously associated with Apple. Using your email with a + will not work. You need access to the email in order to verify your account.
    • For region, choose one of the Apple Pay supported regions.

To log in to iCloud on your Apple test device, with your new Apple sandbox tester account:

  1. Ensure your test device's region is set to one of the Apple Pay supported regions.
  2. Sign in with your new sandbox tester account on your Apple Pay supported device.
    • These exact steps depend on which device you are using, but in general follow the normal process to sign in with your apple ID, but use your new Apple sandbox tester account credentials.
  3. Follow the 2FA prompts and activate 2FA for your account.
Important

If you mistakenly use a sandbox tester account to sign in to a production environment, like iTunes, the sandbox account becomes invalid and can not be used again. If this happens, create a new sandbox tester account with a new email address.

To add a test card to the account's wallet:

  1. Choosing a test card number from Apple's Sandbox testing page.
    • Note: if the card fails to add to your wallet, try another test card.
  2. Open Wallet on your test device.
  3. Follow the prompts to add a new card with manual entry

For more details see the Sandbox testing page of the Apple Pay developer docs.

Test an Apple Pay integration locally

  1. Make sure you meet all the prerequisites listed above.
  2. Sign in to your test device with your Apple sandbox tester account.
  3. Visit your test environment on your test device, in Safari.
  4. Click the Apple Pay button and complete the purchase.

Troubleshooting

The Apple Pay button does not show

Please check the Apple Pay on the web interactive demo.

If the Apple Pay button does not appear on that page:

  • Check that you are signed in on your test device with an Apple ID.
  • Check that region of your Apple ID, and the region that your device is set to, are both Apple Pay supported regions.
  • Check that you are testing with an Apple Pay supported device.
  • Check that you are viewing your page in the Safari web browser.

If the Apple Pay button appears on that page, but not in your integration:

  • Check that the domain you are trying to test on:
  • Check that your test environment is set up to allow Apple Pay purchases. For example, the Ready To Pay API should return Apple Pay in the list of available purchase methods.

ACCOUNT_UNAVAILABLE error when trying to log in on your test device with your sandbox tester account

Ensure the region you used to create the account in the developer console, and the region that your device is set to, are both Apple Pay supported regions.

Remember that test accounts that have signed into real services such as iTunes will become invalidated, and you need to create a new account.

"Could Not Sign In To iCloud" error when trying to sign in to my Apple device with my sandbox tester account

If you receive an error like:

Could Not Sign In To iCloud Your Apple ID "xxx@xxx.com" could not be used to sign in to iCloud. (34608)

Make sure you have updated your device to the latest version of iOS/macOS.

"This website does not accept the card that you have added to Wallet" error when clicking the Apple Pay button

Remove your test card and choose another card number from Apple's Sandbox Testing page.

The Apple Pay button shows, but clicking it does not do anything

If the console shows the message "Apple session was canceled", your Sandbox Tester account may have become invalid by being signed into a live Apple system. Complete the Create an Apple sandbox tester account process.

The Apple Pay button shows, but when trying to make a purchase the Apple Pay payment window stays as "Processing" and eventually results in "Payment Not Complete"

This occurs when you are showing the Apple Pay button on a non-registered domain.

See Apple Pay domain registration.

Useful resources