Class: OffsitePayments::Integrations::Maksuturva::Notification

Inherits:
Notification
  • Object
show all
Defined in:
lib/offsite_payments/integrations/maksuturva.rb

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

Methods inherited from Notification

#amount, #empty!, #gross_cents, #initialize, #iso_currency, #test?, #valid_sender?

Constructor Details

This class inherits a constructor from OffsitePayments::Notification

Instance Method Details

#acknowledge(authcode = nil) ⇒ Object



216
217
218
219
# File 'lib/offsite_payments/integrations/maksuturva.rb', line 216

def acknowledge(authcode = nil)
  return_authcode = [params["pmt_action"], params["pmt_version"], params["pmt_id"], params["pmt_reference"], params["pmt_amount"], params["pmt_currency"], params["pmt_sellercosts"], params["pmt_paymentmethod"], params["pmt_escrow"], authcode].join("&")
  (Digest::MD5.hexdigest(return_authcode + "&").upcase == params["pmt_hash"])
end

#complete?Boolean

Returns:

  • (Boolean)


192
193
194
# File 'lib/offsite_payments/integrations/maksuturva.rb', line 192

def complete?
  true
end

#currencyObject



208
209
210
# File 'lib/offsite_payments/integrations/maksuturva.rb', line 208

def currency
  params["pmt_currency"]
end

#grossObject



204
205
206
# File 'lib/offsite_payments/integrations/maksuturva.rb', line 204

def gross
  params["pmt_amount"]
end

#security_keyObject



200
201
202
# File 'lib/offsite_payments/integrations/maksuturva.rb', line 200

def security_key
  params["pmt_hash"]
end

#statusObject



212
213
214
# File 'lib/offsite_payments/integrations/maksuturva.rb', line 212

def status
  "PAID"
end

#transaction_idObject



196
197
198
# File 'lib/offsite_payments/integrations/maksuturva.rb', line 196

def transaction_id
  params["pmt_id"]
end