A customizable error type that you create to indicate problems with the address or contact information on an Apple Pay sheet.
- Safari Desktop 11.0+
- Safari Mobile 11.0+
- Apple Pay JS
When you determine that there is a problem with an address or contact information on the payment sheet, you can use
Apple to create a customized error message. Apple Pay highlights the area with an error and displays your message, making it easier for users to correct errors.
Users must resolve any errors that you report on the Apple Pay sheet before they can finalize their transaction.
The details you provide in an Apple Pay error include:
code—An error code that identifies the area of the error.
contactField—The specific field on the payment sheet with the error.
message—Your custom error message to display on the payment sheet.
For example, if you found an error in the postal code of the shipping address, create an
Apple with the custom message text
"ZIP Code is invalid", as follows:
On the payment sheet, Apple Pay highlights the postal code field and displays the message text.