bancbox 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/lib/bancbox.rb +199 -0
- data/lib/bancbox/angel_fund.rb +86 -0
- data/lib/bancbox/escrow.rb +117 -0
- data/lib/bancbox/fund_account.rb +42 -0
- data/lib/bancbox/fund_escrow.rb +32 -0
- data/lib/bancbox/investor.rb +83 -0
- data/lib/bancbox/issuer.rb +55 -0
- data/lib/bancbox/proceeds_scheduler.rb +31 -0
- data/lib/bancbox/version.rb +3 -0
- data/lib/bancbox/withdraw_funds.rb +38 -0
- metadata +82 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: e93f5be9c37d7049b56265ef7924247ac11c8fc2
|
4
|
+
data.tar.gz: 3e034a2881e5e2fbe2f8bf6768f3ada7208231d9
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 22e53194e1701c0b39d08c24a447636ff4f8ce55dd2786113ce5020787562c4be7038afa71949fdf39a3a889d44f011145f60cfda623a0392d028e4fd36664f2
|
7
|
+
data.tar.gz: 36441cb19a1019375699f7b7809edb09d48d0fff537ad9fdbb22bbdaf872b21de795c50aa8e5d8a78e1dd3f092328c3b9affe407c7d514f973043b21aa23be43
|
data/lib/bancbox.rb
ADDED
@@ -0,0 +1,199 @@
|
|
1
|
+
require "bancbox/version"
|
2
|
+
require "bancbox/investor"
|
3
|
+
require "bancbox/issuer"
|
4
|
+
require "bancbox/angel_fund"
|
5
|
+
require "bancbox/fund_account"
|
6
|
+
require "bancbox/fund_escrow"
|
7
|
+
require "bancbox/withdraw_funds"
|
8
|
+
require "bancbox/escrow"
|
9
|
+
require "bancbox/proceeds_scheduler"
|
10
|
+
require 'json'
|
11
|
+
module Bancbox
|
12
|
+
|
13
|
+
def self.create_investor_with_ssn(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,created,ssn)
|
14
|
+
investor_obj = Investor.new()
|
15
|
+
@investor = investor_obj.create_investor_with_ssn(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,created,ssn)
|
16
|
+
obj = JSON.parse(@investor.body)
|
17
|
+
if !obj['error'].nil?
|
18
|
+
obj['error']['message']
|
19
|
+
else
|
20
|
+
obj
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.create_investor(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,created)
|
25
|
+
investor_obj = Investor.new()
|
26
|
+
@investor = investor_obj.create_investor(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,created)
|
27
|
+
obj = JSON.parse(@investor.body)
|
28
|
+
if !obj['error'].nil?
|
29
|
+
obj['error']['message']
|
30
|
+
else
|
31
|
+
obj
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.get_investor(apikey,secret,url,id)
|
36
|
+
investor_obj = Investor.new()
|
37
|
+
@investor = investor_obj.get_investor(apikey,secret,url,id)
|
38
|
+
obj = JSON.parse(@investor.body)
|
39
|
+
if !obj['error'].nil?
|
40
|
+
obj['error']['message']
|
41
|
+
else
|
42
|
+
obj
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.create_issuer(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,ssn,internal,created)
|
47
|
+
issuer_obj = Issuer.new()
|
48
|
+
@issuer = issuer_obj.create_issuer(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,ssn,internal,created)
|
49
|
+
obj = JSON.parse(@issuer.body)
|
50
|
+
if !obj['error'].nil?
|
51
|
+
obj['error']['message']
|
52
|
+
else
|
53
|
+
obj
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def self.get_issuer(apikey,secret,url,id)
|
58
|
+
issuer_obj = Issuer.new()
|
59
|
+
@issuer = issuer_obj.get_issuer(apikey,secret,url,id)
|
60
|
+
obj = JSON.parse(@issuer.body)
|
61
|
+
if !obj['error'].nil?
|
62
|
+
obj['error']['message']
|
63
|
+
else
|
64
|
+
obj
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.create_llc_investor_with_ssn(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,created,ssn,llc)
|
69
|
+
investor_obj = AngelFund.new()
|
70
|
+
@investor = investor_obj.create_investor_with_ssn(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,created,ssn,llc)
|
71
|
+
obj = JSON.parse(@investor.body)
|
72
|
+
if !obj['error'].nil?
|
73
|
+
obj['error']['message']
|
74
|
+
else
|
75
|
+
obj
|
76
|
+
end
|
77
|
+
end
|
78
|
+
def self.create_llc_investor(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,created,llc)
|
79
|
+
investor_obj = AngelFund.new()
|
80
|
+
@investor = investor_obj.create_investor(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,created,llc)
|
81
|
+
obj = JSON.parse(@investor.body)
|
82
|
+
if !obj['error'].nil?
|
83
|
+
obj['error']['message']
|
84
|
+
else
|
85
|
+
obj
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.get_angel_investor(apikey,secret,url,id)
|
90
|
+
investor_obj = AngelFund.new()
|
91
|
+
@investor = investor_obj.get_investor(apikey,secret,url,id)
|
92
|
+
obj = JSON.parse(@investor.body)
|
93
|
+
if !obj['error'].nil?
|
94
|
+
obj['error']['message']
|
95
|
+
else
|
96
|
+
obj
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
def self.create_fund_account(apikey,secret,account_number,client_ip,routing_number,type_account,amount,memo,holder_name,fund_text,investor_id,url,agreement_type,document_name,document_version,sign)
|
101
|
+
fund_obj = FundAccount.new()
|
102
|
+
@fund_obj = fund_obj.create_fund_account(apikey,secret,account_number,client_ip,routing_number,type_account,amount,memo,holder_name,fund_text,investor_id,url,agreement_type,document_name,document_version,sign)
|
103
|
+
obj = JSON.parse(@fund_obj.body)
|
104
|
+
if !obj['error'].nil?
|
105
|
+
obj['error']['message']
|
106
|
+
else
|
107
|
+
obj
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
def self.create_fund_escrow(apikey,secret,url,investor_id,client_ip,escrow_id,amount,fund_text)
|
112
|
+
fund_esc_obj = FundEscrow.new()
|
113
|
+
@fund_esc_obj = fund_esc_obj.create_fund_escrow(apikey,secret,url,investor_id,client_ip,escrow_id,amount,fund_text)
|
114
|
+
obj = JSON.parse(@fund_esc_obj.body)
|
115
|
+
if !obj['error'].nil?
|
116
|
+
obj['error']['message']
|
117
|
+
else
|
118
|
+
obj
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def self.withdraw_funds(apikey,secret,url,account_number,client_ip,routing_number,type_account,amount,memo,holder_name,fund_text,method,inv_id)
|
123
|
+
fund_obj = WithdrawFunds.new()
|
124
|
+
@fund_obj = fund_obj.create_withdraw_fund(apikey,secret,url,account_number,client_ip,routing_number,type_account,amount,memo,holder_name,fund_text,method,inv_id)
|
125
|
+
obj = JSON.parse(@fund_obj.body)
|
126
|
+
if !obj['error'].nil?
|
127
|
+
obj['error']['message']
|
128
|
+
else
|
129
|
+
obj
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
def self.open_escrow(apikey,secret,url,name,issuer_id,start_date,close_date,funding_goal,minimum_funding_amount,maximum_funding_amount,platform_signatory_email,issuer_signatory_email,platform_sign_name,platform_sign_title,issuer_sign_name,issuer_sign_title,created)
|
134
|
+
escrow = Escrow.new()
|
135
|
+
@escrow = escrow.open_escrow(apikey,secret,url,name,issuer_id,start_date,close_date,funding_goal,minimum_funding_amount,maximum_funding_amount,platform_signatory_email,issuer_signatory_email,platform_sign_name,platform_sign_title,issuer_sign_name,issuer_sign_title,created)
|
136
|
+
obj = JSON.parse(@escrow.body)
|
137
|
+
if !obj['error'].nil?
|
138
|
+
obj['error']['message']
|
139
|
+
else
|
140
|
+
obj
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
def self.cancel_escrow(apikey,secret,url,escrow_id,reason)
|
145
|
+
escrow = Escrow.new()
|
146
|
+
@escrow = escrow.cancel_escrow(apikey,secret,url,escrow_id,reason)
|
147
|
+
obj = JSON.parse(@escrow.body)
|
148
|
+
if !obj['error'].nil?
|
149
|
+
obj['error']['message']
|
150
|
+
else
|
151
|
+
obj
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
def self.close_escrow(apikey,secret,url,escrow_id,reason)
|
156
|
+
escrow = Escrow.new()
|
157
|
+
@escrow = escrow.close_escrow(apikey,secret,url,escrow_id,reason)
|
158
|
+
obj = JSON.parse(@escrow.body)
|
159
|
+
if !obj['error'].nil?
|
160
|
+
obj['error']['message']
|
161
|
+
else
|
162
|
+
obj
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
def self.get_escrow(apikey,secret,url,id)
|
167
|
+
escrow = Escrow.new()
|
168
|
+
@escrow = escrow.get_escrow(apikey,secret,url,id)
|
169
|
+
obj = JSON.parse(@escrow.body)
|
170
|
+
if !obj['error'].nil?
|
171
|
+
obj['error']['message']
|
172
|
+
else
|
173
|
+
obj
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
def self.modify_escrow(apikey,secret,url,escrow_id,close_date,over_funding_amount,funding_goal)
|
178
|
+
escrow = Escrow.new()
|
179
|
+
@escrow = escrow.modify_escrow(apikey,secret,url,escrow_id,close_date,over_funding_amount,funding_goal)
|
180
|
+
obj = JSON.parse(@escrow.body)
|
181
|
+
if !obj['error'].nil?
|
182
|
+
obj['error']['message']
|
183
|
+
else
|
184
|
+
obj
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
def self.create_proceeds_scheduler(apikey,secret,url,escrow_id,close_date,over_funding_amount,funding_goal)
|
189
|
+
proceeds = ProceedsScheduler.new()
|
190
|
+
@proceeds = proceeds.create_proceeds_scheduler(apikey,secret,url,escrow_id,close_date,over_funding_amount,funding_goal)
|
191
|
+
obj = JSON.parse(@proceeds.body)
|
192
|
+
if !obj['error'].nil?
|
193
|
+
obj['error']['message']
|
194
|
+
else
|
195
|
+
obj
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require "uri"
|
3
|
+
require 'json'
|
4
|
+
require 'openssl'
|
5
|
+
module Bancbox
|
6
|
+
class AngelFund
|
7
|
+
|
8
|
+
def create_investor_with_ssn(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,created,ssn,llc)
|
9
|
+
|
10
|
+
params = {
|
11
|
+
:api_key => apikey,
|
12
|
+
:secret => secret,
|
13
|
+
:first_name => fname,
|
14
|
+
:last_name => lname,
|
15
|
+
:email => email,
|
16
|
+
:phone => phone,
|
17
|
+
:address_1 => address_1,
|
18
|
+
:address_2 => address_2,
|
19
|
+
:created_by => created,
|
20
|
+
:type => llc,
|
21
|
+
:internal => '0',
|
22
|
+
:state => state,
|
23
|
+
:city => city,
|
24
|
+
:zip => zip,
|
25
|
+
:ssn => ssn}
|
26
|
+
|
27
|
+
uri = URI.parse(url)
|
28
|
+
req = Net::HTTP::Post.new(uri.path)
|
29
|
+
req.set_form_data(params)
|
30
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
31
|
+
http.use_ssl = true
|
32
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
33
|
+
|
34
|
+
response = http.request(req)
|
35
|
+
response
|
36
|
+
end
|
37
|
+
|
38
|
+
def create_investor(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,created,llc)
|
39
|
+
|
40
|
+
params = {
|
41
|
+
:api_key => apikey,
|
42
|
+
:secret => secret,
|
43
|
+
:first_name => fname,
|
44
|
+
:last_name => lname,
|
45
|
+
:email => email,
|
46
|
+
:phone => phone,
|
47
|
+
:address_1 => address_1,
|
48
|
+
:address_2 => address_2,
|
49
|
+
:created_by => created,
|
50
|
+
:type => llc,
|
51
|
+
:internal => '1',
|
52
|
+
:state => state,
|
53
|
+
:city => city,
|
54
|
+
:zip => zip
|
55
|
+
}
|
56
|
+
|
57
|
+
uri = URI.parse(url)
|
58
|
+
req = Net::HTTP::Post.new(uri.path)
|
59
|
+
req.set_form_data(params)
|
60
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
61
|
+
http.use_ssl = true
|
62
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
63
|
+
|
64
|
+
response = http.request(req)
|
65
|
+
response
|
66
|
+
end
|
67
|
+
|
68
|
+
def self.get_investor(apikey,secret,url,id)
|
69
|
+
params = {
|
70
|
+
:api_key => apikey,
|
71
|
+
:secret => secret,
|
72
|
+
:investor_id => id
|
73
|
+
}
|
74
|
+
uri = URI.parse(url)
|
75
|
+
req = Net::HTTP::Post.new(uri.path)
|
76
|
+
req.set_form_data(params)
|
77
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
78
|
+
http.use_ssl = true
|
79
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
80
|
+
response = http.request(req)
|
81
|
+
response
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require "uri"
|
3
|
+
|
4
|
+
module Bancbox
|
5
|
+
class Escrow
|
6
|
+
|
7
|
+
def open_escrow(apikey,secret,url,name,issuer_id,start_date,close_date,funding_goal,minimum_funding_amount,maximum_funding_amount,platform_signatory_email,issuer_signatory_email,platform_sign_name,platform_sign_title,issuer_sign_name,issuer_sign_title,created)
|
8
|
+
|
9
|
+
params = {
|
10
|
+
:api_key => apikey,
|
11
|
+
:secret => secret,
|
12
|
+
:name => name,
|
13
|
+
:issuer_id => issuer_id,
|
14
|
+
:start_date => start_date,
|
15
|
+
:close_date => close_date,
|
16
|
+
:funding_goal => funding_goal,
|
17
|
+
:minimum_funding_amount => minimum_funding_amount,
|
18
|
+
:created_by => created,
|
19
|
+
:maximum_funding_amount => maximum_funding_amount,
|
20
|
+
:contract_doc_reference_id => 'cod_sdReffes',
|
21
|
+
:securities_offered => 'EQUITY',
|
22
|
+
:platform_signatory_name => platform_sign_name,
|
23
|
+
:platform_signatory_title => platform_sign_title,
|
24
|
+
:platform_signatory_email => platform_signatory_email,
|
25
|
+
:issuer_signatory_name => issuer_sign_name,
|
26
|
+
:issuer_signatory_title => issuer_sign_title,
|
27
|
+
:issuer_signatory_email => issuer_signatory_email
|
28
|
+
|
29
|
+
}
|
30
|
+
|
31
|
+
uri = URI.parse(url)
|
32
|
+
req = Net::HTTP::Post.new(uri.path)
|
33
|
+
req.set_form_data(params)
|
34
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
35
|
+
http.use_ssl = true
|
36
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
37
|
+
response = http.request(req)
|
38
|
+
response
|
39
|
+
|
40
|
+
end
|
41
|
+
|
42
|
+
def cancel_escrow(apikey,secret,url,escrow_id,reason)
|
43
|
+
params = {
|
44
|
+
:api_key => apikey,
|
45
|
+
:secret => secret,
|
46
|
+
:escrow_id => escrow_id,
|
47
|
+
:reason => reason
|
48
|
+
}
|
49
|
+
|
50
|
+
uri = URI.parse(url)
|
51
|
+
req = Net::HTTP::Post.new(uri.path)
|
52
|
+
req.set_form_data(params)
|
53
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
54
|
+
http.use_ssl = true
|
55
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
56
|
+
response = http.request(req)
|
57
|
+
response
|
58
|
+
end
|
59
|
+
|
60
|
+
def close_escrow(apikey,secret,url,escrow_id,reason)
|
61
|
+
params = {
|
62
|
+
:api_key => apikey,
|
63
|
+
:secret => secret,
|
64
|
+
:escrow_id => escrow_id,
|
65
|
+
:reason => reason
|
66
|
+
}
|
67
|
+
|
68
|
+
uri = URI.parse(url)
|
69
|
+
req = Net::HTTP::Post.new(uri.path)
|
70
|
+
req.set_form_data(params)
|
71
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
72
|
+
http.use_ssl = true
|
73
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
74
|
+
response = http.request(req)
|
75
|
+
response
|
76
|
+
end
|
77
|
+
|
78
|
+
def modify_escrow(apikey,secret,url,escrow_id,close_date,over_funding_amount,funding_goal)
|
79
|
+
params = {
|
80
|
+
:api_key => apikey,
|
81
|
+
:secret => secret,
|
82
|
+
:id => escrow_id,
|
83
|
+
:close_date => close_date,
|
84
|
+
:over_funding_amount => over_funding_amount,
|
85
|
+
:funding_goal => funding_goal
|
86
|
+
}
|
87
|
+
|
88
|
+
uri = URI.parse(url)
|
89
|
+
req = Net::HTTP::Post.new(uri.path)
|
90
|
+
req.set_form_data(params)
|
91
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
92
|
+
http.use_ssl = true
|
93
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
94
|
+
response = http.request(req)
|
95
|
+
response
|
96
|
+
end
|
97
|
+
|
98
|
+
def get_escrow(apikey,secret,url,id)
|
99
|
+
params = {
|
100
|
+
:api_key => apikey,
|
101
|
+
:secret => secret,
|
102
|
+
:escrow_id => id
|
103
|
+
}
|
104
|
+
uri = URI.parse(url)
|
105
|
+
req = Net::HTTP::Post.new(uri.path)
|
106
|
+
req.set_form_data(params)
|
107
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
108
|
+
http.use_ssl = true
|
109
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
110
|
+
|
111
|
+
response = http.request(req)
|
112
|
+
response
|
113
|
+
end
|
114
|
+
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require "uri"
|
3
|
+
require 'openssl'
|
4
|
+
require 'date'
|
5
|
+
module Bancbox
|
6
|
+
class FundAccount
|
7
|
+
|
8
|
+
def create_fund_account(apikey,secret,account_number,client_ip,routing_number,type_account,amount,memo,holder_name,fund_text,investor_id,url,agreement_type,document_name,document_version,sign)
|
9
|
+
|
10
|
+
params = {
|
11
|
+
:api_key => apikey,
|
12
|
+
:secret => secret,
|
13
|
+
'bank_account_number' => account_number.to_s,
|
14
|
+
:bank_account_type => type_account,
|
15
|
+
:bank_account_holder => holder_name,
|
16
|
+
:bank_account_routing => routing_number,
|
17
|
+
:text => fund_text,
|
18
|
+
:link_bank_account => 'N',
|
19
|
+
:client_ip_address => client_ip,
|
20
|
+
:amount => amount,
|
21
|
+
:memo => memo ,
|
22
|
+
:investor_id => investor_id,
|
23
|
+
:agreement_type => agreement_type,
|
24
|
+
:document_name => document_name,
|
25
|
+
:document_version => document_version,
|
26
|
+
:represented_signature => sign,
|
27
|
+
:submit_timestamp => DateTime.now.strftime('%Y-%m-%d %H:%M:%S').to_s
|
28
|
+
}
|
29
|
+
|
30
|
+
|
31
|
+
uri = URI.parse(url)
|
32
|
+
req = Net::HTTP::Post.new(uri.path)
|
33
|
+
req.set_form_data(params)
|
34
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
35
|
+
http.use_ssl = true
|
36
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
37
|
+
response = http.request(req)
|
38
|
+
response
|
39
|
+
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require "uri"
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module Bancbox
|
6
|
+
class FundEscrow
|
7
|
+
|
8
|
+
def create_fund_escrow(apikey,secret,url,investor_id,client_ip,escrow_id,amount,fund_text)
|
9
|
+
|
10
|
+
params = {
|
11
|
+
:api_key => apikey,
|
12
|
+
:secret => secret,
|
13
|
+
:text => fund_text,
|
14
|
+
:client_ip_address => client_ip,
|
15
|
+
:amount => amount,
|
16
|
+
:investor_id => investor_id,
|
17
|
+
:escrow_id => escrow_id ,
|
18
|
+
:submit_timestamp => DateTime.now.strftime('%Y-%m-%d %H:%M:%S').to_s
|
19
|
+
}
|
20
|
+
|
21
|
+
uri = URI.parse(url)
|
22
|
+
req = Net::HTTP::Post.new(uri.path)
|
23
|
+
req.set_form_data(params)
|
24
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
25
|
+
http.use_ssl = true
|
26
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
27
|
+
response = http.request(req)
|
28
|
+
response
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require "uri"
|
3
|
+
require 'json'
|
4
|
+
require 'openssl'
|
5
|
+
module Bancbox
|
6
|
+
class Investor
|
7
|
+
|
8
|
+
def create_investor_with_ssn(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,created,ssn)
|
9
|
+
params = {
|
10
|
+
:api_key => apikey,
|
11
|
+
:secret => secret,
|
12
|
+
:first_name => fname,
|
13
|
+
:last_name => lname,
|
14
|
+
:email => email,
|
15
|
+
:phone => phone,
|
16
|
+
:address_1 => address_1,
|
17
|
+
:address_2 => address_2,
|
18
|
+
:created_by => created,
|
19
|
+
:internal => '0',
|
20
|
+
:state => state,
|
21
|
+
:city => city,
|
22
|
+
:zip => zip,
|
23
|
+
:dob => dob,
|
24
|
+
:ssn=>ssn}
|
25
|
+
|
26
|
+
uri = URI.parse(url)
|
27
|
+
req = Net::HTTP::Post.new(uri.path)
|
28
|
+
req.set_form_data(params)
|
29
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
30
|
+
http.use_ssl = true
|
31
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
32
|
+
|
33
|
+
response = http.request(req)
|
34
|
+
response
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_investor(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,created)
|
38
|
+
params = {
|
39
|
+
:api_key => apikey,
|
40
|
+
:secret => secret,
|
41
|
+
:first_name => fname,
|
42
|
+
:last_name => lname,
|
43
|
+
:email => email,
|
44
|
+
:phone => phone,
|
45
|
+
:address_1 => address_1,
|
46
|
+
:address_2 => address_2,
|
47
|
+
:created_by => created,
|
48
|
+
:internal => '1',
|
49
|
+
:state => state,
|
50
|
+
:city => city,
|
51
|
+
:zip => zip,
|
52
|
+
:dob => dob
|
53
|
+
}
|
54
|
+
|
55
|
+
uri = URI.parse(url)
|
56
|
+
req = Net::HTTP::Post.new(uri.path)
|
57
|
+
req.set_form_data(params)
|
58
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
59
|
+
http.use_ssl = true
|
60
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
61
|
+
|
62
|
+
response = http.request(req)
|
63
|
+
response
|
64
|
+
end
|
65
|
+
|
66
|
+
def get_investor(apikey,secret,url,id)
|
67
|
+
params = {
|
68
|
+
:api_key => apikey,
|
69
|
+
:secret => secret,
|
70
|
+
:investor_id => id
|
71
|
+
}
|
72
|
+
uri = URI.parse(url)
|
73
|
+
req = Net::HTTP::Post.new(uri.path)
|
74
|
+
req.set_form_data(params)
|
75
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
76
|
+
http.use_ssl = true
|
77
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
78
|
+
|
79
|
+
response = http.request(req)
|
80
|
+
response
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require "uri"
|
3
|
+
require 'json'
|
4
|
+
require 'openssl'
|
5
|
+
module Bancbox
|
6
|
+
class Issuer
|
7
|
+
|
8
|
+
def create_issuer(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,ssn,internal,created)
|
9
|
+
params = {
|
10
|
+
:api_key => apikey,
|
11
|
+
:secret => secret,
|
12
|
+
:first_name => fname,
|
13
|
+
:last_name => lname,
|
14
|
+
:email => email,
|
15
|
+
:phone => phone,
|
16
|
+
:address_1 => address_1,
|
17
|
+
:address_2 => address_2,
|
18
|
+
:created_by => created,
|
19
|
+
:internal => internal,
|
20
|
+
:state => state,
|
21
|
+
:city => city,
|
22
|
+
:zip => zip,
|
23
|
+
:dob => dob,
|
24
|
+
:ssn => ssn}
|
25
|
+
|
26
|
+
uri = URI.parse(url)
|
27
|
+
req = Net::HTTP::Post.new(uri.path)
|
28
|
+
req.set_form_data(params)
|
29
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
30
|
+
http.use_ssl = true
|
31
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
32
|
+
response = http.request(req)
|
33
|
+
response
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
def get_issuer(apikey,secret,url,id)
|
38
|
+
params = {
|
39
|
+
:api_key => apikey,
|
40
|
+
:secret => secret,
|
41
|
+
:issuer_id => id
|
42
|
+
}
|
43
|
+
uri = URI.parse(url)
|
44
|
+
req = Net::HTTP::Post.new(uri.path)
|
45
|
+
req.set_form_data(params)
|
46
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
47
|
+
http.use_ssl = true
|
48
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
49
|
+
|
50
|
+
response = http.request(req)
|
51
|
+
response
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require "uri"
|
3
|
+
|
4
|
+
module Bancbox
|
5
|
+
class ProceedsScheduler
|
6
|
+
|
7
|
+
def create_proceeds_scheduler(apikey,secret,url,schedule_date,investor_id,amount,escrow_id)
|
8
|
+
|
9
|
+
params = {
|
10
|
+
:api_key => apikey,
|
11
|
+
:secret => secret,
|
12
|
+
:escrow_id => escrow_id,
|
13
|
+
'schedule_date[0]' => schedule_date,
|
14
|
+
'amount[0]' => amount,
|
15
|
+
'investor_id[0]' => investor_id ,
|
16
|
+
:schedule_count => 1
|
17
|
+
|
18
|
+
}
|
19
|
+
|
20
|
+
uri = URI.parse(url)
|
21
|
+
req = Net::HTTP::Post.new(uri.path)
|
22
|
+
req.set_form_data(params)
|
23
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
24
|
+
http.use_ssl = true
|
25
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
26
|
+
response = http.request(req)
|
27
|
+
response
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require "uri"
|
3
|
+
|
4
|
+
module Bancbox
|
5
|
+
class WithdrawFunds
|
6
|
+
|
7
|
+
def create_withdraw_fund(apikey,secret,url,account_number,client_ip,routing_number,type_account,amount,memo,holder_name,fund_text,method,inv_id)
|
8
|
+
|
9
|
+
|
10
|
+
params = {
|
11
|
+
:api_key => apikey,
|
12
|
+
:secret => secret,
|
13
|
+
:bank_account_number => account_number,
|
14
|
+
:bank_account_type => type_account,
|
15
|
+
:bank_account_holder => holder_name,
|
16
|
+
:bank_account_routing => routing_number,
|
17
|
+
:text => fund_text,
|
18
|
+
:client_ip_address => client_ip,
|
19
|
+
:amount => amount,
|
20
|
+
:memo => memo ,
|
21
|
+
:submit_timestamp => DateTime.now.strftime('%Y-%m-%d %H:%M:%S').to_s,
|
22
|
+
:method => method,
|
23
|
+
:issuer_id => inv_id
|
24
|
+
}
|
25
|
+
|
26
|
+
|
27
|
+
uri = URI.parse(url)
|
28
|
+
req = Net::HTTP::Post.new(uri.path)
|
29
|
+
req.set_form_data(params)
|
30
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
31
|
+
http.use_ssl = true
|
32
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
33
|
+
response = http.request(req)
|
34
|
+
response
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
metadata
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bancbox
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Rahulindia25
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-13 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Bancbox Api
|
42
|
+
email:
|
43
|
+
- rahulindia25@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- lib/bancbox.rb
|
49
|
+
- lib/bancbox/angel_fund.rb
|
50
|
+
- lib/bancbox/escrow.rb
|
51
|
+
- lib/bancbox/fund_account.rb
|
52
|
+
- lib/bancbox/fund_escrow.rb
|
53
|
+
- lib/bancbox/investor.rb
|
54
|
+
- lib/bancbox/issuer.rb
|
55
|
+
- lib/bancbox/proceeds_scheduler.rb
|
56
|
+
- lib/bancbox/version.rb
|
57
|
+
- lib/bancbox/withdraw_funds.rb
|
58
|
+
homepage: https://github.com/krypt2005/bancboxgem
|
59
|
+
licenses:
|
60
|
+
- MIT
|
61
|
+
metadata: {}
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
requirements: []
|
77
|
+
rubyforge_project:
|
78
|
+
rubygems_version: 2.2.2
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: Bancbox Api
|
82
|
+
test_files: []
|