Sha256: 1e83b54d0b2fdfcf934795aa0870a42ea3940982a84d0493af7a2e5c611c9dc6

Contents?: true

Size: 744 Bytes

Versions: 2

Compression:

Stored size: 744 Bytes

Contents

module WebToPayHelper
  def macro_form(params, &block)
    fields = {:orderid => "1", :lang => 'LIT', :amount => 0, :currency => 'LTL',
              :accepturl => 'http://google.com', :cancelurl => 'http://yahoo.com', :callbackurl => 'http://yourdomain.com',
              :projectid => WebToPay.config.project_id,
              :sign_password => WebToPay.config.sign_password,
              :test => 0}

    fields.merge!(params)

    request = WebToPay::Api.build_request(fields)

    concat "<form action=\"https://www.mokejimai.lt/pay/\" method=\"post\" style=\"padding:0px;margin:0px\">".html_safe
    request.each_pair {|k,v| concat hidden_field_tag(k, v) if !v.nil? }
    yield if block_given?
    concat "</form>".html_safe
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
nma-webtopay-1.2.1 lib/webtopay_helper.rb
webtopay-1.2.1 lib/webtopay_helper.rb