paymentCouponCodeInvalidError(localizedDescription:)
Returns an error object that indicates an invalid coupon.
Declaration
static func paymentCouponCodeInvalidError(localizedDescription: String? = nil) -> any ErrorParameters
- localizedDescription:
A user-readable error as a localized string.
Return Value
A new invalid coupon error.
Discussion
Use this convenience method to create a payment error object instead of creating an NSError object yourself. This method indicates that the coupon code received from the Apple Pay sheet is invalid.
The error you provide and its optional message appear on the Apple Pay sheet. There’s limited available space to display messages, so keep your messages concise.
See Also
Providing error information
paymentBillingAddressInvalidError(withKey:localizedDescription:)paymentContactInvalidError(withContactField:localizedDescription:)paymentShippingAddressInvalidError(withKey:localizedDescription:)paymentShippingAddressUnserviceableError(withLocalizedDescription:)paymentCouponCodeExpiredError(localizedDescription:)