Module: OffsitePayments::Integrations::Valitor::ResponseFields

Included in:
Notification, Return
Defined in:
lib/offsite_payments/integrations/valitor.rb

Instance Method Summary collapse

Instance Method Details

#acknowledge(authcode = nil) ⇒ Object



186
187
188
# File 'lib/offsite_payments/integrations/valitor.rb', line 186

def acknowledge(authcode = nil)
  password ? Digest::MD5.hexdigest("#{password}#{order}") == params['RafraenUndirskriftSvar'] : true
end

#authorization_numberObject



146
147
148
# File 'lib/offsite_payments/integrations/valitor.rb', line 146

def authorization_number
  params['Heimildarnumer']
end

#card_last_fourObject



142
143
144
# File 'lib/offsite_payments/integrations/valitor.rb', line 142

def card_last_four
  params['KortnumerSidustu']
end

#card_typeObject



138
139
140
# File 'lib/offsite_payments/integrations/valitor.rb', line 138

def card_type
  params['Kortategund']
end

#currencyObject



122
123
124
# File 'lib/offsite_payments/integrations/valitor.rb', line 122

def currency
  nil
end

#customer_addressObject



158
159
160
# File 'lib/offsite_payments/integrations/valitor.rb', line 158

def customer_address
  params['Heimilisfang']
end

#customer_cityObject



166
167
168
# File 'lib/offsite_payments/integrations/valitor.rb', line 166

def customer_city
  params['Stadur']
end

#customer_commentObject



178
179
180
# File 'lib/offsite_payments/integrations/valitor.rb', line 178

def customer_comment
  params['Athugasemdir']
end

#customer_countryObject



170
171
172
# File 'lib/offsite_payments/integrations/valitor.rb', line 170

def customer_country
  params['Land']
end

#customer_emailObject



174
175
176
# File 'lib/offsite_payments/integrations/valitor.rb', line 174

def customer_email
  params['Tolvupostfang']
end

#customer_nameObject



154
155
156
# File 'lib/offsite_payments/integrations/valitor.rb', line 154

def customer_name
  params['Nafn']
end

#customer_zipObject



162
163
164
# File 'lib/offsite_payments/integrations/valitor.rb', line 162

def customer_zip
  params['Postnumer']
end

#grossObject



134
135
136
# File 'lib/offsite_payments/integrations/valitor.rb', line 134

def gross
  "%0.2f" % params['Upphaed'].to_s.sub(',', '.')
end

#item_idObject Also known as: order



113
114
115
# File 'lib/offsite_payments/integrations/valitor.rb', line 113

def item_id
  params['Tilvisunarnumer']
end

#passwordObject



182
183
184
# File 'lib/offsite_payments/integrations/valitor.rb', line 182

def password
  @options[:credential2]
end

#received_atObject



130
131
132
# File 'lib/offsite_payments/integrations/valitor.rb', line 130

def received_at
  Time.parse(params['Dagsetning'].to_s)
end

#statusObject



126
127
128
# File 'lib/offsite_payments/integrations/valitor.rb', line 126

def status
  "Completed" if acknowledge
end

#success?Boolean Also known as: complete?

Returns:

  • (Boolean)


104
105
106
# File 'lib/offsite_payments/integrations/valitor.rb', line 104

def success?
  status == 'Completed'
end

#test?Boolean

Returns:

  • (Boolean)


109
110
111
# File 'lib/offsite_payments/integrations/valitor.rb', line 109

def test?
  @options[:test]
end

#transaction_idObject



118
119
120
# File 'lib/offsite_payments/integrations/valitor.rb', line 118

def transaction_id
  params['VefverslunSalaID']
end

#transaction_numberObject



150
151
152
# File 'lib/offsite_payments/integrations/valitor.rb', line 150

def transaction_number
  params['Faerslunumer']
end