class Gyft::Client::Transactions
Public Class Methods
new(client)
click to toggle source
# File lib/gyft/client/transactions.rb, line 3 def initialize client @client = client end
Public Instance Methods
all()
click to toggle source
# File lib/gyft/client/transactions.rb, line 13 def all @client.get('/reseller/transactions').map do |transaction| transaction[:client] = @client Gyft::Transaction.new(transaction) end end
find(id)
click to toggle source
# File lib/gyft/client/transactions.rb, line 7 def find id transaction = @client.get("/reseller/transaction/#{id}") transaction[:client] = @client Gyft::Transaction.new(transaction) end
first(number_of_records)
click to toggle source
# File lib/gyft/client/transactions.rb, line 20 def first number_of_records @client.get("/reseller/transactions/first/#{number_of_records}").map do |transaction| transaction[:client] = @client Gyft::Transaction.new(transaction) end end
last(number_of_records)
click to toggle source
# File lib/gyft/client/transactions.rb, line 27 def last number_of_records @client.get("/reseller/transactions/last/#{number_of_records}").map do |transaction| transaction[:client] = @client Gyft::Transaction.new(transaction) end end
refund(id)
click to toggle source
# File lib/gyft/client/transactions.rb, line 34 def refund id transaction = @client.post("/reseller/transaction/refund", id: id) transaction[:client] = @client Gyft::Refund.new(transaction) end