braintree-web/client

Members

(static) VERSION :string

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

Source:

Methods

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

This function is the entry point for the braintree.client module. It is used for creating Client instances that service communication to Braintree servers.

Parameters:
Name Type Attributes Description
options object

Object containing all Client options:

Properties
Name Type Description
authorization string

A tokenizationKey or clientToken.

callback callback <optional>

The second argument, data, is the Client instance.

Source:
Example
var createClient = require('braintree-web/client').create;

createClient({
  authorization: CLIENT_AUTHORIZATION
}, function (createErr, clientInstance) {
  if (createErr) {
    if (createErr.code === 'CLIENT_AUTHORIZATION_INVALID') {
      // either the client token has expired, and a new one should be generated
      // or the tokenization key was deactivated or deleted
    } else {
      console.log('something went wrong creating the client instance', createErr);
    }
    return;
  }

 // set up other components
});