BTVenmoClient
@objc
public class BTVenmoClient : NSObject
extension BTVenmoClient: BTAppContextSwitchClient
Used to process Venmo payments
-
Creates a Venmo client
Declaration
Swift
@objc(initWithAPIClient:) public init(apiClient: BTAPIClient)
Parameters
apiClient
An API client
-
Initialize a new Venmo client instance.
Declaration
Swift
@objc(initWithAPIClient:universalLink:) public convenience init(apiClient: BTAPIClient, universalLink: URL)
Parameters
apiClient
The API Client
universalLink
The 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
request
A Venmo request.
completion
This 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
AnError
describing 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 -> BTVenmoAccountNonce
Parameters
request
Return Value
On success, you will receive an instance of
BTVenmoAccountNonce
-
Returns true if the proper Venmo app is installed and configured correctly, returns false otherwise.
Declaration
Swift
@objc public func isVenmoAppInstalled() -> Bool
-
Switches to the App Store to download the Venmo application.
Declaration
Swift
@objc public func openVenmoAppPageInAppStore()