How to use btcpay - 5 common examples

To help you get started, we’ve selected a few btcpay 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 djseeds / lncast / controllers / btcpay.js View on Github external
const getBtcPayClient = function(podcast) {
  const serverInfo = podcast.btcPayServer;
  const keyPair = btcpay.crypto.load_keypair(
      // eslint-disable-next-line new-cap
      new Buffer.from(serverInfo.privateKey, 'hex'));
  return new btcpay.BTCPayClient(
      serverInfo.serverUrl,
      keyPair,
      {merchant: serverInfo.merchantCode});
}
  ;
github djseeds / lncast / controllers / btcpay.js View on Github external
module.exports.pairClient = function(btcpayUrl, pairCode, callback) {
  const privKey = btcpay.crypto.generate_keypair().getPrivate().toString();
  // eslint-disable-next-line new-cap
  const keyPair = btcpay.crypto.load_keypair(new Buffer.from(privKey, 'hex'));
  new btcpay.BTCPayClient(btcpayUrl,
      keyPair)
      .pair_client(pairCode)
      .then(function(res) {
        callback(null, res.merchant, privKey);
      })
      .catch(function(err) {
        callback(err);
      });
};
github djseeds / lncast / controllers / btcpay.js View on Github external
module.exports.pairClient = function(btcpayUrl, pairCode, callback) {
  const privKey = btcpay.crypto.generate_keypair().getPrivate().toString();
  // eslint-disable-next-line new-cap
  const keyPair = btcpay.crypto.load_keypair(new Buffer.from(privKey, 'hex'));
  new btcpay.BTCPayClient(btcpayUrl,
      keyPair)
      .pair_client(pairCode)
      .then(function(res) {
        callback(null, res.merchant, privKey);
      })
      .catch(function(err) {
        callback(err);
      });
};
github djseeds / lncast / controllers / btcpay.js View on Github external
const getBtcPayClient = function(podcast) {
  const serverInfo = podcast.btcPayServer;
  const keyPair = btcpay.crypto.load_keypair(
      // eslint-disable-next-line new-cap
      new Buffer.from(serverInfo.privateKey, 'hex'));
  return new btcpay.BTCPayClient(
      serverInfo.serverUrl,
      keyPair,
      {merchant: serverInfo.merchantCode});
}
  ;
github djseeds / lncast / controllers / btcpay.js View on Github external
module.exports.pairClient = function(btcpayUrl, pairCode, callback) {
  const privKey = btcpay.crypto.generate_keypair().getPrivate().toString();
  // eslint-disable-next-line new-cap
  const keyPair = btcpay.crypto.load_keypair(new Buffer.from(privKey, 'hex'));
  new btcpay.BTCPayClient(btcpayUrl,
      keyPair)
      .pair_client(pairCode)
      .then(function(res) {
        callback(null, res.merchant, privKey);
      })
      .catch(function(err) {
        callback(err);
      });
};

btcpay

A nodejs client implementation for BTCPay

MIT
Latest version published 3 years ago

Package Health Score

39 / 100
Full package analysis

Popular btcpay functions