objects/btc.rb
def create
    uri = uri('/receive', 'xpub': @xpub, 'callback': 'https://wts.zold.io/btc-hook', 'key': @key)
    res = Zold::Http.new(uri: uri).get
    unless res.code == 200
      raise UserError, "Can't acquire Bitcoin address from Blockchain.com (#{res.code}, try to reload the page)"
    end
    Zold::JsonPage.new(res.body).to_hash['address']
  end
# Create new BTC address to accept payments.
Create new BTC address to accept payments.
Create new BTC address to accept payments .
def create
    uri = uri('/receive', 'xpub': @xpub, 'callback': 'https://wts.zold.io/btc-hook', 'key': @key)
    res = Zold::Http.new(uri: uri).get
    unless res.code == 200
      raise UserError, "Can't acquire Bitcoin address from Blockchain.com (#{res.code}, try to reload the page)"
    end
    Zold::JsonPage.new(res.body).to_hash['address']
  end
def create uri = uri ( '/receive' , 'xpub' : @xpub , 'callback' : 'https://wts.zold.io/btc-hook' , 'key' : @key ) res = Zold :: Http . new ( uri : uri ) . get unless res . code == 200 raise UserError , "Can't acquire Bitcoin address from Blockchain.com (#{res.code}, try to reload the page)" end Zold :: JsonPage . new ( res . body ) . to_hash [ 'address' ] end
Create new BTC address to accept payments.
Create new BTC address to accept payments .