wealthforge3-ruby 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1d930dd2000dc12cd55fc5d6d0ff631f37d2c323f81268dbf01ae9622e4e8535
4
+ data.tar.gz: 7740473fc89652437afbac61dc215fdc01ae9b538ce8a0d93c0970df07507b73
5
+ SHA512:
6
+ metadata.gz: 11acfe98d630eae1b0385930d2a008fb54da4f5f757ffacaacdd09f35dc2157fa4cf5c62f7fbba89a152fd5c01c1866ef5269fdd3c3bdf4377e271fd860af58c
7
+ data.tar.gz: 294fa3520172c99242568f2969dd1a8938df826cfb24d62479aea6816f79448cd02a465034e57b2691aee60c65f6f337e768cd03e3d3b5b9c0dc01cb876bbd36
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Dino Simone
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,67 @@
1
+ # WealthForge API Client for Ruby
2
+
3
+ This client seamlessly integrates into your Ruby application to provide an interface to the WealthForge API web service.
4
+
5
+
6
+ ## Installation
7
+
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'wealthforge3-ruby'
12
+ ```
13
+
14
+ And then execute:
15
+
16
+ $ bundle
17
+
18
+ Or install it yourself as:
19
+
20
+ $ gem install wealthforge3-ruby
21
+
22
+
23
+ ## Configuration
24
+
25
+ Before you can use this gem, you'll need to configure it with the key and cert, which you'll have after registering with WealthForge. If using with Rails, put this code in the initializer.
26
+
27
+ ```ruby
28
+ WealthForge3.configure do |config|
29
+ config.session_id = '[assigned-session-id]'
30
+ config.environment = 'development'
31
+ end
32
+ ```
33
+
34
+ ## Usage
35
+
36
+ ### Available Calls
37
+
38
+ #### Investment
39
+
40
+ ```ruby
41
+ WealthForge3::Investment.create
42
+ WealthForge3::Investment.get
43
+ WealthForge3::Investment.cancel_subscription
44
+ WealthForge3::Investment.file_upload
45
+ ```
46
+
47
+ #### Offering
48
+
49
+ ```ruby
50
+ WealthForge3::Offering.create
51
+ WealthForge3::Offering.get
52
+ ```
53
+
54
+ ## Tests
55
+
56
+ All tests can be run by typing `rspec`. Prior to running tests, you'll need to set your secret and client ID.:
57
+
58
+ ## License
59
+
60
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
61
+
62
+
63
+ ## Disclaimer
64
+
65
+ This project and the code therein was not created by and is not supported by WealthForge.
66
+
67
+
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "wealthforge-ruby"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,7 @@
1
+ class WealthForge3::ApiException < StandardError
2
+ def initialize(e = nil)
3
+ puts "API error: #{e.inspect}"
4
+ super e
5
+ set_backtrace e.backtrace if e
6
+ end
7
+ end
@@ -0,0 +1,18 @@
1
+ module WealthForge3
2
+ class Configuration
3
+ attr_accessor :session_id
4
+ attr_accessor :api_url
5
+ attr_accessor :environment
6
+ attr_accessor :version
7
+ attr_accessor :production_url
8
+ attr_accessor :sandbox_url
9
+
10
+ def initialize
11
+ @session_id = nil
12
+ @environment = nil
13
+ @api_url = nil
14
+ @production_url = "https://wealthforgeprod01.decisions.com/Primary/restapi/Flow/"
15
+ @sandbox_url = "https://wealthforgedev01.decisions.com/decisions/Primary/restapi/Flow"
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,56 @@
1
+ require "openssl"
2
+ require "faraday"
3
+ require "json"
4
+ require "csv"
5
+ require "timeout"
6
+ require "resolv-replace"
7
+ require "jwt"
8
+
9
+ class WealthForge3::Connection
10
+ def self.post(endpoint, params)
11
+ begin
12
+ response = connection.post do |req|
13
+ req.url endpoint
14
+ req.headers["Content-Type"] = "application/json"
15
+ req.body = params.to_json
16
+ end
17
+ rescue => e
18
+ raise WealthForge3::ApiException.new(e)
19
+ end
20
+ JSON.parse(response.body)
21
+ end
22
+
23
+ def self.get(endpoint, params)
24
+ begin
25
+ response = connection.get do |req|
26
+ req.url endpoint
27
+ req.headers["Content-Type"] = "application/json"
28
+ req.body = params.to_json
29
+ end
30
+ rescue => e
31
+ raise WealthForge3::ApiException.new(e)
32
+ end
33
+ JSON.parse(response.body)
34
+ end
35
+
36
+ def self.connection
37
+ Faraday.new(url: WealthForge3.configuration.api_url) do |faraday|
38
+ faraday.request :url_encoded
39
+ faraday.options.timeout = 15
40
+ faraday.options.open_timeout = 15
41
+ faraday.use CustomErrors
42
+ faraday.adapter Faraday.default_adapter
43
+ end
44
+ end
45
+ end
46
+
47
+ class CustomErrors < Faraday::Response::RaiseError
48
+ def on_complete(env)
49
+ case env[:status]
50
+ when 400...600
51
+ JSON.parse(env[:body])
52
+ else
53
+ super
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,17 @@
1
+ class WealthForge3::Investment
2
+ def self.create(params)
3
+ WealthForge3::Connection.post "ce6bf0cf-ff79-11eb-8466-00155d0b8b06", params
4
+ end
5
+
6
+ def self.get(params)
7
+ WealthForge3::Connection.post "51029a96-124b-11ec-8466-00155d0b8b06", params
8
+ end
9
+
10
+ def self.file_upload(params)
11
+ WealthForge3::Connection.post "bcf7264c-2124-11ec-8467-00155d0b8b06", params
12
+ end
13
+
14
+ def self.cancel_subscription(params)
15
+ WealthForge3::Connection.post "df3deb53-2512-11ec-8467-00155d0b8b06", params
16
+ end
17
+ end
@@ -0,0 +1,9 @@
1
+ class WealthForge3::Offering
2
+ def self.create(params)
3
+ WealthForge3::Connection.post "fe47bb35-feb3-11eb-8466-00155d0b8b06", params
4
+ end
5
+
6
+ def self.get(params)
7
+ WealthForge3::Connection.post "1c3d79e5-1fb8-11ec-8467-00155d0b8b06", params
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ module WealthForge3
2
+ VERSION = "3.0.0"
3
+ end
@@ -0,0 +1,24 @@
1
+ require "wealthforge/configuration"
2
+ require "wealthforge/api_exception"
3
+ require "wealthforge/connection"
4
+ require "wealthforge/investment"
5
+ require "wealthforge/offering"
6
+
7
+ module WealthForge3
8
+ class << self
9
+ attr_accessor :configuration
10
+ end
11
+
12
+ def self.configuration
13
+ @configuration ||= Configuration.new
14
+ end
15
+
16
+ def self.reset
17
+ @configuration = Configuration.new
18
+ end
19
+
20
+ def self.configure
21
+ yield(configuration)
22
+ configuration.api_url = configuration.environment == "production" ? configuration.production_url : configuration.sandbox_url
23
+ end
24
+ end
metadata ADDED
@@ -0,0 +1,227 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wealthforge3-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Wali Rahman
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-03-23 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: '2.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.2'
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.3'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 3.3.1
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '3.3'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 3.3.1
47
+ - !ruby/object:Gem::Dependency
48
+ name: jwt
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '2.2'
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 2.2.3
57
+ type: :runtime
58
+ prerelease: false
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - "~>"
62
+ - !ruby/object:Gem::Version
63
+ version: '2.2'
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 2.2.3
67
+ - !ruby/object:Gem::Dependency
68
+ name: openssl
69
+ requirement: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - "~>"
72
+ - !ruby/object:Gem::Version
73
+ version: '2.2'
74
+ type: :runtime
75
+ prerelease: false
76
+ version_requirements: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - "~>"
79
+ - !ruby/object:Gem::Version
80
+ version: '2.2'
81
+ - !ruby/object:Gem::Dependency
82
+ name: json
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '2.5'
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: 2.5.1
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '2.5'
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 2.5.1
101
+ - !ruby/object:Gem::Dependency
102
+ name: rake
103
+ requirement: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - "~>"
106
+ - !ruby/object:Gem::Version
107
+ version: '13.0'
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: 13.0.6
111
+ type: :development
112
+ prerelease: false
113
+ version_requirements: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '13.0'
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: 13.0.6
121
+ - !ruby/object:Gem::Dependency
122
+ name: rspec
123
+ requirement: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - "~>"
126
+ - !ruby/object:Gem::Version
127
+ version: '3.10'
128
+ type: :development
129
+ prerelease: false
130
+ version_requirements: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '3.10'
135
+ - !ruby/object:Gem::Dependency
136
+ name: vcr
137
+ requirement: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '6.0'
142
+ type: :development
143
+ prerelease: false
144
+ version_requirements: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - "~>"
147
+ - !ruby/object:Gem::Version
148
+ version: '6.0'
149
+ - !ruby/object:Gem::Dependency
150
+ name: webmock
151
+ requirement: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - "~>"
154
+ - !ruby/object:Gem::Version
155
+ version: '3.13'
156
+ type: :development
157
+ prerelease: false
158
+ version_requirements: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - "~>"
161
+ - !ruby/object:Gem::Version
162
+ version: '3.13'
163
+ - !ruby/object:Gem::Dependency
164
+ name: factory_bot
165
+ requirement: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - "~>"
168
+ - !ruby/object:Gem::Version
169
+ version: '4.8'
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: 4.8.2
173
+ type: :development
174
+ prerelease: false
175
+ version_requirements: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '4.8'
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: 4.8.2
183
+ description: The WealthForge API acts as a connection between WealthForge's back-end
184
+ transaction engine, CapitalForge, and your front-end website.
185
+ email:
186
+ - walirahman16@gmail.com
187
+ executables:
188
+ - console
189
+ - setup
190
+ extensions: []
191
+ extra_rdoc_files: []
192
+ files:
193
+ - LICENSE
194
+ - README.md
195
+ - bin/console
196
+ - bin/setup
197
+ - lib/wealthforge/api_exception.rb
198
+ - lib/wealthforge/configuration.rb
199
+ - lib/wealthforge/connection.rb
200
+ - lib/wealthforge/investment.rb
201
+ - lib/wealthforge/offering.rb
202
+ - lib/wealthforge/version.rb
203
+ - lib/wealthforge3-ruby.rb
204
+ homepage: https://github.com/Wali89/wealthforge3-ruby
205
+ licenses:
206
+ - MIT
207
+ metadata: {}
208
+ post_install_message:
209
+ rdoc_options: []
210
+ require_paths:
211
+ - lib
212
+ required_ruby_version: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - ">="
215
+ - !ruby/object:Gem::Version
216
+ version: '0'
217
+ required_rubygems_version: !ruby/object:Gem::Requirement
218
+ requirements:
219
+ - - ">="
220
+ - !ruby/object:Gem::Version
221
+ version: '0'
222
+ requirements: []
223
+ rubygems_version: 3.3.3
224
+ signing_key:
225
+ specification_version: 4
226
+ summary: WealthForge API Client
227
+ test_files: []