PayPalPayLaterButton
@MainActor
public struct PayPalPayLaterButton : View
PayPal Pay Later payment button. Available in the colors PayPal blue, black, and white.
-
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
authorizationRequired. A valid client token or tokenization key.
universalLinkRequired. 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.
fallbackURLSchemeOptional. 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.requestRequired. The PayPal Checkout request. The button sets
offerPayLatertotrueon this request.colorOptional. The color of the button. Defaults to
.blue.widthOptional. The width of the button. Defaults to 300 px.
completionThe completion handler to handle client tokenize request success or failure on button press.
-
Declaration
Swift
@MainActor public var body: some View { get }
View on GitHub