Class: OffsitePayments::Integrations::Paxum::Notification

Inherits:
Notification
  • Object
show all
Includes:
Common
Defined in:
lib/offsite_payments/integrations/paxum.rb

Instance Attribute Summary

Attributes inherited from Notification

#params, #raw

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common

#generate_signature, #generate_signature_string

Methods inherited from Notification

#amount, #empty!, #gross, #gross_cents, #iso_currency, #status, #test?, #valid_sender?

Constructor Details

#initialize(post, options = {}) ⇒ Notification


90
91
92
93
94
# File 'lib/offsite_payments/integrations/paxum.rb', line 90

def initialize(post, options = {})
  @raw_post = post.dup
  post.slice!(0)
  super
end

Class Method Details

.recognizes?(params) ⇒ Boolean


96
97
98
# File 'lib/offsite_payments/integrations/paxum.rb', line 96

def self.recognizes?(params)
  (params.has_key?('transaction_item_id') && params.has_key?('transaction_amount'))
end

Instance Method Details

#acknowledge(authcode = nil) ⇒ Object


108
109
110
# File 'lib/offsite_payments/integrations/paxum.rb', line 108

def acknowledge(authcode = nil)
  (security_key == generate_signature)
end

#secretObject


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

def secret
  @options[:secret]
end

#security_keyObject


100
101
102
# File 'lib/offsite_payments/integrations/paxum.rb', line 100

def security_key
  params["key"]
end