Module: Versapay::Helpers
- Defined in:
- lib/versapay/rails_helpers.rb
Instance Method Summary collapse
- #debit_agreement_link(message = "Debit agreement", opts = {}) ⇒ Object
-
#debit_agreement_link_to(anchor, message = "Debit agreement", opts = {}) ⇒ Object
Provides a debit agreement link.
- #payment_checkout_link(message = "Credit Card payment", opts = {}) ⇒ Object
- #payment_checkout_link_to(anchor, message = "Credit Card payment", opts = {}) ⇒ Object
Instance Method Details
#debit_agreement_link(message = "Debit agreement", opts = {}) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/versapay/rails_helpers.rb', line 14 def debit_agreement_link( = "Debit agreement", opts = {}) link = "https://" + Versapay::site + "/authorize?api_token=#{Versapay.token}&message=#{html_escape().gsub(/ /, "+")}" opts.each do |k, v| link += "&#{k}=#{html_escape(v)}" end link end |
#debit_agreement_link_to(anchor, message = "Debit agreement", opts = {}) ⇒ Object
Provides a debit agreement link
4 5 6 7 |
# File 'lib/versapay/rails_helpers.rb', line 4 def debit_agreement_link_to(anchor, = "Debit agreement", opts = {}) link = debit_agreement_link(, opts) "<a href=\"#{link}\">#{anchor}</a>" end |
#payment_checkout_link(message = "Credit Card payment", opts = {}) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/versapay/rails_helpers.rb', line 23 def payment_checkout_link( = "Credit Card payment", opts = {}) link = "https://" + Versapay::site + "/send_money?api_token=#{Versapay.token}&message=#{html_escape().gsub(/ /, "+")}" opts.each do |k, v| link += "&#{k}=#{html_escape(v)}" end link end |
#payment_checkout_link_to(anchor, message = "Credit Card payment", opts = {}) ⇒ Object
9 10 11 12 |
# File 'lib/versapay/rails_helpers.rb', line 9 def payment_checkout_link_to(anchor, = "Credit Card payment", opts = {}) link = payment_checkout_link(, opts) "<a href=\"#{link}\">#{anchor}</a>" end |