fund_america 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 136d970c9bce8151a127ce98ab90f8a6e2952009
4
- data.tar.gz: 59427c4157ebc98a365294f0ccd83c5ace8f54ab
3
+ metadata.gz: c6acc1a01eebae1c79f7532d2fd0cab848d22686
4
+ data.tar.gz: 88e45bd272f2cfd3473283a82e4f38bd946b2712
5
5
  SHA512:
6
- metadata.gz: 93266a647c58cfe28d31d372bd2fd05b4f2a3f2f706355b6f55e543708e78b0dc68a4c423e00d9d2f01ac458c879311dc03170b35b2c3035a71fa3537f9861a4
7
- data.tar.gz: 8b69f0eecae5db59295b2fedfddd718390d282fbaf3a58daaa93b1b3f7a794b1c6c4b1bb0297e58215e446b966cfab7e5035ade4fd80b9c87c927c44a0077b5e
6
+ metadata.gz: d852871d977ee7de39016b31f3a54df4df0b2c82dbb62d76c7979f0cef7cad1cc206cf52dbd2e9daad6391ed67efd196f92accef349265c8c421c488fa737810
7
+ data.tar.gz: fa9c23ca914d415316c423a3a46be2dbd49c1e24e63b8f125e995c1251021a0d7d0bc161a116ef9725dec12ab80c26111ae90b37057136d90c033c9287824b80
data/README.md CHANGED
@@ -20,19 +20,19 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- The details on usage of FundAmerica gem are present at: http://www.rubyeffect.com/blog/category/fundamerica/. If you wish to see FundAmerica's API documentation, please visit the url: https://apps.fundamerica.com/support/documentation
24
-
25
- 1. [FundAmerica Gem Introductory Post](http://www.rubyeffect.com/blog/fundamerica-gem/)
26
- 2. [Entity Endpoints Part One](http://www.rubyeffect.com/blog/fundamerica-gem-entity-endpoints/)
27
- 3. [Entity Endpoints Part Two](http://www.rubyeffect.com/blog/fundamerica-gem-entity-endpoints-part-two/)
28
- 4. [API Info](http://www.rubyeffect.com/blog/fundamerica-gem-api-info-ach-authorizations/)
29
- 5. [ACH Authorizations](http://www.rubyeffect.com/blog/fundamerica-gem-api-info-ach-authorizations/)
30
- 6. [Background Checks](http://www.rubyeffect.com/blog/fundamerica-gem-background-checks-bank-info/)
31
- 7. [Bank Info](http://www.rubyeffect.com/blog/fundamerica-gem-background-checks-bank-info/)
32
- 8. [Error Handling](http://www.rubyeffect.com/blog/fundamerica-gem-error-handling/)
33
- 9. [Offerings](http://www.rubyeffect.com/blog/fundamerica-gem-offerings/)
34
- 10. [Cancel Offering Request](http://www.rubyeffect.com/blog/fundamerica-gem-cancel-close-offering-requests/)
35
- 11. [Close Offering Request](http://www.rubyeffect.com/blog/fundamerica-gem-cancel-close-offering-requests/)
23
+ The details on usage of FundAmerica gem are present at: http://blog.rubyeffect.com/category/fundamerica/. If you wish to see FundAmerica's API documentation, please visit the url: https://apps.fundamerica.com/support/documentation
24
+
25
+ 1. [FundAmerica Gem Introductory Post](http://blog.rubyeffect.com/fundamerica-gem/)
26
+ 2. [Entity Endpoints Part One](http://blog.rubyeffect.com/fundamerica-gem-entity-endpoints/)
27
+ 3. [Entity Endpoints Part Two](http://blog.rubyeffect.com/fundamerica-gem-entity-endpoints-part-two/)
28
+ 4. [API Info](http://blog.rubyeffect.com/fundamerica-gem-api-info-ach-authorizations/)
29
+ 5. [ACH Authorizations](http://blog.rubyeffect.com/fundamerica-gem-api-info-ach-authorizations/)
30
+ 6. [Background Checks](http://blog.rubyeffect.com/fundamerica-gem-background-checks-bank-info/)
31
+ 7. [Bank Info](http://blog.rubyeffect.com/fundamerica-gem-background-checks-bank-info/)
32
+ 8. [Error Handling](http://blog.rubyeffect.com/fundamerica-gem-error-handling/)
33
+ 9. [Offerings](http://blog.rubyeffect.com/fundamerica-gem-offerings/)
34
+ 10. [Cancel Offering Request](http://blog.rubyeffect.com/fundamerica-gem-cancel-close-offering-requests/)
35
+ 11. [Close Offering Request](http://blog.rubyeffect.com/fundamerica-gem-cancel-close-offering-requests/)
36
36
 
37
37
  ## TODO
38
38
 
@@ -45,7 +45,15 @@ The details on usage of FundAmerica gem are present at: http://www.rubyeffect.co
45
45
 
46
46
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
47
47
 
48
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
48
+ To install this gem onto your local machine, run `bundle exec rake install`.
49
+
50
+ ### Running tests
51
+
52
+ To the run tests get a sandbox key from `https://sandbox.fundamerica.com/accounts/<your-account>/api_keys` then run:
53
+
54
+ ```console
55
+ $ env FUND_AMERICA_SANDBOX_KEY='<YOUR-SANDBOX-KEY>' rspec
56
+ ```
49
57
 
50
58
  ## Contributing
51
59
 
@@ -59,13 +67,14 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
59
67
 
60
68
  1. Dan M (https://github.com/dan987)
61
69
  2. Charles S (https://github.com/Designbookcom)
70
+ 3. David Reid (https://github.com/dreid)
62
71
 
63
72
  ## About RubyEffect
64
73
 
65
- ![RubyEffect](http://www.rubyeffect.com/blog/wp-content/uploads/2015/05/cropped-re_original_logo.png)
74
+ ![RubyEffect](http://blog.rubyeffect.com/wp-content/uploads/2015/05/cropped-re_original_logo.png)
66
75
 
67
76
  RubyEffect builds intuitive, live and elegant software that solves real world problems. We love open source and it's community.
68
77
 
69
- Liked this gem? You may also like the articles we post on our [blog](http://www.rubyeffect.com/blog). Please do check
78
+ Liked this gem? You may also like the articles we post on our [blog](http://blog.rubyeffect.com). Please do check
70
79
 
71
80
  We would love to work on your ideas and see them grow. Say hello @ http://rubyeffect.com/contact
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = %q{Ruby gem for easy implementation of FundAmerica API in ruby, rails, sinatra apps}
13
13
  spec.description = %q{This is a ruby gem to use the FundAmerica (http://www.fundamerica.com) API easily in your ruby, rails and sinatra apps built by RubyEffect (http://www.rubyeffect.com)}
14
- spec.homepage = "http://www.rubyeffect.com/blog/category/fundamerica"
14
+ spec.homepage = "http://blog.rubyeffect.com/category/fundamerica/"
15
15
  spec.license = "MIT"
16
16
 
17
17
  # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
@@ -6,11 +6,7 @@ module FundAmerica
6
6
  class << self
7
7
  # Returns API key or raises exception
8
8
  def api_key
9
- # TODO - Uncomment below line for production
10
9
  defined? @api_key and @api_key or raise "FundAmerica.api_key not configured"
11
-
12
- # Sandbox test API key is used for development
13
- # defined? @api_key and @api_key or @api_key = test_api_key
14
10
  end
15
11
  attr_writer :api_key
16
12
 
@@ -45,11 +41,5 @@ module FundAmerica
45
41
  }
46
42
  }
47
43
  end
48
-
49
- # Sandbox API key - Only for development purpose
50
- # TODO - Remove this method for production
51
- # def test_api_key
52
- # "sandbox-key-here"
53
- # end
54
44
  end
55
45
  end
@@ -9,11 +9,13 @@ require 'fund_america/error'
9
9
  # API end points below
10
10
  require 'fund_america/api_info'
11
11
  require 'fund_america/ach_authorization'
12
+ require 'fund_america/aml_exception'
12
13
  require 'fund_america/background_check'
13
14
  require 'fund_america/bank_info'
14
15
  require 'fund_america/billing_log'
15
16
  require 'fund_america/cancel_offering_request'
16
17
  require 'fund_america/close_offering_request'
18
+ require 'fund_america/customer_agreement'
17
19
  require 'fund_america/electronic_signature'
18
20
  require 'fund_america/entity_relationship'
19
21
  require 'fund_america/entity'
@@ -0,0 +1,29 @@
1
+ module FundAmerica
2
+ class AmlException
3
+ class << self
4
+
5
+ # End point: https://apps.fundamerica.com/api/aml_exceptions (GET)
6
+ # Usage: FundAmerica::AmlException.list
7
+ # Output: Returns list of aml_exceptions
8
+ def list
9
+ API::request(:get, FundAmerica.base_uri + 'aml_exceptions')
10
+ end
11
+
12
+ # End point: https://apps.fundamerica.com/api/aml_exceptions/:id (GET)
13
+ # Usage: FundAmerica::AmlException.details(aml_exception_id)
14
+ # Output: Returns the details of an aml_exception with matching id
15
+ def details(aml_exception_id)
16
+ API::request(:get, FundAmerica.base_uri + "aml_exceptions/#{aml_exception_id}")
17
+ end
18
+
19
+ # End point: https://sandbox.fundamerica.com/api/test_mode/aml_exceptions/:id (PATCH)
20
+ # Usage: FundAmerica::AmlException.update(aml_exception_id)
21
+ # Output: Updates an aml exception in test mode
22
+ # Important: This works only for Sandbox mode
23
+ def update(aml_exception_id, options)
24
+ API::request(:patch, FundAmerica.base_uri + "test_mode/aml_exceptions/#{aml_exception_id}", options)
25
+ end
26
+
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,21 @@
1
+ module FundAmerica
2
+ class CustomerAgreement
3
+ class << self
4
+
5
+ # End point: https://apps.fundamerica.com/api/entities/:id/customer_agreement/edit (GET)
6
+ # Usage: FundAmerica::CustomerAgreement.edit(entity_id)
7
+ # Output: Returns the form details for the customer agreement
8
+ def edit(entity_id)
9
+ API::request(:get, "entities/#{entity_id}/customer_agreement/edit")
10
+ end
11
+
12
+ # End point: https://apps.fundamerica.com/api/entities/:id/customer_agreement (PATCH)
13
+ # Usage: FundAmerica::CustomerAgreement.update(entity_id, options)
14
+ # Output: Fill out the customer agreement
15
+ def update(entity_id, options)
16
+ API::request(:patch, "entities/#{entity_id}/customer_agreement", options)
17
+ end
18
+
19
+ end
20
+ end
21
+ end
@@ -23,6 +23,13 @@ module FundAmerica
23
23
  API::request(:get, "distributions/#{distribution_id}/investor_payments?page=#{page}&per=#{per}")
24
24
  end
25
25
 
26
+ # End point: https://apps/fundamerica.com/api/distributions/:id/non_investor_payments
27
+ # Usage: FundAmerica::Distribution.non_investor_payments(distribution_id)
28
+ # Output: Returns the non_investor_payments associated with distribution
29
+ def non_investor_payments(distribution_id, page, per)
30
+ API::request(:get, "distributions/#{distribution_id}/non_investor_payments?page=#{page}&per=#{per}")
31
+ end
32
+
26
33
  end
27
34
  end
28
35
  end
@@ -119,6 +119,14 @@ module FundAmerica
119
119
  API::request(:get, "entities/#{entity_id}/investor_accreditation")
120
120
  end
121
121
 
122
+ # https://apps.fundamerica.com/api/entities/:id/platform_investor (GET)
123
+ # Usage: FundAmerica::Entity.platform_investor
124
+ # Output: Returns entity specific platform_investor information
125
+ # Note: FA platform investor information will also be included with investor information
126
+ def platform_investor(entity_id )
127
+ API::request(:get, "entities/#{entity_id}/platform_investor")
128
+ end
129
+
122
130
  end
123
131
  end
124
132
  end
@@ -5,12 +5,12 @@ module FundAmerica
5
5
  # Contructor method to take response code and parsed_response
6
6
  # and give object methods in rescue - e.message and e.parsed_response
7
7
  def initialize(parsed_response, code)
8
- super(FundAmerica::Error.error_message(code))
8
+ super(FundAmerica::Error.error_message(code, parsed_response))
9
9
  @parsed_response = parsed_response
10
10
  end
11
11
 
12
12
  # Method to return error message based on the response code
13
- def self.error_message(code)
13
+ def self.error_message(code, parsed_response)
14
14
  case code
15
15
  when 401 then
16
16
  'Authentication error. Your API key is incorrect'
@@ -19,7 +19,7 @@ module FundAmerica
19
19
  when 404 then
20
20
  'Resource was not found'
21
21
  when 422 then
22
- 'This usually means you are missing or have supplied invalid parameters for a request'
22
+ "This usually means you are missing or have supplied invalid parameters for a request: #{parsed_response}"
23
23
  when 500 then
24
24
  "Internal server error. Something went wrong. This is a bug. Please report it to support immediately"
25
25
  else
@@ -3,5 +3,5 @@ module FundAmerica
3
3
  # The format is Major dot Minor dot patch
4
4
  # Check the FundAmerica changelog regularly and add changes from it
5
5
  # Increase the patch number
6
- VERSION = "0.0.6"
6
+ VERSION = "0.0.7"
7
7
  end
@@ -2,11 +2,15 @@ module FundAmerica
2
2
  class WebhookLog
3
3
  class << self
4
4
 
5
- # End point: https://apps.fundamerica.com/api/webhook_logs (GET)
5
+ # End point: https://apps.fundamerica.com/api/webhook_logs/?page=[num]&per=[num] (GET)
6
6
  # Usage: FundAmerica::WebhookLog.list
7
7
  # Output: Returns list of webhook_logs
8
- def list
9
- API::request(:get, 'webhook_logs')
8
+ # Params: (method defaults are the same as the current API defaults)
9
+ # * page - page number of results; starts at 1, not 0
10
+ # * per - number of results per page
11
+ def list(page: 1, per: 25)
12
+ request_uri = "webhook_logs/?page=#{page}&per=#{per}"
13
+ API::request(:get, request_uri)
10
14
  end
11
15
 
12
16
  # End point: https://apps.fundamerica.com/api/webhook_logs/:id (GET)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fund_america
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sanjay Vedula
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-09 00:00:00.000000000 Z
11
+ date: 2016-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -115,6 +115,7 @@ files:
115
115
  - lib/fund_america.rb
116
116
  - lib/fund_america/ach_authorization.rb
117
117
  - lib/fund_america/all.rb
118
+ - lib/fund_america/aml_exception.rb
118
119
  - lib/fund_america/api.rb
119
120
  - lib/fund_america/api_info.rb
120
121
  - lib/fund_america/background_check.rb
@@ -123,6 +124,7 @@ files:
123
124
  - lib/fund_america/billing_log.rb
124
125
  - lib/fund_america/cancel_offering_request.rb
125
126
  - lib/fund_america/close_offering_request.rb
127
+ - lib/fund_america/customer_agreement.rb
126
128
  - lib/fund_america/distribution.rb
127
129
  - lib/fund_america/electronic_signature.rb
128
130
  - lib/fund_america/email_log.rb
@@ -143,7 +145,7 @@ files:
143
145
  - lib/fund_america/trade_review.rb
144
146
  - lib/fund_america/version.rb
145
147
  - lib/fund_america/webhook_log.rb
146
- homepage: http://www.rubyeffect.com/blog/category/fundamerica
148
+ homepage: http://blog.rubyeffect.com/category/fundamerica/
147
149
  licenses:
148
150
  - MIT
149
151
  metadata: {}
@@ -163,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
165
  version: '0'
164
166
  requirements: []
165
167
  rubyforge_project:
166
- rubygems_version: 2.4.5.1
168
+ rubygems_version: 2.5.1
167
169
  signing_key:
168
170
  specification_version: 4
169
171
  summary: Ruby gem for easy implementation of FundAmerica API in ruby, rails, sinatra