BTPayPalNativeCheckoutClient

@objc
public class BTPayPalNativeCheckoutClient : NSObject

Client used to collect PayPal payment methods. If possible, this client will present a native flow; otherwise, it will fall back to a web flow.

  • Initializes a PayPal Native client.

    Declaration

    Swift

    @objc(initWithAPIClient:)
    public init(apiClient: BTAPIClient)

    Parameters

    apiClient

    The Braintree API client

  • Tokenize a PayPal account for vault or checkout. On success, you will receive an instance of BTPayPalNativeCheckoutAccountNonce. On failure or user cancelation you will receive an error. If the user cancels out of the flow, the error code will equal BTPayPalNativeError.canceled.rawValue.

    Declaration

    Swift

    @objc(tokenizePayPalAccountWithPayPalRequest:completion:)
    public func tokenizePayPalAccount(
        with request: BTPayPalNativeRequest,
        completion: @escaping (BTPayPalNativeCheckoutAccountNonce?, Error?) -> Void
    )

    Parameters

    request

    Either a BTPayPalNativeCheckoutRequest or a BTPayPalNativeVaultRequest

    completion

    The completion will be invoked exactly once: when tokenization is complete or an error occurs.