InstantVerification

InstantVerification

This class represents an InstantVerification component. Instances of this class open an InstantVerification window for paying using banking account details in specific regions. Any additional UI, such as disabling the page while authentication is taking place, is up to the developer.

Constructor

new InstantVerification(options)

Do not use this constructor directly. Use braintree-web.instant-verification.create instead.

Parameters:
Name Type Description
options object

see instant-verification.create

Source:

Methods

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
Name Type Attributes Description
success string <optional>

URL query param returned from Instant Verification UI

cancel string <optional>

URL query param return from Instant Verification UI

error string <optional>

URL query param return from Instant Verification UI

Source:
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.

Source:
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.

Source: