Module: Liqpay::LiqpayHelper

Defined in:
lib/liqpay/liqpay_helper.rb

Overview

Helpers to integrate LiqPay billing

Instance Method Summary collapse

Instance Method Details

#liqpay_button(liqpay_request, options = {}) ⇒ Object

Displays a form to send a payment request to LiqPay

You can either pass in a block, that SHOULD render a submit button (or not, if you plan to submit the form otherwise), or let the helper create a simple submit button for you.

liqpay_request - an instance of Liqpay::Request options - currently accepts two options

id - the ID of the form being created (`liqpay_form` by default)
title - text on the submit button (`Pay with LiqPay` by default); not used if you pass in a block


15
16
17
18
19
# File 'lib/liqpay/liqpay_helper.rb', line 15

def liqpay_button(liqpay_request, options = {})
  id = options.fetch(:id, 'liqpay_form')
  title = options.fetch(:title, 'Pay with LiqPAY')
  render_button(liqpay_request: liqpay_request, id: id, title: title)
end