BTVenmoClient
@objc
public class BTVenmoClient : NSObject
extension BTVenmoClient: BTAppContextSwitchClient
Used to process Venmo payments
-
Initialize a new Venmo client instance.
Declaration
Swift
@objc(initWithAuthorization:universalLink:) public init(authorization: String, universalLink: URL)Parameters
authorizationA valid client token or tokenization key used to authorize API calls.
universalLinkThe URL for the Venmo app to redirect to after user authentication completes. Must be a valid HTTPS URL dedicated to Braintree app switch returns.
-
Initiates Venmo login via app switch, which returns a BTVenmoAccountNonce when successful.
Declaration
Swift
@objc(tokenizeWithVenmoRequest:completion:) public func tokenize(_ request: BTVenmoRequest, completion: @escaping (BTVenmoAccountNonce?, Error?) -> Void)Parameters
requestA Venmo request.
completionThis completion will be invoked when app switch is complete or an error occurs. On success, you will receive an instance of
BTVenmoAccountNonce; on failure or user cancelation you will receive an error. If the user cancels out of the flow, the error code will be.canceled. -
tokenize(_:Asynchronous) Initiates Venmo login via app switch, which returns a BTVenmoAccountNonce when successful.
Throws
AnErrordescribing the failure. If the user cancels out of the flow, the error code will be.canceled.Declaration
Swift
public func tokenize(_ request: BTVenmoRequest) async throws -> BTVenmoAccountNonceParameters
requestReturn Value
On success, you will receive an instance of
BTVenmoAccountNonce -
Switches to the App Store to download the Venmo application.
Declaration
Swift
@objc public func openVenmoAppPageInAppStore()
View on GitHub