in paiement_cic_hidden_fields, use a hash to obtain the urls

version1.2
David Bourguignon 2009-08-17 10:48:58 +02:00
parent 61703dc979
commit 8cb1aff141
2 changed files with 5 additions and 5 deletions

View File

@ -37,7 +37,7 @@ script/plugin install git://github.com/novelys/paiementcic.git
### in the payment by card view :
- form_tag PaiementCic.target_url do
= paiement_cic_hidden_fields(@order, @order_transaction)
= paiement_cic_hidden_fields(@order, @order_transaction, :url_retour => edit_order_url(order), :url_retour_ok => bank_ok_order_transaction_url(order_transaction), :url_retour_err => bank_err_order_transaction_url(order_transaction))
= submit_tag "Accéder au site de la banque", :style => "font-weight: bold;"
= image_tag "reassuring_pictograms.jpg", :alt => "Pictogrammes rassurants", :style => "width: 157px;"

View File

@ -1,11 +1,11 @@
module PaiementCicHelper
def paiement_cic_hidden_fields(order, order_transaction)
def paiement_cic_hidden_fields(order, order_transaction, options = {})
oa = PaiementCic.config(order.amount, order_transaction.reference)
hsh = oa.dup
hsh["url_retour"] = edit_account_order_url(order)
hsh["url_retour_ok"] = bank_ok_order_transaction_url(order_transaction)
hsh["url_retour_err"] = bank_err_order_transaction_url(order_transaction)
hsh["url_retour"] = options[:url_retour] || edit_order_url(order)
hsh["url_retour_ok"] = options[:url_retour_ok] || bank_ok_order_transaction_url(order_transaction)
hsh["url_retour_err"] = options[:url_retour_err] || bank_err_order_transaction_url(order_transaction)
hsh["MAC"] = PaiementCic.calculate_hmac(oa)
res = "\n"