wealthforge-ruby 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +111 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/fixtures/vcr_cassettes/all_investors.yml +14242 -0
- data/fixtures/vcr_cassettes/create_investor.yml +42 -0
- data/fixtures/vcr_cassettes/create_issuer.yml +42 -0
- data/fixtures/vcr_cassettes/create_offering.yml +42 -0
- data/fixtures/vcr_cassettes/create_subscription_agreement.yml +42 -0
- data/fixtures/vcr_cassettes/due_dilegence.yml +42 -0
- data/fixtures/vcr_cassettes/due_dilegence_file.yml +275 -0
- data/fixtures/vcr_cassettes/get_investment_by_id.yml +127 -0
- data/fixtures/vcr_cassettes/get_investments.yml +9137 -0
- data/fixtures/vcr_cassettes/get_investor.yml +45 -0
- data/fixtures/vcr_cassettes/get_issuer.yml +46 -0
- data/fixtures/vcr_cassettes/get_issuers.yml +238 -0
- data/fixtures/vcr_cassettes/get_subscription_agreement.yml +40 -0
- data/fixtures/vcr_cassettes/investment_account.yml +44 -0
- data/fixtures/vcr_cassettes/investment_certificate.yml +77 -0
- data/fixtures/vcr_cassettes/investment_status.yml +81 -0
- data/fixtures/vcr_cassettes/redirect_url.yml +42 -0
- data/fixtures/vcr_cassettes/request_investment_approval.yml +48 -0
- data/fixtures/vcr_cassettes/request_subscription_approval.yml +48 -0
- data/fixtures/vcr_cassettes/subscription_agreement.yml +153 -0
- data/fixtures/vcr_cassettes/term_sheets.yml +183 -0
- data/fixtures/vcr_cassettes/update_investment.yml +87 -0
- data/fixtures/vcr_cassettes/update_investment_account.yml +44 -0
- data/fixtures/vcr_cassettes/update_investor.yml +80 -0
- data/fixtures/vcr_cassettes/upload_accreditation_files.yml +78 -0
- data/lib/wealth_forge.rb +28 -0
- data/lib/wealth_forge/api_exception.rb +6 -0
- data/lib/wealth_forge/configuration.rb +21 -0
- data/lib/wealth_forge/connection.rb +89 -0
- data/lib/wealth_forge/investment.rb +90 -0
- data/lib/wealth_forge/investor.rb +37 -0
- data/lib/wealth_forge/issuer.rb +35 -0
- data/lib/wealth_forge/offering.rb +8 -0
- data/lib/wealth_forge/version.rb +3 -0
- data/wealthforge-ruby.gemspec +34 -0
- metadata +203 -0
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
class WealthForge::Investor
|
3
|
+
|
4
|
+
def self.all
|
5
|
+
WealthForge::Connection.get "investor", nil
|
6
|
+
end
|
7
|
+
|
8
|
+
|
9
|
+
def self.create(params)
|
10
|
+
WealthForge::Connection.post "investor", params
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
def self.get(investor_id)
|
15
|
+
WealthForge::Connection.get "investor/#{investor_id}", nil
|
16
|
+
end
|
17
|
+
|
18
|
+
|
19
|
+
def self.update(investor_id, params)
|
20
|
+
WealthForge::Connection.put "investor/#{investor_id}", params
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
def self.accreditation_evidence(investor_id, params)
|
25
|
+
mapped_params = {
|
26
|
+
status: {code: 'FILE_INPROGRESS', active: true},
|
27
|
+
mimeType: MIME::Types.type_for(params[:filename]).first.to_s,
|
28
|
+
folder: {parentFolder: {code: 'DUE_DILIGENCE'}},
|
29
|
+
fileName: params[:filename],
|
30
|
+
displayTitle: params[:filename],
|
31
|
+
content: Base64.strict_encode64(params[:file]),
|
32
|
+
parent: params[:remote_investment]
|
33
|
+
}
|
34
|
+
WealthForge::Connection.put "investor/#{investor_id}/accreditationEvidence", mapped_params
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
class WealthForge::Issuer
|
3
|
+
|
4
|
+
def self.all
|
5
|
+
WealthForge::Connection.get "issuer", nil
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.create(params = {})
|
9
|
+
params[:country] = {code: params[:country]}
|
10
|
+
params[:state_of_formation] = {code: params[:state_of_formation]}
|
11
|
+
params[:entity_type] = {code: params[:entity_type]}
|
12
|
+
WealthForge::Connection.post "issuer", params
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.get(issuer_id)
|
16
|
+
WealthForge::Connection.get "issuer/#{issuer_id}", nil
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.update(params = {}, issuer_id)
|
20
|
+
WealthForge::Connection.post "issuer/#{issuer_id}", params
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.accounts(issuer_id)
|
24
|
+
WealthForge::Connection.get "issuer/#{issuer_id}/accounts", nil
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.create_account(params = {}, issuer_id)
|
28
|
+
WealthForge::Connection.post "issuer/#{issuer_id}/accounts", params
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.update_account(params, issuer_id, account_id)
|
32
|
+
WealthForge::Connection.put "issuer/#{issuer_id}/accounts/#{account_id}", params
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'wealth_forge/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "wealthforge-ruby"
|
8
|
+
spec.version = WealthForge::VERSION
|
9
|
+
spec.authors = ["Dino Simone"]
|
10
|
+
spec.email = ["dino@simone.is"]
|
11
|
+
|
12
|
+
spec.summary = %q{WealthForge API Client}
|
13
|
+
spec.description = %q{The WealthForge API acts as a connection between WealthForge's back-end transaction engine, CapitalForge, and your front-end website. This client seamlessly integrates into your Ruby application to provide an interface to the WealthForge API web service.}
|
14
|
+
spec.homepage = "https://api.wealthforge.com"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_runtime_dependency "faraday", "~> 0.12.0.1"
|
25
|
+
spec.add_runtime_dependency "mime-types", "~> 3.1"
|
26
|
+
|
27
|
+
spec.add_development_dependency "bundler", "~> 1.13"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
30
|
+
spec.add_development_dependency "vcr", "~> 3.0"
|
31
|
+
spec.add_development_dependency "webmock", "~> 2.3"
|
32
|
+
spec.add_development_dependency "factory_girl", "~> 4.0"
|
33
|
+
|
34
|
+
end
|
metadata
ADDED
@@ -0,0 +1,203 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: wealthforge-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dino Simone
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-06-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: faraday
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.12.0.1
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.12.0.1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mime-types
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.13'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.13'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '10.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '10.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '3.0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '3.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '3.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '3.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: webmock
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '2.3'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '2.3'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: factory_girl
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '4.0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '4.0'
|
125
|
+
description: The WealthForge API acts as a connection between WealthForge's back-end
|
126
|
+
transaction engine, CapitalForge, and your front-end website. This client seamlessly
|
127
|
+
integrates into your Ruby application to provide an interface to the WealthForge
|
128
|
+
API web service.
|
129
|
+
email:
|
130
|
+
- dino@simone.is
|
131
|
+
executables: []
|
132
|
+
extensions: []
|
133
|
+
extra_rdoc_files: []
|
134
|
+
files:
|
135
|
+
- ".gitignore"
|
136
|
+
- ".rspec"
|
137
|
+
- ".travis.yml"
|
138
|
+
- Gemfile
|
139
|
+
- LICENSE
|
140
|
+
- README.md
|
141
|
+
- Rakefile
|
142
|
+
- bin/console
|
143
|
+
- bin/setup
|
144
|
+
- fixtures/vcr_cassettes/all_investors.yml
|
145
|
+
- fixtures/vcr_cassettes/create_investor.yml
|
146
|
+
- fixtures/vcr_cassettes/create_issuer.yml
|
147
|
+
- fixtures/vcr_cassettes/create_offering.yml
|
148
|
+
- fixtures/vcr_cassettes/create_subscription_agreement.yml
|
149
|
+
- fixtures/vcr_cassettes/due_dilegence.yml
|
150
|
+
- fixtures/vcr_cassettes/due_dilegence_file.yml
|
151
|
+
- fixtures/vcr_cassettes/get_investment_by_id.yml
|
152
|
+
- fixtures/vcr_cassettes/get_investments.yml
|
153
|
+
- fixtures/vcr_cassettes/get_investor.yml
|
154
|
+
- fixtures/vcr_cassettes/get_issuer.yml
|
155
|
+
- fixtures/vcr_cassettes/get_issuers.yml
|
156
|
+
- fixtures/vcr_cassettes/get_subscription_agreement.yml
|
157
|
+
- fixtures/vcr_cassettes/investment_account.yml
|
158
|
+
- fixtures/vcr_cassettes/investment_certificate.yml
|
159
|
+
- fixtures/vcr_cassettes/investment_status.yml
|
160
|
+
- fixtures/vcr_cassettes/redirect_url.yml
|
161
|
+
- fixtures/vcr_cassettes/request_investment_approval.yml
|
162
|
+
- fixtures/vcr_cassettes/request_subscription_approval.yml
|
163
|
+
- fixtures/vcr_cassettes/subscription_agreement.yml
|
164
|
+
- fixtures/vcr_cassettes/term_sheets.yml
|
165
|
+
- fixtures/vcr_cassettes/update_investment.yml
|
166
|
+
- fixtures/vcr_cassettes/update_investment_account.yml
|
167
|
+
- fixtures/vcr_cassettes/update_investor.yml
|
168
|
+
- fixtures/vcr_cassettes/upload_accreditation_files.yml
|
169
|
+
- lib/wealth_forge.rb
|
170
|
+
- lib/wealth_forge/api_exception.rb
|
171
|
+
- lib/wealth_forge/configuration.rb
|
172
|
+
- lib/wealth_forge/connection.rb
|
173
|
+
- lib/wealth_forge/investment.rb
|
174
|
+
- lib/wealth_forge/investor.rb
|
175
|
+
- lib/wealth_forge/issuer.rb
|
176
|
+
- lib/wealth_forge/offering.rb
|
177
|
+
- lib/wealth_forge/version.rb
|
178
|
+
- wealthforge-ruby.gemspec
|
179
|
+
homepage: https://api.wealthforge.com
|
180
|
+
licenses:
|
181
|
+
- MIT
|
182
|
+
metadata: {}
|
183
|
+
post_install_message:
|
184
|
+
rdoc_options: []
|
185
|
+
require_paths:
|
186
|
+
- lib
|
187
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
188
|
+
requirements:
|
189
|
+
- - ">="
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: '0'
|
192
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - ">="
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0'
|
197
|
+
requirements: []
|
198
|
+
rubyforge_project:
|
199
|
+
rubygems_version: 2.4.8
|
200
|
+
signing_key:
|
201
|
+
specification_version: 4
|
202
|
+
summary: WealthForge API Client
|
203
|
+
test_files: []
|