Skip to content

dabibbit/bitpay-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gatewayd Bitpay Inbound Bridge Plugin

Plugin that hooks into the express.js application server in gatewayd, and records incoming bitcoin invoices and payments as deposits using the gatewayd javascript api.

Usage

In the Gatewaydfile.js of your gatewayd installation:

var BitpayGatewaydPlugin = require('bitpay-gatewayd-plugin');

module.exports = function(gatewayd) {
  var bitpayPlugin = new BitpayGatewaydPlugin({
    gatewayd: gatewayd,
    bitpayApiKey: gatewayd.config.get('BITPAY_API_KEY')
  }); 

  gatewayd.server.use('/bitpay', bitpayPlugin);
}

The bitpayPlugin object is simply an instance of the express.js Router class.

gatewayd.bitpayInvoices.create({
  amount: 0.002,
  destination: 'stevenzeiler',
  policy: 'deposit'  
})
.then(console.log)
.error(console.log);

gatewayd.bitpayInvoices.find({
  id: 9653
})
.then(console.log)
.error(console.log)

gatewayd.bitpayInvoices.pay({
  payment: { bitpayCallbackData },
  id: 9653
})
.then(console.log)
.error(console.log);

gatewayd.bitpayInvoices.delete({
  id: 9653
})
.then(console.log)
.error(console.log);

About

Inbound bridge for Bitcoins to Gatewayd on Ripple

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published