Class: OffsitePayments::Integrations::A1agregator::Notification
- Inherits:
-
Notification
- Object
- Notification
- OffsitePayments::Integrations::A1agregator::Notification
show all
- Defined in:
- lib/offsite_payments/integrations/a1agregator.rb
Instance Attribute Summary
Attributes inherited from Notification
#params, #raw
Instance Method Summary
collapse
#amount, #empty!, #gross_cents, #iso_currency, #status, #valid_sender?
Constructor Details
Returns a new instance of Notification.
48
49
50
51
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 48
def initialize(*args)
super
guess_notification_type
end
|
Instance Method Details
#acknowledge(authcode = nil) ⇒ Object
189
190
191
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 189
def acknowledge(authcode = nil)
security_key == signature
end
|
#additional_notification? ⇒ Boolean
185
186
187
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 185
def additional_notification?
@notification_type == :additional
end
|
#command ⇒ Object
141
142
143
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 141
def command
params['command']
end
|
76
77
78
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 76
def
params['comment']
end
|
#complete? ⇒ Boolean
Simple notification request params: tid name comment partner_id service_id order_id type partner_income system_income
64
65
66
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 64
def complete?
true
end
|
#currency ⇒ Object
172
173
174
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 172
def currency
'RUB'
end
|
#inclome_total ⇒ Object
Additional notification request params: tid name comment partner_id service_id order_id type cost income_total income partner_income system_income command phone_number email resultStr date_created version check
125
126
127
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 125
def inclome_total
params['income_total']
end
|
#income ⇒ Object
129
130
131
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 129
def income
params['income']
end
|
#item_id ⇒ Object
88
89
90
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 88
def item_id
params['order_id']
end
|
#partner_id ⇒ Object
80
81
82
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 80
def partner_id
params['partner_id']
end
|
#partner_income ⇒ Object
96
97
98
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 96
def partner_income
params['partner_income']
end
|
#payer_email ⇒ Object
149
150
151
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 149
def payer_email
params['email']
end
|
#phone_number ⇒ Object
145
146
147
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 145
def phone_number
params['phone_number']
end
|
#received_at ⇒ Object
157
158
159
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 157
def received_at
params['date_created']
end
|
#result_string ⇒ Object
153
154
155
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 153
def result_string
params['resultStr']
end
|
#security_key ⇒ Object
165
166
167
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 165
def security_key
params[A1agregator.signature_parameter_name].to_s.downcase
end
|
#service_id ⇒ Object
84
85
86
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 84
def service_id
params['service_id']
end
|
#simple_notification? ⇒ Boolean
181
182
183
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 181
def simple_notification?
@notification_type == :simple
end
|
#system_income ⇒ Object
Also known as:
gross
100
101
102
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 100
def system_income
params['system_income']
end
|
#test? ⇒ Boolean
Was this a test transaction?
177
178
179
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 177
def test?
params['test'] == '1'
end
|
#title ⇒ Object
72
73
74
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 72
def title
params['name']
end
|
#transaction_id ⇒ Object
68
69
70
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 68
def transaction_id
params['tid']
end
|
#type ⇒ Object
92
93
94
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 92
def type
params['type']
end
|
#version ⇒ Object
161
162
163
|
# File 'lib/offsite_payments/integrations/a1agregator.rb', line 161
def version
params['version']
end
|