How to use the opennode.chargeInfo function in opennode

To help you get started, we’ve selected a few opennode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github opennodedev / opennode-node / examples / example.js View on Github external
/**
 * Setup your API Key and environment
 */
opennode.setCredentials('MY_API_KEY', 'dev');


/**
 *
 * Fetch charge information
 */

/**
 * Using promises
 */

opennode.chargeInfo('47bb5224-bf50-49d0-a317-4adfd345221a')
  .then(charge => {
    console.log(charge);
  })
  .catch(error => {
    console.error(`${error.status} | ${error.message}`);
  })

/**
 *
 * Using async/await
 */

;(async () => {

  try {
    const data = await opennode.chargeInfo('47bb5224-bf50-49d0-a317-4adfd345221a');
github opennodedev / opennode-node / examples / example.js View on Github external
;(async () => {

  try {
    const data = await opennode.chargeInfo('47bb5224-bf50-49d0-a317-4adfd345221a');
    console.log(data);
  }
  catch (error) {
    console.error(`${error.status} | ${error.message}`);
  }
})()

opennode

Node.js library for the OpenNode API.

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis