PayPalPayLaterButton

@MainActor
public struct PayPalPayLaterButton : View

PayPal Pay Later payment button. Available in the colors PayPal blue, black, and white.

Initializer

  • Creates a PayPal Pay Later payment button.

    Declaration

    Swift

    @MainActor
    public init(
        authorization: String,
        universalLink: URL,
        fallbackURLScheme: String? = nil,
        request: BTPayPalCheckoutRequest,
        color: PayPalPayLaterButtonColor? = .blue,
        width: CGFloat? = 300,
        completion: @escaping (BTPayPalAccountNonce?, Error?) -> Void
    )

    Parameters

    authorization

    Required. A valid client token or tokenization key.

    universalLink

    Required. The URL to use for the PayPal app switch flow.Must be a valid HTTPS URL dedicated to Braintree app switch returns. This URL must be allow-listed in your Braintree Control Panel.

    fallbackURLScheme

    Optional. A custom URL scheme to use as a fallback if the universal link fails. Pass only the scheme name using alphanumeric characters, hyphens, and periods-without ‘://’ (e.g., "com.my-app.payments" not "com.my-app.payments://"). This scheme must be registered in your app’s Info.plist. You must also contact Braintree to register your URL scheme.

    request

    Required. The PayPal Checkout request. The button sets offerPayLater to true on this request.

    color

    Optional. The color of the button. Defaults to .blue.

    width

    Optional. The width of the button. Defaults to 300 px.

    completion

    The completion handler to handle client tokenize request success or failure on button press.

  • Declaration

    Swift

    @MainActor
    public var body: some View { get }