Class: Bancbox::Investor

Inherits:
Object
  • Object
show all
Defined in:
lib/bancbox/investor.rb

Instance Method Summary collapse

Instance Method Details

#create_investor(apikey, secret, url, fname, lname, email, phone, address_1, address_2, city, state, zip, dob, created) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/bancbox/investor.rb', line 37

def create_investor(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,created)
  params = {
           :api_key => apikey,
           :secret => secret,
           :first_name => fname,
           :last_name => lname,
           :email => email,
           :phone => phone,
           :address_1 => address_1,
           :address_2 => address_2,
           :created_by => created,
           :internal => '1',
           :state => state,
           :city => city,
           :zip => zip,
           :dob => dob
           }
  
   uri = URI.parse(url)
   req = Net::HTTP::Post.new(uri.path)
   req.set_form_data(params)
   http = Net::HTTP.new(uri.host, uri.port)
   http.use_ssl = true 	
   http.verify_mode = OpenSSL::SSL::VERIFY_NONE
   
   response = http.request(req)
   response
end

#create_investor_with_ssn(apikey, secret, url, fname, lname, email, phone, address_1, address_2, city, state, zip, dob, created, ssn) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/bancbox/investor.rb', line 8

def create_investor_with_ssn(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,created,ssn)
  params = {
           :api_key => apikey,
           :secret => secret,
           :first_name => fname,
           :last_name => lname,
           :email => email,
           :phone => phone,
           :address_1 => address_1,
           :address_2 => address_2,
           :created_by => created,
           :internal => '0',
           :state => state,
           :city => city,
           :zip => zip,
           :dob => dob,
           :ssn=>ssn}
  
   uri = URI.parse(url)
   req = Net::HTTP::Post.new(uri.path)
   req.set_form_data(params)
   http = Net::HTTP.new(uri.host, uri.port)
   http.use_ssl = true 	
   http.verify_mode = OpenSSL::SSL::VERIFY_NONE
   
   response = http.request(req)
   response
end

#get_investor(apikey, secret, url, id) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/bancbox/investor.rb', line 66

def get_investor(apikey,secret,url,id)
    params = {
          :api_key => apikey,
          :secret => secret,
          :investor_id => id
          }
   uri = URI.parse(url)
   req = Net::HTTP::Post.new(uri.path)
   req.set_form_data(params)
   http = Net::HTTP.new(uri.host, uri.port)
   http.use_ssl = true 	
   http.verify_mode = OpenSSL::SSL::VERIFY_NONE
   
   response = http.request(req)
   response
end