我是nodejs的新手。我现在有这样的代码。
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: '3Du1WGxRf1bPZXrX1EyhdAYB4g113RnDeY' }
但是我需要这样的答案:
'3Du1WGxRf1bPZXrX1EyhdAYB4g113RnDeY'
有人可以帮助我吗?
答案 0 :(得分:0)
您将要像这样访问地址键的值:
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);
})