Constructor
new VaultManager(options)
You cannot use this constructor directly. Use braintree.vault-manager.create instead.
Parameters:
Name | Type | Description |
---|---|---|
options |
object |
Options |
- Source:
Methods
fetchPaymentMethods(optionsopt, callbackopt) → {Promise|void}
Fetches payment methods owned by the customer whose id was used to generate the client token used to create the client.
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
Options for fetching payment methods. Properties
|
||||||||||
callback |
callback |
<optional> |
The second argument is a fetchPaymentMethodsPayload. This is also what is resolved by the promise if no callback is provided. |
- Source:
Example
vaultManagerInstance.fetchPaymentMethods(function (err, paymentMethods) {
paymentMethods.forEach(function (paymentMethod) {
// add payment method to UI
// paymentMethod.nonce <- transactable nonce associated with payment method
// paymentMethod.details <- object with additional information about payment method
// paymentMethod.type <- a constant signifying the type
});
});
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
vaultManagerInstance.teardown();
vaultManagerInstance.teardown(function () {
// teardown is complete
});
Type Definitions
fetchPaymentMethodsPayload :array
The customer's payment methods.
Properties:
Name | Type | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
paymentMethod |
object |
The payment method object. Properties
|
- Source: