Module: Newebpay::PeriodicalHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/newebpay/periodical_helper.rb
Instance Method Summary collapse
- #newebpay_periodical_pay_button(title, options = {}) ⇒ Object
- #render_newebpay_periodical_form(periodical_form_object, options = {}) ⇒ Object
Instance Method Details
#newebpay_periodical_pay_button(title, options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/helpers/newebpay/periodical_helper.rb', line 23 def (title, = {}) form = Newebpay::Periodical::Form.new() render_newebpay_periodical_form( form, title: title, class: [:class], id: [:id], data: [:data] ) end |
#render_newebpay_periodical_form(periodical_form_object, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/helpers/newebpay/periodical_helper.rb', line 5 def render_newebpay_periodical_form(periodical_form_object, = {}) unless periodical_form_object.is_a? Newebpay::Periodical::Form raise ArgumentError, 'The first argument must be a Newebpay::Periodical::Form.' end title = [:title] || 'Go' submit_class = [:class] || '' submit_id = [:id] || '' data = [:data] || {} form_tag(Newebpay.config.periodical_gateway_url, method: :post) do periodical_form_object.form_attrs.each do |key, value| concat hidden_field_tag key, value end concat title, class: submit_class, id: submit_id, data: data end end |