Class: OffsitePayments::Integrations::WebPay::Notification
Instance Attribute Summary
Attributes inherited from Notification
#params, #raw
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Common
#generate_signature, #notify_signature_string, #request_signature_string
#empty!, #gross_cents, #initialize, #iso_currency, #test?, #valid_sender?
Class Method Details
.recognizes?(params) ⇒ Boolean
144
145
146
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 144
def self.recognizes?(params)
params.has_key?('site_order_id') && params.has_key?('amount')
end
|
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
176
177
178
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 176
def acknowledge(authcode = nil)
(security_key == generate_signature(:notify))
end
|
#amount ⇒ Object
152
153
154
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 152
def amount
BigDecimal.new(gross)
end
|
#complete? ⇒ Boolean
148
149
150
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 148
def complete?
true
end
|
#gross ⇒ Object
164
165
166
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 164
def gross
params['amount']
end
|
#item_id ⇒ Object
156
157
158
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 156
def item_id
params['site_order_id']
end
|
#secret ⇒ Object
172
173
174
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 172
def secret
@options[:secret]
end
|
#security_key ⇒ Object
160
161
162
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 160
def security_key
params[OffsitePayments::Integrations::WebPay.signature_parameter_name]
end
|
#status ⇒ Object
168
169
170
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 168
def status
'success'
end
|
#success_response(*args) ⇒ Object
180
181
182
|
# File 'lib/offsite_payments/integrations/web_pay.rb', line 180
def success_response(*args)
{:nothing => true}
end
|