Module: ActiveMerchant::Billing::Integrations::Valitor::ResponseFields

Included in:
Notification, Return
Defined in:
lib/active_merchant/billing/integrations/valitor/response_fields.rb

Instance Method Summary collapse

Instance Method Details

#acknowledge(authcode = nil) ⇒ Object



90
91
92
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 90

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

#authorization_numberObject



50
51
52
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 50

def authorization_number
  params['Heimildarnumer']
end

#card_last_fourObject



46
47
48
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 46

def card_last_four
  params['KortnumerSidustu']
end

#card_typeObject



42
43
44
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 42

def card_type
  params['Kortategund']
end

#currencyObject



26
27
28
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 26

def currency
  nil
end

#customer_addressObject



62
63
64
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 62

def customer_address
  params['Heimilisfang']
end

#customer_cityObject



70
71
72
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 70

def customer_city
  params['Stadur']
end

#customer_commentObject



82
83
84
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 82

def customer_comment
  params['Athugasemdir']
end

#customer_countryObject



74
75
76
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 74

def customer_country
  params['Land']
end

#customer_emailObject



78
79
80
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 78

def customer_email
  params['Tolvupostfang']
end

#customer_nameObject



58
59
60
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 58

def customer_name
  params['Nafn']
end

#customer_zipObject



66
67
68
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 66

def customer_zip
  params['Postnumer']
end

#grossObject



38
39
40
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 38

def gross
  "%0.2f" % params['Upphaed'].to_s
end

#item_idObject Also known as: order



17
18
19
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 17

def item_id
  params['Tilvisunarnumer']
end

#passwordObject



86
87
88
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 86

def password
  @options[:credential2]
end

#received_atObject



34
35
36
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 34

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

#statusObject



30
31
32
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 30

def status
  "Completed" if acknowledge
end

#success?Boolean Also known as: complete?

Returns:

  • (Boolean)


8
9
10
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 8

def success?
  status == 'Completed'
end

#test?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 13

def test?
  @options[:test]
end

#transaction_idObject



22
23
24
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 22

def transaction_id
  params['VefverslunSalaID']
end

#transaction_numberObject



54
55
56
# File 'lib/active_merchant/billing/integrations/valitor/response_fields.rb', line 54

def transaction_number
  params['Faerslunumer']
end