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 Properties
|
- Source:
Example
var baseInitOptions = {
paymentRequest: {
currencyCode: 'USD',
subtotal: '1.00',
total: '1.00'
}
};
var initOptions = visaCheckoutInstance.createInitOptions(baseInitOptions);
console.log('initOptions with Braintree properties', initOptions);
V.init(initOptions);
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 Properties
|
|||||||||||||
callback |
callback |
<optional> |
The second argument, |
- Source:
Example
V.on('payment.success', function (payment) {
visaCheckoutInstance.tokenize(payment, function (err, tokenizePayload) {
if (err) {
console.error('There was an error tokenizing Visa Checkout', err);
return;
}
console.log('Send tokenizePayload.nonce to your server here!', tokenizePayload);
});
});
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
|
|||||||||
description |
string | A human-readable description. |
|||||||||
type |
string | The payment method type, always |
|||||||||
billingAddress |
VisaCheckout~Address | The customer's billing address. |
|||||||||
shippingAddress |
VisaCheckout~Address | The customer's shipping address. |
|||||||||
userData |
VisaCheckout~UserData | Information about the customer. |
- 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: