创建地址回调

时间:2015-07-04 13:59:02

标签: ruby-on-rails ruby coinbase-api

我正在尝试使用Coinbase的Ruby API来管理我应用中的用户钱包。目前,在注册时,会为用户创建一个新钱包。

def create_account
  wallet = Coinbase::Wallet::Client.new(api_key: ENV["COINBASE_KEY"], api_secret: ENV["COINBASE_SECRET"])
  mAccount = check_account
  if mAccount.nil?
    mAccount = wallet.create_account(name: self.email)
  end
  newaddr = mAccount.create_address
  newaddr = newaddr["address"]
  account = Account.new
  account.address = newaddr
  account.user_id = self.id
  account.balance = mAccount["balance"]["amount"]
  account.account_id = mAccount["id"]
  account.save
end

这是我用来创建钱包和钱包内的地址的代码。我的问题是:如何通过api调用将回调网址附加到地址?我想要包括几个参数,如“secret”和“account_id”。

0 个答案:

没有答案