diff --git a/lib/fund_america/ach_authorization.rb b/lib/fund_america/ach_authorization.rb index c8a9e4e..7103bc9 100644 --- a/lib/fund_america/ach_authorization.rb +++ b/lib/fund_america/ach_authorization.rb @@ -5,8 +5,8 @@ class << self # End point: https://apps.fundamerica.com/api/ach_authorizations (GET) # Usage: FundAmerica::AchAuthorization.list # Output: Returns list of ach_authorizations - def list - API::request(:get, 'ach_authorizations') + def list(options = {}) + API::request(:get, 'ach_authorizations', options) end # End point: https://apps.fundamerica.com/api/ach_authorizations (POST) diff --git a/lib/fund_america/distribution.rb b/lib/fund_america/distribution.rb index 94818bb..8b954c8 100644 --- a/lib/fund_america/distribution.rb +++ b/lib/fund_america/distribution.rb @@ -19,15 +19,15 @@ def details(distribution_id) # End point: https://apps/fundamerica.com/api/distributions/:id/investor_payments # Usage: FundAmerica::Distribution.investor_payments(distribution_id) # Output: Returns the investor_payments associated with distribution - def investor_payments(distribution_id, page, per) - API::request(:get, "distributions/#{distribution_id}/investor_payments?page=#{page}&per=#{per}") + def investor_payments(distribution_id, options = {}) + API::request(:get, "distributions/#{distribution_id}/investor_payments", options) end # End point: https://apps/fundamerica.com/api/distributions/:id/non_investor_payments # Usage: FundAmerica::Distribution.non_investor_payments(distribution_id) # Output: Returns the non_investor_payments associated with distribution - def non_investor_payments(distribution_id, page, per) - API::request(:get, "distributions/#{distribution_id}/non_investor_payments?page=#{page}&per=#{per}") + def non_investor_payments(distribution_id, options = {}) + API::request(:get, "distributions/#{distribution_id}/non_investor_payments", options) end end diff --git a/lib/fund_america/investment.rb b/lib/fund_america/investment.rb index 5e17a83..477c2ac 100644 --- a/lib/fund_america/investment.rb +++ b/lib/fund_america/investment.rb @@ -53,6 +53,13 @@ def investment_payments(investment_id) API::request(:get, "investments/#{investment_id}/investment_payments") end + # End Point: https://api.fundamerica.com/api/investments/:id/invest (POST) + # Usage: FundAmerica::Investment.invested(investment_id) + # Output: If the investment is “received” and “cleared” you’ll get a 200 and the status will be updated. + def invested(investment_id) + API::request(:post, "investments/#{investment_id}/invest") + end + end end end