Class: AuthorizeNet::SIM::HostedPaymentForm

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/authorize_net/sim/hosted_payment_form.rb

Overview

Models a hosted payment form.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Model

#initialize, #to_a

Instance Attribute Details

#background_urlObject

Returns the value of attribute background_url.



8
9
10
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 8

def background_url
  @background_url
end

#color_backgroundObject

Returns the value of attribute color_background.



8
9
10
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 8

def color_background
  @color_background
end

Returns the value of attribute color_link.



8
9
10
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 8

def color_link
  @color_link
end

#color_textObject

Returns the value of attribute color_text.



8
9
10
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 8

def color_text
  @color_text
end

Returns the value of attribute footer_html.



8
9
10
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 8

def footer_html
  @footer_html
end

#header_htmlObject

Returns the value of attribute header_html.



8
9
10
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 8

def header_html
  @header_html
end

#logo_urlObject

Returns the value of attribute logo_url.



8
9
10
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 8

def logo_url
  @logo_url
end

#renameObject

Returns the value of attribute rename.



8
9
10
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 8

def rename
  @rename
end

Instance Method Details

#add_rename(field, name) ⇒ Object

Convenience method for adding field rename requests to the transaction. This renames a field shown on the hosted payment form.



12
13
14
15
16
17
18
19
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 12

def add_rename(field, name)
  rename = "#{field},#{name}"
  unless @rename.nil?
    @rename = @rename.to_a << rename
  else
    @rename = [rename]
  end
end

#to_hashObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 21

def to_hash
  hash = {
    :header_html_payment_form => @header_html,
    :footer_html_payment_form => @footer_html,
    :color_background => @color_background,
    :color_link => @color_link,
    :color_text => @color_text,
    :logo_url => @logo_url,
    :background_url => @background_url,
    :rename => @rename
  }
  hash.delete_if {|k, v| v.nil?}
  hash
end