Class: FundAmerica::Offering

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

Class Method Summary collapse

Class Method Details

.billing_logs(offering_id) ⇒ Object

End point: apps.fundamerica.com/api/offerings/:id/billing_logs (GET) Usage: FundAmerica::Offering.billing_logs(offering_id) Output: Returns billing logs of an offering with matching id



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

def billing_logs(offering_id)
  API::request(:get, "offerings/#{offering_id}/billing_logs")
end

.create(options) ⇒ Object

End point: apps.fundamerica.com/api/offerings (POST) Usage: FundAmerica::Offering.create(options) Output: Creates a new offering



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

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

.delete(offering_id) ⇒ Object

End point: apps.fundamerica.com/api/offerings/:id (DELETE) Usage: FundAmerica::Offering.delete(offering_id) Output: Deletes an offering with matching id



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

def delete(offering_id)
  API::request(:delete, "offerings/#{offering_id}")
end

.details(offering_id) ⇒ Object

End point: apps.fundamerica.com/api/offerings/:id (GET) Usage: FundAmerica::Offering.details(offering_id) Output: Returns the details of an offering with matching id



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

def details(offering_id)
  API::request(:get, "offerings/#{offering_id}")
end

.escrow_ledger(offering_id) ⇒ Object

End point: apps.fundamerica.com/api/offerings/:id/escrow_ledger (GET) Usage: FundAmerica::Offering.escrow_ledger(offering_id) Output: Returns escrow_ledger of an offering with matching id



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

def escrow_ledger(offering_id)
  API::request(:get, "offerings/#{offering_id}/escrow_ledger")
end

.investment_payments(offering_id) ⇒ Object

End point: apps.fundamerica.com/api/offerings/:id/investment_payments (GET) Usage: FundAmerica::Offering.investment_payments(offering_id) Output: Returns investment_payments of an offering with matching id



59
60
61
# File 'lib/fund_america/offering.rb', line 59

def investment_payments(offering_id)
  API::request(:get, "offerings/#{offering_id}/investment_payments")
end

.listObject

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



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

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

.update(offering_id, options) ⇒ Object

End point: apps.fundamerica.com/api/offerings/:id (PATCH) Usage: FundAmerica::Offering.update(offering_id, options) Output: Updates an offering In sandbox mode accept_investments can only be updated



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

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