Class: Bancbox::Issuer

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

Instance Method Summary collapse

Instance Method Details

#create_issuer(apikey, secret, url, fname, lname, email, phone, address_1, address_2, city, state, zip, dob, ssn, internal, created) ⇒ 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/issuer.rb', line 8

def create_issuer(apikey,secret,url,fname,lname,email,phone,address_1,address_2,city,state,zip,dob,ssn,internal,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 => internal,
          :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_issuer(apikey, secret, url, id) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/bancbox/issuer.rb', line 37

def get_issuer(apikey,secret,url,id)
    params = {
          :api_key => apikey,
          :secret => secret,
          :issuer_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