I'm new to nodejs. I now have a code like this.
var Coinpayments = require('coinpayments');
var cpayment = new Coinpayments({
key: 'api',
secret: 'api',
autoIpn: true
});
var address = cpayment.getCallbackAddress("BTC", function (err, response) {
console.log(response);
})
which answers the bellow response :
{ address: '3Du1WGxRf1bPZXrX1EyhdAYB4g113RnDeY' }
But I need the answer just like this:
'3Du1WGxRf1bPZXrX1EyhdAYB4g113RnDeY'
can anyone help me?
You'll want to access the value of the address key like this:
var Coinpayments = require('coinpayments');
var cpayment = new Coinpayments({
key: 'api',
secret: 'api',
autoIpn: true
});
var address = cpayment.getCallbackAddress("BTC", function (err, response) {
console.log(response.address);
})