Class: Transfers

Inherits:
OpenPayResource show all
Defined in:
lib/openpay/transfers.rb

Instance Attribute Summary

Attributes inherited from OpenPayResource

#api_hook

Instance Method Summary collapse

Methods inherited from OpenPayResource

#delete, #delete_all, #env, #errors?, #get_with_custom_url, #hash2json, #initialize, #json2hash, #post, #put

Constructor Details

This class inherits a constructor from OpenPayResource

Instance Method Details

#all(customer_id) ⇒ Object



10
11
12
13
# File 'lib/openpay/transfers.rb', line 10

def all(customer_id)
  customers=@api_hook.create(:customers)
  customers.all_transfers(customer_id)
end

#create(transfer, customer_id) ⇒ Object



5
6
7
8
# File 'lib/openpay/transfers.rb', line 5

def create(transfer, customer_id)
  customers=@api_hook.create(:customers)
  customers.create_transfer(customer_id, transfer)
end

#each(customer_id) ⇒ Object



20
21
22
23
24
25
# File 'lib/openpay/transfers.rb', line 20

def each(customer_id)
  customers=@api_hook.create(:customers)
  customers.each_transfer(customer_id) do |tran|
    yield tran
  end
end

#get(transfer, customer_id) ⇒ Object



15
16
17
18
# File 'lib/openpay/transfers.rb', line 15

def get(transfer, customer_id)
  customers=@api_hook.create(:customers)
  customers.get_transfer(customer_id, transfer)
end

#list(search_params, customer_id = nil) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/openpay/transfers.rb', line 27

def list(search_params, customer_id=nil)
  if customer_id
    customers=@api_hook.create(:customers)
    customers.list_transfers(customer_id, search_params)
  else
    super search_params
  end
end