braintree-web/venmo

Members

(static) VERSION :string

The current version of the SDK, i.e. 3.46.0.

Source:

Methods

(static) create(options, callbackopt) → {Promise|void}

Parameters:
Name Type Attributes Description
options object

Creation options:

Properties
Name Type Attributes Default Description
client Client <optional>

A Client instance.

authorization string <optional>

A tokenizationKey or clientToken. Can be used in place of options.client.

allowNewBrowserTab boolean <optional>
true

This should be set to false if your payment flow requires returning to the same tab, e.g. single page applications. Doing so causes isBrowserSupported to return true only for mobile web browsers that support returning from the Venmo app to the same tab.

profileId string <optional>

The Venmo profile ID to be used during payment authorization. Customers will see the business name and logo associated with this Venmo profile, and it will show up in the Venmo app as a "Connected Merchant". Venmo profile IDs can be found in the Braintree Control Panel. Omitting this value will use the default Venmo profile.

deepLinkReturnUrl string <optional>

An override for the URL that the Venmo iOS app opens to return from an app switch.

callback callback <optional>

The second argument, data, is the Venmo instance. If no callback is provided, create returns a promise that resolves with the Venmo instance.

Source:
Example
braintree.venmo.create({
  client: clientInstance
}).then(function (venmoInstance) {
  // venmoInstance is ready to be used.
}).catch(function (createErr) {
  console.error('Error creating Venmo instance', createErr);
});

(static) isBrowserSupported(optionsopt) → {boolean}

Parameters:
Name Type Attributes Description
options object <optional>

browser support options:

Properties
Name Type Attributes Default Description
allowNewBrowserTab boolean <optional>
true

This should be set to false if your payment flow requires returning to the same tab, e.g. single page applications.

Source:
Examples
if (braintree.venmo.isBrowserSupported()) {
  // set up Venmo
}

Explicitly require browser support returning to the same tab

if (braintree.venmo.isBrowserSupported({
  allowNewBrowserTab: false
})) {
  // set up Venmo
}