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.



6
7
8
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 6

def background_url
  @background_url
end

#color_backgroundObject

Returns the value of attribute color_background.



6
7
8
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 6

def color_background
  @color_background
end

Returns the value of attribute color_link.



6
7
8
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 6

def color_link
  @color_link
end

#color_textObject

Returns the value of attribute color_text.



6
7
8
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 6

def color_text
  @color_text
end

Returns the value of attribute footer_html.



6
7
8
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 6

def footer_html
  @footer_html
end

#header_htmlObject

Returns the value of attribute header_html.



6
7
8
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 6

def header_html
  @header_html
end

#logo_urlObject

Returns the value of attribute logo_url.



6
7
8
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 6

def logo_url
  @logo_url
end

#renameObject

Returns the value of attribute rename.



6
7
8
# File 'lib/authorize_net/sim/hosted_payment_form.rb', line 6

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.



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

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

#to_hashObject



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

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