-1

我是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'

谁能帮我?

4

1 回答 1

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);
})
于 2018-08-29T03:54:53.340 回答