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

    launcher

    The Apple Pay launcher instance that caused this callback to be called

    payment

    The data that represents the customer’s chosen payment method.

    Return Value

    nil if 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

    launcher

    The Apple Pay launcher instance that caused this callback to be called

    status

    The status of the completed Apple Pay flow

    error

    The error returned from ODWApplePayLauncherDelegate.paymentCreated, if any.