module WebToPayHelper def macro_form(params, &block) fields = {:orderid => "1", :lang => 'LIT', :amount => 0, :currency => 'LTL', :accepturl => 'http://google.com', :cancelurl => 'http://yahoo.com', :callbackurl => 'http://yourdomain.com', :projectid => WebToPay.config.project_id, :sign_password => WebToPay.config.sign_password, :test => 0} fields.merge!(params) request = WebToPay::Api.build_request(fields) concat "
".html_safe request.each_pair {|k,v| concat hidden_field_tag(k, v) if !v.nil? } yield if block_given? concat "
".html_safe end end