Class: Bancbox::FundAccount

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

Instance Method Summary collapse

Instance Method Details

#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) ⇒ 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
36
37
38
39
40
# File 'lib/bancbox/fund_account.rb', line 8

def (apikey,secret,,client_ip,routing_number,,amount,memo,holder_name,fund_text,investor_id,url,agreement_type,document_name,document_version,sign)

params = {
         :api_key => apikey,
         :secret => secret,
         'bank_account_number' => .to_s,
         :bank_account_type => ,
         :bank_account_holder => holder_name,
         :bank_account_routing => routing_number,
         :text => fund_text,
         :link_bank_account => 'N',
         :client_ip_address => client_ip,
         :amount => amount,
         :memo => memo , 
         :investor_id => investor_id,
         :agreement_type => agreement_type,
         :document_name => document_name,
         :document_version => document_version,
         :represented_signature => sign,
         :submit_timestamp => DateTime.now.strftime('%Y-%m-%d %H:%M:%S').to_s
        }


 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