VisaCheckout

VisaCheckout

This class represents a Visa Checkout component produced by braintree-web/visa-checkout.create. Instances of this class have methods for interacting with Visa Checkout's JavaScript library.

Constructor

new VisaCheckout(options)

Do not use this constructor directly. Use braintree-web.visa-checkout.create instead.

Parameters:
Name Type Description
options object

The Visa Checkout create options.

Source:

Methods

createInitOptions(options) → {object}

Creates an initOptions object from the passed options, applying properties that Braintree needs to transact Visa Checkout.

Braintree will apply these properties if they do not exist on the given options:

  • apikey
  • externalClientId
  • settings.payment.cardBrands

Braintree will overwrite settings.dataLevel = 'FULL' to access the full payment method.

Parameters:
Name Type Description
options object

The base initOptions that will be used to init Visa Checkout.

Properties
Name Type Attributes Description
apikey string <optional>

The API key used to initialize Visa Checkout. When not supplied, Braintree will set this property.

externalClientId string <optional>

The external client ID key used to initialize Visa Checkout. When not supplied, Braintree will set this property.

settings object <optional>

The settings object used to initialize Visa Checkout.

Properties
Name Type Attributes Description
dataLevel string <optional>

The data level used to initialize Visa Checkout. Braintree will overwrite this property to 'FULL'.

payment object <optional>

The payment object used to initialize Visa Checkout.

Properties
Name Type Attributes Description
cardBrands Array.<string> <optional>

The card brands that Visa Checkout will allow the customer to pay with. When not supplied, Braintree will set this property.

Source:

teardown(callbackopt) → {Promise|void}

Cleanly tear down anything set up by create.

Parameters:
Name Type Attributes Description
callback callback <optional>

Called once teardown is complete. No data is returned if teardown completes successfully.

Source:
Examples
visaCheckoutInstance.teardown();

With callback

visaCheckoutInstance.teardown(function () {
  // teardown is complete
});

tokenize(payment, callbackopt) → {Promise|void}

Tokenizes the Visa Checkout payload, returning a payment method nonce.

Parameters:
Name Type Attributes Description
payment object

The object that Visa Checkout supplies on payment.success.

Properties
Name Type Description
callid string

Visa Checkout transaction ID associated with this payment.

encKey string

The encrypted key used to decrypt the payment data.

encPaymentData string

The encrypted payment data.

callback callback <optional>

The second argument, tokenizePayload is a tokenizePayload. If no callback is provided, tokenize returns a promise that resolves with the tokenizePayload.

Source:

Type Definitions

Address :object

Visa Checkout Address object.

Properties:
Name Type Description
countryCode string

The customer's country code.

extendedAddress string

The customer's extended address.

firstName string

The customer's first name.

lastName string

The customer's last name.

locality string

The customer's locality.

postalCode string

The customer's postal code.

region string

The customer's region.

streetAddress string

The customer's street address.

phoneNumber string

The customer's phone number.

Source:

tokenizePayload :object

Visa Checkout tokenize payload.

Properties:
Name Type Description
nonce string

The payment method nonce.

details object

Additional account details.

Properties
Name Type Description
cardType string

Type of card, ex: Visa, MasterCard.

lastFour string

Last four digits of card number.

lastTwo string

Last two digits of card number.

description string

A human-readable description.

type string

The payment method type, always VisaCheckoutCard.

billingAddress VisaCheckout~Address

The customer's billing address.

shippingAddress VisaCheckout~Address

The customer's shipping address.

userData VisaCheckout~UserData

Information about the customer.

binData object

Information about the card based on the bin.

Properties
Name Type Description
commercial string

Possible values: 'Yes', 'No', 'Unknown'.

countryOfIssuance string

The country of issuance.

debit string

Possible values: 'Yes', 'No', 'Unknown'.

durbinRegulated string

Possible values: 'Yes', 'No', 'Unknown'.

healthcare string

Possible values: 'Yes', 'No', 'Unknown'.

issuingBank string

The issuing bank.

payroll string

Possible values: 'Yes', 'No', 'Unknown'.

prepaid string

Possible values: 'Yes', 'No', 'Unknown'.

productId string

The product id.

Source:

UserData :object

Visa Checkout UserData object.

Properties:
Name Type Description
userEmail string

The customer's email address.

userFirstName string

The customer's first name.

userLastName string

The customer's last name.

userFullName string

The customer's full name.

userName string

The customer's username.

Source: