braintree-web/masterpass

Processes Masterpass. This component is currently in beta and is subject to change.

Source:

Members

(static) VERSION :string

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

Source:

Methods

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

Parameters:
Name Type Attributes Description
options object

Creation options:

Properties
Name Type Description
client Client

A Client instance.

callback callback <optional>

The second argument, data, is the Masterpass instance. If no callback is passed in, the create function returns a promise that resolves the Masterpass instance.

Source:
Example
braintree.masterpass.create({
  client: clientInstance
}, function (createErr, masterpassInstance) {
  if (createErr) {
    if (createErr.code === 'MASTERPASS_BROWSER_NOT_SUPPORTED') {
      console.error('This browser is not supported.');
    } else {
      console.error('Error!', createErr);
    }
    return;
  }
});

(static) isSupported() → {Boolean}

Returns true if Masterpass supports this browser.

Source:
Example
if (braintree.masterpass.isSupported()) {
  // Add Masterpass button to the page
} else {
  // Hide Masterpass payment option
}