Type Method

paymentContactInvalidError(withContactField:localizedDescription:)

Creates a contact error with the supplied field and user-facing error message.

Declaration

class func paymentContactInvalidError(withContactField field: PKContactField, localizedDescription: String?) -> Error

Parameters

field

A value from PKContactField that indicates which part of the contact information has an error.

localizedDescription

Optional. Provide a localized, user-facing error message string to help the user resolve the error.

Discussion

You can use this convenience method to create a payment error object instead of creating an NSError object yourself. This method indicates an error in the contact information that is received from an Apple Pay sheet.

The error you provide and its optional message appear on the Apple Pay sheet. The available space to display messages is limited, so you should keep your messages concise.

See Also

Providing Error Information

class func paymentBillingAddressInvalidError(withKey: String, localizedDescription: String?) -> Error

Creates a billing address error with the supplied key and user-facing error message.

class func paymentShippingAddressInvalidError(withKey: String, localizedDescription: String?) -> Error

Creates a shipping address error with the supplied key and user-facing error message.

class func paymentShippingAddressUnserviceableError(withLocalizedDescription: String?) -> Error

Creates an error for an unserviceable address, with the supplied user-facing error message.