Module: FundAmerica

Defined in:
lib/fund_america.rb,
lib/fund_america/api.rb,
lib/fund_america/error.rb,
lib/fund_america/entity.rb,
lib/fund_america/holding.rb,
lib/fund_america/version.rb,
lib/fund_america/api_info.rb,
lib/fund_america/investor.rb,
lib/fund_america/offering.rb,
lib/fund_america/bank_info.rb,
lib/fund_america/email_log.rb,
lib/fund_america/investment.rb,
lib/fund_america/billing_log.rb,
lib/fund_america/webhook_log.rb,
lib/fund_america/distribution.rb,
lib/fund_america/trade_review.rb,
lib/fund_america/aml_exception.rb,
lib/fund_america/background_check.rb,
lib/fund_america/escrow_agreement.rb,
lib/fund_america/investor_payment.rb,
lib/fund_america/ach_authorization.rb,
lib/fund_america/customer_agreement.rb,
lib/fund_america/investment_payment.rb,
lib/fund_america/entity_relationship.rb,
lib/fund_america/bank_transfer_method.rb,
lib/fund_america/electronic_signature.rb,
lib/fund_america/plaid_authentication.rb,
lib/fund_america/close_offering_request.rb,
lib/fund_america/subscription_agreement.rb,
lib/fund_america/cancel_offering_request.rb,
lib/fund_america/escrow_service_application.rb,
lib/fund_america/subscription_agreement_template.rb

Defined Under Namespace

Classes: API, AchAuthorization, AmlException, ApiInfo, BackgroundCheck, BankInfo, BankTransferMethod, BillingLog, CancelOfferingRequest, CloseOfferingRequest, CustomerAgreement, Distribution, ElectronicSignature, EmailLog, Entity, EntityRelationship, Error, EscrowAgreement, EscrowServiceApplication, Holding, Investment, InvestmentPayment, Investor, InvestorPayment, Offering, PlaidAuthentication, SubscriptionAgreement, SubscriptionAgreementTemplate, TradeReview, WebhookLog

Constant Summary collapse

VERSION =

The first version is being given as 0.0.1 The format is Major dot Minor dot patch Check the FundAmerica changelog regularly and add changes from it Increase the patch number

"0.0.7"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns API key or raises exception



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

def api_key
  defined? @api_key and @api_key or raise "FundAmerica.api_key not configured"
end

.modeObject

Returns mode and if mode is not set, it takes sandbox as mode Mode is either sandbox or production



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

def mode
  defined? @mode and @mode or @mode='sandbox'
end

Class Method Details

.base_uriObject

Sets the API endpoint based on mode The base uri here has the common url part in end points For each API request, the request specific element must be added An example for entities is: base_uri + ‘entities’



24
25
26
27
28
29
30
# File 'lib/fund_america.rb', line 24

def base_uri
  if mode == 'sandbox'
    @base_uri = 'https://sandbox.fundamerica.com/api/'
  else
    @base_uri = 'https://apps.fundamerica.com/api/'
  end
end

.basic_authObject

Returns basic authentication hash While making a request, merge this hash into options hash of request Request specific hash has to be merged into this hash with key as body The options hash would look like => {:username => ‘someapikey’}, :body => request_specific_options_hash}



37
38
39
40
41
42
43
# File 'lib/fund_america.rb', line 37

def basic_auth
  {
    :basic_auth => {
      :username => api_key
    }
  }
end