Class: OffsitePayments::Integrations::Robokassa::Notification
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
#amount, #empty!, #gross_cents, #initialize, #iso_currency, #test?, #valid_sender?
Class Method Details
.recognizes?(params) ⇒ 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
102
103
104
|
# File 'lib/offsite_payments/integrations/robokassa.rb', line 102
def complete?
true
end
|
#currency ⇒ Object
138
139
140
|
# File 'lib/offsite_payments/integrations/robokassa.rb', line 138
def currency
'RUB'
end
|
#gross ⇒ Object
114
115
116
|
# File 'lib/offsite_payments/integrations/robokassa.rb', line 114
def gross
params['OutSum']
end
|
#item_id ⇒ Object
106
107
108
|
# File 'lib/offsite_payments/integrations/robokassa.rb', line 106
def item_id
params['InvId']
end
|
#main_params ⇒ Object
126
127
128
|
# File 'lib/offsite_payments/integrations/robokassa.rb', line 126
def main_params
[gross, item_id]
end
|
#secret ⇒ Object
122
123
124
|
# File 'lib/offsite_payments/integrations/robokassa.rb', line 122
def secret
@options[:secret]
end
|
#security_key ⇒ Object
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
|
#status ⇒ Object
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
|