Module: OffsitePayments::Integrations::Valitor::ResponseFields
- Included in:
- Notification, Return
- Defined in:
- lib/offsite_payments/integrations/valitor.rb
Instance Method Summary collapse
- #acknowledge(authcode = nil) ⇒ Object
- #authorization_number ⇒ Object
- #card_last_four ⇒ Object
- #card_type ⇒ Object
- #currency ⇒ Object
- #customer_address ⇒ Object
- #customer_city ⇒ Object
- #customer_comment ⇒ Object
- #customer_country ⇒ Object
- #customer_email ⇒ Object
- #customer_name ⇒ Object
- #customer_zip ⇒ Object
- #gross ⇒ Object
- #item_id ⇒ Object (also: #order)
- #password ⇒ Object
- #received_at ⇒ Object
- #status ⇒ Object
- #success? ⇒ Boolean (also: #complete?)
- #test? ⇒ Boolean
- #transaction_id ⇒ Object
- #transaction_number ⇒ Object
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_number ⇒ Object
146 147 148 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 146 def params['Heimildarnumer'] end |
#card_last_four ⇒ Object
142 143 144 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 142 def card_last_four params['KortnumerSidustu'] end |
#card_type ⇒ Object
138 139 140 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 138 def card_type params['Kortategund'] end |
#currency ⇒ Object
122 123 124 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 122 def currency nil end |
#customer_address ⇒ Object
158 159 160 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 158 def customer_address params['Heimilisfang'] end |
#customer_city ⇒ Object
166 167 168 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 166 def customer_city params['Stadur'] end |
#customer_comment ⇒ Object
178 179 180 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 178 def customer_comment params['Athugasemdir'] end |
#customer_country ⇒ Object
170 171 172 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 170 def customer_country params['Land'] end |
#customer_email ⇒ Object
174 175 176 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 174 def customer_email params['Tolvupostfang'] end |
#customer_name ⇒ Object
154 155 156 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 154 def customer_name params['Nafn'] end |
#customer_zip ⇒ Object
162 163 164 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 162 def customer_zip params['Postnumer'] end |
#gross ⇒ Object
134 135 136 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 134 def gross "%0.2f" % params['Upphaed'].to_s.sub(',', '.') end |
#item_id ⇒ Object Also known as: order
113 114 115 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 113 def item_id params['Tilvisunarnumer'] end |
#password ⇒ Object
182 183 184 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 182 def password @options[:credential2] end |
#received_at ⇒ Object
130 131 132 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 130 def received_at Time.parse(params['Dagsetning'].to_s) end |
#status ⇒ Object
126 127 128 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 126 def status "Completed" if acknowledge end |
#success? ⇒ Boolean Also known as: complete?
104 105 106 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 104 def success? status == 'Completed' end |
#test? ⇒ Boolean
109 110 111 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 109 def test? @options[:test] end |
#transaction_id ⇒ Object
118 119 120 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 118 def transaction_id params['VefverslunSalaID'] end |
#transaction_number ⇒ Object
150 151 152 |
# File 'lib/offsite_payments/integrations/valitor.rb', line 150 def transaction_number params['Faerslunumer'] end |