Not even sure of the best way to work around this and make this method functional for Rails 2 and Rails 3. Since html_safe makes thigns a little awkward.
def payment_service_for(order, account, options = {}, &proc)
raise ArgumentError, "Missing block" unless block_given?
integration_module = ActiveMerchant::Billing::Integrations.const_get(options.delete(:service).to_s.classify)
if ignore_binding?
concat(form_tag(integration_module.service_url, options.delete(:html) || {}))
else
concat(form_tag(integration_module.service_url, options.delete(:html) || {}), proc.binding)
end
result = "\n".html_safe
service_class = integration_module.const_get('Helper')
service = service_class.new(order, account, options)
yield service
result << service.form_fields.collect do |field, value|
hidden_field_tag(field, value)
end.join("\n").html_safe
result << "\n".html_safe
result << '</form>'.html_safe
if ignore_binding?
concat(result)
else
concat(result, proc.binding)
end
end