Class: OffsitePayments::Integrations::Webmoney::Notification
Instance Attribute Summary
Attributes inherited from Notification
#params, #raw
Instance Method Summary
collapse
Methods included from Common
#generate_signature, #generate_signature_string
#empty!, #gross_cents, #initialize, #iso_currency, #status, #test?, #valid_sender?
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
109
110
111
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 109
def acknowledge(authcode = nil)
(security_key == generate_signature)
end
|
#amount ⇒ Object
85
86
87
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 85
def amount
Money.from_amount(BigDecimal(gross), currency)
end
|
#currency ⇒ Object
117
118
119
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 117
def currency
'RUB'
end
|
#gross ⇒ Object
97
98
99
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 97
def gross
params['LMI_PAYMENT_AMOUNT']
end
|
#item_id ⇒ Object
93
94
95
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 93
def item_id
params['LMI_PAYMENT_NO']
end
|
#key_present? ⇒ Boolean
89
90
91
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 89
def key_present?
params["LMI_HASH"].present?
end
|
#recognizes? ⇒ Boolean
81
82
83
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 81
def recognizes?
(params.has_key?('LMI_PAYMENT_NO') && params.has_key?('LMI_PAYMENT_AMOUNT'))
end
|
#secret ⇒ Object
105
106
107
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 105
def secret
@options[:secret]
end
|
#security_key ⇒ Object
101
102
103
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 101
def security_key
params["LMI_HASH"]
end
|
#success_response(*args) ⇒ Object
113
114
115
|
# File 'lib/offsite_payments/integrations/webmoney.rb', line 113
def success_response(*args)
{:nothing => true}
end
|