Sha256: 60d067964b25b5fcdc48ee711f3da9b239a6ebf4e4513d3c37ce3a8a56c46b5d

Contents?: true

Size: 1.83 KB

Versions: 2

Compression:

Stored size: 1.83 KB

Contents

= form_tag(EffectiveOrders.moneris[:hpp_url], :method => 'post') do
  = hidden_field_tag(:ps_store_id, EffectiveOrders.moneris[:ps_store_id])
  = hidden_field_tag(:hpp_key, EffectiveOrders.moneris[:hpp_key])
  = hidden_field_tag(:lang, 'en-ca')
  = hidden_field_tag(:rvar_authenticity_token, form_authenticity_token)

  - if purchased_redirect_url.present?
    = hidden_field_tag(:rvar_purchased_redirect_url, purchased_redirect_url)

  - if declined_redirect_url.present?
    = hidden_field_tag(:rvar_declined_redirect_url, declined_redirect_url)

  = hidden_field_tag(:email, order.user.try(:email))
  = hidden_field_tag(:cust_id, order.user.to_param)

  - moneris_order_id = "#{order.to_param.gsub(/[^0-9]/, '').to_i + EffectiveOrders.moneris[:order_nudge].to_i}"
  - if EffectiveOrders.moneris[:include_billing_name_in_order_id] == true
    - moneris_order_id = moneris_order_id + '-' + order.billing_name.parameterize

  = hidden_field_tag(:order_id, moneris_order_id)
  = hidden_field_tag(:gst, '%.2f' % (order.tax / 100.0))
  = hidden_field_tag(:charge_total, '%.2f' % (order.total / 100.0))

  - order.order_items.each_with_index do |item, x|
    = hidden_field_tag("id#{x}", x)
    = hidden_field_tag("description#{x}", item.title)
    = hidden_field_tag("quantity#{x}", item.quantity)
    = hidden_field_tag("price#{x}", '%.2f' % (item.price / 100.0))
    = hidden_field_tag("subtotal#{x}", '%.2f' % (item.subtotal / 100.0))

  - if order.billing_address.present?
    - address = order.billing_address
    = hidden_field_tag(:bill_address_one, address.address1)
    = hidden_field_tag(:bill_city, address.city)
    = hidden_field_tag(:bill_state_or_province, address.state)
    = hidden_field_tag(:bill_postal_code, address.postal_code)
    = hidden_field_tag(:bill_country, address.country)

  %p= submit_tag 'Checkout with Moneris', :class => 'btn btn-primary'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
effective_orders-1.2.3 app/views/effective/orders/moneris/_form.html.haml
effective_orders-1.2.2 app/views/effective/orders/moneris/_form.html.haml