BTPaymentFlowRequestDelegate

Objective-C

@protocol BTPaymentFlowRequestDelegate

Swift

protocol BTPaymentFlowRequestDelegate

Protocol for payment flow processing.

  • Handle payment request for a variety of web/app switch flows.

    Use the delegate to handle success/error/cancel flows.

    Declaration

    Objective-C

    - (void)handleRequest:(nonnull BTPaymentFlowRequest *)request
                       client:(nonnull BTAPIClient *)apiClient
        paymentDriverDelegate:(nonnull id<BTPaymentFlowDriverDelegate>)delegate;

    Swift

    func handle(_ request: BTPaymentFlowRequest, client apiClient: BTAPIClient, paymentDriverDelegate delegate: BTPaymentFlowDriverDelegate)

    Parameters

    request

    A BTPaymentFlowRequest request.

    delegate

    The BTPaymentFlowDriverDelegate to handle response.

  • Check if this BTPaymentFlowRequestDelegate can handle the return URL

    Declaration

    Objective-C

    - (BOOL)canHandleAppSwitchReturnURL:(nonnull NSURL *)url;

    Swift

    func canHandleAppSwitchReturn(_ url: URL) -> Bool

    Parameters

    url

    The URL to check.

    Return Value

    True if the BTPaymentFlowRequestDelegate can handle the URL. Otherwise return false.

  • Handles the return URL and completes and post processing.

    Declaration

    Objective-C

    - (void)handleOpenURL:(nonnull NSURL *)url;

    Swift

    func handleOpen(_ url: URL)

    Parameters

    url

    The URL to check.

  • A short and unique alphanumeric name for the payment flow.

    Used for analytics/events. No spaces and all lowercase.

    Declaration

    Objective-C

    - (nonnull NSString *)paymentFlowName;

    Swift

    func paymentFlowName() -> String