Module: NimbleshopAuthorizedotnet::ExposedHelper

Defined in:
app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb

Instance Method Summary collapse

Instance Method Details

#nimbleshop_authorizedotnet_available_payment_options_iconsObject



23
24
25
26
# File 'app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb', line 23

def nimbleshop_authorizedotnet_available_payment_options_icons
  return unless NimbleshopAuthorizedotnet::Authorizedotnet.first
  %w(visa mastercard discover american_express).map { |i| image_tag("engines/nimbleshop_authorizedotnet/#{i}.png") }
end

#nimbleshop_authorizedotnet_crud_formObject



44
45
46
47
# File 'app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb', line 44

def nimbleshop_authorizedotnet_crud_form
  return unless NimbleshopAuthorizedotnet::Authorizedotnet.first
  render partial: '/nimbleshop_authorizedotnet/authorizedotnets/edit'
end

#nimbleshop_authorizedotnet_icon_for_order_payment(order) ⇒ Object



28
29
30
31
32
33
# File 'app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb', line 28

def nimbleshop_authorizedotnet_icon_for_order_payment(order)
  if payment_transaction = order.payment_transactions.last
    cardtype = payment_transaction.[:cardtype]
    image_tag("engines/nimbleshop_authorizedotnet/#{cardtype}.png", height: '10px')
  end
end

#nimbleshop_authorizedotnet_next_payment_processing_action(order) ⇒ Object



4
5
6
7
8
# File 'app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb', line 4

def nimbleshop_authorizedotnet_next_payment_processing_action(order)
  if order.authorized?
    link_to 'Capture payment', capture_payment_admin_order_path(order), method: :put, class: 'btn btn-success'
  end
end

#nimbleshop_authorizedotnet_order_show_extra_info(order) ⇒ Object



18
19
20
21
# File 'app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb', line 18

def nimbleshop_authorizedotnet_order_show_extra_info(order)
  return unless NimbleshopAuthorizedotnet::Authorizedotnet.first
  render partial: '/nimbleshop_authorizedotnet/payments/order_show_extra_info', locals: { transaction: order.payment_transactions.last }
end

#nimbleshop_authorizedotnet_payment_form(order) ⇒ Object



39
40
41
42
# File 'app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb', line 39

def nimbleshop_authorizedotnet_payment_form(order)
  return unless NimbleshopAuthorizedotnet::Authorizedotnet.first
  render partial: '/nimbleshop_authorizedotnet/payments/new', locals: { order: order }
end

#nimbleshop_authorizedotnet_payment_info_for_buyer(order) ⇒ Object



35
36
37
# File 'app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb', line 35

def nimbleshop_authorizedotnet_payment_info_for_buyer(order)
  render partial: '/nimbleshop_authorizedotnet/payments/payment_info_for_buyer', locals: { order: order }
end

#nimbleshop_authorizedotnet_picture_on_admin_payment_methodsObject



14
15
16
# File 'app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb', line 14

def nimbleshop_authorizedotnet_picture_on_admin_payment_methods
  image_tag 'engines/nimbleshop_authorizedotnet/authorizedotnet_big.png', alt: 'authorizedotnet logo'
end

#nimbleshop_authorizedotnet_small_imageObject



10
11
12
# File 'app/helpers/nimbleshop_authorizedotnet/exposed_helper.rb', line 10

def nimbleshop_authorizedotnet_small_image
  image_tag 'engines/nimbleshop_authorizedotnet/authorizedotnet_small.png', alt: 'authorizedotnet icon'
end