Class: PushPay::Fund

Inherits:
Base
  • Object
show all
Defined in:
lib/pushpay/fund.rb

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from PushPay::Base

Instance Method Details

#create(params, organization_key: nil) ⇒ Object

Create a fund



21
22
23
# File 'lib/pushpay/fund.rb', line 21

def create(params, organization_key: nil)
  client.post("#{organization_path(organization_key)}/funds", params)
end

#delete(fund_key, organization_key: nil) ⇒ Object

Delete a fund



36
37
38
# File 'lib/pushpay/fund.rb', line 36

def delete(fund_key, organization_key: nil)
  client.delete("#{organization_path(organization_key)}/fund/#{fund_key}")
end

#find(fund_key, organization_key: nil) ⇒ Object

Get a specific fund



6
7
8
# File 'lib/pushpay/fund.rb', line 6

def find(fund_key, organization_key: nil)
  client.get("#{organization_path(organization_key)}/fund/#{fund_key}")
end

#list(merchant_key: nil, **params) ⇒ Object

List funds for a merchant



11
12
13
# File 'lib/pushpay/fund.rb', line 11

def list(merchant_key: nil, **params)
  client.get("#{merchant_path(merchant_key)}/funds", params)
end

#list_for_organization(organization_key: nil, **params) ⇒ Object

List funds for an organization



16
17
18
# File 'lib/pushpay/fund.rb', line 16

def list_for_organization(organization_key: nil, **params)
  client.get("#{organization_path(organization_key)}/funds", params)
end

#update(fund_key, params, organization_key: nil) ⇒ Object

Update a fund



26
27
28
# File 'lib/pushpay/fund.rb', line 26

def update(fund_key, params, organization_key: nil)
  client.put("#{organization_path(organization_key)}/fund/#{fund_key}", params)
end

#update_status(fund_key, params, organization_key: nil) ⇒ Object

Change fund status (open/close)



31
32
33
# File 'lib/pushpay/fund.rb', line 31

def update_status(fund_key, params, organization_key: nil)
  client.patch("#{organization_path(organization_key)}/fund/#{fund_key}", params)
end