Module: Versapay::Helpers

Defined in:
lib/versapay/rails_helpers.rb

Instance Method Summary collapse

Instance Method Details



14
15
16
17
18
19
20
21
# File 'lib/versapay/rails_helpers.rb', line 14

def debit_agreement_link(message = "Debit agreement", opts = {})
  link = "https://" + Versapay::site + "/authorize?api_token=#{Versapay.token}&message=#{html_escape(message).gsub(/ /, "+")}"
  opts.each do |k, v|
    link += "&#{k}=#{html_escape(v)}"
  end

  link
end

Provides a debit agreement link



4
5
6
7
# File 'lib/versapay/rails_helpers.rb', line 4

def debit_agreement_link_to(anchor, message = "Debit agreement", opts = {})
  link = debit_agreement_link(message, opts)
  "<a href=\"#{link}\">#{anchor}</a>"
end


23
24
25
26
27
28
29
30
# File 'lib/versapay/rails_helpers.rb', line 23

def payment_checkout_link(message = "Credit Card payment", opts = {})
  link = "https://" + Versapay::site + "/send_money?api_token=#{Versapay.token}&message=#{html_escape(message).gsub(/ /, "+")}"
  opts.each do |k, v|
    link += "&#{k}=#{html_escape(v)}"
  end

  link
end


9
10
11
12
# File 'lib/versapay/rails_helpers.rb', line 9

def payment_checkout_link_to(anchor, message = "Credit Card payment", opts = {})
  link = payment_checkout_link(message, opts)
  "<a href=\"#{link}\">#{anchor}</a>"
end