Class: FundAmerica::Investment

Inherits:
Object
  • Object
show all
Defined in:
lib/fund_america/investment.rb

Class Method Summary collapse

Class Method Details

.billing_logs(investment_id) ⇒ Object

End point: apps.fundamerica.com/api/investments/:id/billing_logs (GET) Usage: FundAmerica::Investment.billing_logs(investment_id) Output: Returns billing logs of an investment with matching id



45
46
47
# File 'lib/fund_america/investment.rb', line 45

def billing_logs(investment_id)
  API::request(:get, "investments/#{investment_id}/billing_logs")
end

.create(options) ⇒ Object

End point: apps.fundamerica.com/api/investments (POST) Usage: FundAmerica::Investment.create(options) Output: Creates a new investment



15
16
17
# File 'lib/fund_america/investment.rb', line 15

def create(options)
  API::request(:post, 'investments', options)
end

.delete(investment_id) ⇒ Object

End point: apps.fundamerica.com/api/investments/:id (DELETE) Usage: FundAmerica::Investment.delete(investment_id) Output: Deletes an investment with matching id



38
39
40
# File 'lib/fund_america/investment.rb', line 38

def delete(investment_id)
  API::request(:delete, "investments/#{investment_id}")
end

.details(investment_id) ⇒ Object

End point: apps.fundamerica.com/api/investments/:id (GET) Usage: FundAmerica::Investment.details(investment_id) Output: Returns the details of an investment with matching id



31
32
33
# File 'lib/fund_america/investment.rb', line 31

def details(investment_id)
  API::request(:get, "investments/#{investment_id}")
end

.investment_payments(investment_id) ⇒ Object

End point: apps.fundamerica.com/api/investments/:id/investment_payments (GET) Usage: FundAmerica::Investment.investment_payments(investment_id) Output: Returns investment_payments of an investment with matching id



52
53
54
# File 'lib/fund_america/investment.rb', line 52

def investment_payments(investment_id)
  API::request(:get, "investments/#{investment_id}/investment_payments")
end

.listObject

End point: apps.fundamerica.com/api/investments (GET) Usage: FundAmerica::Investment.list Output: Returns list of investments



8
9
10
# File 'lib/fund_america/investment.rb', line 8

def list
  API::request(:get, 'investments')
end

.update(investment_id, options) ⇒ Object

End point: apps.fundamerica.com/api/investments/:id (PATCH) Usage: FundAmerica::Investment.update(investment_id, options) Output: Updates an investment In sandbox mode status can be updated to received using test_mode url



23
24
25
26
# File 'lib/fund_america/investment.rb', line 23

def update(investment_id, options)
  end_point_url = FundAmerica.base_uri + "#{FundAmerica.mode == 'sandbox' ? 'test_mode/' : ''}" + "investments/#{investment_id}"
  API::request(:patch, end_point_url, options)
end