BraintreeError

BraintreeError

This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.

Constructor

new BraintreeError(options)

You cannot use this constructor directly. Interact with instances of this class through callbacks.

Parameters:
Name Type Description
options object

Construction options

Source:

Members

(static) American Express - getExpressCheckoutProfile Error Codes

Errors that occur when creating components.

Properties:
Name Type Description
AMEX_NONCE_REQUIRED MERCHANT

Occurs when a nonce is not provided to method.

AMEX_NETWORK_ERROR NETWORK

Occurs when there is an error communicating with the Braintree gateway.

Source:

(static) American Express - getRewardsBalance Error Codes

Errors that occur when creating components.

Properties:
Name Type Description
AMEX_NONCE_REQUIRED MERCHANT

Occurs when a nonce is not provided to method.

AMEX_NETWORK_ERROR NETWORK

Occurs when there is an error communicating with the Braintree gateway.

Source:

(static) Apple Pay - Creation Error Codes

Errors that occur when creating the Apple Pay component.

Properties:
Name Type Description
APPLE_PAY_NOT_ENABLED MERCHANT

Occurs when the authorization used is not authorized to process Apple Pay.

Source:

(static) Apple Pay - performValidation Error Codes

Errors that occur when validating.

Properties:
Name Type Description
APPLE_PAY_VALIDATION_URL_REQUIRED MERCHANT

Occurs when the validationURL option is not passed in.

APPLE_PAY_MERCHANT_VALIDATION_FAILED MERCHANT

Occurs when the website domain has not been registered in the Braintree control panel.

APPLE_PAY_MERCHANT_VALIDATION_NETWORK NETWORK

Occurs when an unknown network error occurs.

Source:

(static) Apple Pay - tokenize Error Codes

Errors that occur when tokenizing.

Properties:
Name Type Description
APPLE_PAY_PAYMENT_TOKEN_REQUIRED MERCHANT

Occurs when the token option is not passed in.

APPLE_PAY_TOKENIZATION NETWORK

Occurs when an unknown network error occurs.

Source:

(static) Client - Create Error Codes

Errors that may occur when creating the client

Properties:
Name Type Description
CLIENT_INVALID_AUTHORIZATION MERCHANT

Occurs when client token cannot be parsed.

Source:

(static) Client - Request Error Codes

Errors that may occur when using the request method

Properties:
Name Type Description
CLIENT_OPTION_REQUIRED MERCHANT

An option required in the request method was not provided. Usually options.method or options.endpoint

CLIENT_OPTION_INVALID MERCHANT

The request option provided is invalid.

CLIENT_GATEWAY_NETWORK MERCHANT

The Braintree gateway could not be contacted.

CLIENT_REQUEST_TIMEOUT NETWORK

The request took too long to complete and timed out.

CLIENT_REQUEST_ERROR NETWORK

The response from a request had status 400 or greater.

CLIENT_GRAPHQL_REQUEST_ERROR NETWORK

The response from a request to GraphQL contained an error.

CLIENT_RATE_LIMITED MERCHANT

The response from a request had a status of 429, indicating rate limiting.

CLIENT_AUTHORIZATION_INSUFFICIENT MERCHANT

The user assocaited with the client token or tokenization key does not have permissions to make the request.

Source:

(static) 3D Secure - cancelVerifyCard Error Codes

Errors that occur when using the cancelVerifyCard method.

Properties:
Name Type Description
THREEDS_NO_VERIFICATION_PAYLOAD MERCHANT

Occurs when the 3D Secure flow is canceled, but there is no 3D Secure information available.

Source:

(static) 3D Secure - Creation Error Codes

Errors that occur when creating the 3D Secure component.

Properties:
Name Type Description
THREEDS_NOT_ENABLED MERCHANT

Occurs when 3D Secure is not enabled in the Braintree control panel.

THREEDS_CAN_NOT_USE_TOKENIZATION_KEY MERCHANT

Occurs when 3D Secure component is created without a Client Token.

THREEDS_HTTPS_REQUIRED MERCHANT

Occurs when 3D Secure component is created in production over HTTPS.

Source:

(static) 3D Secure - verifyCard Error Codes

Errors that occur when using the verifyCard method.

Properties:
Name Type Description
THREEDS_AUTHENTICATION_IN_PROGRESS MERCHANT

Occurs when another verification is already in progress.

THREEDS_MISSING_VERIFY_CARD_OPTION MERCHANT

Occurs when a required option is missing.

Source:

(static) Data Collector - Creation Error Codes

Errors that occur when creating the Data Collector component.

Properties:
Name Type Description
DATA_COLLECTOR_KOUNT_NOT_ENABLED MERCHANT

Occurs when Kount is enabled in creation options but is not enabled on the Braintree control panel.

DATA_COLLECTOR_KOUNT_ERROR MERCHANT

Occurs when Kount errors while setting up.

DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS MERCHANT

Occurs when Kount or PayPal Fraudnet could not be enabled.

Source:

(static) Google Payment - Creation Error Codes

Errors that occur when creating the Google Payment component.

Properties:
Name Type Description
GOOGLE_PAYMENT_NOT_ENABLED MERCHANT

Occurs when Google Pay is not enabled on the Braintree control panel.

GOOGLE_PAYMENT_UNSUPPORTED_VERSION MERCHANT

Occurs when a Google Pay version is used that is not supported by the Braintree SDK.

Source:

(static) Google Payment - parseResponse Error Codes

Errors that occur when parsing the response from Google.

Properties:
Name Type Description
GOOGLE_PAYMENT_GATEWAY_ERROR UNKNOWN

Occurs when Google Pay could not be tokenized.

Source:

(static) Hosted Fields - Creation Error Codes

Errors that occur when creating the Hosted Fields component.

Properties:
Name Type Description
HOSTED_FIELDS_TIMEOUT UNKNOWN

Occurs when Hosted Fields does not finish setting up within 60 seconds.

HOSTED_FIELDS_INVALID_FIELD_KEY MERCHANT

Occurs when Hosted Fields is instantated with an invalid Field option.

HOSTED_FIELDS_INVALID_FIELD_SELECTOR MERCHANT

Occurs when Hosted Fields given a field selector that is not valid.

HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME MERCHANT

Occurs when Hosted Fields given a field selector that already contains an iframe.

HOSTED_FIELDS_FIELD_PROPERTY_INVALID MERCHANT

Occurs when a field configuration option is not valid.

Source:

(static) Hosted Fields - Field Manipulation Error Codes

Errors that occur when modifying fields through addClass, removeClass, setAttribute, removeAttribute, clear, and focus.

Properties:
Name Type Description
HOSTED_FIELDS_FIELD_INVALID MERCHANT

Occurs when attempting to modify a field that is not a valid Hosted Fields option.

HOSTED_FIELDS_FIELD_NOT_PRESENT MERCHANT

Occurs when attempting to modify a field that is not configured with Hosted Fields.

Source:

(static) Hosted Fields - Set Attribtue Error Codes

Errors that occur when using the setAttribtue method

Properties:
Name Type Description
HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED MERCHANT

Occurs when trying to set an attribtue that is not supported to be set.

HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED MERCHANT

Occurs when the type of value for an attribue is not allowed to be set.

Source:

(static) Hosted Fields - Tokenize Error Codes

Properties:
Name Type Description
HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR NETWORK

Occurs when the Braintree gateway cannot be contacted.

HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE CUSTOMER

Occurs when attempting to vault a card, but the client token being used is configured to fail if the card already exists in the vault.

HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED CUSTOMER

Occurs when cvv verification is turned on in the Braintree control panel.

HOSTED_FIELDS_FAILED_TOKENIZATION CUSTOMER

Occurs when the credit card details were sent to Braintree, but failed to tokenize.

HOSTED_FIELDS_FIELDS_EMPTY CUSTOMER

Occurs when all the Hosted Fields inputs are empty.

HOSTED_FIELDS_FIELDS_INVALID CUSTOMER

Occurs when one ore more fields are invalid.

Source:

(static) LocalPayment - Creation Error Codes

Errors that occur when creating the Local Payment component.

Properties:
Name Type Description
LOCAL_PAYMENT_NOT_ENABLED MERCHANT

Occurs when Local Payment is not enabled on the Braintree control panel.

Source:

(static) LocalPayment - startPayment Error Codes

Errors that occur when using the startPayment method.

Properties:
Name Type Description
LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION MERCHANT

Occurs when a startPayment is missing a required option.

LOCAL_PAYMENT_ALREADY_IN_PROGRESS MERCHANT

Occurs when a startPayment call is already in progress.

LOCAL_PAYMENT_INVALID_PAYMENT_OPTION MERCHANT

Occurs when a startPayment call has an invalid option.

LOCAL_PAYMENT_START_PAYMENT_FAILED NETWORK

Occurs when a startPayment call fails.

LOCAL_PAYMENT_TOKENIZATION_FAILED NETWORK

Occurs when a startPayment call fails to tokenize the result from authorization.

LOCAL_PAYMENT_WINDOW_CLOSED CUSTOMER

Occurs when the customer closes the Local Payment window.

LOCAL_PAYMENT_WINDOW_OPEN_FAILED MERCHANT

Occurs when the Local Payment window fails to open. Usualy because startPayment was not called as a direct result of a user action.

Source:

(static) Masterpass - Creation Error Codes

Errors that occur when creating the Masterpass component.

Properties:
Name Type Description
MASTERPASS_BROWSER_NOT_SUPPORTED CUSTOMER

Occurs when browser is not a supported browser for Masterpass.

MASTERPASS_NOT_ENABLED MERCHANT

Occurs when Masterpass is not enabled in the Braintree contorl panel.

Source:

(static) Masterpass - Tokenize Error Codes

Errors that occur when tokenizing.

Properties:
Name Type Description
MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION MERCHANT

Occurs when tokenize is called without a required option.

MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS MERCHANT

Occurs if tokenization flow is intialized while another flow is already in progress.

MASTERPASS_ACCOUNT_TOKENIZATION_FAILED NETWORK

Occurs when tokenization of Masterpass details fails.

MASTERPASS_POPUP_OPEN_FAILED MERCHANT

Occurs when the popup fails to open.

MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS MERCHANT

Occurs when Masterpass is missing required parameters for tokenization.

MASTERPASS_POPUP_CLOSED CUSTOMER

Occurs when the popup is closed by the customer.

MASTERPASS_INVALID_PAYMENT_OPTION MERCHANT

Occurs when an invalid payment option is used to tokenize Masterpass.

MASTERPASS_FLOW_FAILED NETWORK

Occurs when an error is returned from request to tokenize.

Source:

(static) Payment Request - canMakePayment Error Codes

Errors that occur when using the canMakePayment method

Properties:
Name Type Description
PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED MERCHANT

Occurs when the Payment Request is intatiated with misconfigured options.

PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED MERCHANT

Occurs when canMakePayment results in a DomException with a NotAllowedError. This usually occurs when canMakePayment is called multiple times with different supported payment options.

PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD MERCHANT

Occurs when canMakePayment is called with a supportedPaymentMethods array that contains a payment method that is not supported by the Braintree SDK.

PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED UNKNOWN

Occurs when canMakePayment fails for any reason other than a misconfigured Payment Request object.

Source:

(static) Payment Request - createSupportedPaymentMethodsConfiguration Error Codes

Errors that occur when using the createSupportedPaymentMethodsConfiguration method

Properties:
Name Type Description
PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE MERCHANT

Occurs when no type is supplied for method.

PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED MERCHANT

Occurs when configured type is not enabled.

Source:

(static) Payment Request - Creation Error Codes

Errors that occur when creating the Payment Request component.

Properties:
Name Type Description
PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS MERCHANT

Occurs when there are no valid payment methods configured.

Source:

(static) Payment Request - tokenize Error Codes

Errors that occur when using the tokenize method

Properties:
Name Type Description
PAYMENT_REQUEST_CANCELED CUSTOMER

Occurs when customer cancels the Payment Request.

PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED MERCHANT

Occurs when the Payment Request is closed do to the options being misconfigured.

PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE MERCHANT

Occurs when a Google Payment payment method is unable to be tokenized.

PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR UNKNOWN

Occurs when the result of tokenizing a Google Payment payment method could not be parsed.

PAYMENT_REQUEST_NOT_COMPLETED CUSTOMER

Occurs when an error prevented the Payment Request from being completed.

Source:

(static) PayPal - Creation Error Codes

Errors that occur when creating the PayPal component.

Properties:
Name Type Description
PAYPAL_NOT_ENABLED MERCHANT

Occurs when PayPal is not enabled on the Braintree control panel.

Source:

(static) PayPal - tokenize Error Codes

Errors that occur when using the tokenize method.

Properties:
Name Type Description
PAYPAL_TOKENIZATION_REQUEST_ACTIVE MERCHANT

Occurs when a tokenization request is already in progress.

PAYPAL_FLOW_OPTION_REQUIRED MERCHANT

Occurs when flow option is not provdided.

PAYPAL_ACCOUNT_TOKENIZATION_FAILED NETWORK

Occurs when PayPal account could not be tokenized.

PAYPAL_FLOW_FAILED NETWORK

Occurs when PayPal flow could not be initiated.

PAYPAL_POPUP_OPEN_FAILED MERCHANT

Occurs when PayPal window could not be opened.

PAYPAL_POPUP_CLOSED CUSTOMER

Occurs when customer closes the PayPal window before completing the flow.

PAYPAL_INVALID_PAYMENT_OPTION MERCHANT

Occurs when an invalid payment option is passed.

Source:

(static) PayPal Checkout - createPayment Error Codes

Errors that occur when using the createPayment method.

Properties:
Name Type Description
PAYPAL_FLOW_OPTION_REQUIRED MERCHANT

Occurs when a required option is missing.

PAYPAL_INVALID_PAYMENT_OPTION MERCHANT

Occurs when an option contains an invalid value.

PAYPAL_FLOW_FAILED NETWORK

Occurs when something goes wrong when initializing the flow.

Source:

(static) PayPal Checkout - Creation Error Codes

Errors that occur when creating the PayPal Checkout component.

Properties:
Name Type Description
PAYPAL_NOT_ENABLED MERCHANT

Occurs when PayPal is not enabled on the Braintree control panel.

PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED MERCHANT

Occurs only when testing in Sandbox, when a PayPal sandbox account is not linked to the merchant account in the Braintree control panel.

Source:

(static) PayPal Checkout - tokenizePayment Error Codes

Errors that occur when using the tokenizePayment method.

Properties:
Name Type Description
PAYPAL_ACCOUNT_TOKENIZATION_FAILED NETWORK

Occurs when PayPal account could not be tokenized.

Source:

(static) Shared Errors - Component Creation Error Codes

Errors that occur when creating components.

Properties:
Name Type Description
INSTANTIATION_OPTION_REQUIRED MERCHANT

Occurs when a component is created that is missing a required option.

INCOMPATIBLE_VERSIONS MERCHANT

Occurs when a component is created with a client with a different version than the component.

CLIENT_SCRIPT_FAILED_TO_LOAD NETWORK

Occurs when a component attempts to load the Braintree client script, but the request fails.

Source:

(static) Shared Errors - Component Instance Error Codes

Errors that occur when using instances of components.

Properties:
Name Type Description
METHOD_CALLED_AFTER_TEARDOWN MERCHANT

Occurs when a method is called on a component instance after it has been torn down.

BRAINTREE_API_ACCESS_RESTRICTED MERCHANT

Occurs when the client token or tokenization key does not have the correct permissions.

Source:

(static, readonly) types

Enum for BraintreeError types.

Properties:
Name Type Description
CUSTOMER string

An error caused by the customer.

MERCHANT string

An error that is actionable by the merchant.

NETWORK string

An error due to a network problem.

INTERNAL string

An error caused by Braintree code.

UNKNOWN string

An error where the origin is unknown.

Source:

(static) Union Pay - Creation Error Codes

Errors that occur when creating the Union Pay component.

Properties:
Name Type Description
UNIONPAY_NOT_ENABLED MERCHANT

Occurs when Union Pay is not enabled on the Braintree control panel.

Source:

(static) Union Pay - enroll Error Codes

Errors that occur when using the enroll method.

Properties:
Name Type Description
UNIONPAY_MISSING_MOBILE_PHONE_DATA MERCHANT

Occurs when no mobile phone data is provided.

UNIONPAY_EXPIRATION_DATE_INCOMPLETE MERCHANT

Occurs when expiration date is incomplete.

UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID CUSTOMER

Occurs when customer enrollment input is invalid.

UNIONPAY_ENROLLMENT_NETWORK_ERROR NETWORK

Occurs when there is an error during enrollment.

Source:

(static) Union Pay - fetchCapabilities Error Codes

Errors that occur when using the fetchCapabilities method.

Properties:
Name Type Description
UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR NETWORK

Occurs when there is an error looking up the Union Pay capabilities.

Source:

(static) Union Pay - Shared Error Codes

Errors that occur when starting the Union Pay Flow

Properties:
Name Type Description
UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES MERCHANT

Occurs when a method is used with both card details and a Hosted Fields instance.

UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID MERCHANT

Occurs when Hosted Fields instance used is not a valid Hosted Fields instance.

UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED MERCHANT

Occurs when neither card detals or Hosted Fields are used.

UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED MERCHANT

Occurs when Hosted Fields cannot be found on the page.

Source:

(static) Union Pay - tokenize Error Codes

Errors that occur when using the tokenize method.

Properties:
Name Type Description
UNIONPAY_FAILED_TOKENIZATION CUSTOMER

Occurs when data cannot be tokenized.

UNIONPAY_TOKENIZATION_NETWORK_ERROR NETWORK

Occurs when the Braintree gateway cannot be reached.

Source:

(static) Us Bank Account - Creation Error Codes

Errors that occur when creating the Us Bank Account component.

Properties:
Name Type Description
US_BANK_ACCOUNT_NOT_ENABLED MERCHANT

Occurs when US Bank Account is not enabled in the Braintree control panel.

Source:

(static) Us Bank Account - tokenize Error Codes

Errors that occur when using the tokenize method.

Properties:
Name Type Description
US_BANK_ACCOUNT_OPTION_REQUIRED MERCHANT

Occurs when a required option is not passed.

US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS MERCHANT

Occurs when 1 or more incompatible options are passsed.

US_BANK_ACCOUNT_LOGIN_LOAD_FAILED NETWORK

Occurs when bank login flow fails.

US_BANK_ACCOUNT_LOGIN_CLOSED CUSTOMER

Occurs when bank login window is closed.

US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE MERCHANT

Occurs when a bank login flow is already active.

US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR NETWORK

Occurs when payment details could not be tokenized.

US_BANK_ACCOUNT_FAILED_TOKENIZATION CUSTOMER

Occurs when payment details failed to be tokenized.

US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED MERCHANT

Occurs when bank login flow is not enabled in the Braintree control panel.

Source:

(static) Vault Manager - deletePaymentMethod Error Codes

Errors that occur when using the deletePaymentMethod method.

Properties:
Name Type Description
VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN MERCHANT

Occurs when vault manager is initalized with a tokenization key instead of a Client Token.

VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND MERCHANT

Occurs when the specified payment method can not be found.

VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR UNKNOWN

Occurs when there is an error attempting to delete the payment method.

Source:

(static) Venmo - Creation Error Codes

Errors that occur when creating the Venmo component.

Properties:
Name Type Description
VENMO_NOT_ENABLED MERCHANT

Occurs when Venmo is not enabled on the Braintree control panel.

VENMO_INVALID_PROFILE_ID MERCHANT

Occurs when Venmo is intilaized with a profile id, but it is invalid.

Source:

(static) Venmo - tokenize Error Codes

Errors that occur when using the tokenize method.

Properties:
Name Type Description
VENMO_TOKENIZATION_REQUEST_ACTIVE MERCHANT

Occurs when tokenize is called when the flow is already in progress.

VENMO_APP_FAILED UNKNOWN

Occurs when tokenization fails.

VENMO_APP_CANCELED CUSTOMER

Occurs when customer cancels flow from the Venmo app.

VENMO_CANCELED CUSTOMER

Occurs when customer cancels the flow or Venmo app is not available.

Source:

(static) Visa Checkout - createInitOptions Error Codes

Errors that occur when using the createInitOptions method.

Properties:
Name Type Description
VISA_CHECKOUT_INIT_OPTIONS_REQUIRED MERCHANT

Occurs when no options are provided to method.

Source:

(static) Visa Checkout - Creation Error Codes

Errors that occur when creating the Visa Checkout component.

Properties:
Name Type Description
VISA_CHECKOUT_NOT_ENABLED MERCHANT

Occurs when Visa Checkout is not enabled in the Braintree control panel.

Source:

(static) Visa Checkout - tokenize Error Codes

Errors that occur when using the tokenize method.

Properties:
Name Type Description
VISA_CHECKOUT_PAYMENT_REQUIRED MERCHANT

Occurs when no payment data is not provided.

VISA_CHECKOUT_TOKENIZATION NETWORK

Occurs when tokenization fails.

Source:

code :string

A code that corresponds to specific errors.

Source:

details :object

Additional information about the error, such as an underlying network error response.

Source:

message :string

A short description of the error.

Source:

type :BraintreeError.types

The type of error.

Source: