Type Aliases
The following type aliases are available globally.
-
An empty block, called with no arguments, returning nothing.
Declaration
Swift
public typealias OPVoidBlock = () -> Void -
A callback used to return an error during the ApplePay completion flow
Declaration
Swift
public typealias OPApplePayCompletionBlock = (_ error: Error?) -> VoidParameters
errorThe error that occurred when submitting an ApplePay payment method to Olo’s Ordering API, or
nilif no error occurred -
A completion handler used when generating payment methods
Declaration
Swift
public typealias OPPaymentMethodCompletionBlock = (_ paymentMethod: OPPaymentMethodProtocol?, _ error: Error?) -> VoidParameters
paymentMethodThe payment method from the response. Will be
nilif an error occurs.errorThe error returned from the response, or nil if no error occurred.
-
A completion handler used when generating CVV update tokens
Declaration
Swift
public typealias OPCvvTokenUpdateCompletionBlock = (_ token: OPCvvUpdateTokenProtocol?, _ error: Error?) -> VoidParameters
tokenThe CVV Update token from the response. Will be
nilif an error occurserrorThe error returned from the response, or nil if no error occured
-
A block used for returning an image associated with the card brand parameter
Declaration
Swift
public typealias OPCardBrandImageBlock = (_ cardBrand: OPCardBrand) -> UIImage?Parameters
cardBrandThe brand to get an image for
Return Value
An image associated with the given brand, or nil
-
A block used for returning an error message based on the current state of the Card control
Declaration
Swift
public typealias OPCardErrorMessageBlock = (_ cardState: NSDictionary, _ cardBrand: OPCardBrand, _ ignoreUneditedFieldErrors: Bool) -> StringParameters
cardStateA representation of the current state of the card input control
cardBrandThe detected brand of the card number entered by the user
ignoreUneditedFieldErrorsIf true, only fields that have been edited should be considered when generating an error message. If false, all fields should be considered.
Return Value
An error message, or empty string if no message should be displayed
-
A block used for returning an error message based on the current state of the CVV control
Declaration
Swift
public typealias OPCvvErrorMessageBlock = (_ cvvFieldState: OPCardFieldStateProtocol, _ ignoreUneditedFieldErrors: Bool) -> StringParameters
cvvFieldStateA representation of the current state of the CVV control
ignoreUneditedFieldErrorsIf true, only fields that have been edited should be considered when generating an error message. If false, all fields should be considered.
Return Value
An error message, or empty string if no message should be displayed
Type Aliases Reference