Constructor
new InstantVerification(options)
Do not use this constructor directly. Use braintree-web.instant-verification.create instead.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
object |
Methods
getAchMandateDetails(options) → {Promise.<object>}
Fetches ACH mandate details for a specific mandate ID.
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
options |
object |
Options for fetching ACH mandate details. Properties
|
Example
instantVerificationInstance.getAchMandateDetails({
mandateId: 'mandate-id-from-tokenization'
})
.then(function (mandateDetails) {
console.log('Bank name:', mandateDetails.bankName);
console.log('Account holder:', mandateDetails.accountHolderName);
console.log('Last 4:', mandateDetails.last4);
console.log('Routing number:', mandateDetails.routingNumber);
})
.catch(function (err) {
if (err.code === 'INSTANT_VERIFICATION_MANDATE_ID_REQUIRED') {
console.error('A mandate ID is required');
} else if (err.code === 'INSTANT_VERIFICATION_MANDATE_DETAILS_FAILED') {
console.error('Failed to fetch mandate details:', err);
}
});
handleRedirect(options) → {Promise.<string>|BraintreeError}
Handle redirect back to merchant page from Instant Verification experience.
Parameters:
| Name | Type | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Options for the handling redirect back from Instant Verification UI. Properties
|
Example
const urlParams = new URL(window.location.href).searchParams;
instantVerificationInstance.handleRedirect({
success: urlParams.get('success');,
cancel: urlParams.get('cancel');,
error: urlParams.get('error');
})
.then((result) => {
if (result) {
console.log('nonce: %s', result);
} else {
console.log('empty result');
}
})
.catch((err) => {
console.error(error: ${JSON.stringify(err)}`);
})
startPayment(options) → {Promise|void}
Initiates the Instant Verification payment flow by redirecting to the authorization page.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
InstantVerification~startPaymentOptions |
The options for starting a payment session. |
Example
button.addEventListener('click', function () {
instantVerificationInstance.startPayment({
jwt: 'JWT_STRING_FROM_YOUR_SERVER',
}).catch(function (err) {
// Handle error
console.error(err);
});
});
Type Definitions
startPaymentOptions :object
Options used for startPayment
Properties:
| Name | Type | Description |
|---|---|---|
jwt |
string |
A JSON Web Token (JWT) containing the redirect URL and callback URL for the Instant Verification payment flow. |