Class: ActiveMerchant::Billing::Integrations::Maksuturva::Notification

Inherits:
Notification
  • Object
show all
Defined in:
lib/active_merchant/billing/integrations/maksuturva/notification.rb

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Instance Method Summary collapse

Methods inherited from Notification

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

Constructor Details

This class inherits a constructor from ActiveMerchant::Billing::Integrations::Notification

Instance Method Details

#acknowledge(authcode) ⇒ Object



32
33
34
35
# File 'lib/active_merchant/billing/integrations/maksuturva/notification.rb', line 32

def acknowledge(authcode)
  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)


8
9
10
# File 'lib/active_merchant/billing/integrations/maksuturva/notification.rb', line 8

def complete?
  true
end

#currencyObject



24
25
26
# File 'lib/active_merchant/billing/integrations/maksuturva/notification.rb', line 24

def currency
  params["pmt_currency"]
end

#grossObject



20
21
22
# File 'lib/active_merchant/billing/integrations/maksuturva/notification.rb', line 20

def gross
  params["pmt_amount"]
end

#security_keyObject



16
17
18
# File 'lib/active_merchant/billing/integrations/maksuturva/notification.rb', line 16

def security_key
  params["pmt_hash"]
end

#statusObject



28
29
30
# File 'lib/active_merchant/billing/integrations/maksuturva/notification.rb', line 28

def status
  "PAID"
end

#transaction_idObject



12
13
14
# File 'lib/active_merchant/billing/integrations/maksuturva/notification.rb', line 12

def transaction_id
  params["pmt_id"]
end