9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'lib/hncb_e_atm/view_helpers.rb', line 9
def hncb_e_atm_form_for(params, &block)
query_string = HncbEAtm::Serialization.new(params).serialize
val = Base64.encode64(query_string)
mac = Digest::SHA1.hexdigest(query_string).upcase
html_form = []
html_form << "<form action='"+HncbEAtm.endpoint+"' method='post'>"
html_form << "<input type='hidden' name='trx' value='com.eatm.wibc.trx.web.EAtmWShopping'>"
html_form << "<input type='hidden' name='state' value='prompt'>"
html_form << "<input type='hidden' name='val' value='#{val}'>"
html_form << "<input type='hidden' name='mac' value='#{mac}'>"
html_form << capture(&block) if block_given?
html_form << "</form>"
html_form = html_form.join("\n")
concat(html_form.respond_to?(:html_safe) ? html_form.html_safe : html_form)
nil
end
|