Module: Simplepay::Rails::SimplepayHelper

Defined in:
app/helpers/simplepay/rails/simplepay_helper.rb

Overview

Adds helpers to your views for generating the correct HTML forms and valid signatures.

Instance Method Summary collapse

Instance Method Details

#simplepay_form_for(service_name, attributes = {}, submit_tag = nil) ⇒ Object

This is the general interface for generating your Simple Pay service forms. See Simplepay::Services for available services and information specific to each.

Example

(in your view)

<%= simplepay_form_for(:service_name, {:attr => 'foo'}) %>


21
22
23
24
25
26
27
# File 'app/helpers/simplepay/rails/simplepay_helper.rb', line 21

def simplepay_form_for(service_name, attributes = {}, submit_tag = nil)
  service = get_simplepay_service(service_name)
  if block_given?
    submit_tag = capture(&Proc.new)
  end
  service.form(attributes, submit_tag).html_safe
end