braintree-web/venmo

Members

(static) VERSION :string

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

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.

allowWebviews boolean <optional>
true

This should be set to false if your payment flow does not occur from within a webview that you control. Doing so causes isBrowserSupported to return true only for mobile web browsers that are not webviews.

ignoreHistoryChanges boolean <optional>
false

When the Venmo app returns to the website, it will modify the hash of the url to include data about the tokenization. By default, the SDK will put the state of the hash back to where it was before the change was made. Pass true to handle the hash change instead of the SDK.

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.

requireManualReturn boolean <optional>
false

When true, the customer will have to manually switch back to the browser/webview that is presenting Venmo to complete the payment.

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:
Examples
braintree.venmo.create({
  client: clientInstance
}).then(function (venmoInstance) {
  // venmoInstance is ready to be used.
}).catch(function (createErr) {
  console.error('Error creating Venmo instance', createErr);
});

Allow desktop flow to be used

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.

allowWebviews boolean <optional>
true

This should be set to false if your payment flow does not occur from within a webview that you control.

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
}

Explicitly set webviews as disallowed browsers

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