in paiement_cic_hidden_fields, use a hash to obtain the urls
parent
61703dc979
commit
8cb1aff141
|
@ -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;"
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue