ODWApplePayLauncherDelegate
@objc
public protocol ODWApplePayLauncherDelegate : NSObjectProtocol
Delegate to hook into important events in the Apple Pay flow
Required
Implement ODWApplePayLauncherDelegate.applePaymentCreated(...)to get payment details that are needed when submitting a basket to the Olo Ordering API
Optional
Implement ODWApplePayLauncherDelegate.applePaymentCompleted(...) to know when the Apple Pay sheet is dismissed
-
Called after the customer has authorized Apple Pay and payment details have been created. Implement this method to submit payment details for payment processing. If payment processing fails, return an error so iOS can dismiss the Apple Pay sheet appropriately.
Declaration
Swift
@objc func applePaymentCreated(_ launcher: ODWApplePayLauncherProtocol, _ payment: ODWPaymentDataProtocol) -> NSError?Parameters
launcherThe Apple Pay launcher instance that caused this callback to be called
paymentThe data that represents the customer’s chosen payment method.
Return Value
nilif basket submission was successful, or an error if payment submission was unsuccessful -
Called after the Apple Pay sheet is dismissed with the status of the Apple Pay payment flow. Use this method to update the app state (e.g. display an error or an order receipt)
Declaration
Swift
@objc optional func applePaymentCompleted(_ launcher: ODWApplePayLauncherProtocol, _ status: ODWPaymentStatus, error: Error?)Parameters
launcherThe Apple Pay launcher instance that caused this callback to be called
statusThe status of the completed Apple Pay flow
errorThe error returned from
ODWApplePayLauncherDelegate.paymentCreated, if any.