Class: OffsitePayments::Integrations::Robokassa::Notification

Inherits:
Notification
  • Object
show all
Includes:
Common
Defined in:
lib/offsite_payments/integrations/robokassa.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_cents, #initialize, #iso_currency, #test?, #valid_sender?

Constructor Details

This class inherits a constructor from OffsitePayments::Notification

Class Method Details

.recognizes?(params) ⇒ Boolean

Returns:

  • (Boolean)


98
99
100
# File 'lib/offsite_payments/integrations/robokassa.rb', line 98

def self.recognizes?(params)
  params.has_key?('InvId') && params.has_key?('OutSum')
end

Instance Method Details

#acknowledge(authcode = nil) ⇒ Object



130
131
132
# File 'lib/offsite_payments/integrations/robokassa.rb', line 130

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

#complete?Boolean

Returns:

  • (Boolean)


102
103
104
# File 'lib/offsite_payments/integrations/robokassa.rb', line 102

def complete?
  true
end

#currencyObject



138
139
140
# File 'lib/offsite_payments/integrations/robokassa.rb', line 138

def currency
  'RUB'
end

#grossObject



114
115
116
# File 'lib/offsite_payments/integrations/robokassa.rb', line 114

def gross
  params['OutSum']
end

#item_idObject



106
107
108
# File 'lib/offsite_payments/integrations/robokassa.rb', line 106

def item_id
  params['InvId']
end

#main_paramsObject



126
127
128
# File 'lib/offsite_payments/integrations/robokassa.rb', line 126

def main_params
  [gross, item_id]
end

#secretObject



122
123
124
# File 'lib/offsite_payments/integrations/robokassa.rb', line 122

def secret
  @options[:secret]
end

#security_keyObject



110
111
112
# File 'lib/offsite_payments/integrations/robokassa.rb', line 110

def security_key
  params[OffsitePayments::Integrations::Robokassa.signature_parameter_name].to_s.downcase
end

#statusObject



118
119
120
# File 'lib/offsite_payments/integrations/robokassa.rb', line 118

def status
  'success'
end

#success_response(*args) ⇒ Object



134
135
136
# File 'lib/offsite_payments/integrations/robokassa.rb', line 134

def success_response(*args)
  "OK#{item_id}"
end