Skip to content

Authorizing Charge

Tom Kay edited this page May 13, 2020 · 4 revisions

To initialize the payment authorization

ChargeHive.authorizeCharge();

To react to the authorization response, set up event listeners:

ChargeHive.addEventListener(
  ChargeHive.events.ON_SUCCESS,
  function (event)
  {
    console.info("ON_SUCCESS", event.detail);
  }
);

ChargeHive.addEventListener(
  ChargeHive.events.ON_DECLINED,
  function (event)
  {
    console.info('ON_DECLINED', event.detail);
  }
);

ChargeHive.addEventListener(
  ChargeHive.events.ON_ERROR,
  function (event)
  {
    console.info('ON_ERROR', event.detail);
  }
);
Clone this wiki locally