2011-06-23 15:32:23 +02:00
|
|
|
module PaiementCic::FormHelper
|
2013-06-05 15:22:41 +02:00
|
|
|
def paiement_cic_hidden_fields(reference, price, options = {})
|
|
|
|
oMac = PaiementCic::TPE.new(options)
|
|
|
|
oa = oMac.config(reference, price, options)
|
2009-08-17 10:37:35 +02:00
|
|
|
|
2013-06-05 15:22:41 +02:00
|
|
|
chaineMAC = oMac.computeHMACSHA1(oa.values.join('*'))
|
2013-06-05 10:28:56 +02:00
|
|
|
|
2013-06-05 15:22:41 +02:00
|
|
|
url_retour = options[:url_retour]
|
|
|
|
url_retour_ok = options[:url_retour_ok]
|
|
|
|
url_retour_err = options[:url_retour_err]
|
2013-06-05 10:28:56 +02:00
|
|
|
|
2013-06-05 15:22:41 +02:00
|
|
|
html = hidden_field_tag('MAC', chaineMAC)
|
|
|
|
html << hidden_field_tag('url_retour', url_retour)
|
|
|
|
html << hidden_field_tag('url_retour_ok', url_retour_ok)
|
|
|
|
html << hidden_field_tag('url_retour_err', url_retour_err)
|
2012-01-30 09:38:45 +01:00
|
|
|
|
2013-06-05 15:22:41 +02:00
|
|
|
oa.each do |k,v|
|
|
|
|
html << hidden_field_tag(k, v) unless v.empty?
|
|
|
|
end
|
|
|
|
|
|
|
|
html
|
2009-08-17 10:37:35 +02:00
|
|
|
end
|
|
|
|
end
|