module Tapbot::Client::Transactions
Public Instance Methods
create_transaction(to, amount, comments="", earn=false, app_id="")
click to toggle source
# File lib/tapbot/client/transactions.rb, line 19 def create_transaction(to, amount, comments="", earn=false, app_id="") response = self.class.post("/transactions", { :body => {:transaction => { to: to, amount: amount, comments: comments, earn: earn, app_id: app_id }}.to_json, headers: auth_headers("/transactions", { :transaction => { to: to, amount: amount, comments: comments, earn: earn, app_id: app_id }}.to_json)}) raise Tapbot::Error, response["errors"][0] unless response.success? response end
transaction_details(id)
click to toggle source
# File lib/tapbot/client/transactions.rb, line 13 def transaction_details(id) response = self.class.get("/transactions/#{id}", headers: auth_headers("/transactions/#{id}")) raise Tapbot::Error, response["errors"][0] unless response.success? response end
transaction_list(options={})
click to toggle source
# File lib/tapbot/client/transactions.rb, line 5 def transaction_list(options={}) page = options[:page] || 1 paginate = options[:paginate] || 50 response = self.class.get("/transactions?paginate=#{paginate}&page=#{page}", headers: auth_headers("/transactions?paginate=#{paginate}&page=#{page}")) raise Tapbot::Error, response["errors"][0] unless response.success? response end