TokenDetails

Details about the payment card used to create a payment token

TokenDetails provides the payment card information needed to match a token returned by the SDK with payment card information input by a buyer.

Properties

JS
JavaScript

try {

  const result = await card.tokenize();

  alert(`Payment for  ${result.details.card.brand},

    number ${result.details.card.last4}

    expiration year ${result.details.card.expYear} was processed`);

} catch (e) {

    e.errorList.forEach(err => {

      const li = document.createElement('li');

      li.innerText = err.message;

      document.querySelector('#errors').appendChild(li);

    });

}